-
Notifications
You must be signed in to change notification settings - Fork 147
Closed
Description
Working on my first esp-rs project, using a std configuration from esp-idf-template on an esp32c6.
Having deployment issues, so I have the following simple test:
fn main() {
esp_idf_svc::sys::link_patches();
esp_idf_svc::log::EspLogger::initialize_default();
log::info!("Hello World!");
}
This runs correctly under Wokwi but fails to start on the esp32c6 with an Invalid app image header warning as follows
[2025-04-17T14:54:10Z INFO ] Detected 6 serial ports
[2025-04-17T14:54:10Z INFO ] Ports which match a known common dev board are highlighted
[2025-04-17T14:54:10Z INFO ] Please select a port
[2025-04-17T14:54:11Z INFO ] Serial port: '/dev/cu.usbserial-2115330'
[2025-04-17T14:54:11Z INFO ] Connecting...
[2025-04-17T14:54:12Z 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:43:a4:18
App/part. size: 1,018,048/8,323,072 bytes, 12.23%
[2025-04-17T14:54:13Z INFO ] Segment at address '0x0' has not changed, skipping write
[2025-04-17T14:54:13Z INFO ] Segment at address '0x8000' has not changed, skipping write
[00:00:42] [========================================] 421/421 0x10000 [2025-04-17T14:54:58Z INFO ] Flashing has completed!
Commands:
CTRL+R Reset chip
CTRL+C Exit
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
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 : 80MHz
I (33) boot.esp32c6: SPI Mode : DIO
I (38) boot.esp32c6: SPI Flash Size : 8MB
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 007f0000
I (82) boot: End of partition table
I (86) esp_image: segment 0: paddr=00010020 vaddr=42000020 size=c5d78h (810360) map
I (259) esp_image: segment 1: paddr=000d5da0 vaddr=40800000 size=0a278h ( 41592) load
I (269) esp_image: segment 2: paddr=000e0020 vaddr=420d0020 size=25e24h (155172) map
I (301) esp_image: segment 3: paddr=00105e4c vaddr=4080a278 size=02a4ch ( 10828) load
I (307) boot: Loaded app from partition at offset 0x10000
I (308) boot: Disabling RNG early entropy source...
I (322) cpu_start: Unicore app
E (331) cpu_start: Invalid app image header
abort() was called at PC 0x40800fd9 on core 0
0x40800fd9 - call_start_cpu0
at /Users/terry/esp/esp-idf/components/esp_system/port/cpu_start.c:810
Core 0 register dump:
MEPC : 0x40801426 RA : 0x40805302 SP : 0x4087e160 GP : 0x4080b6e4
0x40801426 - panic_abort
at /Users/terry/esp/esp-idf/components/esp_system/panic.c:463
0x40805302 - __ubsan_include
at /Users/terry/esp/esp-idf/components/esp_system/ubsan.c:311
0x4080b6e4 - uart_context
at ??:??
TP : 0x00000000 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x00000004 S1 : 0x4087e1c4 A0 : 0x4087e18c A1 : 0x4087e1c2
A2 : 0x00000000 A3 : 0x4087e1b9 A4 : 0x00000001 A5 : 0x4080e000
A6 : 0x00000000 A7 : 0x76757473 S2 : 0x42800000 S3 : 0x420d0000
S4 : 0x42000000 S5 : 0x42000000 S6 : 0x40800d2c S7 : 0x00025e24
0x40800d2c - call_start_cpu0
at /Users/terry/esp/esp-idf/components/esp_system/port/cpu_start.c:395
S8 : 0x000c5d78 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
MSTATUS : 0x00001881 MTVEC : 0x40800001 MCAUSE : 0x00000007 MTVAL : 0x00000000
0x40800001 - _vector_table
at /Users/terry/esp/esp-idf/components/riscv/vectors_intc.S:54
MHARTID : 0x00000000
Stack memory:
4087e160: 0x00000000 0x00000000 0x4087e1c0 0x40809cbc 0x40800d2c 0x42000000 0x42000000 0x4080cb34
0x40809cbc - abort
at /Users/terry/esp/esp-idf/components/newlib/abort.c:35
0x40800d2c - call_start_cpu0
at /Users/terry/esp/esp-idf/components/esp_system/port/cpu_start.c:395
4087e180: 0x4087e1c4 0x4080cb50 0x4087e1c0 0x726f6261 0x20292874 0x20736177 0x6c6c6163 0x61206465
4087e1a0: 0x43502074 0x34783020 0x30303830 0x20396466 0x63206e6f 0x2065726f 0x00000030 0x40800000
0x40800000 - _vector_table
at /Users/terry/esp/esp-idf/components/riscv/vectors_intc.S:54
4087e1c0: 0x42800030 0x30383034 0x39646630 0x4087e200 0x0000002e 0x00000001 0x00300000 0x40800fdc
0x40800fdc - panic_enable_cache
at /Users/terry/esp/esp-idf/components/esp_system/port/panic_handler.c:227
4087e1e0: 0x000052e0 0x00700000 0x0793c42e 0x1c230d80 0x411c00f1 0x004c43dc 0x50b29782 0x80826145
4087e200: 0x42800000 0x420c5d97 0x420f5e43 0x4086f95c 0xf4edb2c7 0x00028000 0x00010020 0x000e0020
0x420f5e43 - esp_system_init_fn_init_disable_rtc_wdt
at ??:??
4087e220: 0x42000020 0x420d0020 0x000c5d78 0x00025e24 0x000052e0 0x00000133 0x00000000 0x40880000
0x42000020 - std::process::ExitCode::to_i32
at /Users/terry/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/process.rs:2076
4087e240: 0x000052e0 0x4004b05c 0x0000ffff 0xffffffff 0xffffffff 0x4087e3a0 0xffffffff 0x4086fda2
4087e260: 0xffffffff 0x0000002e 0x00010000 0x007f0000 0x00010000 0x3f0204e9 0x40800d2c 0x000000ee
0x40800d2c - call_start_cpu0
at /Users/terry/esp/esp-idf/components/esp_system/port/cpu_start.c:395
4087e280: 0x0000000d 0x00006300 0x01000000 0x42000020 0x000c5d78 0x40800000 0x0000a278 0x420d0020
0x42000020 - std::process::ExitCode::to_i32
at /Users/terry/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/process.rs:2076
0x40800000 - _vector_table
at /Users/terry/esp/esp-idf/components/riscv/vectors_intc.S:54
4087e2a0: 0x00025e24 0x4080a278 0x00002a4c 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x4080a278 - memspi_host_erase_block
at /Users/terry/esp/esp-idf/components/spi_flash/memspi_host_driver.c:162
4087e2c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e2e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e300: 0x00000000 0x00000000 0x00000000 0x00010020 0x000d5da0 0x000e0020 0x00105e4c 0x00000000
4087e320: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e340: 0x00000000 0x00000000 0x00000000 0x000f88c0 0x40350206 0x72c310af 0x3e0cce91 0x2988920c
4087e360: 0x7e1a7164 0xd93db49d 0x727d3cad 0x0452edb9 0x000052e0 0x4004b05c 0x0000ffff 0x40880000
4087e380: 0x00000000 0x00000021 0x000052f0 0x4086c492 0xd997efe0 0x53d0c848 0x00000000 0xffffffff
4087e3a0: 0x00000000 0x00000000 0x00010000 0x007f0000 0x00000000 0x00000000 0x00000000 0x00000000
4087e3c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e3e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e400: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e420: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e440: 0x60002000 0x00000100 0x00000020 0x4001b1c0 0x3ca1be7b 0x41454a00 0x6231344d 0x00000000
4087e460: 0x31110e68 0x00000000 0x00010000 0x3f0203e9 0x4086c410 0x40875720 0x00001800 0x000000ee
4087e480: 0x0000000d 0x00006300 0x01000000 0x420052f0 0x7533885e 0x890d2817 0x6de2d3ef 0x2028fdf7
0x420052f0 - alloc::collections::btree::node::NodeRef<alloc::collections::btree::node::marker::Owned,K,V,Type>::borrow_mut
at /Users/terry/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/collections/btree/node.rs:632
4087e4a0: 0x6eccadb6 0x922c325a 0x6858dc9e 0x947130cd 0x9931d4d3 0x00000000 0x00000000 0x00000000
4087e4c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x4087e5f0 0x00000101 0x00000002
4087e4e0: 0x890d2817 0x6de2d3ef 0x2028fdf7 0x6eccadb6 0x922c325a 0x6858dc9e 0x947130cd 0x9931d4d3
4087e500: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4087e520: 0x00000063 0x5f707365 0x5f6d6f72 0x69676572 0x775f6332 0x65746972 0x73616d5f 0x0000006b
4087e540: 0x00000000 0x00000000 0x00000000 0x21000000 0x00000080 0x00000000 0x00000000 0x80970200
ELF file SHA256:
I am using an ESP-IDF install that I have checked out at v5.3.3 and have set MCU="esp32c6" in .cargo/config.toml.
I have also tried manually adding an sdkconfig file to the project (as the native process for using menuconfig with esp-rs seems to be undocumented).
Would be grateful for some pointers to help debug, please.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Todo