Closed waruqi closed 1 year ago
@waruqi It looks like the chip is still in boot mode. Have you tried manually resetting it? If that does not work, please make sure that GPIO0 is pulled high, then try to reset again.
What you experience looks similar to what happens when you connect your chip without the reset lines or if the reset circuit does not work. This is commonly the case when only connecting RXD, TXD and GND of a USB to UART converter to the chip. In the latter case, a simple manual reset would help.
I've tried resetting it several times and it doesn't work. and I'm not sure if it's finished flashing because it ended up reporting an error.
I just used usb-typec to connect it.
If you run idf.py monitor
, do you see something like the following when pressing the reset button?:
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x1 (POWERON),boot:0x0 (DOWNLOAD(USB/UART0/1/SPI))
waiting for download
startup
$ idf.py monitor
Executing action: monitor
Serial port /dev/cu.usbmodem01
Connecting...
Detecting chip type... Unsupported detection protocol, switching and trying again...
Detecting chip type... ESP32-S2
Running idf_monitor in directory /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world
Executing "/Users/ruki/.espressif/python_env/idf5.1_py3.10_env/bin/python /Users/ruki/projects/personal/esp-idf/tools/idf_monitor.py -p /dev/cu.usbmodem01 -b 115200 --toolchain-prefix xtensa-esp32s2-elf- --target esp32s2 /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/hello_world.elf -m '/Users/ruki/.espressif/python_env/idf5.1_py3.10_env/bin/python' '/Users/ruki/projects/personal/esp-idf/tools/idf.py'"...
--- idf_monitor on /dev/cu.usbmodem01 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
after pressing reset
None
Waiting for the device to reconnect...........................................................................................................................
It looks like the chip is still in boot mode
maybe it still in boot mode after flashing.
But I flash other firmware, like micropython, it works fine.
just when I flash idf program, it does not work.
Hello @waruqi,
your log shows that flashing finished successfully (Hash of data verified.
means success).
You are flashing the ESP32-S2 over a software USB console. This has some limitations:
1) You have to reset the chip after flashing to run the app
2) If you reset the chip, the USB port disappears because the console is implemented in software. That's why you see Waiting for the device to reconnect..
after pressing the reset button.
Other limitations are explained in the docs.
3) The app has to be configured to use the right console.
Your problem is that you have not configured your app to use this USB-OTG console.
You have to run idf.py menuconfig
and then navigate to Component config > ESP System Settings
and change Channel for console output
to USB-CDC
.
Then rebuild the app, flash it, reset the chip manually, and try monitoring.
You have to run idf.py menuconfig and then navigate to Component config > ESP System Settings and change Channel for console output to USB-CDC. Then rebuild the app, flash it, reset the chip manually, and try monitoring.
I tried it, it still does not work.
$ idf.py menuconfig
Executing action: menuconfig
Running ninja in directory /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build
Executing "ninja menuconfig"...
[0/1] Re-running CMake...
-- Building ESP-IDF components for target esp32s2
-- Project sdkconfig file /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/sdkconfig
Compiler supported targets: xtensa-esp32s2-elf
-- App "hello_world" version: v5.1-dev-4051-g4f0769d2ed
-- Adding linker script /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_system/ld/esp32s2/sections.ld.in
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.api.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.libgcc.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.newlib-funcs.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.newlib-data.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.spiflash.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/soc/esp32s2/ld/esp32s2.peripherals.ld
-- Components: app_trace app_update bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp_adc esp_app_format esp_coex esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_wifi espcoredump esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json log lwip main mbedtls mqtt newlib nvs_flash openthread partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport touch_element ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: /Users/ruki/projects/personal/esp-idf/components/app_trace /Users/ruki/projects/personal/esp-idf/components/app_update /Users/ruki/projects/personal/esp-idf/components/bootloader /Users/ruki/projects/personal/esp-idf/components/bootloader_support /Users/ruki/projects/personal/esp-idf/components/bt /Users/ruki/projects/personal/esp-idf/components/cmock /Users/ruki/projects/personal/esp-idf/components/console /Users/ruki/projects/personal/esp-idf/components/cxx /Users/ruki/projects/personal/esp-idf/components/driver /Users/ruki/projects/personal/esp-idf/components/efuse /Users/ruki/projects/personal/esp-idf/components/esp-tls /Users/ruki/projects/personal/esp-idf/components/esp_adc /Users/ruki/projects/personal/esp-idf/components/esp_app_format /Users/ruki/projects/personal/esp-idf/components/esp_coex /Users/ruki/projects/personal/esp-idf/components/esp_common /Users/ruki/projects/personal/esp-idf/components/esp_eth /Users/ruki/projects/personal/esp-idf/components/esp_event /Users/ruki/projects/personal/esp-idf/components/esp_gdbstub /Users/ruki/projects/personal/esp-idf/components/esp_hid /Users/ruki/projects/personal/esp-idf/components/esp_http_client /Users/ruki/projects/personal/esp-idf/components/esp_http_server /Users/ruki/projects/personal/esp-idf/components/esp_https_ota /Users/ruki/projects/personal/esp-idf/components/esp_https_server /Users/ruki/projects/personal/esp-idf/components/esp_hw_support /Users/ruki/projects/personal/esp-idf/components/esp_lcd /Users/ruki/projects/personal/esp-idf/components/esp_local_ctrl /Users/ruki/projects/personal/esp-idf/components/esp_mm /Users/ruki/projects/personal/esp-idf/components/esp_netif /Users/ruki/projects/personal/esp-idf/components/esp_netif_stack /Users/ruki/projects/personal/esp-idf/components/esp_partition /Users/ruki/projects/personal/esp-idf/components/esp_phy /Users/ruki/projects/personal/esp-idf/components/esp_pm /Users/ruki/projects/personal/esp-idf/components/esp_psram /Users/ruki/projects/personal/esp-idf/components/esp_ringbuf /Users/ruki/projects/personal/esp-idf/components/esp_rom /Users/ruki/projects/personal/esp-idf/components/esp_system /Users/ruki/projects/personal/esp-idf/components/esp_timer /Users/ruki/projects/personal/esp-idf/components/esp_wifi /Users/ruki/projects/personal/esp-idf/components/espcoredump /Users/ruki/projects/personal/esp-idf/components/esptool_py /Users/ruki/projects/personal/esp-idf/components/fatfs /Users/ruki/projects/personal/esp-idf/components/freertos /Users/ruki/projects/personal/esp-idf/components/hal /Users/ruki/projects/personal/esp-idf/components/heap /Users/ruki/projects/personal/esp-idf/components/http_parser /Users/ruki/projects/personal/esp-idf/components/idf_test /Users/ruki/projects/personal/esp-idf/components/ieee802154 /Users/ruki/projects/personal/esp-idf/components/json /Users/ruki/projects/personal/esp-idf/components/log /Users/ruki/projects/personal/esp-idf/components/lwip /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/main /Users/ruki/projects/personal/esp-idf/components/mbedtls /Users/ruki/projects/personal/esp-idf/components/mqtt /Users/ruki/projects/personal/esp-idf/components/newlib /Users/ruki/projects/personal/esp-idf/components/nvs_flash /Users/ruki/projects/personal/esp-idf/components/openthread /Users/ruki/projects/personal/esp-idf/components/partition_table /Users/ruki/projects/personal/esp-idf/components/perfmon /Users/ruki/projects/personal/esp-idf/components/protobuf-c /Users/ruki/projects/personal/esp-idf/components/protocomm /Users/ruki/projects/personal/esp-idf/components/pthread /Users/ruki/projects/personal/esp-idf/components/sdmmc /Users/ruki/projects/personal/esp-idf/components/soc /Users/ruki/projects/personal/esp-idf/components/spi_flash /Users/ruki/projects/personal/esp-idf/components/spiffs /Users/ruki/projects/personal/esp-idf/components/tcp_transport /Users/ruki/projects/personal/esp-idf/components/touch_element /Users/ruki/projects/personal/esp-idf/components/ulp /Users/ruki/projects/personal/esp-idf/components/unity /Users/ruki/projects/personal/esp-idf/components/usb /Users/ruki/projects/personal/esp-idf/components/vfs /Users/ruki/projects/personal/esp-idf/components/wear_levelling /Users/ruki/projects/personal/esp-idf/components/wifi_provisioning /Users/ruki/projects/personal/esp-idf/components/wpa_supplicant /Users/ruki/projects/personal/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build
[0/1] cd /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build && /Users/ruki...GA= --output config /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/sdkconfig
TERM environment variable is set to "xterm-256color"
Loaded configuration '/Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/sdkconfig'
No changes to save (for '/Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/sdkconfig')
ruki-2:hello_world ruki$ idf.py build
Executing action: all (aliases: build)
Running ninja in directory /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build
Executing "ninja all"...
[0/1] Re-running CMake...-- Building ESP-IDF components for target esp32s2
-- Project sdkconfig file /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/sdkconfig
Compiler supported targets: xtensa-esp32s2-elf
-- App "hello_world" version: v5.1-dev-4051-g4f0769d2ed
-- Adding linker script /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_system/ld/esp32s2/sections.ld.in
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.api.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.libgcc.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.newlib-funcs.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.newlib-data.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.spiflash.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/soc/esp32s2/ld/esp32s2.peripherals.ld
-- Components: app_trace app_update bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp_adc esp_app_format esp_coex esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_wifi espcoredump esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json log lwip main mbedtls mqtt newlib nvs_flash openthread partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport touch_element ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: /Users/ruki/projects/personal/esp-idf/components/app_trace /Users/ruki/projects/personal/esp-idf/components/app_update /Users/ruki/projects/personal/esp-idf/components/bootloader /Users/ruki/projects/personal/esp-idf/components/bootloader_support /Users/ruki/projects/personal/esp-idf/components/bt /Users/ruki/projects/personal/esp-idf/components/cmock /Users/ruki/projects/personal/esp-idf/components/console /Users/ruki/projects/personal/esp-idf/components/cxx /Users/ruki/projects/personal/esp-idf/components/driver /Users/ruki/projects/personal/esp-idf/components/efuse /Users/ruki/projects/personal/esp-idf/components/esp-tls /Users/ruki/projects/personal/esp-idf/components/esp_adc /Users/ruki/projects/personal/esp-idf/components/esp_app_format /Users/ruki/projects/personal/esp-idf/components/esp_coex /Users/ruki/projects/personal/esp-idf/components/esp_common /Users/ruki/projects/personal/esp-idf/components/esp_eth /Users/ruki/projects/personal/esp-idf/components/esp_event /Users/ruki/projects/personal/esp-idf/components/esp_gdbstub /Users/ruki/projects/personal/esp-idf/components/esp_hid /Users/ruki/projects/personal/esp-idf/components/esp_http_client /Users/ruki/projects/personal/esp-idf/components/esp_http_server /Users/ruki/projects/personal/esp-idf/components/esp_https_ota /Users/ruki/projects/personal/esp-idf/components/esp_https_server /Users/ruki/projects/personal/esp-idf/components/esp_hw_support /Users/ruki/projects/personal/esp-idf/components/esp_lcd /Users/ruki/projects/personal/esp-idf/components/esp_local_ctrl /Users/ruki/projects/personal/esp-idf/components/esp_mm /Users/ruki/projects/personal/esp-idf/components/esp_netif /Users/ruki/projects/personal/esp-idf/components/esp_netif_stack /Users/ruki/projects/personal/esp-idf/components/esp_partition /Users/ruki/projects/personal/esp-idf/components/esp_phy /Users/ruki/projects/personal/esp-idf/components/esp_pm /Users/ruki/projects/personal/esp-idf/components/esp_psram /Users/ruki/projects/personal/esp-idf/components/esp_ringbuf /Users/ruki/projects/personal/esp-idf/components/esp_rom /Users/ruki/projects/personal/esp-idf/components/esp_system /Users/ruki/projects/personal/esp-idf/components/esp_timer /Users/ruki/projects/personal/esp-idf/components/esp_wifi /Users/ruki/projects/personal/esp-idf/components/espcoredump /Users/ruki/projects/personal/esp-idf/components/esptool_py /Users/ruki/projects/personal/esp-idf/components/fatfs /Users/ruki/projects/personal/esp-idf/components/freertos /Users/ruki/projects/personal/esp-idf/components/hal /Users/ruki/projects/personal/esp-idf/components/heap /Users/ruki/projects/personal/esp-idf/components/http_parser /Users/ruki/projects/personal/esp-idf/components/idf_test /Users/ruki/projects/personal/esp-idf/components/ieee802154 /Users/ruki/projects/personal/esp-idf/components/json /Users/ruki/projects/personal/esp-idf/components/log /Users/ruki/projects/personal/esp-idf/components/lwip /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/main /Users/ruki/projects/personal/esp-idf/components/mbedtls /Users/ruki/projects/personal/esp-idf/components/mqtt /Users/ruki/projects/personal/esp-idf/components/newlib /Users/ruki/projects/personal/esp-idf/components/nvs_flash /Users/ruki/projects/personal/esp-idf/components/openthread /Users/ruki/projects/personal/esp-idf/components/partition_table /Users/ruki/projects/personal/esp-idf/components/perfmon /Users/ruki/projects/personal/esp-idf/components/protobuf-c /Users/ruki/projects/personal/esp-idf/components/protocomm /Users/ruki/projects/personal/esp-idf/components/pthread /Users/ruki/projects/personal/esp-idf/components/sdmmc /Users/ruki/projects/personal/esp-idf/components/soc /Users/ruki/projects/personal/esp-idf/components/spi_flash /Users/ruki/projects/personal/esp-idf/components/spiffs /Users/ruki/projects/personal/esp-idf/components/tcp_transport /Users/ruki/projects/personal/esp-idf/components/touch_element /Users/ruki/projects/personal/esp-idf/components/ulp /Users/ruki/projects/personal/esp-idf/components/unity /Users/ruki/projects/personal/esp-idf/components/usb /Users/ruki/projects/personal/esp-idf/components/vfs /Users/ruki/projects/personal/esp-idf/components/wear_levelling /Users/ruki/projects/personal/esp-idf/components/wifi_provisioning /Users/ruki/projects/personal/esp-idf/components/wpa_supplicant /Users/ruki/projects/personal/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build
[0/1] Re-running CMake...-- Building ESP-IDF components for target esp32s2
-- Project sdkconfig file /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/sdkconfig
Compiler supported targets: xtensa-esp32s2-elf
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/soc/esp32s2/ld/esp32s2.peripherals.ld
-- App "bootloader" version: v5.1-dev-4051-g4f0769d2ed
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.api.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.libgcc.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.newlib-funcs.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.spiflash.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/bootloader/subproject/main/ld/esp32s2/bootloader.ld
-- Adding linker script /Users/ruki/projects/personal/esp-idf/components/bootloader/subproject/main/ld/esp32s2/bootloader.rom.ld
-- Components: bootloader bootloader_support efuse esp_app_format esp_common esp_hw_support esp_rom esp_system esptool_py freertos hal log main micro-ecc newlib partition_table soc spi_flash xtensa
-- Component paths: /Users/ruki/projects/personal/esp-idf/components/bootloader /Users/ruki/projects/personal/esp-idf/components/bootloader_support /Users/ruki/projects/personal/esp-idf/components/efuse /Users/ruki/projects/personal/esp-idf/components/esp_app_format /Users/ruki/projects/personal/esp-idf/components/esp_common /Users/ruki/projects/personal/esp-idf/components/esp_hw_support /Users/ruki/projects/personal/esp-idf/components/esp_rom /Users/ruki/projects/personal/esp-idf/components/esp_system /Users/ruki/projects/personal/esp-idf/components/esptool_py /Users/ruki/projects/personal/esp-idf/components/freertos /Users/ruki/projects/personal/esp-idf/components/hal /Users/ruki/projects/personal/esp-idf/components/log /Users/ruki/projects/personal/esp-idf/components/bootloader/subproject/main /Users/ruki/projects/personal/esp-idf/components/bootloader/subproject/components/micro-ecc /Users/ruki/projects/personal/esp-idf/components/newlib /Users/ruki/projects/personal/esp-idf/components/partition_table /Users/ruki/projects/personal/esp-idf/components/soc /Users/ruki/projects/personal/esp-idf/components/spi_flash /Users/ruki/projects/personal/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/bootloader
[94/95] Generating binary image from built executableesptool.py v4.5.1
Creating esp32s2 image...
Merged 1 ELF section
Successfully created esp32s2 image.
Generated /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/bootloader/bootloader.bin
[95/95] cd /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/bootloader/e...sers/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/bootloader/bootloader.binBootloader binary size 0x5580 bytes. 0x1a80 bytes (24%) free.
[869/870] Generating binary image from built executableesptool.py v4.5.1
Creating esp32s2 image...
Merged 2 ELF sections
Successfully created esp32s2 image.
Generated /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/hello_world.bin
[870/870] cd /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/esp-idf/es...ble.bin /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/hello_world.binhello_world.bin binary size 0x27770 bytes. Smallest app partition is 0x100000 bytes. 0xd8890 bytes (85%) free.
Project build complete. To flash, run this command:
/Users/ruki/.espressif/python_env/idf5.1_py3.10_env/bin/python ../../../components/esptool_py/esptool/esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset --chip esp32s2 write_flash --flash_mode dio --flash_size 2MB --flash_freq 80m 0x1000 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/hello_world.bin
or run 'idf.py -p (PORT) flash'
ruki-2:hello_world ruki$ ls -l /dev/tty.*
crw-rw-rw- 1 root wheel 0x9000000 3 22 10:23 /dev/tty.BLTH
ruki-2:hello_world ruki$ ls -l /dev/tty.*
crw-rw-rw- 1 root wheel 0x9000000 3 22 10:23 /dev/tty.BLTH
ruki-2:hello_world ruki$ ls -l /dev/tty.*
crw-rw-rw- 1 root wheel 0x9000000 3 22 10:23 /dev/tty.BLTH
ruki-2:hello_world ruki$ ls -l /dev/tty.*
crw-rw-rw- 1 root wheel 0x9000000 3 22 10:23 /dev/tty.BLTH
ruki-2:hello_world ruki$ ls -l /dev/tty.*
crw-rw-rw- 1 root wheel 0x9000000 3 22 10:23 /dev/tty.BLTH
ruki-2:hello_world ruki$ ls -l /dev/tty.*
crw-rw-rw- 1 root wheel 0x9000000 3 22 10:23 /dev/tty.BLTH
ruki-2:hello_world ruki$ ls -l /dev/tty.*
crw-rw-rw- 1 root wheel 0x9000000 3 22 10:23 /dev/tty.BLTH
crw-rw-rw- 1 root wheel 0x9000002 3 22 23:10 /dev/tty.usbmodem01
ruki-2:hello_world ruki$ esptool.py --chip esp32s2 --port /dev/tty.usbmodem01 erase_flash
esptool.py v4.5.1
Serial port /dev/tty.usbmodem01
Connecting...
Chip is ESP32-S2FNR2 (revision v0.0)
Features: WiFi, Embedded Flash 4MB, Embedded PSRAM 2MB, ADC and temperature sensor calibration in BLK2 of efuse V2
Crystal is 40MHz
MAC: 48:27:e2:55:f5:ea
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 14.3s
WARNING: ESP32-S2FNR2 (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'.
ruki-2:hello_world ruki$ idf.py flash
Executing action: flash
Serial port /dev/cu.usbmodem01
Connecting...
Detecting chip type... Unsupported detection protocol, switching and trying again...
Detecting chip type... ESP32-S2
Running ninja in directory /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build
Executing "ninja flash"...
[1/5] cd /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/esp-idf/esptool_py && /Users/ruki/.espressif/python_env/idf5.1_py3.10_env/bin/python /Users/ruki/projects/personal/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 partition --type app /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/partition_table/partition-table.bin /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/hello_world.bin
hello_world.bin binary size 0x27770 bytes. Smallest app partition is 0x100000 bytes. 0xd8890 bytes (85%) free.
[2/5] Performing build step for 'bootloader'
[1/1] cd /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/bootloader/esp-idf/esptool_py && /Users/ruki/.espressif/python_env/idf5.1_py3.10_env/bin/python /Users/ruki/projects/personal/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/bootloader/bootloader.bin
Bootloader binary size 0x5580 bytes. 0x1a80 bytes (24%) free.
[3/5] No install step for 'bootloader'
[4/5] Completed 'bootloader'
[4/5] cd /Users/ruki/projects/personal/esp-idf/components/esptool_py && /usr/local/Cellar/cmake/3.25.3/bin/cmake -D IDF_PATH=/Users/ruki/projects/personal/esp-idf -D "SERIAL_TOOL=/Users/ruki/.espressif/python_env/idf5.1_py3.10_env/bin/python;;/Users/ruki/projects/personal/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32s2" -D "SERIAL_TOOL_ARGS=--before=default_reset;--after=hard_reset;write_flash;@flash_args" -D WORKING_DIRECTORY=/Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build -P /Users/ruki/projects/personal/esp-idf/components/esptool_py/run_serial_tool.cmake
esptool esp32s2 -p /dev/cu.usbmodem01 -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.5.1
Serial port /dev/cu.usbmodem01
Connecting...
Chip is ESP32-S2FNR2 (revision v0.0)
Features: WiFi, Embedded Flash 4MB, Embedded PSRAM 2MB, ADC and temperature sensor calibration in BLK2 of efuse V2
Crystal is 40MHz
MAC: 48:27:e2:55:f5:ea
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 0x00037fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 21888 bytes to 13921...
Writing at 0x00001000... (14 %)
Writing at 0x0000252b... (28 %)
Writing at 0x00003185... (42 %)
Writing at 0x00003cd4... (57 %)
Writing at 0x00004743... (71 %)
Writing at 0x00005118... (85 %)
Writing at 0x00005c3a... (100 %)
Wrote 21888 bytes (13921 compressed) at 0x00001000 in 0.3 seconds (effective 542.2 kbit/s)...
Hash of data verified.
Compressed 161648 bytes to 89420...
Writing at 0x00010000... (2 %)
Writing at 0x0001116f... (4 %)
Writing at 0x00012746... (6 %)
Writing at 0x00013f7c... (9 %)
Writing at 0x000156e3... (11 %)
Writing at 0x0001703d... (13 %)
Writing at 0x00018f9b... (15 %)
Writing at 0x0001a499... (18 %)
Writing at 0x0001afd8... (20 %)
Writing at 0x0001b9ad... (22 %)
Writing at 0x0001c551... (25 %)
Writing at 0x0001cfd4... (27 %)
Writing at 0x0001dc74... (29 %)
Writing at 0x0001e84e... (31 %)
Writing at 0x0001f332... (34 %)
Writing at 0x0001fef3... (36 %)
Writing at 0x00020b20... (38 %)
Writing at 0x00021637... (40 %)
Writing at 0x000220d8... (43 %)
Writing at 0x00022aea... (45 %)
Writing at 0x00023694... (47 %)
Writing at 0x000241e3... (50 %)
Writing at 0x00024ecd... (52 %)
Writing at 0x00025a24... (54 %)
Writing at 0x00026491... (56 %)
Writing at 0x00026efe... (59 %)
Writing at 0x0002795e... (61 %)
Writing at 0x000284a6... (63 %)
Writing at 0x000290d8... (65 %)
Writing at 0x0002a6f3... (68 %)
Writing at 0x0002b255... (70 %)
Writing at 0x0002bca1... (72 %)
Writing at 0x0002c6e7... (75 %)
Writing at 0x0002d4b4... (77 %)
Writing at 0x0002e7f8... (79 %)
Writing at 0x0002fca5... (81 %)
Writing at 0x000319a8... (84 %)
Writing at 0x000325be... (86 %)
Writing at 0x00032f9c... (88 %)
Writing at 0x00033b2f... (90 %)
Writing at 0x00034a28... (93 %)
Writing at 0x00035753... (95 %)
Writing at 0x000361a2... (97 %)
Writing at 0x00036cee... (100 %)
Wrote 161648 bytes (89420 compressed) at 0x00010000 in 1.3 seconds (effective 1021.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.1 seconds (effective 468.1 kbit/s)...
Hash of data verified.
Leaving...
WARNING: ESP32-S2FNR2 (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:63 (message):
/Users/ruki/.espressif/python_env/idf5.1_py3.10_env/bin/python;;/Users/ruki/projects/personal/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32s2
failed.
FAILED: CMakeFiles/flash /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/CMakeFiles/flash
cd /Users/ruki/projects/personal/esp-idf/components/esptool_py && /usr/local/Cellar/cmake/3.25.3/bin/cmake -D IDF_PATH=/Users/ruki/projects/personal/esp-idf -D "SERIAL_TOOL=/Users/ruki/.espressif/python_env/idf5.1_py3.10_env/bin/python;;/Users/ruki/projects/personal/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32s2" -D "SERIAL_TOOL_ARGS=--before=default_reset;--after=hard_reset;write_flash;@flash_args" -D WORKING_DIRECTORY=/Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build -P /Users/ruki/projects/personal/esp-idf/components/esptool_py/run_serial_tool.cmake
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/log/idf_py_stderr_output_21273 and /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/log/idf_py_stdout_output_21273
ruki-2:hello_world ruki$ idf.py monitor
Executing action: monitor
Serial port /dev/cu.usbmodem01
Connecting...
Detecting chip type... Unsupported detection protocol, switching and trying again...
Detecting chip type... ESP32-S2
Running idf_monitor in directory /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world
Executing "/Users/ruki/.espressif/python_env/idf5.1_py3.10_env/bin/python /Users/ruki/projects/personal/esp-idf/tools/idf_monitor.py -p /dev/cu.usbmodem01 -b 115200 --toolchain-prefix xtensa-esp32s2-elf- --target esp32s2 /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/hello_world.elf -m '/Users/ruki/.espressif/python_env/idf5.1_py3.10_env/bin/python' '/Users/ruki/projects/personal/esp-idf/tools/idf.py'"...
--- idf_monitor on /dev/cu.usbmodem01 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
None
Waiting for the device to reconnect................................................................
You have to first flash the device with idf.py flash, then reset it (either by pressing the button or reconnecting the USB cable) and then start monitoring with idf.py monitor.
Do not reset the chip while monitoring.
ok, it works now, thanks! :+1:
/esp-idf/examples/get-started/hello_world/build/log/idf_py_stdout_output_27407
ruki-2:hello_world ruki$ ls -l /dev/tty.*
crw-rw-rw- 1 root wheel 0x9000000 3 22 10:23 /dev/tty.BLTH
crw-rw-rw- 1 root wheel 0x9000002 3 22 23:27 /dev/tty.usbmodem01
ruki-2:hello_world ruki$ ls -l /dev/tty.*
crw-rw-rw- 1 root wheel 0x9000000 3 22 10:23 /dev/tty.BLTH
crw-rw-rw- 1 root wheel 0x9000002 3 22 23:28 /dev/tty.usbmodem14401
ruki-2:hello_world ruki$ idf.py monitor
Executing action: monitor
Serial port /dev/cu.usbmodem14401
Connecting.........
Detecting chip type... Unsupported detection protocol, switching and trying again...
Detecting chip type... ESP32-S2
Running idf_monitor in directory /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world
Executing "/Users/ruki/.espressif/python_env/idf5.1_py3.10_env/bin/python /Users/ruki/projects/personal/esp-idf/tools/idf_monitor.py -p /dev/cu.usbmodem14401 -b 115200 --toolchain-prefix xtensa-esp32s2-elf- --target esp32s2 /Users/ruki/projects/personal/esp-idf/examples/get-started/hello_world/build/hello_world.elf -m '/Users/ruki/.espressif/python_env/idf5.1_py3.10_env/bin/python' '/Users/ruki/projects/personal/esp-idf/tools/idf.py'"...
--- idf_monitor on /dev/cu.usbmodem14401 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
I (36) boot: ESP-IDF v5.1-dev-4051-g4f0769d2ed 2nd stage bootloader
I (37) boot: compile time Mar 22 2023 23:08:48
I (37) boot: chip revision: v0.0
I (37) boot.esp32s2: SPI Speed : 80MHz
I (37) boot.esp32s2: SPI Mode : DIO
I (38) boot.esp32s2: SPI Flash Size : 2MB
I (38) boot: Enabling RNG early entropy source...
I (38) boot: Partition Table:
I (38) boot: ## Label Usage Type ST Offset Length
I (39) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (40) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (41) boot: 2 factory factory app 00 00 00010000 00100000
I (43) boot: End of partition table
I (43) esp_image: segment 0: paddr=00010020 vaddr=3f000020 size=083ach ( 33708) map
I (50) esp_image: segment 1: paddr=000183d4 vaddr=3ffbee90 size=018a8h ( 6312) load
I (52) esp_image: segment 2: paddr=00019c84 vaddr=40024000 size=06394h ( 25492) load
I (58) esp_image: segment 3: paddr=00020020 vaddr=40080020 size=12c28h ( 76840) map
I (75) esp_image: segment 4: paddr=00032c50 vaddr=4002a394 size=04af4h ( 19188) load
I (86) boot: Loaded app from partition at offset 0x10000
I (87) boot: Disabling RNG early entropy source...
I (107) main_task: Started on CPU0
I (107) main_task: Calling app_main()
Hello world!
This is esp32s2 chip with 1 CPU core(s), WiFi, silicon revision v0.0, 2MB external flash
Minimum free heap size: 250192 bytes
Restarting in 10 seconds...
Restarting in 9 seconds...
Restarting in 8 seconds...
Restarting in 7 seconds...
Restarting in 6 seconds...
Restarting in 5 seconds...
Restarting in 4 seconds...
Restarting in 3 seconds...
Restarting in 2 seconds...
Restarting in 1 seconds...
Restarting in 0 seconds...
Restarting now.
I (36) boot: ESP-IDF v5.1-dev-4051-g4f0769d2ed 2nd stage bootloader
I (37) boot: compile time Mar 22 2023 23:08:48
I (37) boot: chip revision: v0.0
I (37) boot.esp32s2: SPI Speed : 80MHz
I (37) boot.esp32s2: SPI Mode : DIO
I (38) boot.esp32s2: SPI Flash Size : 2MB
I (38) boot: Enabling RNG early entropy source...
I (38) boot: Partition Table:
I (38) boot: ## Label Usage Type ST Offset Length
I (39) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (40) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (41) boot: 2 factory factory app 00 00 00010000 00100000
I (43) boot: End of partition table
I (43) esp_image: segment 0: paddr=00010020 vaddr=3f000020 size=083ach ( 33708) map
I (50) esp_image: segment 1: paddr=000183d4 vaddr=3ffbee90 size=018a8h ( 6312) load
I (52) esp_image: segment 2: paddr=00019c84 vaddr=40024000 size=06394h ( 25492) load
I (58) esp_image: segment 3: paddr=00020020 vaddr=40080020 size=12c28h ( 76840) map
I (74) esp_image: segment 4: paddr=00032c50 vaddr=4002a394 size=04af4h ( 19188) load
I (85) boot: Loaded app from partition at offset 0x10000
I (86) boot: Disabling RNG early entropy source...
I (105) main_task: Started on CPU0
I (105) main_task: Calling app_main()
Hello world!
This is esp32s2 chip with 1 CPU core(s), WiFi, silicon revision v0.0, 2MB external flash
Minimum free heap size: 250192 bytes
Restarting in 10 seconds...
Restarting in 9 seconds...
Restarting in 8 seconds...
Restarting in 7 seconds...
Restarting in 6 seconds...
Restarting in 5 seconds...
Answers checklist.
IDF version.
v5.1-dev-4051-g4f0769d2ed
Operating System used.
macOS
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32-S2FNR2
Power Supply used.
USB
What is the expected behavior?
I use
idf.py build
to buildexamples/get-started/hello_world
project and flash itit will report some errors after downloading.
then I run
idf.py monitor
, I cannot get any serial-io output.What is the actual behavior?
I can see app output.
Steps to reproduce.
Debug Logs.
No response
More Information.
No response