This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2340R5: problems using SysTick after an RTC wakeup from STANDBY

Part Number: CC2340R5

i'm using the SysTIck peripheral for short-term delays (<100ms)....  as such, the MCU will enter its IDLE mode when awaiting a SysTick interrupt; and all is well here....

pushing the envelope a bit more, i enter STANDBY mode where i'm awaiting a button-press (GPIO interrupt) to awaken the MCU....  once i'm ACTIVE, i can successfully enable SysTick and enter IDLE for a short period of time before awaiting the next button-press....

the problem arises when i use the RTC to wakeup from STANDY after (say) a few seconds....  when i then go to use the SysTick peripheral, i'm finding that **ALL** of my wakeups from IDLE occur after ~150ms -- regardless of what value i've placed in the SysTick->LOAD register!!!!!

note that SysTick works just fine when used **BEFORE** using the RTC to enter STANDBY....  and as i mentioned above, coming out of STANDBY with a GPIO interrupt also works just fine....

something about using the RTC with the 32kHz LFCLK screws up SysTick, which is presumably using the 48MHz processor clock....  it's odd, however, in that i believe the processor clock really is running at 48MHz when coming out of STANDY; busy-wait loops of known duration continue to delay as expected....

given the nature of my tooling environment, it's difficult to create a "standalone program" usable in CCS to reproduce the problem....  in the meantime, i'm more than willing to quickly try any suggestions to ensure SysTick works correctly after awakening from an RTC STANDBY....

  • Hi bob,

    Can you please provide code snippets which demonstrate the issue you've used observed?  Also, how are you measuring the delays and Idle mode wakeup times?  Have you tried using a different approach, such as LGPTimer?  So SysTick will operate as expected up to the initial Standby mode entry, after which operation is unexpected?  Consecutive delays in between Standby mode are always incorrect at a constant delta?  Please note that Systick registers are modified in the PowerCC23X0_standbyPolicy function of simplelink_lowpower_f3_sdk_7_20_00_29\kernel\freertos\dpl\PowerCC23X0_freertos.c and that you may need to re-configure the SysTick according to the specifications of your application.

    Regards,
    Ryan

  • first of all, i'm running in a completely "bare-metal" environment;  i'm not using ANY of the drivers supplied with your SDK....

    as for measuring time, i'm using a saleae logic analyzer together with some GPIOs; i could certainly send some captures, so you can see SysTick working correctly before the first STANDBY, but then failing each time subsequently....

    for sure, i'm reconfiguring SysTIck correctly....  when i awaken from a button press, everything works correctly....

    i could try the LGPTimer as an alternative....  FWIW, i already tried using SYSTIM -- but ran into an even stranger set of problems which i'll report later on....

    question -- is there any "check" i need to perform when coming out of STANDBY to ensure the processor clock is indeed ready to go???? 

  • The best resource I know is from the aforementioned PowerCC23X0_freertos.c, where everything after Power_sleep(PowerLPF3_STANDBY); to the end of PowerCC23X0_standbyPolicy applies.  Are you using LP-EM-CC2340R5 hardware in your evaluation?

    Regards,
    Ryan

  • yes, i using LP-EM-CC2340R5 hardware....  and i'll certainly review the TI Power module....

    in the meanwhile, i have switched my implementation to use LGPT -- and now everything appears to be working....

    that's not to say some problem might be lurking in SysTick; i also discovered another problem with maintaining GPIO state while in IDLE mode awaiting a SysTick interrupt, which i'll try to characterize later....