Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp32c6 doesn´t boot after flashing #549

Closed
thedevleon opened this issue Jan 8, 2025 · 7 comments
Closed

esp32c6 doesn´t boot after flashing #549

thedevleon opened this issue Jan 8, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@thedevleon
Copy link

thedevleon commented Jan 8, 2025

Bug description

We have a custom PCB with an ESP32C6-WROOM-1-N8 module.
We already have firmware based on esp-idf-svc 0.49 and esp-idf v5.1.3 that flashes and runs just fine on this PCB.

However, we would like to update to the latest version of esp-idf-svc, and are running into a bootloop with even just a sightly adjusted sample from the esp-idf-template to match the increased flash size: https://github.com/thedevleon/esp-idf-issue-bootloop

Running 'cargo run --release' results in the following looping output only:

❯ cargo run --release
    Finished `release` profile [optimized] target(s) in 0.36s
     Running `espflash flash --partition-table partitions.csv -s 8mb --no-stub --monitor target/riscv32imac-esp-espidf/release/esp-idf-test`
[2025-01-08T17:01:40Z INFO ] Serial port: '/dev/ttyACM0'
[2025-01-08T17:01:40Z INFO ] Connecting...
Chip type:         esp32c6 (revision v0.1)
Crystal frequency: 40 MHz
Flash size:        8MB
Features:          WiFi 6, BT 5
MAC address:       f0:f5:bd:25:ff:b8
Partition table:   partitions.csv
App/part. size:    371,568/4,063,232 bytes, 9.14%
[2025-01-08T17:01:41Z INFO ] Segment at address '0x0' has not changed, skipping write
[2025-01-08T17:01:41Z INFO ] Segment at address '0x8000' has not changed, skipping write
[2025-01-08T17:01:41Z INFO ] Segment at address '0x10000' has not changed, skipping write
[2025-01-08T17:01:41Z INFO ] Flashing has completed!
Commands:
    CTRL+R    Reset chip
    CTRL+C    Exit

ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x15 (USB_UART_HPSYS),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4002f474
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c410,len:0xd48
load:0x4086e610,len:0x2d68
load:0x40875720,len:0x1800
entry 0x4086c410
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x7 (TG0_WDT_HPSYS),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4086ed7a
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c410,len:0xd48
load:0x4086e610,len:0x2d68
load:0x40875720,len:0x1800
entry 0x4086c410
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x7 (TG0_WDT_HPSYS),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4086ed7a
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c410,len:0xd48
load:0x4086e610,len:0x2d68
load:0x40875720,len:0x1800
entry 0x4086c410
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x7 (TG0_WDT_HPSYS),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4086ed7a
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c410,len:0xd48
load:0x4086e610,len:0x2d68
load:0x40875720,len:0x1800
entry 0x4086c410
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x7 (TG0_WDT_HPSYS),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4086ed7a
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c410,len:0xd48
load:0x4086e610,len:0x2d68
load:0x40875720,len:0x1800
entry 0x4086c410
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x7 (TG0_WDT_HPSYS),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4086ed7a
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c410,len:0xd48
load:0x4086e610,len:0x2d68
load:0x40875720,len:0x1800
entry 0x4086c410
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x7 (TG0_WDT_HPSYS),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4086ed7a
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c410,len:0xd48
load:0x4086e610,len:0x2d68
load:0x40875720,len:0x1800
entry 0x4086c410
  • Would you like to work on a fix? y

To Reproduce

  • clone the repo above
  • connect a devkit with the WROOM-1-N8 module (via the native USB port, not UART)
  • cargo run --release
  • observe the looping output

Expected behavior

I can see a hello world printed and the output of the bootloader.

Environment

  • Crate (esp-idf-svc) version: 0.50
  • ESP-IDF branch or tag: v5.3.2
  • Target device (MCU): esp32c6
  • OS: Fedora Workstation 41
@thedevleon thedevleon added the bug Something isn't working label Jan 8, 2025
@github-project-automation github-project-automation bot moved this to Todo in esp-rs Jan 8, 2025
@thedevleon
Copy link
Author

