Skip to content

it reports Could not recognize stack trace/backtrace C6, RISC-V #43

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

Open
kittaakos opened this issue May 9, 2025 · 9 comments
Open

Comments

@kittaakos
Copy link
Contributor

Thank @kittaakos . I've already read the guide, and could do it well with xtensa core. But with C6, RISC-V, it reports Could not recognize stack trace/backtrace

Core  0 register dump:
MEPC    : 0x42006c3a  RA      : 0x420016ac  SP      : 0x4081b9a0  GP      : 0x4080fed4  
TP      : 0x4081bae0  T0      : 0x40022494  T1      : 0x4080916c  T2      : 0x00000000  
S0/FP   : 0x40812000  S1      : 0x40815000  A0      : 0x00000000  A1      : 0x00000000  
A2      : 0x00000000  A3      : 0x00000001  A4      : 0x00000000  A5      : 0x00000000  
A6      : 0x600b1400  A7      : 0x00000000  S2      : 0x50003fec  S3      : 0x40818b58  
S4      : 0x40815000  S5      : 0x00000010  S6      : 0x00000000  S7      : 0x00000000  
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
T3      : 0x00000014  T4      : 0x40815000  T5      : 0x40815000  T6      : 0x00000000  
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000005  MTVAL   : 0x00000008  
MHARTID : 0x00000000  

Stack memory:
4081b9a0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
4081b9c0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
4081b9e0: 0xffffffff 0x00000010 0xffffffff 0x00000000 0x00010000 0x00000000 0xffffffff 0x4080f788
4081ba00: 0x00000001 0x00000010 0xffffffff 0xffffffff 0x00000000 0x4080f788 0x00000000 0x4200ec1c
4081ba20: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x00000000 0x00000011 0x00000010
4081ba40: 0xffffffff 0xffffffff 0x00000000 0x00000000 0x4080f788 0x00000000 0x00000001 0x4200ef98
4081ba60: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xba7c61b8
4081ba80: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081baa0: 0x00000000 0x00000000 0x00000000 0x4200fb90 0x00000000 0x00000000 0x00000000 0x00000000
4081bac0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
4081bae0: 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 0x0000016c 0xabba1234 0x00000160 0x4081b7b0 0x00000000
4081bb00: 0x40811f84 0x40811f84 0x4081baf8 0x40811f7c 0x00000018 0x4081c448 0x4081c448 0x4081baf8
4081bb20: 0x00000000 0x00000001 0x40819ae8 0x706f6f6c 0x6b736154 0x00000000 0x4081bae0 0x00000005
4081bb40: 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000571
4081bb60: 0x00000000 0x40815824 0x4081588c 0x408158f4 0x00000000 0x00000000 0x00000001 0x00000000
4081bb80: 0x00000000 0x00000000 0x4201977a 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081bba0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081bbc0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081bbe0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081bc00: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081bc20: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081bc40: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xbaad5678 0x00000068
4081bc60: 0xabba1234 0x0000005c 0x00000000 0x4081bc68 0x00000000 0x00000000 0x00000000 0x4081bc80
4081bc80: 0xffffffff 0x4081bc80 0x4081bc80 0x00000000 0x4081bc94 0xffffffff 0x4081bc94 0x4081bc94
4081bca0: 0x00000001 0x00000001 0x00000000 0x0000ffff 0x00000000 0x00000000 0x00000001 0x00000000
4081bcc0: 0x00000000 0xbaad5678 0x00000088 0xabba1234 0x0000007c 0x00000000 0x00000014 0x4081c488
4081bce0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x4081bd60 0x00000000 0x00000101
4081bd00: 0x00000000 0x00000000 0x0000000a 0x4081c52c 0x00000000 0x00000000 0x00000000 0x00000000
4081bd20: 0x00000000 0x00000000 0x00000000 0x00000000 0x4081bf70 0x4081c0dc 0x00000000 0x4081c2d8
4081bd40: 0x4081c26c 0x4081c41c 0x4081c3b0 0x4081c344 0xbaad5678 0x0000020c 0xabba1234 0x00000200
4081bd60: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081bd80: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000

Could not recognize stack trace/backtrace

Paste exception to decode...

Originally posted by @bhcuong2008 in #6

