Skip to content

Commit 2265957

Browse files
committed
Use WIP pico_debug module to get debug information on CPU trap
1 parent f8157b9 commit 2265957

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

CMakeLists.txt

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,40 @@ add_executable(PicoLinksSwift
7474
)
7575

7676
target_link_libraries(PicoLinksSwift
77-
pico_stdlib
7877
$<TARGET_OBJECTS:myswiftlib>
78+
pico_stdlib
79+
80+
# Prints debugging information (register values and stack contents)
81+
# to stdout when an exception occurs. Example output:
82+
#
83+
# ```
84+
# -----------------------------------------------------------
85+
# Unhandled Hard Fault exception on core 0
86+
# -----------------------------------------------------------
87+
# R0: 000000c8 R1: 0000012c R2: 00001000 R3: e0900001
88+
# R4: 1000026c R5: d0000000 R6: 02000000 R7: 00000000
89+
# R8: ffffffff R9: ffffffff R10: ffffffff R11: ffffffff
90+
# R12: 40014000 SP: 20041fe8 LR: 10000339 PC: e0900000
91+
# MSP: 20041fe8 PSP: fffffffc XPSR: 01000000
92+
# EXC_RETURN: fffffff9 PRIMASK: 00000000
93+
# -----------------------------------------------------------
94+
# 20041fe8: 00000001 1000026c 20041f01 18000000
95+
# 20041ff8: 00000000 1000022b
96+
# 20042008:
97+
# 20042018:
98+
# 20042028:
99+
# 20042038:
100+
# 20042048:
101+
# 20042058:
102+
# ```
103+
#
104+
# The pico_debug module is introduced in a pull request from 2022-09:
105+
# Print registers, stack & other details on unhandled exception
106+
# <https://github.com/raspberrypi/pico-sdk/pull/1026>, which hasn't been
107+
# merged as of 2023-12-13.
108+
#
109+
# You need to check out this branch in your PICO_SDK_PATH folder to use it.
110+
pico_debug
79111
)
80112

81113
# create map/bin/hex file etc.

0 commit comments

Comments
 (0)