Skip to content

Commit c4b72ff

Browse files
committed
Upload: NUVOTON: Fix GDB restart command for pyOCD
PyOCD debug restart is failed without this somehow. It appears the device under debug must be halted after MBED_UPLOAD_RESTART_COMMANDS, but this is broken. Change to "monitor reset halt" to fix it.
1 parent 1ba35e4 commit c4b72ff

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

targets/TARGET_NUVOTON/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,16 @@ target_sources(mbed-nuvoton
2727

2828
target_link_libraries(mbed-nuvoton INTERFACE mbed-cmsis-cortex-m)
2929

30+
# PyOCD debug restart is failed without this somehow. It appears the device
31+
# under debug must be halted after MBED_UPLOAD_RESTART_COMMANDS, but this is
32+
# broken. Change to "monitor reset halt" to fix it.
33+
function(mbed_upload_nuvoton_adjust_restart_command_for_pyocd target)
34+
if(DEFINED MBED_UPLOAD_RESTART_COMMANDS AND
35+
"${UPLOAD_METHOD}" STREQUAL "PYOCD")
36+
set(MBED_UPLOAD_RESTART_COMMANDS "monitor reset halt" CACHE INTERNAL "" FORCE)
37+
endif()
38+
endfunction()
39+
40+
function(mbed_adjust_upload_debug_commands target)
41+
mbed_upload_nuvoton_adjust_restart_command_for_pyocd(${target})
42+
endfunction()

0 commit comments

Comments
 (0)