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 - Wakeup from Shutdown; Pin config not working

Other Parts Discussed in Thread: CC2650, BLE-STACK

Hi,

I am trying to put the CC2650 into the shutdown power mode and wake it up.

This is how I have my pin configured for wakeup.  

PIN_Config WakeupPinTable[2];
WakeupPinTable[0] = Board_WAKE_PIN | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP;
WakeupPinTable[1] = PIN_TERMINATE;
hWakeupPin = PIN_open(&wakeupPinState, WakeupPinTable);

PIN_setConfig(hWakeupPin, PINCC26XX_BM_WAKEUP, Board_WAKE_PIN | PINCC26XX_WAKEUP_NEGEDGE);
Power_shutdown(NULL);

I am not sure what to pass for Power_shutdown so this may very well be part of the problem.

By monitoring current consumption I am not seeing the SW wakeup.

  • I added the pulsing of an LED upon wakeup to verify the chip has woken instead.

    Thanks,

    Ben

  • Hi Ben,

    We'll have our RTOS driver team take a look and get back.

    Best wishes
  • Hi Ben,

    It seems you are doing things correctly. Where are you calling your code from and which SW versions are you using? You should call the shutdown API from within task context and not in a HW ISR (e.g. pin callback) or SW ISR (e.g. Clock callback).

    I tested injecting the following code into SimpleBLEPeripheral / SimpleBLEPeripheral_init() and it works fine. The code shuts off the device the first time powering on and ends up in while(1) after waking up again:

    #include "Board.h"
    #include <ti/drivers/PIN/PINCC26XX.h>
    #include <driverlib/sys_ctrl.h>
    #define Board_WAKE_PIN Board_KEY_SELECT
    
    #include <ti/sysbios/family/arm/cc26xx/Power.h>
    #include <ti/sysbios/family/arm/cc26xx/PowerCC2650.h>
    
    PIN_Config shutdownIO[] = {
      Board_WAKE_PIN | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP,
      PIN_TERMINATE };
    
    PIN_Handle pinHandle;
    PIN_State pinState;
    
    static void SimpleBLEPeripheral_init(void)
    {
    
      if( SysCtrlResetSourceGet() != RSTSRC_WAKEUP_FROM_SHUTDOWN ) {
        pinHandle = PIN_open(&pinState, shutdownIO);
        PIN_setConfig(pinHandle, PINCC26XX_BM_WAKEUP, Board_WAKE_PIN | PINCC26XX_WAKEUP_NEGEDGE);
        Power_shutdown(NULL);
    
      }
    
      else {
        while(1);
      }
    }

    Note that using shutdown is not supported when the debugger is attached.

    Also, the BLE projects by default have a "backdoor" enabled to stop user code from executing if a certain button is held down (corresponds to SELECT key on SmartRF06EB). This can be disabled by editing appBLE.cfg to Boot.checkBackdoor = false;

    This was put in place for revision 1.0 devices which could be bricked since wake on JTAG did not work properly and will be removed in future releases.

    Regards,
    Svend

  • Hello Svend,

    I also have tried to wake up the cc2650 module from shutdown mode , but this method is not working.

    I have seen in multimeter the current consumption is gone up to 4 mA after I push the select button but our while(1) loop is not executing .

    In while(1) I have On and OFF the LED but it is not executing .

    Please suggest what to do .

    Regards,

    Rahul Sharma 

  • Rahul,

    I suspect you are setting up the IO toggling wrong in that case. I just tested the below code and it works fine:

    #include "Board.h"
    #include <ti/drivers/PIN/PINCC26XX.h>
    #include <driverlib/sys_ctrl.h>
    #define Board_WAKE_PIN Board_KEY_SELECT
    
    #include <ti/sysbios/family/arm/cc26xx/Power.h>
    #include <ti/sysbios/family/arm/cc26xx/PowerCC2650.h>
    
    PIN_Config shutdownIO[] = {
      Board_WAKE_PIN | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP,
      PIN_TERMINATE };
    
    PIN_Config blinkIO[] = {
      Board_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_INPUT_DIS | PIN_PUSHPULL | PIN_DRVSTR_MAX,
      PIN_TERMINATE };
    
    
    PIN_Handle pinHandle;
    PIN_State pinState;
    
    #pragma optimize=none
    static void SimpleBLEPeripheral_init(void)
    {
    
      if( SysCtrlResetSourceGet() != RSTSRC_WAKEUP_FROM_SHUTDOWN ) {
        pinHandle = PIN_open(&pinState, shutdownIO);
        PIN_setConfig(pinHandle, PINCC26XX_BM_WAKEUP, Board_WAKE_PIN | PINCC26XX_WAKEUP_NEGEDGE);
        Power_shutdown(NULL);
    
      }
    
      else {
        pinHandle = PIN_open(&pinState, blinkIO);
        uint32_t i = 20;
        while(i--) {
          PIN_setOutputValue(pinHandle, PIN_ID(Board_LED1), Board_LED_ON);
          Task_sleep(100 * 1000 / Clock_tickPeriod);
          PIN_setOutputValue(pinHandle, PIN_ID(Board_LED1), Board_LED_OFF);
          Task_sleep(100 * 1000 / Clock_tickPeriod);
        }
      }
    ...

    .:svend

  • hello svend,

    Thanks for the reply.

    But I also On and Off my LED in if case and in there it is working fine but not in case of while(1) loop.
    Is the silicon version should be consider in this case.
    Because I am using old version of silicon i.e PG 2.0 .

    Please suggest.

    Regards,
    Rahul Sharma
  • Rahul,

    Do you mean the above example works but not if you use a while(1) loop instead of while(i--)?

    Which software versions are you using? Make sure you update to the latest one in www.ti.com/.../ble-stack if you haven't already.

    If you are using an older pre-release version of the device such as rev 2.0 or 2.0 and update to the latest SW version, make sure you follow the guide under "Troubleshooting" in the following link: e2e.ti.com/.../404236

    .:svend
  • Hello Svend,

    Sry I have not explained the above blog properly.
    I'll show what i have done in my code .

    static void SimpleBLEPeripheral_init(void)
    {

    if( SysCtrlResetSourceGet() != RSTSRC_WAKEUP_FROM_SHUTDOWN ) {
    pinHandle = PIN_open(&pinState, shutdownIO);
    PIN_setConfig(pinHandle, PINCC26XX_BM_WAKEUP, Board_KEY_SELECT | PINCC26XX_WAKEUP_NEGEDGE);

    PIN_setOutputValue(pinHandle,Board_LED1, 0);
    Task_sleep(2000*1000/Clock_tickPeriod);
    PIN_setOutputValue(pinHandle,Board_LED1, 1);
    Task_sleep(2000*1000/Clock_tickPeriod);
    PIN_setOutputValue(pinHandle,Board_LED1, 0);

    Power_shutdown(NULL);

    }
    else {
    while(1){
    PIN_setOutputValue(pinHandle,Board_LED1, 0);
    Task_sleep(2000*1000/Clock_tickPeriod);
    PIN_setOutputValue(pinHandle,Board_LED1, 1);
    Task_sleep(2000*1000/Clock_tickPeriod);
    }
    }
    }


    In If condition my LED are working proper as I have wanted but when i push the Select button then its not coming in while(1) loop and not toggling my LED.

    And I am not talking about the software version , I am asking Is it necessary to use latest hardware version i.e PG 2.2 which is in market or this code also work same on older hardware version i.e PG 2.0.

    Please suggest.

    Regards,
    Rahul Sharma
  • Rahul,

    You are not running PIN_open for the Board_LED1 pin in your example. Have you done this elsewhere?
    Running on revision 2.0 works fine for now as long as you follow the description in the above FAQ post.

    .:svend
  • hello svend,

    I am able put and wake up the cc26xx module from shutdown mode through negative edge using select button but now if I am trying to wake the cc26xx module using any external device it not coming out of shutdown mode.

    I am not able to understand why the cc26xx module is not able to detect the edge from the external device.

    please suggest.

    Regards,

    Rahul Sharma 

  • Hi Rahul,

    Are you using the same code for both cases? Have you checked with an oscilloscope that the voltage level from the external device is rail-to-rail?
  • hello svendbt,

     Thanks for reply.

    Yes I am using the same code for both case mentioned . 

    And I have checked with the oscilloscope the voltage level for BLE module and the external device is same i.e 3.3 .

    I have made the ground common but sill getting this.

    Please suggest .

    Regards,

    Rahul Sharma  

  • That sounds very strange. I would double-check again that ground levels are the same and that the negative pulse created by the external device is not extremely short (nanoseconds).

    Regards,
    Svend
  • Hello Rahul,

    We are facing the same problem for wakeup. We tried using your sample code but we dont see the LED toggle after wakeup.

    How did you solve the problem? 

    Regards,

    Shriharsh

  • We have copied the same code but still not able to get the wake up piece working. Kindly provide more inputs on the same.
  • hello,

    i have used the same code which is posted by you but when i run this code the current consumption is 27 microA and when i used the button interupt it comes to 4 mA.

    But as per the TI documentation when the device is in shutdown mode the current consumption should be less than .15 microA.

    and moreover when i press the button it is not coming into the while(1)  loop

  • The shutdown current should be measured when there is no load in any IOs. How do you measure the current? Did you disconnect all the jumpers?

    There is already an TI-RTOS example[pinShutdown] for entering shutdown mode using TI-RTOS drivers. It will run out of the box.

    Just a reminder, the device won't go into shutdown mode if you are in debug mode due to in order to enter shutdown, you will need to turn off JTAG domain. When you are doing debug mode, the JTAG domain is always on, therefore, you won't be able to enter shutdown. 

  • Thanks Christin,

    i am not using cc in debug mode and moreover i had used the same snippet which is mentioned in one of the threads .
    i did try removing all the jumpers but of no use.
    i am using lab view to measure the current
  • You can use the standard code found in TI-RTOS which comes together with BLE-stack.

  • hi,
    i had installed the new BLE stack but i was not able to find the path which you have mentioned above.
    In TI driver folder i could find PIN examples but there are only two files named PINCC26xx.c and PINCC26xx.h.

    The examples which are mentioned above are missing

  • Sorry, I did not realize the one comes with BLE stack does not contain shutdown example.

    You can download newer version of TI-RTOS (anything >=2.14.01.20) has that example in
    C:\ti\tirtos_simplelink_2_14_01_20\tirtos_simplelink_2_14_01_20_examples\TI\CC2650DK\pinShutdown

    different version of TI-RTOS can be downloaded here:
    software-dl.ti.com/.../index.html
  • i had downloaded the newer version of TI-RTOS and it has the standby and shutdown mode examples but the current ratings differ from that of the data sheet.
    The values i got are:
    1.current consumption in shutdown mode is 28uA but as per the data sheet it is just 0.15uA
    2.idle mode without any LED blinks it is 1.93mA
    3.standby mode it is 28uA

    can u please tell the expected current ratings in different modes
  • I have tested the standby mode without any pin configure. It's below 1uA.

    Since you only care about verifying the current without actually wake up the device. Then all you need with new TI-RTOS, is calling Power_Init and the bios_start. Then you will enter standby. Remember to remove all the jumpers when you measure the current. You will get what's stated on datasheet.

    The default example for standby is repeating go to standby and wake up from it.
  • hi,
    i am more concerned about the shutdown mode rather than the standby mode . The code provided for the shutdown mode is working fine but the only problem is it is consuming 28uA. i wanted my cc to go in shutdown mode when there is nothing for cc to do and wake up when i give an gpio interuptt, so i am more concerned about shutdown mode
  • Hi,

    I just tested the shutdown current from TI-RTOS example. I measure less than 100nA. How did you do the measurement? Were you able to enter shutdown? Did you disconnect JTAG and do a power cycle after programming the image?
  • i was using an ammetter to measure the current ..yup i was able to get into shutdown mode.
    28uA was the current which i measured in shutdown and when it is active it is measuring 1.8mA.
  • What's your HW? As stated, I was able to measure the shutdown current without any problem. You will have to elaborate a bit more on what your setup look like, so I can figure it out.

    Also please take a look at this document, a general guide on measuring current on CC2650/40
    www.ti.com/.../swra478a.pdf
  • The hardware that is being used is a SmartRF06 Evaluation Board with 7x7 package .

    The setup that is being used is a NI chassi  and i am using the same test points to measure the current