Please share the ELF file by attaching it as a zip (or any other allowed extension) if you can. Enable as much logging as possible (#10 (comment)), and share the details. Please also copy-paste the entire content of the decoder terminal. If it's shareable info, I would like to see it with sketch path, FQBN, etc.

The more you can share about your environment, the more likely I will be able to fix the problem. If only the monitor output is available, I can check if the parser part of the code is correct, but I won't be able to debug the gdb part 😕 Thanks!

@bhcuong2008
Copy link

Here is the test code to cause exception on ESP32-C6. While creating this example, there is a very strange thing that I can't explain it that I take note in the code (p->hello("Hello, World 1!"); // not cause exception, WHY?).

class Person {
public:
    Person() {
        Serial.printf("New person\n");
    }
    void hello(const char* msg) {
        Serial.printf("%s\n", msg);
    }
};

Person *p = NULL;
Person *p2 = NULL;
int *p3 = NULL;

void setup() {   
    Serial.begin(115200);
    Serial.printf("Test exception, p = 0x%X | p2 = 0x%X\n", p, p2);
    p->hello("Hello, World 1!");    // not cause exception, WHY?
    p2->hello("Hello, World 2!");   // not cause exception, WHY?
    *p3 = 10;   // Cause exception here
}

void loop() {    
    delay(2000);
}

Here is terminal log.

Rebooting...
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0xc (SW_CPU),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4001975a
SPIWP:0xee
mode:DIO, clock div:2
load:0x40875720,len:0x126c
load:0x4086c110,len:0xff0
load:0x4086e610,len:0x30a8
entry 0x4086c110
Test exception, p = 0x0 | p2 = 0x0
Hello, World 1!
Hello, World 2!
Guru Meditation Error: Core  0 panic'ed (Store access fault). Exception was unhandled.

Core  0 register dump:
MEPC    : 0x420000a2  RA      : 0x42002014  SP      : 0x40815670  GP      : 0x4080ce84  
TP      : 0x408156b0  T0      : 0x40030dca  T1      : 0x40806908  T2      : 0x00000000  
S0/FP   : 0x00000000  S1      : 0x42036000  A0      : 0x00000010  A1      : 0x00000000  
A2      : 0x00000000  A3      : 0x00000001  A4      : 0x0000000a  A5      : 0x00000000  
A6      : 0x600b1400  A7      : 0x00000000  S2      : 0x00000000  S3      : 0x00000000  
S4      : 0x00000000  S5      : 0x00000000  S6      : 0x00000000  S7      : 0x00000000  
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
T3      : 0x40815e30  T4      : 0x00000000  T5      : 0x00000000  T6      : 0x00000000  
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000  
MHARTID : 0x00000000  

Stack memory:
40815670: 0x00000000 0x00000000 0x00000000 0x42002014 0x00000000 0x00000000 0x00000000 0x00000000
40815690: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
408156b0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 0x0000016c 0xabba1234 0x00000160 0x40815570
408156d0: 0x00000000 0x4080e504 0x4080e504 0x408156cc 0x4080e4fc 0x00000018 0x00000000 0x00000000
408156f0: 0x408156cc 0x00000000 0x00000001 0x408136bc 0x706f6f6c 0x6b736154 0x00000000 0x408156b0
40815710: 0x00000005 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815730: 0x0000005c 0x00000000 0x40810014 0x4081007c 0x408100e4 0x00000000 0x00000000 0x00000001
40815750: 0x00000000 0x00000000 0x00000000 0x4200b240 0x00000000 0x00000000 0x00000000 0x00000000
40815770: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815790: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408157b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408157d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408157f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815810: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xbaad5678
40815830: 0x00000068 0xabba1234 0x0000005c 0x00000000 0x4081583c 0x00000000 0x00000000 0x00000000
40815850: 0x40815854 0xffffffff 0x40815854 0x40815854 0x00000000 0x40815868 0xffffffff 0x40815868
40815870: 0x40815868 0x00000001 0x00000001 0x00000000 0xa500ffff 0x00000000 0xa5a5a5a5 0xa5a5a501
40815890: 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 0x00000088 0xabba1234 0x0000007c 0x00000000 0x00000014
408158b0: 0x40816100 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x40815934 0x00000000
408158d0: 0x00000101 0x00000000 0x00000000 0x0000000a 0x4081605c 0x00000000 0x00000000 0x00000000
408158f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x40815b44 0x40815cb0 0x00000000
40815910: 0x40815eac 0x40815e40 0x40815ff0 0x40815f84 0x40815f18 0xbaad5678 0x0000020c 0xabba1234
40815930: 0x00000200 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815950: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815970: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815990: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408159b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408159d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408159f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815a10: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815a30: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815a50: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000



ELF file SHA256: 1e15f610a

Here is the decoder terminal.

ESP Exception Decoder
Sketch: WireScan FQBN: esp_cth:esp32:esp32c6

Guru Meditation Error: Core  0 panic'ed (Store access fault). Exception was unhandled.

Core  0 register dump:
MEPC    : 0x420000a2  RA      : 0x42002014  SP      : 0x40815670  GP      : 0x4080ce84  
TP      : 0x408156b0  T0      : 0x40030dca  T1      : 0x40806908  T2      : 0x00000000  
S0/FP   : 0x00000000  S1      : 0x42036000  A0      : 0x00000010  A1      : 0x00000000  
A2      : 0x00000000  A3      : 0x00000001  A4      : 0x0000000a  A5      : 0x00000000  
A6      : 0x600b1400  A7      : 0x00000000  S2      : 0x00000000  S3      : 0x00000000  
S4      : 0x00000000  S5      : 0x00000000  S6      : 0x00000000  S7      : 0x00000000  
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
T3      : 0x40815e30  T4      : 0x00000000  T5      : 0x00000000  T6      : 0x00000000  
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000  
MHARTID : 0x00000000  

Stack memory:
40815670: 0x00000000 0x00000000 0x00000000 0x42002014 0x00000000 0x00000000 0x00000000 0x00000000
40815690: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
408156b0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 0x0000016c 0xabba1234 0x00000160 0x40815570
408156d0: 0x00000000 0x4080e504 0x4080e504 0x408156cc 0x4080e4fc 0x00000018 0x00000000 0x00000000
408156f0: 0x408156cc 0x00000000 0x00000001 0x408136bc 0x706f6f6c 0x6b736154 0x00000000 0x408156b0
40815710: 0x00000005 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815730: 0x0000005c 0x00000000 0x40810014 0x4081007c 0x408100e4 0x00000000 0x00000000 0x00000001
40815750: 0x00000000 0x00000000 0x00000000 0x4200b240 0x00000000 0x00000000 0x00000000 0x00000000
40815770: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815790: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408157b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408157d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408157f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815810: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xbaad5678
40815830: 0x00000068 0xabba1234 0x0000005c 0x00000000 0x4081583c 0x00000000 0x00000000 0x00000000
40815850: 0x40815854 0xffffffff 0x40815854 0x40815854 0x00000000 0x40815868 0xffffffff 0x40815868
40815870: 0x40815868 0x00000001 0x00000001 0x00000000 0xa500ffff 0x00000000 0xa5a5a5a5 0xa5a5a501
40815890: 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 0x00000088 0xabba1234 0x0000007c 0x00000000 0x00000014
408158b0: 0x40816100 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x40815934 0x00000000
408158d0: 0x00000101 0x00000000 0x00000000 0x0000000a 0x4081605c 0x00000000 0x00000000 0x00000000
408158f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x40815b44 0x40815cb0 0x00000000
40815910: 0x40815eac 0x40815e40 0x40815ff0 0x40815f84 0x40815f18 0xbaad5678 0x0000020c 0xabba1234
40815930: 0x00000200 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815950: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815970: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815990: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408159b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408159d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408159f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815a10: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815a30: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40815a50: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000



ELF file SHA256: 1e15f610a

Exception 7: Store/AMO access fault
MEPC: 0x420000a2
MTVAL: 0x00000000

Decoding stack results
0x00000000: ??

Paste exception to decode...

This is elf file built at default partition scheme (Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)), at flash address 0x10000.
The editor of github not allow uploading .elf file.

