Page 1 of 1

Linux, IDF looses serial port after sucessful programming

Posted: Wed Sep 20, 2023 2:59 pm
by ResubaDigital
I've searched for an answer, but have had no luck.

I'm trying to switch from Arduino IDE to IDF on linux and can successfully compile and download the example "getting started/hello_world.
But right after it downloads, the serial port (/dev/ttyACM1 in my case) completely dissapears from the /dev tree.
The only thing that brings it back is a bootload reset, it doesn't show up on a regular reset. (I'm using both a UM feather S2 and an Adafruit Feather S2).

Is there a different boot bootloader I'm missing?

(It's not a permission problem, Arduino IDE works fine (and I'm killing that so it's not attached to the port).

Code of a successful compile and download:

Code: Select all

bill@music2:~/esp/Projects/hello_world$ idf.py -p /dev/ttyACM1 flash
Executing action: flash
Running ninja in directory /home/bill/esp/Projects/hello_world/build
Executing "ninja flash"...
[1/5] cd /home/bill/esp/Projects/hello_world/build/esp-idf/esptool...able.bin /home/bill/esp/Projects/hello_world/build/hello_world.bin
hello_world.bin binary size 0x2af60 bytes. Smallest app partition is 0x100000 bytes. 0xd50a0 bytes (83%) free.
[1/1] cd /home/bill/esp/Projects/hello_world/build/bootloader/esp-...home/bill/esp/Projects/hello_world/build/bootloader/bootloader.bin
Bootloader binary size 0x5510 bytes. 0x1af0 bytes (24%) free.
[2/3] cd /home/bill/esp/esp-idf/components/esptool_py && /usr/bin/.../home/bill/esp/esp-idf/components/esptool_py/run_serial_tool.cmake
esptool.py --chip esp32s2 -p /dev/ttyACM1 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 2MB 0x1000 bootloader/bootloader.bin 0x10000 hello_world.bin 0x8000 partition_table/partition-table.bin
esptool.py v4.7.dev1
Serial port /dev/ttyACM1
Connecting...
Chip is ESP32-S2 (revision v0.0)
Features: WiFi, No Embedded Flash, No Embedded PSRAM, ADC and temperature sensor calibration in BLK2 of efuse V2
Crystal is 40MHz
MAC: 60:55:f9:eb:ea:24
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00006fff...
Flash will be erased from 0x00010000 to 0x0003afff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 21776 bytes to 13827...
Writing at 0x00005c44... (100 %)
Wrote 21776 bytes (13827 compressed) at 0x00001000 in 0.3 seconds (effective 536.6 kbit/s)...
Hash of data verified.
Compressed 175968 bytes to 96941...
Writing at 0x0003aaa5... (100 %)
Wrote 175968 bytes (96941 compressed) at 0x00010000 in 1.3 seconds (effective 1044.8 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 103...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.0 seconds (effective 517.7 kbit/s)...
Hash of data verified.

Leaving...
WARNING: ESP32-S2 (revision v0.0) chip was placed into download mode using GPIO0.
esptool.py can not exit the download mode over USB. To run the app, reset the chip manually.
To suppress this note, set --after option to 'no_reset'.
CMake Error at run_serial_tool.cmake:66 (message):
  
  /home/bill/.espressif/python_env/idf5.2_py3.8_env/bin/python;;/home/bill/esp/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32s2
  failed.
A chip reset, later:

Code: Select all

bill@music2:~$ ls -l /dev/tty[AU]*
crw-rw----+ 1 root dialout 166, 0 Sep 20 08:09 /dev/ttyACM0
crw-rw----+ 1 root dialout 166, 2 Sep 20 08:09 /dev/ttyACM2
crw-rw----+ 1 root plugdev 188, 0 Sep 20 08:09 /dev/ttyUSB0
Thanks.