cancel
Showing results for 
Search instead for 
Did you mean: 

RTC timer is unstable in simulation

jhl14
Associate II
Posted on July 08, 2016 at 13:13

Hi Team,

Use RTC as timer to restart STM32F030K6 from stop mode every 10mS, Set/Reset a dedicated I/O to show stop and running duration respectively in main loop like following procedure.  

while(1)

{

if( RTC_Refresh_TimeOn )

{

RTC_Refresh_TimeOn = 0;

...

HAL_DBGMCU_EnableDBGStopMode();

HAL_PWR_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);

HAL_DBGMCU_DisableDBGStopMode();

EnablePLL();

...

}

}

After burn the program or simulate the program, always got the I/O output pulse is not period, it is saying RTC is unstable. But when re-power the device, the I/O out wave is period.

Can you give some suggestion?

Best Regards

JHL

 
4 REPLIES 4
slimen
Senior
Posted on July 11, 2016 at 16:54

Hi,

You can review RTC example under STM32CubeF0: 

STM32Cube_FW_F0_V1.6.0\Projects\STM32F030R8-Nucleo\Examples\RTC\RTC_Alarm

It will be better to compare your generated code with one of the provided RTC applications and identify what you have missed. 

Regards

Walid FTITI_O
Senior II
Posted on July 12, 2016 at 17:05

Hi liu.jianhui,

I suggest to share the RTC configuration/initialization part from your code to try helping you. And what can of STM32 hardware you are using ?

-Hannibal-

jhl14
Associate II
Posted on July 13, 2016 at 09:43

Hi Hannibal,

After more verification of the issue, we found that RTC running is good when simulating with ST-Link. The issue occurs when using J-LINK. 

So wet wonder if there is some data setting of simulator affecting STM32F030 internal logic to get RTC unstable? 

Best Regards,

JHL

Posted on July 13, 2016 at 11:40

Assume interaction on SWD of debugger is NOT instant, and it might take several, or ten, milliseconds.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..