thedevleon commented Jan 8, 2025

If i first flash our existing firmware, and then the sample, I can see the output successfully, wierd!

❯ cargo run --release
   Compiling esp-idf-test v0.1.0 (/home/leon/Desktop/ivy/code/esp-idf-test)
    Finished `release` profile [optimized] target(s) in 0.97s
     Running `espflash flash --partition-table partitions.csv -s 8mb --no-stub --monitor target/riscv32imac-esp-espidf/release/esp-idf-test`
[2025-01-08T17:16:35Z INFO ] Serial port: '/dev/ttyACM0'
[2025-01-08T17:16:35Z INFO ] Connecting...
Chip type:         esp32c6 (revision v0.1)
Crystal frequency: 40 MHz
Flash size:        8MB
Features:          WiFi 6, BT 5
MAC address:       f0:f5:bd:25:ff:b8
Partition table:   partitions.csv
App/part. size:    371,568/4,063,232 bytes, 9.14%
[2025-01-08T17:16:35Z INFO ] Segment at address '0x0' has not changed, skipping write
[2025-01-08T17:16:35Z INFO ] Segment at address '0x8000' has not changed, skipping write
[00:00:01] [========================================]     201/201     0x10000                                                                                                                                                                               [2025-01-08T17:16:39Z INFO ] Flashing has completed!
Commands:
    CTRL+R    Reset chip
    CTRL+C    Exit

ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x15 (USB_UART_HPSYS),boot:0x2d (SPI_FAST_FLASH_BOOT)
Saved PC:0x400228dc
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c410,len:0xd48
load:0x4086e610,len:0x2d68
load:0x40875720,len:0x1800
entry 0x4086c410
I (23) boot: ESP-IDF v5.1-beta1-378-gea5e0ff298-dirt 2nd stage bootloader
I (23) boot: compile time Jun  7 2023 08:02:08
I (24) boot: chip revision: v0.1
I (29) boot.esp32c6: SPI Speed      : 40MHz
I (33) boot.esp32c6: SPI Mode       : DIO
I (37) boot.esp32c6: SPI Flash Size : 8MB
I (42) boot: Enabling RNG early entropy source...
I (48) boot: Partition Table:
I (51) boot: ## Label            Usage          Type ST Offset   Length
I (58) boot:  0 nvs              WiFi data        01 02 00009000 00004000
I (66) boot:  1 otadata          OTA data         01 00 0000d000 00002000
I (73) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (81) boot:  3 ota_0            OTA app          00 10 00010000 003e0000
I (88) boot:  4 ota_1            OTA app          00 11 003f0000 003e0000
I (96) boot: End of partition table
I (100) esp_image: segment 0: paddr=00010020 vaddr=42000020 size=3dc3ch (252988) map
I (160) esp_image: segment 1: paddr=0004dc64 vaddr=40800000 size=023b4h (  9140) load
I (163) esp_image: segment 2: paddr=00050020 vaddr=42040020 size=11a18h ( 72216) map
I (180) esp_image: segment 3: paddr=00061a40 vaddr=408023b4 size=07388h ( 29576) load
I (188) esp_image: segment 4: paddr=00068dd0 vaddr=40809740 size=01d74h (  7540) load
I (193) boot: Loaded app from partition at offset 0x10000
I (194) boot: Disabling RNG early entropy source...
I (209) cpu_start: Unicore app
I (218) cpu_start: Pro cpu start user code
I (218) cpu_start: cpu freq: 160000000 Hz
I (219) app_init: Application information:
I (221) app_init: Project name:     libespidf
I (226) app_init: App version:      1
I (230) app_init: Compile time:     Jan  8 2025 17:00:59
I (236) app_init: ELF file SHA256:  000000000...
I (242) app_init: ESP-IDF:          v5.3.2
I (246) efuse_init: Min chip rev:     v0.0
I (251) efuse_init: Max chip rev:     v0.99 
I (256) efuse_init: Chip rev:         v0.1
I (261) heap_init: Initializing. RAM available for dynamic allocation:
I (268) heap_init: At 4080C530 len 000700E0 (448 KiB): RAM
I (274) heap_init: At 4087C610 len 00002F54 (11 KiB): RAM
I (280) heap_init: At 50000000 len 00003FE8 (15 KiB): RTCRAM
I (287) spi_flash: detected chip: generic
I (291) spi_flash: flash io: dio
W (296) pcnt(legacy): legacy driver is deprecated, please migrate to `driver/pulse_cnt.h`
W (304) i2c: This driver is an old driver, please migrate your application code to adapt `driver/i2c_master.h`
W (315) timer_group: legacy driver is deprecated, please migrate to `driver/gptimer.h`
I (324) sleep: Configure to isolate all GPIO pins in sleep state
I (330) sleep: Enable automatic switching of GPIO sleep configuration
I (337) coexist: coex firmware version: cbb41d7
I (343) coexist: coexist rom version 5b8dcfa
I (348) main_task: Started on CPU0
I (348) main_task: Calling app_main()
I (348) esp_idf_test: Hello, world!

