2018-06-13 01:49 PM
Segger JLink claims that debug RTT doesnt work with some STM32 devices because the devices don't allow reading of memory while the device is asleep, which is a HUGE problem for debugging. They say most other mfg cortex devices have no problem with this.
I am using a stm32f411re, but I could switch to a stm32l471 series.
Does anyone know if the stm32l4 series also has this problem?
2018-06-14 12:30 AM
Hello
web.002
,please refer to reference manual for your MCU and check forDBGMCU_CR register. There are low-power mode configurations for debugging which allow you to debug your MCU in sleep mode.
Please note that when you do this, your current consumption will be higher.
Best regards,
Tilen
2018-06-14 01:05 AM
G'day Tilen,
while I would tend to agree that DBGMCU_CR would be where to turn for this problem, it unfortunately has no effect.
this is what I do early on in main()
[code]
#ifdef DEBUG
/* allow debugging during low-power modes */ LL_DBGMCU_EnableDBGSleepMode(); //LL_DBGMCU_EnableDBGStopMode(); //LL_DBGMCU_EnableDBGStandbyMode();/* freeze RTC during debugging */
LL_DBGMCU_APB1_GRP1_FreezePeriph(LL_DBGMCU_APB1_GRP1_RTC_STOP); LL_DBGMCU_APB1_GRP1_FreezePeriph(LL_DBGMCU_APB1_GRP1_TIM4_STOP);#endif
[/code]
What SEGGER is saying, is that even with this enabled, the STM32F4 series does not allow 'Background Memory Access' when in sleep mode, and specifically the STM32F4 series reports back zero's when trying to read memory while in SLEEP mode (in my case I'm talking about the least invasive sleep mode and not STOP or STANDBY mode).
The manifested problem occurs when using the Real Time Terminal functionality of the JLink programmer/debugger.. As an example I'll printf out some debug statements at the startup of the program, and if NO sleep mode is present the output is great. As soon as I jump into WFI(), all debug output stops (as the JLink tool reads a specific part of memory to grab the output, but it cannot because sleep modes do not allow 'Background Memory Access').
I can accept this, if perhaps this is a limitation of the F4 series.. What I am wondering about is if this limitation is also present on the L4 series.
For example the SiLabs EM35xx series Cortex-M3's, nordic semi's nRF52, etc do not have this issue with 'Background Memory Access'.
:(
Cheers,
Paul