Skip to main content
jacobb
Associate II
January 24, 2014
Question

Using halSleepWithOptions

  • January 24, 2014
  • 3 replies
  • 765 views
Posted on January 24, 2014 at 22:49

Hi,

I'm attempting to put my stm32w108 micro controller to sleep using the halSleepWithOptions function. The comments in halSleepWithOptions suggest calling halPowerDown and halPowerUp before and after waking up from sleep respectively. I can find those library functions alright but then it suggests using stStackPowerUp() and cstartup to restore some of the registers. Where can I find those two functions?
    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    January 24, 2014
    Posted on January 24, 2014 at 23:09

    cstartup sounds like an IAR function to initialize the C memory arena (ie bss, statics either cleared, or copied, C++ constructors ctors). Look in cstartup.s or startup_stm32w108.s, ...

    I'm not particularly familiar with the W108, but other STM32 reset out of standby, and the SRAM content is assumed to be destroyed, not sure what the expectations are with the sleep mode you're using here.
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    jacobb
    jacobbAuthor
    Associate II
    January 24, 2014
    Posted on January 24, 2014 at 23:35

    I found something regarding cstartup in the context-switch.s79 file. According to the comments in that file, when waking up cstartup will trigger a context restore automatically. So i guess that is already handled for me. I'm still looking for the stStackPowerUp() function though.

     

    jacobb
    jacobbAuthor
    Associate II
    January 29, 2014
    Posted on January 29, 2014 at 20:37

    Has anyone actually been able to go into a deep sleep and recover correctly in the STM32w108?