Further notes:

  • Putting the ESP into bootloader mode first, and then flashing just results in a "waiting for download" message, even after the flash and after resetting via CTRL-R
  • Resetting via CTRL+R or via the EN pin doesn't help
  • any attempt to monitor after the initial espflash --monitor from cargo run will result in a timeout
❯ espflash monitor
[2025-01-08T17:18:58Z INFO ] Serial port: '/dev/ttyACM0'
[2025-01-08T17:18:58Z INFO ] Connecting...
[2025-01-08T17:18:58Z INFO ] Using flash stub
Error: espflash::timeout

  × Error while connecting to device
  ╰─▶ Timeout while running command

@ivmarkov
Copy link
Collaborator

ivmarkov commented Jan 8, 2025

ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x15 (USB_UART_HPSYS),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4002f474
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c410,len:0xd48
load:0x4086e610,len:0x2d68
load:0x40875720,len:0x1800
entry 0x4086c410
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x7 (TG0_WDT_HPSYS),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4086ed7a
SPIWP:0xee

How is that a problem with the new ESP IDF given that you can't even load and start the ESP IDF bootloader?

@ivmarkov ivmarkov closed this as completed Jan 8, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Jan 8, 2025
@thedevleon
Copy link
Author

thedevleon commented Jan 8, 2025

ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x15 (USB_UART_HPSYS),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4002f474
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c410,len:0xd48
load:0x4086e610,len:0x2d68
load:0x40875720,len:0x1800
entry 0x4086c410
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x7 (TG0_WDT_HPSYS),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4086ed7a
SPIWP:0xee

How is that a problem with the new ESP IDF given that you can't even load and start the ESP IDF bootloader?

I don't quite understand what you mean. Can you elaborate? I don't know why the bootloader doesn't load either. All the configuration around the bootloader and partition layout is the same between our current firmware with the old esp-idf(-svc) version and the new sample with the new esp-idf(-svc)version. Why would one boot and not the other?

@ivmarkov
Copy link
Collaborator

ivmarkov commented Jan 8, 2025

I have no idea because I have no detailed information for your configuration. What I'm saying however is that you are very likely looking at the wrong place. Your esp-idf-test (old or new) starts executing at millisecond 209 or so in your log. Everything before that is the ROM bootloader and then the 2nd stage bootloader flashed by espflash (as you are not flashing a custom one). So it sounds pretty much impossible the culprit to be the new esp idf 5.3, given that the esp idf 5.3 new code does not even get the chance to be loaded, let alone executed.

@thedevleon
Copy link
Author

thedevleon commented Jan 8, 2025

I just generated a new project using cargo generate, but chose the v5.2 esp-idf sdk instead of the v5.3 and that boots and flashes fine... So at least from my view, that's the only difference and thus the culprit, wouldn´t you agree?
So for now we'll stick with ESP_IDF_VERSION = "v5.2.3".

@ivmarkov
Copy link
Collaborator

