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.

RTOS/CC2640R2F: simple_peripheral standby issue

Part Number: CC2640R2F
Other Parts Discussed in Thread: LAUNCHXL-CC2640R2, , CC1350

Tool/software: TI-RTOS

Hi,

our device isn't entering standby mode. This is necessary, because our device is battery driven. I'm using IAR embedded workbench.

As recommended in TI literature i've choosen simple_peripheral example project to set up the application on our device. So far everything works fine, but the power consumption is ~1.5mA, which is too high.
I tried this by running my application with all tasks commented out, except SYS/BIOS task.
I didn't change the static power config in the board file, so standby mode should work properly.

* =============================== Power ===============================
*/
#include <ti/drivers/Power.h>
#include <ti/drivers/power/PowerCC26XX.h>

const PowerCC26XX_Config PowerCC26XX_config = {
.policyInitFxn = NULL,
.policyFxn = &PowerCC26XX_standbyPolicy,
.calibrateFxn = &PowerCC26XX_calibrate,
.enablePolicy = TRUE,
#ifdef USE_RCOSC
.calibrateRCOSC_LF = TRUE,
#else
.calibrateRCOSC_LF = FALSE,
#endif
.calibrateRCOSC_HF = TRUE,
};

I enabled power manager IAR by entering POWER_SAVING in the preprocessor settings. Furthermore i entered USE_RCOSC to enable calibration and clock for standby mode.

Preprocessor config below:

BOARD_DISPLAY_USE_LCD=0
BOARD_DISPLAY_USE_UART=0
BOARD_DISPLAY_USE_UART_ANSI=0
CC26XX
CC26XX_R2
DeviceFamily_CC26X0R2
xDisplay_DISABLE_ALL
ICALL_EVENTS
ICALL_JT
ICALL_LITE
ICALL_MAX_NUM_ENTITIES=6
ICALL_MAX_NUM_TASKS=3
ICALL_STACK0_ADDR
MAX_NUM_BLE_CONNS=1
POWER_SAVING
RF_SINGLEMODE
STACK_LIBRARY
USE_ICALL
USE_RCOSC
xdc_runtime_Assert_DISABLE_ALL
xdc_runtime_Log_DISABLE_ALL
Display_DISABLE_ALL

I followed the instructions from processors.wiki.ti.com/.../CC26xx_HW_Troubleshooting as recommended in post e2e.ti.com/.../485324.
We didn't mount the LF 32kHz XTAL oscillator. Could this be the reason why our device isn't entering standby mode?

To find out if this is the reason for the standby issue i tried the following:
To compare standby behaviour i flashed simple_peripheral example on LAUNCHXL-CC2640R2, commented out all tasks in main except Bios_start(), measured current by removing the 3V3 jumper and exited debug mode.
After doing this the current consumption is still high at 935uA.

What do you think is going wrong?

