2020-05-12 12:54 PM
I have a strange problem, I have ported the MBED-OS blinkly program to the IDE (this was a relatively painless process) , which sends the device to sleep between flashes. When I download and run the program with the emulator (I have tried blink, stink V2 and V3) it gets a hard memory fault. If I however power cycle the board removing the emulator. It works correctly.
I have enabled the debug core of the ST device
HAL_EnableDBGStandbyMode() ; // Enable Debugger in Standby Mode
HAL_EnableDBGSleepMode() ; // Enable Debugger in Sleep Mode
HAL_EnableDBGStopMode(); // Enable Debugger in Stop Mode
If I build exactly the same code on GNU Arm Eclipse it functions with the debugger.
However I need to be able to debug Mbed projects in STM32cubeide as it is a requirement of my customer that I develop using this platform (it is a great platform )
Note that if I disable the sleep function in the code, it all works perfectly with the debugger.
Has anybody seen a problem like this or has a suggestion what I can do get the emulator to function I would be extremely grateful.
Thanks in advance for any help provided
David
2020-05-12 12:57 PM
please read JLINK and STLINK for blink, stink, I missed the spelling checkers change :(
2020-05-13 03:56 AM
You must activate DBGMCU_CR debugging in sleep/stop and standby.
2020-05-13 04:58 AM
I believe a have already done this the macros, which are executed from Main before putting the device to sleep
HAL_EnableDBGStandbyMode() ; // Enable Debugger in Standby Mode
HAL_EnableDBGSleepMode() ; // Enable Debugger in Sleep Mode
HAL_EnableDBGStopMode(); // Enable Debugger in Stop Mode
sets the relevant bits in the DBGMCU_CR (bits 0 to 2)