I'm debugging a project with J-Link GDB Server and everything works stable (program executing and debug session running both stable).
After I made some modifications just to source code only, I encountered an unstable debug session behavior. After some activity a debug session suspends with SIGTRAP (Trace/breakpoint trap) at address 0x0. But program continues executing and responds to external events. I press resume button in debugger and it continue working. I can even suspend it and it will stop at valid program code point. In general, this issue doesn't crash system.
There are fragment from j-link log file:
Display All
Something goes wrong on line 5:
What might cause this error ? I even accept an assumption that code could fall out to incorrect execution or to address invalid memory, etc. But I can't understand how it can affect J-link and even lead it to such error ???
After I made some modifications just to source code only, I encountered an unstable debug session behavior. After some activity a debug session suspends with SIGTRAP (Trace/breakpoint trap) at address 0x0. But program continues executing and responds to external events. I press resume button in debugger and it continue working. I can even suspend it and it will stop at valid program code point. In general, this issue doesn't crash system.
There are fragment from j-link log file:
Source Code
- ... a lot of JLINK_GetHWStatus and JLINK_IsHalted ...T0284 199:445 JLINK_GetHWStatus(...) returns 0x00 (0001ms, 26422ms total)
- T0478 199:458 JLINK_IsHalted() returns FALSE (0001ms, 26423ms total)
- T0478 199:479 JLINK_IsHalted() returns FALSE (0001ms, 26424ms total)
- T0478 199:500 JLINK_IsHalted() returns ERROR (0001ms, 26425ms total)
- T0478 199:501 JLINK_ReadReg(R15) -- CPU is running
- ***** Error: Can not read register 15 (R15) while CPU is running returns 0x00000000 (0001ms, 26426ms total)
- T0478 199:502 JLINK_FindBP(Addr = 0x00000000)
- JLINK_ReadMemHW(0x00000000, 0x0004 Bytes, ...) -- CPU is running -- CPU_ReadMem(4 bytes @ 0x00000000) -- Data: 00 00 02 20 returns 0x00 (0000ms, 0000ms total)
- JLINK_ReadMemHW(0x08000000, 0x0004 Bytes, ...) -- CPU is running -- CPU_ReadMem(4 bytes @ 0x08000000) -- Data: 00 00 02 20 returns 0x00 (0001ms, 0000ms total)
- JLINK_WriteMemHW(0x00000000, 0x0004 Bytes, ...) -- Data: 01 00 03 00 -- CPU is running -- CPU_WriteMem(4 bytes @ 0x00000000) returns 0x04 (0001ms, 0001ms total)
- JLINK_ReadMemHW(0x00000000, 0x0004 Bytes, ...) -- CPU is running -- CPU_ReadMem(4 bytes @ 0x00000000) -- Data: 00 00 02 20 returns 0x00 (0001ms, 0002ms total)
- -- MA0 is in flash -- Unmirror addr 0x00000000 returns 0x00000000 (0003ms, 26427ms total)
- T0478 199:505 JLINK_GetNumWPs() returns 0x00 (0000ms, 26430ms total)
- T0478 199:525 JLINK_ReadReg(R0) -- CPU is running
- ***** Error: Can not read register 0 (R0) while CPU is running returns 0x00000000 (0000ms, 26430ms total)
- T0478 199:525 JLINK_ReadReg(R1) -- CPU is running
- ***** Error: Can not read register 1 (R1) while CPU is running returns 0x00000000 (0000ms, 26430ms total)
- T0478 199:525 JLINK_ReadReg(R2) -- CPU is running
- ***** Error: Can not read register 2 (R2) while CPU is running returns 0x00000000 (0000ms, 26430ms total)
- T0478 199:525 JLINK_ReadReg(R3) -- CPU is running
- ***** Error: Can not read register 3 (R3) while CPU is running returns 0x00000000 (0000ms, 26430ms total)
- T0478 199:525 JLINK_ReadReg(R4) -- CPU is running
- ***** Error: Can not read register 4 (R4) while CPU is running returns 0x00000000 (0000ms, 26430ms total)
- T0478 199:525 JLINK_ReadReg(R5) -- CPU is running
- ***** Error: Can not read register 5 (R5) while CPU is running returns 0x00000000 (0000ms, 26430ms total)
- T0478 199:525 JLINK_ReadReg(R6) -- CPU is running
- ***** Error: Can not read register 6 (R6) while CPU is running returns 0x00000000 (0000ms, 26430ms total)
- T0478 199:525 JLINK_ReadReg(R7) -- CPU is running
- ***** Error: Can not read register 7 (R7) while CPU is running returns 0x00000000 (0000ms, 26430ms total)
- T0478 199:525 JLINK_ReadReg(R8) -- CPU is running
- ***** Error: Can not read register 8 (R8) while CPU is running returns 0x00000000 (0000ms, 26430ms total)
- T0478 199:525 JLINK_ReadReg(R9) -- CPU is running
- ***** Error: Can not read register 9 (R9) while CPU is running returns 0x00000000 (0000ms, 26430ms total)
- T0478 199:525 JLINK_ReadReg(R10) -- CPU is running
- ***** Error: Can not read register 10 (R10) while CPU is running returns 0x00000000 (0001ms, 26430ms total)
- T0478 199:526 JLINK_ReadReg(R11) -- CPU is running
- ***** Error: Can not read register 11 (R11) while CPU is running returns 0x00000000 (0000ms, 26431ms total)
- T0478 199:526 JLINK_ReadReg(R12) -- CPU is running
- ***** Error: Can not read register 12 (R12) while CPU is running returns 0x00000000 (0000ms, 26431ms total)
- T0478 199:526 JLINK_ReadReg(R13) -- CPU is running
- ***** Error: Can not read register 13 (R13) while CPU is running returns 0x00000000 (0000ms, 26431ms total)
- T0478 199:526 JLINK_ReadReg(R14) -- CPU is running
- ***** Error: Can not read register 14 (R14) while CPU is running returns 0x00000000 (0000ms, 26431ms total)
- T0478 199:526 JLINK_ReadReg(R15) -- CPU is running
- ***** Error: Can not read register 15 (R15) while CPU is running returns 0x00000000 (0000ms, 26431ms total)
- T0478 199:526 JLINK_ReadReg(XPSR) -- CPU is running
- ***** Error: Can not read register 16 (XPSR) while CPU is running returns 0x00000000 (0000ms, 26431ms total)
- T0478 199:527 JLINK_ReadCodeMem(0x00000000, 0x0004 Bytes, ...) -- Unmirror addr 0x00000000 -- Read from flash cache (256 bytes @ 0x08000000) -- Data: 00 00 02 20 returns 0x04 (0000ms, 26431ms total)
- T0478 199:548 JLINK_ReadCodeMem(0x00000000, 0x0004 Bytes, ...) -- Data: 00 00 02 20 returns 0x04 (0000ms, 26431ms total)
- T0478 199:658 JLINK_ReadCodeMem(0x00000000, 0x0002 Bytes, ...) -- Data: 00 00 returns 0x02 (0000ms, 26431ms total)
- T0478 199:665 JLINK_ReadCodeMem(0x00000000, 0x0002 Bytes, ...) -- Data: 00 00 returns 0x02 (0000ms, 26431ms total)...
Something goes wrong on line 5:
What might cause this error ? I even accept an assumption that code could fall out to incorrect execution or to address invalid memory, etc. But I can't understand how it can affect J-link and even lead it to such error ???
The post was edited 1 time, last by artem_pisarenko ().