This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52840 debugging, breakpoint doesn't stop LFCLK

Hi,

I'm starting development of a new product utilizing nRF52840 mcu. We used this chip in previous product with Bluetooh stack (SoftDevice). I didn't participate on this project, but my colleagues told me that they didn't used standard debugging method, but they used Monitor Mode debugging because they could not stop BT stack from running. This approach has some disadvantages, like there is no call stack, they see some strange issues like structure data are not displayed correctly, etc. I'm developing product which doesn't have BT stack (no SoftDevice) so I was hoping to use standard debugging mode. The first thing I encountered was that low frequency clock was disabled without SoftDevice. I had to manually enable it. But now, when I hit breakpoint, wait for a bit, and continue with program execution, it seems like the code which is related to LFCLK is still running like timers - for example scheduler queue becomes full resulting in "out of memory" error. When I manually disable LFCLK before breakpoint, it works as expected. I tried both possible sources for LFCLK using following #define NRFX_CLOCK_CONFIG_LF_SRC - 0 (internal RC) and 2 (synth from HFCLK). No change. My question is:

Is there any easy way how to stop LFCLK when breakpoint is triggered and start it again when you continue with code execution? The only thing I noticed is that there can be executed some J-link scripts "Debug > Target Script > Debug Begin Script". But I'm not familiar with those script and I hope that there is some easier solution. Another solution is to use Monitor Mode because there you can call your function when breakpoint is triggered/untriggered, but there are consequences mention earlier. Any suggestion will be appreciated. Thanks.

btw my setup is: SES 4.10 + nRF5 SDK 15.2.0 + j-Link Ultra

Parents Reply Children
No Data
Related