2020-09-16 02:35 AM
Hello, I'm using STML052T8.
I'd like to debug while STOP mode on MDK-ARM.
How can I set up the MDK-ARM for STOP mode?
I'd like to know if there is a caution as this the first time to use MDK-ARM.
Thank you in advance.
Solved! Go to Solution.
2020-09-17 07:52 PM
DBGMCU->CR |= DBGMCU_CR_DBG_STOP; /* To be able to debug in stop mode */
2020-09-17 06:28 PM
adding screenshot.
Click "Edit" then "configuration"?
But I still don't know how to do.
There is no configuration for STOP mode in MDK-ARM or μVision?
2020-09-17 07:32 PM
There is a DBG_CR register at 0x40015804, you could configure in your own code, or in a debug initialization script
Bit 0 DBG_SLEEP: Debug Sleep mode
0: In Sleep mode, FCLK is clocked by the system clock previously configured by the software while HCLK is disabled. The clock controller configuration is not reset and remains in its previously programmed state. As a consequence, when exiting from Sleep mode, the software does not need to reconfigure the clock controller.
1: In this case, when entering in Sleep mode, HCLK is fed by the same clock that is provided to FCLK (system clock previously configured by the software).
2020-09-17 07:52 PM
DBGMCU->CR |= DBGMCU_CR_DBG_STOP; /* To be able to debug in stop mode */
2020-09-28 02:07 AM
Thank you for your reply.
I have already tried to add "DBGMCU->CR |= DBGMCU_CR_DBG_STOP;r" but still it does not connect.
I confirmed following points:
・ The setting of MDK-ARM and μVsion are okay to debug during STOP mode.
・After writing program to flash, MCU can execute user code and enter STOP mode.
・After entering STOP mode with "DBGMCU->CR |= DBGMCU_CR_DBG_STOP;", it can never come back from STOP mode and cannot connect debugger to MCU.
I doubt that:
・There is no supplying clock to MCU when returning from STOP mode.
・RDP is set.
The order to enter STOP mode in program is below. (These code is in the same function.)
If you have any review, please add comment.
I also try to figure it out, thank you.