9.6.1 Halt Mode Debugging vs. Monitor Mode Debugging
By default, the debug mode for the CPU is "halt mode debugging" where the CPU halts on a debug request, causing the user application and, depending on the CPU, also peripherals to stop execution. In some circumstances halt mode may cause problems during debugging specific systems:
-
Certain parts of the application need to keep running in order to make sure communication with external components does not break down. For example, an application has a Bluetooth part where halting the complete target application would cause the Bluetooth communication to break down. Monitor mode debugging allows the Bluetooth "keep-alive" interrupt(s) to run and handle the low-level Bluetooth communication while the rest of the application is halted and can be debugged.
- Some peripherals are also stopped when the CPU enters debug mode. For example, Pulse-width modulation (PWM) parts for motor control applications may be halted while in an undefined / or even dangerous state, resulting in unwanted side-effects on the external hardware connected to these units. Monitor mode debugging allows the PWM part of the application to keep running while the rest of the application is halted and can be debugged.
