ESP32-C3 stucks at "waiting for download"

johnny72
Posts: 1
Joined: Sat Nov 19, 2022 5:55 pm

ESP32-C3 stucks at "waiting for download"

Postby johnny72 » Sat Nov 19, 2022 10:28 pm

Hi,

I am trying to use esp-idf.py monitor under FreeBSD with ESP32-C3. I can build, flash but can't see UART prints with esp-idf.py. I can see UART prints with another tool (cu).

When trying to use esp-idf.py monitor board is stuck:

Code: Select all

% ~/src/esp32/esp-idf/tools/idf.py monitor
Setting IDF_PATH environment variable: /usr/home/user/src/esp32/esp-idf
Executing action: monitor
Serial port /dev/cuaU0
Connecting....
Detecting chip type... ESP32-C3
Running idf_monitor in directory /usr/home/user/src/esp32/esp-idf/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_server
Executing "/usr/local/bin/python /usr/home/user/src/esp32/esp-idf/tools/idf_monitor.py -p /dev/cuaU0 -b 115200 --toolchain-prefix riscv32-esp-elf- --target esp32c3 --decode-panic backtrace /usr/home/user/src/esp32/esp-idf/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_server/build/onoff_server.elf -m '/usr/local/bin/python' '/home/user/src/esp32/esp-idf/tools/idf.py'"...
--- idf_monitor on /dev/cuaU0 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x5 (DOWNLOAD(USB/UART0/1))
Saved PC:0x4004c62c
waiting for download
default stty for serial port after connecting USB:

Code: Select all

# stty -a -f /dev/cuaU0
speed 9600 baud; 0 rows; 0 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
        -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
        -extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
        brkint -inpck -ignpar -parmrk
oflags: opost onlcr -ocrnl tab0 -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl clocal -cstopb -crtscts -dsrflow
        -dtrflow -mdmbuf rtsdtr
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
        eol2 = <undef>; erase = ^?; erase2 = ^H; intr = ^C; kill = ^U;
        lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q;
        status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W;
stty after running esp-idf monitor:

Code: Select all

# stty -a -f /dev/cuaU0
speed 115200 baud; 0 rows; 0 columns;
lflags: -icanon -isig -iexten -echo -echoe -echok -echoke -echonl
        -echoctl -echoprt -altwerase -noflsh -tostop -flusho -pendin
        -nokerninfo -extproc
iflags: -istrip -icrnl -inlcr -igncr -ixon -ixoff -ixany imaxbel -ignbrk
        brkint -inpck -ignpar -parmrk
oflags: -opost -onlcr -ocrnl tab0 -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl clocal -cstopb -crtscts -dsrflow
        -dtrflow -mdmbuf rtsdtr
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
        eol2 = <undef>; erase = ^?; erase2 = ^H; intr = ^C; kill = ^U;
        lnext = ^V; min = 0; quit = ^\; reprint = ^R; start = ^Q;
        status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W;

But if I try to open another esp-idy monitor in another tab then first one will unstuck:

Code: Select all

% ~/src/esp32/esp-idf/tools/idf.py monitor
Setting IDF_PATH environment variable: /usr/home/user/src/esp32/esp-idf
Executing action: monitor
Serial port /dev/cuaU0
Connecting....
Detecting chip type... ESP32-C3
Running idf_monitor in directory /usr/home/user/src/esp32/esp-idf/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_server
Executing "/usr/local/bin/python /usr/home/user/src/esp32/esp-idf/tools/idf_monitor.py -p /dev/cuaU0 -b 115200 --toolchain-prefix riscv32-esp-elf- --target esp32c3 --decode-panic backtrace /usr/home/user/src/esp32/esp-idf/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_server/build/onoff_server.elf -m '/usr/local/bin/python' '/home/user/src/esp32/esp-idf/tools/idf.py'"...
--- idf_monitor on /dev/cuaU0 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x5 (DOWNLOAD(USB/UART0/1))
Saved PC:0x4004c72e
waiting for download
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x400462e2
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5810,len:0x16c4
load:0x403cc710,len:0x930
load:0x403ce710,len:0x2d28
entry 0x403cc710
I (24) boot: ESP-IDF v4.4.2-391-g6e3e1936b5 2nd stage bootloader
I (24) boot: compile time 14:24:55
I (25) boot: chip revision: 3
I (27) boot.esp32c3: SPI Speed      : 80MHz
I (32) boot.esp32c3: SPI Mode       : DIO
I (37) boot.esp32c3: SPI Flash Size : 2MB
I (42) boot: Enabling RNG early entropy source...
I (47) boot: Partition Table:
[I (58) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (65) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (73) boot:  2 factory          factory app      00 00 00010000 00100000
I (80) boot: End of partition table
I (84) esp_image: segment 0: paddr=00010020 vaddr=3c0c0020 size=2bb38h (179000) map
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x4005886e
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5810,len:0x16c4
device reports readiness to read but returned no data (device disconnected or multiple access on port?)
Waiting for the device to reconnect
I (251) esp_image: segment 4: paddr=000f5b00 vaddr=40381700 size=0fa78h ( 64120) load
I (263) esp_image: segment 5: paddr=00105580 vaddr=50000010 size=00010h (    16) load
I (269) boot: Loaded app from partition at offset 0x10000
I (269) boot: Disabling RNG early entropy source...
I (284) cpu_start: Pro cpu up.
I (292) cpu_start: Pro cpu start user code
I (292) cpu_start: cpu freq: 160000000
I (292) cpu_start: Application information:
I (295) cpu_start: Project name:     onoff_server
I (300) cpu_start: App version:      v4.4.2-391-g6e3e1936b5
I (307) cpu_start: Compile time:     Nov 19 2022 14:24:34
I (313) cpu_start: ELF file SHA256:  76ade831b509999e...
I (319) cpu_start: ESP-IDF:          v4.4.2-391-g6e3e1936b5
I (325) heap_init: Initializing. RAM available for dynamic allocation:
I (332) heap_init: At 3FC9B1D0 len 00041540 (261 KiB): DRAM
I (338) heap_init: At 3FCDC710 len 00002950 (10 KiB): STACK/DRAM
I (345) heap_init: At 50000020 len 00001FE0 (7 KiB): RTCRAM
I (352) spi_flash: detected chip: generic
I (356) spi_flash: flash io: dio
W (360) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
...
stty after unstucking is the same as before.

paulthetinkerer
Posts: 1
Joined: Thu Feb 29, 2024 10:24 am

Re: ESP32-C3 stucks at "waiting for download"

Postby paulthetinkerer » Thu Feb 29, 2024 10:46 am

Hello, I have the same problem when trying to program the esp-c3 from FreeBSD, did you ever manage to find a solution?

Thanks for your feedback!

Paul

Who is online

Users browsing this forum: No registered users and 87 guests