I am currently having an issue with the debugging mode in Keil. I have a sample code which runs on a Cortex-M33 device, utilizes a JLink to debug, and was originally written to run on an Eclipse environment. I am migrating this application into the Keil IDE, but am experiencing issues running it in Keils debugging mode. In short, this application is used to showcase how the board can utilize different sources to wake the board up from a sleep state, which can be verified by hooking its GPIO peripherals up to an oscilloscope. It performs as expected on Eclipse without any problems, yet experiences issues when tested on the Keil environment – specifically, I have issues with the Keil debugger.
The behavior observed during testing is summarized below:
Here are some of the methods I’ve tried to pinpoint the issue:
This process revealed that there is some configuration in Keil which is producing this exception – the device and the sample code do not seem to be the issue.
Does anyone know why the DebugMon exception handler gets triggered in the first place? Is there a way to disable it from being triggered?
Adi12 said:Does anyone know why the DebugMon exception handler gets triggered
I think that's what Segger use for their "Monitor Mode Debug" - are you doing that?
If so, probably best to ask Segger about that?
www.segger.com/.../
Hey Andy,
So I've looked into it further and came across this article: https://interrupt.memfault.com/blog/cortex-m-debug-monitor#a-minimal-debugmonitor-handler
It seems like this exception gets triggered because ARM is in Debug Monitor mode. I've tried setting the bits related to the DebugMonitor exception to 0 to turn it off (MON_EN, MON_PEND, MON_STEP), but no luck.
The strangest thing is that this exception only gets triggered when I use SWD, but doesn't get triggered when I use JTAG....