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.

Deep Sleep - Power Mode 3

Other Parts Discussed in Thread: CC2430

I noticed that the BLE application always goes to power mode 2 when sleeping , and not to power mode 3.

I found the following code :

  /* HAL_SLEEP_PM2 is entered only if the timeout is zero and

   * the device is a stimulated device.

   */

  halPwrMgtMode = (timeout == 0) ? HAL_SLEEP_DEEP : HAL_SLEEP_TIMER;

The remark is not compatible with the code - according to the code when there is a timeout which is not zero, HAL_SLEEP_PM2  is entered and not deep sleep.
Is this a bug ?
If not, in what cases does the system enter power mode 3 ?
Thanks,
Sahsa.

  • Hi Sasha

    As far as I know you can wake up the uP in mode 3 only with a external interrupt. So the BLE application doesn't go to mode 3 because it frequently advertise without an external interrupt...

  • What you say about external interrupts makes sence.I dont think it has to do something with the advertising.

    But than I would like to understand the code logic - what is the meaning of going to poer mode 3 when the timeout is 0 ?

  • The device does not go into PM3 because the sleep timer is active to set up the next advertisement event or connection event. If you are unconnected, have advertising turned off, and do not have any active OSAL timers set, the device should go into PM3.

  • Yes. I noticed the same thing even though I am using Zstack for CC2430.

    According to the definition:

    #define HAL_SLEEP_TIMER       CC2430_PM2
    #define HAL_SLEEP_DEEP CC2430_PM3

    "halPwrMgtMode = (timeout == 0) ? HAL_SLEEP_DEEP : HAL_SLEEP_TIMER" means halPwrMgtMode = CC2430_PM3 if timeout is zero.

    I think TI used this piece of code in firmwares of quite a number of chips. Probably HAL_SLEEP_PM2 here is a typo. This name is not found elsewhere in the code.

    regards,

    Yuan Jian

  • Hi Willis1

    I wondered how to close sleep timer ?

    When I'm unconnected, I have done like these:

    {
              uint8 turnOnAdv = FALSE;
              uint16 gapRole_AdvertOffTime = 0;
              GAPRole_SetParameter( GAPROLE_ADVERT_OFF_TIME, sizeof( uint16 ), &gapRole_AdvertOffTime );
              GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &turnOnAdv );
    }

    Best regarts!