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.

LAUNCHXL-CC1310: Based on NORTOS on SDK1.5, CC1310 arise abnormal current when using irq、Semaphores、sleep at the same time

Part Number: LAUNCHXL-CC1310
Other Parts Discussed in Thread: CC1310

Hi Team, 

       Based on NORTOS on SDK1.5,   CC1310 arise abnormal current when using irq、Semaphores、sleep at the same time. Le t me introduct our test.

      We build below code and download the code to CC1310 LP. 

#include <ti/drivers/Power.h>

/* Drivers */
#include <ti/drivers/UART.h>
#include <ti/drivers/PIN.h>
#include <ti/drivers/rf/RF.h>
#include <ti/drivers/dpl/SemaphoreP.h>
#include "Board.h"


/* Global memory storage for a PIN_Config table */
static PIN_State buttonPinState;
static PIN_Handle buttonPinHandle;
static PIN_State ledPinState;
static PIN_Handle ledPinHandle;

SemaphoreP_Struct semStruct;
SemaphoreP_Handle sem;

PIN_Config pinTable[] ={
                        Board_PIN_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
                        Board_PIN_LED0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
                        PIN_TERMINATE
};

PIN_Config buttonPinTable[] = {
                               Board_PIN_BUTTON0  | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE,
                               Board_PIN_BUTTON1  | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE,
                               PIN_TERMINATE
};

void buttonCallbackFxn(PIN_Handle handle, PIN_Id pinId) {
    PIN_setOutputValue(ledPinHandle, Board_PIN_LED1,!PIN_getOutputValue(Board_PIN_LED1));
    SemaphoreP_post(sem);
}

void *mainThread(void *arg0)
{
    ledPinHandle =  PIN_open(&ledPinState, pinTable);
    buttonPinHandle = PIN_open(&buttonPinState, buttonPinTable);
    sem = SemaphoreP_construct(&semStruct, 0, NULL);
    if (PIN_registerIntCb(buttonPinHandle, &buttonCallbackFxn) != 0) {
        /* Error registering button callback function */
        while(1);
    }
    while(1){
        SemaphoreP_pend(sem, SemaphoreP_WAIT_FOREVER);
        sleep(5);
        PIN_setOutputValue(ledPinHandle, Board_PIN_LED0,!PIN_getOutputValue(Board_PIN_LED0));
    }
}

TEST:

       We keep pressing the key on CC1310LP quickly, about 10s, the board current grows 3ma, Pls see the below pic.

         We don't know why ?Maybe we have a bug in NoRTOS.

Could you have any suggestions?

Thank you!

Eggsy