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.

Extended PM2 sleep time CC2541

Other Parts Discussed in Thread: CC2541

I want to place a CC2541 chip into a very long sleep on PM2, e.g. for 1 day, or for theoretical sake even 1 month.

I'm using the SimpleBLE Peripheral project.

I thought I'd ask to see if anyone else has experience before attempting "debugging" an event that can take 1 week to complete.

1) If I turn off advertising - e.g. set Gaprole_Advert_Enabled to false.  Then create a SBP_Periodic_Event for a long period of time will this work send the device to PM2?

2) Has anyone attempted very long sleeps and is there an issue with this???  Does OSAL become unstable when the sleep is extended greatly?

Thanks for your help.

  • Hi Carl,

    Carl Schwarz said:
    1) If I turn off advertising - e.g. set Gaprole_Advert_Enabled to false.  Then create a SBP_Periodic_Event for a long period of time will this work send the device to PM2?

    Yes. Setting an OSAL event with a timer will allow the device to enter PM2 until the actual event timer runs out.

    Carl Schwarz said:
    2) Has anyone attempted very long sleeps and is there an issue with this???  Does OSAL become unstable when the sleep is extended greatly?

    I have personally tried a few hours, which works fine.

    Best Regards

    Joakim

  • I remember there was another thread about the timeout in BLE stack.

    If I remember correctly, the timer in PM2 maximum is at around 41s, (with the POWER_SAVING enabled).

  • The sleep timer is 24-bit, meaning that the device needs to wake up every approx 8.5 minutes to set a new time for the sleep timer compare register. This will repeat until the time given in SBP_Periodic_Event is reached. This will be handled automatically by the scheduler.

  • I think it has something to do with the function "ll_McuPrecisionCount" (16bit return).

    Reason  is 65535 * 625us = 41s

  • Thankyou it has worked great!  I haven't power tested it with an oscilloscope to verify I'm hitting PM2, but as far as the firmware goes it all seems to be fine.

    As a secondary question, is there a way to verify PM2 via the debugger in IAR?  I'll be getting out an osc anyway but it would be nice to know.

    PS, I haven't tested very extended times yet, but if I do I'll post back here (in around one month :)

  • zack ow said:

    I think it has something to do with the function "ll_McuPrecisionCount" (16bit return).

    Reason  is 65535 * 625us = 41s

    I ran the OSC test and the MCU does indeed wake up every 41s.