==================================================
Now, I build the code to flash at address 0x30000, the exception program behavior is still the same, but in the decoder terminal, it reports Could not recognize stack trace/backtrace

Sketch: WireScan FQBN: esp_cth:esp32:cloudfermi_boot_esp32c6

Guru Meditation Error: Core  0 panic'ed (Store access fault). Exception was unhandled.

Core  0 register dump:
MEPC    : 0x420000a8  RA      : 0x42002f84  SP      : 0x408160e0  GP      : 0x4080ce84  
TP      : 0x40816120  T0      : 0x40030dca  T1      : 0x4080758e  T2      : 0x00000000  
S0/FP   : 0x00000000  S1      : 0x42037000  A0      : 0x00000010  A1      : 0x00000000  
A2      : 0x00000000  A3      : 0x00000001  A4      : 0x0000000a  A5      : 0x00000000  
A6      : 0x600b1400  A7      : 0x00000000  S2      : 0x00000000  S3      : 0x00000000  
S4      : 0x00000000  S5      : 0x00000000  S6      : 0x00000000  S7      : 0x00000000  
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
T3      : 0x408168a0  T4      : 0x00000000  T5      : 0x00000000  T6      : 0x00000000  
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000  
MHARTID : 0x00000000  

Stack memory:
408160e0: 0x00000000 0x00000000 0x00000000 0x42002f84 0x00000000 0x00000000 0x00000000 0x00000000
40816100: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
40816120: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 0x0000016c 0xabba1234 0x00000160 0x40816080
40816140: 0x00000000 0x4081210c 0x4080e504 0x4081613c 0x4080e4fc 0x00000018 0x00000000 0x00000000
40816160: 0x4081613c 0x00000000 0x00000001 0x4081412c 0x706f6f6c 0x6b736154 0x00000000 0x40816120
40816180: 0x00000005 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408161a0: 0x00000000 0x00000000 0x40810014 0x4081007c 0x408100e4 0x00000000 0x00000000 0x00000001
408161c0: 0x00000000 0x00000000 0x00000000 0x4200c71a 0x00000000 0x00000000 0x00000000 0x00000000
408161e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816200: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816220: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816240: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816260: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816280: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xbaad5678
408162a0: 0x00000068 0xabba1234 0x0000005c 0x00000000 0x408162ac 0x00000000 0x00000000 0x00000000
408162c0: 0x408162c4 0xffffffff 0x408162c4 0x408162c4 0x00000000 0x408162d8 0xffffffff 0x408162d8
408162e0: 0x408162d8 0x00000001 0x00000001 0x00000000 0xa500ffff 0x00000000 0xbaad5678 0x00000001
40816300: 0xabba1234 0x0000007c 0xbaad5678 0x00000088 0xabba1234 0x0000007c 0x00000000 0x00000014
40816320: 0x40816b70 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x408163a4 0x00000000
40816340: 0x00000101 0x00000000 0x00000000 0x0000000a 0x40816acc 0x00000000 0x00000000 0x00000000
40816360: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x408165b4 0x40816720 0x00000000
40816380: 0x4081691c 0x408168b0 0x40816a60 0x408169f4 0x40816988 0xbaad5678 0x0000020c 0xabba1234
408163a0: 0x00000200 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408163c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408163e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816400: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816420: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816440: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816460: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816480: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408164a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408164c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000