ivmarkov commented Jan 8, 2025

  • I just generated a new project using cargo generate (full logs below), flashed on the c3 c6 and it works.
  • I also tried to explain why I find the new ESP-IDF 5.3 support to be the least likely of all possible options (really, and again sounds theoretically impossible).

There are other more likely (IMO) possibilities:

  • Brownout (though too early for that, usu. happens when Wifi kicks in) have you tried with more powerful USB power supply?
  • Buggy board. Perhaps you should google why you get the TG0_WDT_HPSYS triggered for your board
  • Old/buggy espflash

So for now we'll stick with ESP_IDF_VERSION = "v5.2.3"

Sure, up to you.

=========================

ivan@m800:~/dev$ cargo generate esp-rs/esp-idf-template cargo
⚠️   Favorite `esp-rs/esp-idf-template` not found in config, using it as a git repository: https://github.com/esp-rs/esp-idf-template.git
🤷   Project Name: test53
🔧   Destination: /home/ivan/dev/test53 ...
🔧   project-name: test53 ...
🔧   Generating template ...
✔ 🤷   Which MCU to target? · esp32c6
✔ 🤷   Configure advanced template options? · false
🔧   Moving generated files into: `/home/ivan/dev/test53`...
🔧   Initializing a fresh Git repository
✨   Done! New project created /home/ivan/dev/test53
ivan@m800:~/dev$ cd test53
ivan@m800:~/dev/test53$ cargo build
    Updating crates.io index
     Locking 168 packages to latest compatible versions
  Downloaded autocfg v1.4.0
  Downloaded rustversion v1.0.19
  Downloaded toml_datetime v0.6.8
  Downloaded strum v0.24.1
  Downloaded shlex v1.3.0
  Downloaded bitflags v1.3.2
  Downloaded bindgen v0.71.1
  Downloaded globwalk v0.8.1
  Downloaded proc-macro-error2 v2.0.1
  Downloaded winnow v0.6.22
  Downloaded void v1.0.2
  Downloaded minimal-lexical v0.2.1
  Downloaded thiserror-impl v1.0.69
  Downloaded same-file v1.0.6
  Downloaded cfg-if v1.0.0
  Downloaded libc v0.2.169
  Downloaded unicode-ident v1.0.14
  Downloaded regex v1.11.1
  Downloaded strum v0.25.0
  Downloaded fastrand v2.3.0
  Downloaded unicode-xid v0.2.6
  Downloaded remove_dir_all v0.8.4
  Downloaded thiserror-impl v2.0.9
  Downloaded uncased v0.9.10
  Downloaded strum_macros v0.24.3
  Downloaded which v4.4.2
  Downloaded pin-utils v0.1.0
  Downloaded thiserror v2.0.9
  Downloaded walkdir v2.5.0
  Downloaded serde_derive v1.0.217
  Downloaded serde v1.0.217
  Downloaded toml_edit v0.22.22
  Downloaded darling_core v0.20.10
  Downloaded memchr v2.7.4
  Downloaded serde_json v1.0.135
  Downloaded nom v7.1.3
  Downloaded aho-corasick v1.1.3
  Downloaded futures-util v0.3.31
  Downloaded syn v1.0.109
  Downloaded itertools v0.13.0
  Downloaded chrono v0.4.39
  Downloaded nix v0.29.0
  Downloaded heapless v0.8.0
  Downloaded hashbrown v0.15.2
  Downloaded esp-idf-hal v0.45.0
  Downloaded bstr v1.11.3
  Downloaded rustix v0.38.43
  Downloaded indexmap v2.7.0
  Downloaded cc v1.2.7
  Downloaded regex-syntax v0.8.5
  Downloaded log v0.4.22
  Downloaded ignore v0.4.23
  Downloaded fs_at v0.2.1
  Downloaded const_format v0.2.34
  Downloaded ryu v1.0.18
  Downloaded regex-automata v0.4.9
  Downloaded embuild v0.33.0
  Downloaded prettyplease v0.2.27
  Downloaded embedded-hal v1.0.0
  Downloaded camino v1.1.9
  Downloaded anyhow v1.0.95
  Downloaded proc-macro2 v1.0.92
  Downloaded pin-project-lite v0.2.16
  Downloaded litrs v0.4.1
  Downloaded heck v0.4.1
  Downloaded globset v0.4.15
  Downloaded getrandom v0.2.15
  Downloaded fnv v1.0.7
  Downloaded enumset v1.1.5
  Downloaded embedded-svc v0.28.1
  Downloaded tempfile v3.15.0
  Downloaded cargo_metadata v0.18.1
  Downloaded nb v0.1.3
  Downloaded glob v0.3.2
  Downloaded version_check v0.9.5
  Downloaded proc-macro-error-attr2 v2.0.0
  Downloaded num_enum_derive v0.7.3
  Downloaded num-traits v0.2.19
  Downloaded itoa v1.0.14
  Downloaded home v0.5.11
  Downloaded hash32 v0.3.1
  Downloaded futures-io v0.3.31
  Downloaded embassy-time-driver v0.1.0
  Downloaded critical-section v1.2.0
  Downloaded either v1.13.0
  Downloaded defmt-macros v0.4.0
  Downloaded thiserror v1.0.69
  Downloaded embedded-hal-async v1.0.0
  Downloaded embedded-can v0.4.1
  Downloaded cargo-platform v0.1.9
  Downloaded rustc-hash v2.1.0
  Downloaded cmake v0.1.52
  Downloaded clang-sys v1.8.1
  Downloaded byteorder v1.5.0
  Downloaded atomic-waker v1.1.2
  Downloaded once_cell v1.20.2
  Downloaded num_enum v0.7.3
  Downloaded ident_case v1.0.1
  Downloaded linux-raw-sys v0.4.15
  Downloaded iana-time-zone v0.1.61
  Downloaded embedded-hal v0.2.7
  Downloaded embassy-futures v0.1.1
  Downloaded darling v0.20.10
  Downloaded const_format_proc_macros v0.2.34
  Downloaded normpath v1.3.0
  Downloaded libloading v0.8.6
  Downloaded build-time v0.1.3
  Downloaded syn v2.0.95
  Downloaded strum_macros v0.25.3
  Downloaded semver v1.0.24
  Downloaded quote v1.0.38
  Downloaded proc-macro-crate v3.2.0
  Downloaded futures-task v0.3.31
  Downloaded futures-core v0.3.31
  Downloaded filetime v0.2.25
  Downloaded equivalent v1.0.1
  Downloaded enumset_derive v0.10.0
  Downloaded embassy-sync v0.6.1
  Downloaded cvt v0.1.2
  Downloaded crossbeam-epoch v0.9.18
  Downloaded crossbeam-deque v0.8.6
  Downloaded darling_macro v0.20.10
  Downloaded cfg_aliases v0.2.1
  Downloaded futures-sink v0.3.31
  Downloaded nb v1.1.0
  Downloaded esp-idf-sys v0.36.0
  Downloaded errno v0.3.10
  Downloaded envy v0.4.2
  Downloaded embedded-io-async v0.6.1
  Downloaded embedded-io v0.6.1
  Downloaded embedded-hal-nb v1.0.0
  Downloaded document-features v0.2.10
  Downloaded defmt-parser v0.4.1
  Downloaded defmt v0.3.10
  Downloaded crossbeam-utils v0.8.21
  Downloaded cexpr v0.6.0
  Downloaded stable_deref_trait v1.2.0
  Downloaded bitflags v2.6.0
  Downloaded esp-idf-svc v0.50.1
  Downloaded 139 crates (11.5 MB) in 0.85s (largest was `linux-raw-sys` at 2.2 MB)
    Updating crates.io index
  Downloaded getopts v0.2.21
  Downloaded adler2 v2.0.0
  Downloaded unicode-width v0.1.14
  Downloaded allocator-api2 v0.2.21
  Downloaded rustc-demangle v0.1.24
  Downloaded addr2line v0.24.2
  Downloaded miniz_oxide v0.8.2
  Downloaded compiler_builtins v0.1.140
  Downloaded gimli v0.31.1
  Downloaded object v0.36.7
  Downloaded 10 crates (1.3 MB) in 0.13s
   Compiling compiler_builtins v0.1.140
   Compiling core v0.0.0 (/home/ivan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling libc v0.2.169
   Compiling proc-macro2 v1.0.92
   Compiling object v0.36.7
   Compiling unicode-ident v1.0.14
   Compiling std v0.0.0 (/home/ivan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std)
   Compiling memchr v2.7.4
   Compiling cfg-if v1.0.0
   Compiling serde v1.0.217
   Compiling bitflags v2.6.0
   Compiling regex-syntax v0.8.5
   Compiling aho-corasick v1.1.3
   Compiling crossbeam-utils v0.8.21
   Compiling cfg_aliases v0.2.1
   Compiling glob v0.3.2
   Compiling quote v1.0.38
   Compiling syn v2.0.95
   Compiling clang-sys v1.8.1
   Compiling nix v0.29.0
   Compiling syn v1.0.109
   Compiling rustversion v1.0.19
   Compiling rustix v0.38.43
   Compiling prettyplease v0.2.27
   Compiling log v0.4.22
   Compiling crossbeam-epoch v0.9.18
   Compiling bstr v1.11.3
   Compiling serde_json v1.0.135
   Compiling minimal-lexical v0.2.1
   Compiling either v1.13.0
   Compiling regex-automata v0.4.9
   Compiling thiserror v1.0.69
   Compiling shlex v1.3.0
   Compiling linux-raw-sys v0.4.15
   Compiling same-file v1.0.6
   Compiling walkdir v2.5.0
   Compiling nom v7.1.3
   Compiling crossbeam-deque v0.8.6
   Compiling cvt v0.1.2
   Compiling globset v0.4.15
   Compiling libloading v0.8.6
   Compiling bindgen v0.71.1
   Compiling anyhow v1.0.95
   Compiling once_cell v1.20.2
   Compiling heck v0.4.1
   Compiling itoa v1.0.14
   Compiling ryu v1.0.18
   Compiling ignore v0.4.23
   Compiling fs_at v0.2.1
   Compiling regex v1.11.1
   Compiling cexpr v0.6.0
   Compiling cc v1.2.7
   Compiling itertools v0.13.0
   Compiling getrandom v0.2.15
   Compiling normpath v1.3.0
   Compiling bitflags v1.3.2
   Compiling strum_macros v0.24.3
   Compiling rustc-hash v2.1.0
   Compiling home v0.5.11
   Compiling fastrand v2.3.0
   Compiling which v4.4.2
   Compiling tempfile v3.15.0
   Compiling globwalk v0.8.1
   Compiling cmake v0.1.52
   Compiling serde_derive v1.0.217
   Compiling thiserror-impl v1.0.69
   Compiling remove_dir_all v0.8.4
   Compiling filetime v0.2.25
   Compiling semver v1.0.24
   Compiling camino v1.1.9
   Compiling strum v0.24.1
   Compiling autocfg v1.4.0
   Compiling fnv v1.0.7
   Compiling ident_case v1.0.1
   Compiling darling_core v0.20.10
   Compiling heapless v0.8.0
   Compiling embedded-io-async v0.6.1
   Compiling num-traits v0.2.19
   Compiling embassy-time-driver v0.1.0
   Compiling unicode-xid v0.2.6
   Compiling iana-time-zone v0.1.61
   Compiling rustc-std-workspace-core v1.99.0 (/home/ivan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling const_format_proc_macros v0.2.34
   Compiling chrono v0.4.39
   Compiling alloc v0.0.0 (/home/ivan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc)
   Compiling unwind v0.0.0 (/home/ivan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/unwind)
   Compiling adler2 v2.0.0
   Compiling rustc-demangle v0.1.24
   Compiling embassy-sync v0.6.1
   Compiling version_check v0.9.5
   Compiling embedded-hal-async v1.0.0
   Compiling darling_macro v0.20.10
   Compiling uncased v0.9.10
   Compiling build-time v0.1.3
   Compiling num_enum_derive v0.7.3
   Compiling darling v0.20.10
   Compiling enumset_derive v0.10.0
   Compiling litrs v0.4.1
   Compiling rustc-std-workspace-alloc v1.99.0 (/home/ivan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
   Compiling gimli v0.31.1
   Compiling hashbrown v0.15.2
   Compiling miniz_oxide v0.8.2
   Compiling std_detect v0.1.5 (/home/ivan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
   Compiling panic_abort v0.0.0 (/home/ivan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/panic_abort)
   Compiling panic_unwind v0.0.0 (/home/ivan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/panic_unwind)
   Compiling document-features v0.2.10
   Compiling cargo-platform v0.1.9
   Compiling envy v0.4.2
   Compiling addr2line v0.24.2
   Compiling embuild v0.33.0
   Compiling cargo_metadata v0.18.1
   Compiling esp-idf-sys v0.36.0
   Compiling esp-idf-hal v0.45.0
   Compiling esp-idf-svc v0.50.1
   Compiling test53 v0.1.0 (/home/ivan/dev/test53)
   Compiling proc_macro v0.0.0 (/home/ivan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro)
   Compiling byteorder v1.5.0
   Compiling nb v1.1.0
   Compiling hash32 v0.3.1
   Compiling embedded-io v0.6.1
   Compiling stable_deref_trait v1.2.0
   Compiling embedded-hal v1.0.0
   Compiling pin-utils v0.1.0
   Compiling futures-core v0.3.31
   Compiling pin-project-lite v0.2.16
   Compiling futures-task v0.3.31
   Compiling nb v0.1.3
   Compiling futures-sink v0.3.31
   Compiling critical-section v1.2.0
   Compiling futures-util v0.3.31
   Compiling enumset v1.1.5
   Compiling const_format v0.2.34
   Compiling void v1.0.2
   Compiling embedded-hal v0.2.7
   Compiling embedded-hal-nb v1.0.0
   Compiling embedded-can v0.4.1
   Compiling atomic-waker v1.1.2
   Compiling num_enum v0.7.3
   Compiling embassy-futures v0.1.1
   Compiling futures-io v0.3.31
   Compiling embedded-svc v0.28.1
    Finished `dev` profile [optimized + debuginfo] target(s) in 3m 25s
ivan@m800:~/dev/test53$ pwd
/home/ivan/dev/test53
ivan@m800:~/dev/test53$ ll target/riscv32imac-esp-espidf/debug/test53
-rwxr-xr-x 2 ivan ivan 12774216 Jan  8 18:26 target/riscv32imac-esp-espidf/debug/test53*
ivan@m800:~/dev/test53$ 

ivan@ivan-laptop:~$ espflash flash ./test53
[2025-01-08T18:28:04Z INFO ] Serial port: '/dev/ttyUSB0'
[2025-01-08T18:28:04Z INFO ] Connecting...
[2025-01-08T18:28:06Z INFO ] Using flash stub
Chip type:         esp32c6 (revision v0.0)
Crystal frequency: 40 MHz
Flash size:        8MB
Features:          WiFi 6, BT 5
MAC address:       40:4c:ca:42:a1:f4
App/part. size:    497,872/4,128,768 bytes, 12.06%
[2025-01-08T18:28:08Z INFO ] Segment at address '0x0' has not changed, skipping write
[2025-01-08T18:28:08Z INFO ] Segment at address '0x8000' has not changed, skipping write
[00:00:23] [========================================]     234/234     0x10000                                                                                                                                      [2025-01-08T18:28:32Z INFO ] Flashing has completed!
ivan@ivan-laptop:~$ espflash monitor
[2025-01-08T18:28:48Z INFO ] Serial port: '/dev/ttyUSB0'
[2025-01-08T18:28:48Z INFO ] Connecting...
[2025-01-08T18:28:50Z INFO ] Using flash stub
Commands:
    CTRL+R    Reset chip
    CTRL+C    Exit

ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c410,len:0xd48
load:0x4086e610,len:0x2d68
load:0x40875720,len:0x1800
entry 0x4086c410
I (23) boot: ESP-IDF v5.1-beta1-378-gea5e0ff298-dirt 2nd stage bootloader
I (24) boot: compile time Jun  7 2023 08:02:08
I (25) boot: chip revision: v0.0
I (29) boot.esp32c6: SPI Speed      : 40MHz
I (33) boot.esp32c6: SPI Mode       : DIO
I (38) boot.esp32c6: SPI Flash Size : 4MB
I (43) boot: Enabling RNG early entropy source...
I (49) boot: Partition Table:
I (52) boot: ## Label            Usage          Type ST Offset   Length
I (59) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (67) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (74) boot:  2 factory          factory app      00 00 00010000 003f0000
I (82) boot: End of partition table
I (86) esp_image: segment 0: paddr=00010020 vaddr=42000020 size=4d020h (315424) map
I (158) esp_image: segment 1: paddr=0005d048 vaddr=40800000 size=02fd0h ( 12240) load
I (162) esp_image: segment 2: paddr=00060020 vaddr=42050020 size=21a2ch (137772) map
I (192) esp_image: segment 3: paddr=00081a54 vaddr=40802fd0 size=0625ch ( 25180) load
I (199) esp_image: segment 4: paddr=00087cb8 vaddr=40809230 size=01bech (  7148) load
I (203) boot: Loaded app from partition at offset 0x10000
I (204) boot: Disabling RNG early entropy source...
I (221) cpu_start: Unicore app
W (229) clk: esp_perip_clk_init() has not been implemented yet
I (236) cpu_start: Pro cpu start user code
I (236) cpu_start: cpu freq: 160000000 Hz
I (236) cpu_start: Application information:
I (239) cpu_start: Project name:     libespidf
I (244) cpu_start: App version:      1
I (249) cpu_start: Compile time:     Jan  8 2025 18:25:30
I (255) cpu_start: ELF file SHA256:  000000000...
I (260) cpu_start: ESP-IDF:          v5.2.3
I (265) cpu_start: Min chip rev:     v0.0
I (270) cpu_start: Max chip rev:     v0.99 
I (274) cpu_start: Chip rev:         v0.0
I (279) heap_init: Initializing. RAM available for dynamic allocation:
I (286) heap_init: At 4080BE50 len 000707C0 (449 KiB): RAM
I (292) heap_init: At 4087C610 len 00002F54 (11 KiB): RAM
I (299) heap_init: At 50000000 len 00003FE8 (15 KiB): RTCRAM
I (306) spi_flash: detected chip: generic
I (310) spi_flash: flash io: dio
W (314) spi_flash: Detected size(8192k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
W (327) pcnt(legacy): legacy driver is deprecated, please migrate to `driver/pulse_cnt.h`
W (335) i2c: This driver is an old driver, please migrate your application code to adapt `driver/i2c_master.h`
W (346) timer_group: legacy driver is deprecated, please migrate to `driver/gptimer.h`
I (355) sleep: Configure to isolate all GPIO pins in sleep state
I (362) sleep: Enable automatic switching of GPIO sleep configuration
I (369) coexist: coex firmware version: 27d8387
I (374) coexist: coexist rom version 5b8dcfa
I (379) main_task: Started on CPU0
I (379) main_task: Calling app_main()
I (379) test53: Hello, world!
I (389) main_task: Returned from app_main()
ivan@ivan-laptop:~$ 


@ivmarkov
Copy link
Collaborator

ivmarkov commented Jan 8, 2025

In all fairness, the log from above ^^^ was for ESP IDF 5.2.3 as apparently this is still the default. Yet - I took the effort, re-generated a completely new project, went to advanced settings, made sure I select "5.3.2", built, flashed, ran. Same result.

If you want to get to the bottom of this, googling for TG0_WDT_HPSYS early during bootup might be key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants