2022-05-28 01:03 AM
I have developed firmware on STM32F413 with STM32CubeMX using FreeRTOS. I have several tasks and PPP connection over Serial (PPPoS). I am using KEIL IDE for debug and everything is OK in debug mode and after debug without resetting MCU. But when I powered off it and then power on again, operations were 8X slower (sending data over UDP on PPPoS can be slow!). There is no error in data transferring, only the unexpected slowdown.
I have tested it with STM32CubeProgrammer too by flashing
.hex
file and running it with STM32CubeProgrammer, and everything is OK! After I power down and on again, the problem recurs.
I notice that in debug, KEIL uses object files. But I cannot understand what is different between the power-on MCU situation (booting time) vs. debug time.
How I can fix this problem?
Can anyone help?
2022-05-28 01:13 AM
Do you use some of the low-power modes (sleep etc.), directly or indirectly (i.e. FreeRTOS uses it)?
JW
2022-05-28 01:50 AM
I'm using FreeRTOS and have a IdleTask but I am not using low-power modes. (USE_TICKLESS_IDLE = Disabled)
2022-05-28 05:32 AM
Print out the SystemCoreClock value. Make sure it's clocking at expected speeds. If not look at how the clocks and PLL are configured.
2022-05-28 05:40 AM
I checked the SystemCoreClock with RCC_MCO. It is OK!
2022-05-28 05:59 AM
Instrument key portions of your code by toggling pins around them,and observe using oscilloscope/LA; comparing the "good" and "bad" cases.
JW
2022-05-28 07:13 AM
@mnoro.1 Is your subject line misleading? It looks like there are not two binaries (debug vs release) but different behaviors of the same binary with debugger attached vs not attached?
2022-05-29 05:09 AM
Thanks, I will check it.
2022-05-29 05:14 AM
Yes, a binary seems to behave well when it is programmed for a first time and debugger is connected yet, but it behaves differently at other times. I do not know what the reason is and where it comes from.
Can you guide me? @Pavel A.
2022-06-01 11:28 PM
I rechecked reset scenario and find that with longer reset signal everything be OK!
I increased nRST pin capacitor value and problem have been resolved.
STM32F413 datasheet recommends 100nF value for capacitor but it is not good in my case.
The only thing that I don't understand yet is that why with other codes I haven't this problem? and why in this case it works slowly (instead not completely wrong)?