ELF file SHA256: a8896b669

Could not recognize stack trace/backtrace

Paste exception to decode...

@bhcuong2008
Copy link

Here is app built, flashed at 0x30000, that decoder reports Could not recognize stack trace/backtrace

app_0x30000.zip

@bhcuong2008
Copy link

bhcuong2008 commented May 9, 2025

Here is app built, flashed at 0x10000, using default partition scheme of ESP32C6 Dev, that could show some of decode, but not having line detail.
app_0x10000.zip

Exception 7: Store/AMO access fault
MEPC: 0x420000a2
MTVAL: 0x00000000

Decoding stack results
0x00000000: ??

@bhcuong2008
Copy link

bhcuong2008 commented May 9, 2025

Here is the source file .ino,
WireScan.zip

class Person {
public:
    Person() {
        Serial.printf("New person\n");
    }
    void hello(const char* msg) {
        Serial.printf("%s\n", msg);
    }
};

Person *p = NULL;
Person *p2 = NULL;
int *p3 = NULL;

void setup() {   
    Serial.begin(115200);
    Serial.printf("Test exception, p = 0x%X | p2 = 0x%X\n", p, p2);
    p->hello("Hello, World 1!");    // not cause exception, WHY?
    p2->hello("Hello, World 2!");   // not cause exception, WHY?
    *p3 = 10;   // Cause exception here
}

void loop() {    
    delay(2000);
}

@dankeboy36
Copy link
Owner

You're the best for providing me with all these details. I will look into the defect

FQBN: esp_cth:esp32:esp32c6

How did you install the ESP32 core?

Which version do you have installed?

Image

@bhcuong2008
Copy link

bhcuong2008 commented May 9, 2025

I install Arduino ESP32 core via command line, using version 3.2.0, in Ubuntu environment. I built custom version from esp-idf to change setting values in sdkconfig. Anyway, it does not affect the test code.

@bhcuong2008
Copy link

To build app with flash address different from 0x10000, it must change manually file hardware/espressif/esp32/platform.txt to update 0x10000 with new value 0x30000.

@kittaakos
Copy link
Contributor Author

I confirm that compiling, uploading, monitoring, and decoding the exception provides insufficient traces:

ESP Exception Decoder
Sketch: eed_issue43 FQBN: esp32:esp32:esp32c6

Guru Meditation Error: Core  0 panic'ed (Store access fault). Exception was unhandled.

