diff --git a/modules/segger/CMakeLists.txt b/modules/segger/CMakeLists.txt index 06c720138c..103774d198 100644 --- a/modules/segger/CMakeLists.txt +++ b/modules/segger/CMakeLists.txt @@ -1,15 +1,29 @@ if(CONFIG_USE_SEGGER_RTT) - zephyr_library() set(SEGGER_DIR ${ZEPHYR_CURRENT_MODULE_DIR}) zephyr_include_directories_ifdef(CONFIG_USE_SEGGER_RTT ${SEGGER_DIR}/SEGGER ${SEGGER_DIR}/Config . - ) + ) zephyr_library_sources( ${SEGGER_DIR}/SEGGER/SEGGER_RTT.c SEGGER_RTT_zephyr.c - ) + ) zephyr_library_sources_ifdef(CONFIG_SEGGER_SYSTEMVIEW ${SEGGER_DIR}/SEGGER/SEGGER_SYSVIEW.c) endif() + +if(CONFIG_SEGGER_DEBUGMON) + if(!CONFIG_USE_SEGGER_RTT) + zephyr_library() + endif() + + set(SEGGER_DIR ${ZEPHYR_CURRENT_MODULE_DIR}) + zephyr_include_directories_ifdef(CONFIG_SEGGER_DEBUGMON + ${SEGGER_DIR}/SEGGER/DebugMon/include + ) + zephyr_library_sources( + ${SEGGER_DIR}/SEGGER/DebugMon/JLINK_MONITOR.c + ${SEGGER_DIR}/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s + ) +endif() diff --git a/subsys/debug/Kconfig b/subsys/debug/Kconfig index a76242dbd5..09e7697461 100644 --- a/subsys/debug/Kconfig +++ b/subsys/debug/Kconfig @@ -421,3 +421,11 @@ config GDBSTUB_BUF_SZ full GDB packet at a time. endif + +config SEGGER_DEBUGMON + bool "Use Segger's J-Link debug monitor implementation" + depends on CORTEX_M_DEBUG_MONITOR_HOOK + help + This option will enable Segger's implementation of + the debug monitor interrupt, overriding the + default z_arm_debug_monitor symbol. diff --git a/west.yml b/west.yml index 8f51c660fc..6195fc1634 100644 --- a/west.yml +++ b/west.yml @@ -209,7 +209,7 @@ manifest: path: modules/lib/picolibc revision: 04ada5951cbaf8e7b17f8226ce31cb6837c28ba7 - name: segger - revision: d4e568a920b4bd087886170a5624c167b2d0665e + revision: e2ff2200556e8a8f962921444275c04971a2bb3d path: modules/debug/segger groups: - debug