This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MKL03Z32 - debug not possible after adding code to go to low power states

Hello,

I am using Keil to develop code for my Cortex M0+ based MCU.
I have added code to set the core to sleep state based on a certain condition.

The problem is that when I run the code on the MCU, all works fine.
When I try to debug the code, the execution doesn't even get to the main().

The only possibilities I have during that debug session are to either click the reset button or the stop button on the debug interface. When I click on the stop button, call stack shows me that the execution stopped in a HardFault_Handler.

I am aware that in the low power mode that I am using the debug is not possible, but after a reset the core should run normally and then enter sleep state. Until that happens I should be able to debug!

I even tried to hack that the code tries to put the core in the run state (current state) again. Still the debug is not possible. Runs well on the MCU.

The new code with the low power modes enabled links wells and runs on the MCU. So I can't doubt the memory insufficiency. If I go back to my old code, debug is possible as normal.

Please help.