Core  0 register dump:
MEPC    : 0x420000a2  RA      : 0x42002024  SP      : 0x408161d0  GP      : 0x4080bdd4  
TP      : 0x40816220  T0      : 0x400283c2  T1      : 0x40806910  T2      : 0x00000000  
S0/FP   : 0x00000000  S1      : 0x42027000  A0      : 0x00000010  A1      : 0x00000000  
A2      : 0x00000000  A3      : 0x00000001  A4      : 0x0000000a  A5      : 0x00000000  
A6      : 0x600b1400  A7      : 0x00000000  S2      : 0x00000000  S3      : 0x00000000  
S4      : 0x00000000  S5      : 0x00000000  S6      : 0x00000000  S7      : 0x00000000  
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
T3      : 0x4081699c  T4      : 0x00000000  T5      : 0x00000000  T6      : 0x00000000  
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000  
MHARTID : 0x00000000  

Stack memory:
408161d0: 0x00000000 0x00000000 0x00000000 0x42002024 0x00000000 0x00000000 0x00000000 0x40806c52
408161f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816210: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678
40816230: 0x00000168 0xabba1234 0x0000015c 0x40815fc0 0x00000000 0x4080d534 0x4080d534 0x4081623c
40816250: 0x4080d52c 0x00000018 0x00000000 0x00000000 0x4081623c 0x00000000 0x00000001 0x4081422c
40816270: 0x706f6f6c 0x6b736154 0x00000000 0x00000000 0x40816220 0x00000004 0x00000000 0x00000001
40816290: 0x00000000 0x00000000 0x00000000 0x00000106 0x00000000 0x4080f1c4 0x4080f22c 0x4080f294
408162b0: 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 0x4200b42c 0x00000000
408162d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408162f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816310: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816330: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816350: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816370: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816390: 0x00000000 0x00000000 0xbaad5678 0x00000068 0xabba1234 0x0000005c 0x00000000 0x408163a8
408163b0: 0x00000000 0x00000000 0x00000000 0x408163c0 0xffffffff 0x408163c0 0x408163c0 0x00000000
408163d0: 0x408163d4 0xffffffff 0x408163d4 0x408163d4 0x00000001 0x00000001 0x00000000 0xa500ffff
408163f0: 0x00000000 0xa5a5a5a5 0xa5a5a501 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 0x00000088 0xabba1234
40816410: 0x0000007c 0x00000000 0x00000014 0x40816c6c 0x00000000 0x00000000 0x00000000 0x00000000
40816430: 0x00000000 0x408164a0 0x00000000 0x00000101 0x00000000 0x00000000 0x0000000a 0x40816bc8
40816450: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816470: 0x408166b0 0x4081681c 0x00000000 0x40816a18 0x408169ac 0x40816b5c 0x40816af0 0x40816a84
40816490: 0xbaad5678 0x0000020c 0xabba1234 0x00000200 0x00000000 0x00000000 0x00000000 0x00000000
408164b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408164d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408164f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816510: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816530: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816550: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816570: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40816590: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408165b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000



ELF file SHA256: 3206192b6

Exception 7: Store/AMO access fault
MEPC: 0x420000a2
MTVAL: 0x00000000

Decoding stack results
0x526c8040: ??

Paste exception to decode...

Here is app built, flashed at 0x30000

Here is app built, flashed at 0x10000

I can't comment on these, unfortunately.

There is another project (https://github.com/dankeboy36/trbr) that provides slightly better decoded output:

Core 0 | Store/AMO access fault | 7

PC → 0x420000a2: setup() at /Users/kittaakos/dev/sandbox/trbr/.tests/sketches/eed_issue43/eed_issue43.ino:20
Addr → 0x00000000

0x526c8040: ??Waiting for the debugger to disconnect...

When looking at the stdout from gdb, it looks like this:

0x420000a2 in setup () at /Users/kittaakos/dev/sandbox/trbr/.tests/sketches/eed_issue43/eed_issue43.ino:20
20	  *p3 = 10;                      // Cause exception here
#0  0x420000a2 in setup () at /Users/kittaakos/dev/sandbox/trbr/.tests/sketches/eed_issue43/eed_issue43.ino:20
#1  0x42002024 in loopTask (pvParameters=<optimized out>) at /Users/kittaakos/Library/Arduino15/packages/esp32/hardware/esp32/3.2.0/cores/esp32/main.cpp:59
#2  0x526c8040 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

I will try to get the improvements from trbr into this project (#40), please bear with me.

@bhcuong2008
Copy link

@kittaakos thank you for ur effort. It's a good news that your trbr project has better output.
I'm looking forward to your improvements from trbr💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants