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.

CC2650: Shutdown mode with RTOS

Other Parts Discussed in Thread: CC2640, SYSBIOS

We need to use shutdown mode (LPM4.5) with 0.1 uA current.

Our device will go into sleep and will wakeup on gpio interrupt.

We dont need any RAM retention.

Please confirm whether we can use LPM 4.5 with current 0.1uA?  And we are using TI RTOS in our application.

If yes, how to do it?

  • If I am not wrong, BLE-STACK-2 only supports to Standby mode not Shutdown mode.
  • Abhijeet,

    You need first to set up a pin to wake up the device first using the PIN driver and then use the shutdown API from the power driver:

    - PIN_init (in main) or PIN_open - set up your input pin as desired (pull-up, hysteresis etc + PINCC26XX_WAKEUP_POSEDGE or PINCC26XX_WAKEUP_NEGEDGE).
    - Power_shutdown(NULL) - Force the device into shutdown mode.

    .:svend
  • Hi Sevend,
    Can we do this in BLE-STACK-2? If yes, can you provide an example?
  • Yes we can do it, all code needed is in example above.

    Note that wakeup time with the BLE stack from shutdown is 180 (!) ms due to some legacy code doing a CRC check of the ROM contents has not been removed. This will be fixed in the next release of the stack this summer.

    Regards,
    Svend
  • So, I give the wrong answer that BLE-STACK-2 cannot support this. I am sorry about this.
  • Hello Svend,
    Thanks for the update.

    I just wanted to one more thing.
    Do I need to do any RTOS config (destructing the tasks or any other) before calling the Power_shutdown() api?
    Also, on wakeup, will the code start after instruction where I had called Power_shutdown()?
  • You don't need to do anything but call the functions.

    Shutdown mode only latches IO to their current state and has no retention. When booting up again it is like from a pin reset / power-on except for that a latch bit is set and the reset source register is different. The latch is unfrozen again when re-initialization the IO's with PIN_init in main.
  • Svend,

    I configured the wakable interrupt as:

    PIN_setConfig(hSbpPins, PIN_BM_IRQ, IOID_1 | PIN_IRQ_NEGEDGE);
    PIN_setConfig(hSbpPins, PINCC26XX_BM_WAKEUP, IOID_1 |PINCC26XX_WAKEUP_NEGEDGE);

    Yet I am unable to wake it up when I call the Power_shutdown() function.

    I have checked for the interrupt without calling the Power_shutdown() and it was working fine.
  • Abhijeet,

    You will not get an interrupt when waking from shutdown and you will also lose contact with the debugger. The best way to check whether you wake up again or not might be to measure current.

    There is an example available on usage of the drivers for shutdown and wakeup again at the following E2E post:
    e2e.ti.com/.../1461886

    .:svend
  • Svend,

    With reference to your link e2e.ti.com/.../1461886 I had tried calling Power_shutdown() api.

    The device is able to go into shutdown and consumes a current of nearly 0.1 uA

    But on giving the wakable interrupt it doesnt wakes back and it consumes a constant current of 4-5 mA.

    I think that the device is  getting stuck somewhere on wakeup.

    What would be the issue ? Can you please help us on that

    regards,

    abhijeet

  • Hi Abhijeet,

    Did you also follow the instructions on setting Boot.checkBackdoor = false in the RTOS config file appBLE.cfg?
    After doing this you need to delete the configPkg folder and the src folder created in SimpleBLEPeripheral\CC26xx\IAR\Config before re-building the project.

    You can also attach to the target directly after waking up again to see where in the code it is stuck.
    - Project Options -> Debugger -> Download -> Check "Attach to running target".
    - Then connect to the target and halt to see where in the code it is stuck. Remember to reset back to "Use flash loader" once done.

    .:svend
  • Thank you Svend.

    The above solution worked for me.

    Best Regards,

    Abhijeet Kanade

  • Svend,

    I have found a strange observation regarding shutdown mode.
    The device goes into shutdown and consumes 0.1 micro Amps current.
    But after some time (nearly 1-2 hours) the device is consuming about 3 mA of current.

    What could be the issue?
  • Hi Abhijeet,

    I can think of three potential causes at least:

    1:
    Floating input pins without defined pull level
    2:
    Device has woken up again due to noise on wake pin.
    3:
    Device has reset due to low battery.

    Can you measure the voltage on VDDR and DCOUPL once you see the issue occur?

    Regards,
    Svend
  • Hello Svend,

    I am sure that cause 2 (Wake up due to noise) is not possible as on wakeup the device starts advertising, but it isnt doing.

    Also cause 3 (low battery) isnt possible cause I have connected the device to the powers supply.

    And even if it gets reset due to low battery, I have called Power_shutdown() api once it starts from reset.

    I dont know about the cause 1 (Floating input pins without defined pull level)

    The voltage on the VDDR and DCOUPL are as:

    On VDDR: 1.68 V

    On DCOUPL: 1.26 V

    Pin initialization:

    From main I havent touched the default function PIN_init(BoardGpioInitTable). (I am using 5x5 CC2640. )

    I have done my pin initialization from  SimpleBLEPeripheral_init().

    I have initialized as follows:

    static PIN_Config SBP_configTable[] =
    {
    IOID_1 | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS,
    IOID_2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH  | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    PIN_TERMINATE
    };

    hSbpPins = PIN_open(&sbpPins, SBP_configTable);
    // Register ISR
    PIN_registerIntCb(hSbpPins, buttonHwiFxn);
    // Configure interrupt
    PIN_setConfig(hSbpPins, PIN_BM_IRQ, IOID_1 | PIN_IRQ_NEGEDGE);
    // Enable wakeup
    PIN_setConfig(hSbpPins, PINCC26XX_BM_WAKEUP, IOID_1 |PINCC26XX_WAKEUP_NEGEDGE);

  • Abhijeet,

    If you see a regulated voltage on VDDR and DCOUPL then the device has woken up again.

    Once you see the issue, can you attach to target and read out the register values from AON_SYSCTL:WU_FROM_SD and AON_SYSCTL:GPIO_WU_FROM_SD?

    You can attach without resetting in IAR by going to project options->Debugger->Download->"Attach to running target" and then press "Play".
    Remember to restore settings for later development.

    - If WU_FROM_SD=1 -and- GPIO_WU_FROM_SD=1 then you woke up from a pin interrupt.
    - If WU_FROM_SD=1 -and- GPIO_WU_FROM_SD=0 then you woke up from JTAG. This can happen if there is noise coupling on TCK pin strong enough to have it toggle a number of times.

    Regards,
    Svend
  • How do i disable the backdoor? If i add this to my .cfg:

    var Boot = xdc.useModule('ti.sysbios.family.arm.cc26xx.Boot');
    Boot.checkBackdoor = false

    get this:

    js: "C:/ti/simplelink/ble_cc26xx_2_01_00_44423/Projects/ble/fx12.2.sbp/CC26xx/IAR/Config/appBLE.cfg", line 22: XDC runtime error: ti.sysbios.family.arm.cc26xx.Boot: no element named 'checkBackdoor' 
        "./package/cfg/appBLE_prm3.cfg", line 169 
    gmake.exe: *** [package/cfg/appBLE_prm3.xdl] Error 1 
    

    svendbt said:


    Did you also follow the instructions on setting Boot.checkBackdoor = false in the RTOS config file appBLE.cfg?

  • I met you the same mistakes, I ask you to solve the problem yet

    js: "C:/ti/simplelink/ble_cc26xx_2_01_00_44423/Projects/ble/SimpleBLEPeripheral/CC26xx_beifen_shutdown/IAR/Config/appBLE.cfg", line
    123: XDC runtime error: ti.sysbios.family.arm.cc26xx.Boot: no element named 'checkBackdoor'
    "./package/cfg/appBLE_prm3.cfg", line 169
    xdctools_3_31_01_33_core\gmake.exe: *** [package/cfg/appBLE_prm3.xdl] Error 1
  • The backdoor was only there in the first two sw releases which supported chip rev 1, since rev 1 did not support wake on jtag.

    On later versions there are no backdoor configuration options available, hence the error.