Greets,
Alex

  • Hi Alex,

    What version of the SDK are you using?

    Can you try following this guide and measure again: http://www.ti.com/lit/swra478
  • Hi,

    I have done what you are trying to do. If using CC2640R2F Launchpad you need to make sure that the External SPI Flash is closed before entering Standby Mode. Just opening and closing the SPI will not work. You need to use the C function to close the SPI external flash that is from the Pin Shutdown Example Program.

    Also, if you are using UART from SDK v1.40 and then open the UART at your Application, there is a bug at UART Close C function. In which if you close the UART it will still drain current. I was able to fix this with some unusual code for closing the UART.

    Anyway, if you are simple peripheral as base for your development, it will go to Standby Mode as expected.

    - kel
  • Marie H (4757099)  & Markel Robregado (1531317) :

    I'm using  SimpleLink CC2640R2 SDK 1.40.00.45 and the version of IAR is 8.11.2.13606.

    I was able to solve the problem with the  LAUNCHXL-CC2640R2. After quitting the debug session the evalboard must be reconnected to the usb port. Then the current consumption is ~10uA. I guess 1uA can't be reached because of the external flash, which draws additional current in sleepmode.

    Anyway, this is a very good result. But i can't achieve this on our custom board.

    To further minimize the reasons why current consumption is so high on our custom board, i again flashed simple_peripheral example on our custom board with all tasks disabled except SYS/BIOS, with "USE_RCOSC" in preprocessor settings enabled and PIN_Config disabled. 

    See the following settings:

    Preprocessor:

    $SRC_BLE_DIR$\controller\cc26xx_r2\inc
    $SRC_BLE_DIR$\inc
    $SRC_BLE_DIR$\common\cc26xx
    $EXAMPLE_BLE_ROOT$\src\app
    $SRC_BLE_DIR$\icall\inc
    $SRC_BLE_DIR$\inc
    $SRC_BLE_DIR$\profiles\dev_info
    $SRC_BLE_DIR$\profiles\roles
    $SRC_BLE_DIR$\profiles\roles\cc26xx
    $SRC_BLE_DIR$\profiles\simple_profile
    $SRC_BLE_DIR$\profiles\simple_profile\cc26xx
    $SRC_BLE_DIR$\target
    $SRC_BLE_DIR$\hal\src\inc
    $SRC_BLE_DIR$\hal\src\target\_common
    $SRC_BLE_DIR$\hal\src\target\_common\cc26xx
    $SRC_BLE_DIR$\heapmgr
    $SRC_BLE_DIR$\icall\src\inc
    $SRC_BLE_DIR$\osal\src\inc
    $SRC_BLE_DIR$\services\src\saddr
    $SRC_BLE_DIR$\services\src\sdata
    $SIMPLELINK_CORE_SDK_INSTALL_DIR$\source\ti\devices\cc26x0r2
    $SIMPLELINK_CORE_SDK_INSTALL_DIR$\source
    $SRC_BLE_DIR$\common\cc26xx\rcosc
    BOARD_DISPLAY_USE_LCD=0
    BOARD_DISPLAY_USE_UART=1
    BOARD_DISPLAY_USE_UART_ANSI=1
    CC2640R2_LAUNCHXL
    CC26XX
    CC26XX_R2
    DeviceFamily_CC26X0R2
    xDisplay_DISABLE_ALL
    ICALL_EVENTS
    ICALL_JT
    ICALL_LITE
    ICALL_MAX_NUM_ENTITIES=6
    ICALL_MAX_NUM_TASKS=3
    ICALL_STACK0_ADDR
    MAX_NUM_BLE_CONNS=1
    POWER_SAVING
    RF_SINGLEMODE
    STACK_LIBRARY
    USE_ICALL
    USE_RCOSC
    xdc_runtime_Assert_DISABLE_ALL
    xdc_runtime_Log_DISABLE_ALL

    Main (code extract - above code parts remain unchanged):

      /* Initialize ICall module */
    //  ICall_init();
    //
    //  /* Start tasks of external images - Priority 5 */
    //  ICall_createRemoteTasks();
    //
    //  /* Kick off profile - Priority 3 */
    //  GAPRole_createTask();
    //
    //  SimpleBLEPeripheral_createTask();
    
      /* enable interrupts and start SYS/BIOS */
      BIOS_start();
    
      return 0;
    }

    CC2640R2_LAUNCHXL.c:

    /*
     *  =============================== PIN ===============================
     */
    #include <ti/drivers/PIN.h>
    #include <ti/drivers/pin/PINCC26XX.h>
    
    const PIN_Config BoardGpioInitTable[] = {
    
    //    CC2640R2_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,       /* LED initially off */
    //    CC2640R2_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,       /* LED initially off */
    //    CC2640R2_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS,          /* Button is active low */
    //    CC2640R2_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS,          /* Button is active low */
    //    CC2640R2_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN,  /* External flash chip select */
    //    CC2640R2_LAUNCHXL_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN,                                              /* UART RX via debugger back channel */
    //    CC2640R2_LAUNCHXL_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL,                        /* UART TX via debugger back channel */
    //    CC2640R2_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN,                                            /* SPI master out - slave in */
    //    CC2640R2_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN,                                            /* SPI master in - slave out */
    //    CC2640R2_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN,                                             /* SPI clock */
    
        PIN_TERMINATE
    };

    I don't get why current consumption on our board is still at ~1.5mA. I desoldered all the other IC's and periphery to limit possible error sources. 

    Again, could the reason of this be, that we have no external 32kHz XTAL oscillator mounted on our board?

    Regard to:

    http://processors.wiki.ti.com/index.php/CC26xx_HW_Troubleshooting

    "

    • The 32.768kHz crystal is not connected or fails to start up. This causes the 48 MHz RC Oscillator and the supply system to stay on, preventing Standby mode.

    Add the crystal or use a crystal with load capacitors within the range given in the data sheet."

     

    Is it possible to disable static power configuration in simple_peripheral and use dynamic power apis instead? 

     

    Greets,

    Alex

     

      /* Initialize ICall module *///  ICall_init();////  /* Start tasks of external images - Priority 5 *///  ICall_createRemoteTasks();////  /* Kick off profile - Priority 3 *///  GAPRole_createTask();////  SimpleBLEPeripheral_createTask();
      /* enable interrupts and start SYS/BIOS */  BIOS_start();
      return 0;}

  • Hi,

    If you want to measure Standby Current of 1.3uA to 1.6uA using CC2640R2F Launchpad, you need to close connection to SPI External Flash and remove all jumpers. If you are using Simple Peripheral it will go to Standby Mode if there is no activity. Comment out the periodic clock just to be sure. Also, you need to set the Multimeter to read Average Current to be able to read Standby Current of 1.3uA to 1.6uA. For whatever reason the Standby Current is not steady from my experience.

    There is code to force the device to go to Standby Mode.

    You might also want to consider putting your device to Shutdown Mode to achieve low current consumption around 0.01uA to 0.09uA. I have done extensive testing to measure and achieve Standby and Shutdown Current and it is tedious work.

    - kel
  • Hi,

    my answers/questions to your suggestions inline non cursive.

    "If you want to measure Standby Current of 1.3uA to 1.6uA using CC2640R2F Launchpad, you need to close connection to SPI External Flash and remove all jumpers. If you are using Simple Peripheral it will go to Standby Mode if there is no activity. Comment out the periodic clock just to be sure. Also, you need to set the Multimeter to read Average Current to be able to read Standby Current of 1.3uA to 1.6uA. For whatever reason the Standby Current is not steady from my experience."

    As written in my last post i was able to enter standby mode with LAUNCHXL-CC2640R2. I really don't mind if external SPI Flash is in Standby or not. 

    The main problem is, that our device (=custom board) isn't entering standby mode by using the same code (=reduced simple_peripheral example to definitively enter standby), which i used to flash LAUNCHXL-CC2640R2.

    To gain same hw conditions like on the launchxl-cc2640r2 i removed every IC and other periphery on our board. At this point the only difference from a hw viewpoint is that on our custom board has no external 32kHz-XTAL mounted. So i guess this is the reason why our device isn't entering standby mode. Or do you have any other suggestion?

    "There is code to force the device to go to Standby Mode."

    I know, but here in the e2e forum it's adviced to not use dynamic standby apis, when working right away from simple_peripheral project. Entering POWER_SAVING in preprocessor settings should be sufficient. 

    "You might also want to consider putting your device to Shutdown Mode to achieve low current consumption around 0.01uA to 0.09uA. I have done extensive testing to measure and achieve Standby and Shutdown Current and it is tedious work."


    Shutdown mode is no option, because we need RTC retention.

    Regards,
    Alex

  • Hi alexbec,

        I have measured Standby Current at CC2640R2F Launchpad and Custom CC2640R2F Board. I measure Average Current of 1.3uA to 1.6uA. I doubt that the 32Khz XTAL has something to do with your custom board not going to Standby Mode.

        You need to put your CC240R2F Board GPIO's to a state that it will not consume current before you measure Standby Current of 1.3uA to 1.6uA.  

        There is code to notify you if your device goes into Standby Mode. You can see that at main.c of Simple Peripheral Example Program, but is for CC1350 Launchpad. You can use this code below to know if your device goes to Standby Mode. Just modify it a little bit.

    #if defined (CC1350_LAUNCHXL) && defined (POWER_SAVING)
    /*******************************************************************************
     * @fn          rFSwitchNotifyCb
     *
     * @brief       Power driver callback to toggle RF switch on Power state
     *              transitions.
     *
     * input parameters
     *
     * @param   eventType - The state change.
     * @param   eventArg  - Not used.
     * @param   clientArg - Not used.
     *
     * @return  Power_NOTIFYDONE to indicate success.
     */
    static uint8_t rFSwitchNotifyCb(uint8_t eventType, uint32_t *eventArg,
                                    uint32_t *clientArg)
    {
      if (eventType == PowerCC26XX_ENTERING_STANDBY)
      {
        // Power down RF Switch
        PIN_setOutputValue(radCtrlHandle, Board_DIO30_SWPWR, 0);
      }
      else if (eventType == PowerCC26XX_AWAKE_STANDBY)
      {
        // Power up RF Switch
        PIN_setOutputValue(radCtrlHandle, Board_DIO30_SWPWR, 1);
      }
    
      // Notification handled successfully
      return Power_NOTIFYDONE;
    }
    #endif //CC1350_LAUNCHXL || POWER_SAVING

    -kel

  • Hi Markel,

    at first i did some changes in "ccfg_app_ble_rcosc.c".

    Furthermore i was able to debug through power modes by applying code changes in main as suggested.

    Power consumption in standby mode is now at approximately 200uA -that's what i was expecting.

    Thank you for your suggestions!

    Best regards,
    Alex