VSCode Cortex-Debugging
From EdWiki
VSCode Cortex Debugging
Use F5 or the menu Run > Start Debugging to start a debug session:
This starts debug session. In case of troubles, check the Debug Console:
Reading symbols from arm-none-eabi-objdump.exe --syms -C -h -w E:\tm4c123gxl\blinky/build/blinky.elf Reading symbols from arm-none-eabi-nm.exe --defined-only -S -l -C -p E:\tm4c123gxl\blinky/build/blinky.elf Launching GDB: arm-none-eabi-gdb.exe -q --interpreter=mi2 "E:\\tm4c123gxl\\blinky/build/blinky.elf" Set "showDevDebugOutput": true in your "launch.json" to see verbose GDB transactions here. Helpful to debug issues or report problems Launching gdb-server: openocd.exe -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "E:\\tm4c123gxl\\blinky" -f "c:/Users/shankarappa/.vscode/extensions/marus25.cortex-debug-1.4.0/support/openocd-helpers.tcl" -f board/ek-tm4c123gxl.cfg Please check TERMINAL tab (gdb-server) for output from openocd.exe Finished reading symbols from objdump: Time: 843 ms Finished reading symbols from nm: Time: 313 ms C:\ProgramData\chocolatey\lib\gcc-arm-embedded\tools\gcc-arm-none-eabi-10-2020-q4-major\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory. Reading symbols from E:\tm4c123gxl\blinky/build/blinky.elf... 0x0000031c in delayMs (n=500) at E:/tm4c123gxl/blinky/src/main.c:39 39 for (j = 0; j < 3180; j++) Program stopped, probably due to a reset and/or halt issued by debugger SRST error SRST error target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x00000354 msp: 0x2000021c SRST error target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x00000354 msp: 0x2000021c SRST error target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x00000354 msp: 0x2000021c Note: automatically using hardware breakpoints for read-only addresses. Temporary breakpoint 1, main () at E:/tm4c123gxl/blinky/src/main.c:16 16 SYSCTL_RCGC2_R |= 0x00000020;
By default there are several debug views available. With the .svd file, we have access to the peripheral register too: