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.

CC1310 launchpad standalone mode error issue.

Other Parts Discussed in Thread: CC1310

Hi,

The following code is works well in debug remote mode.

But When I plugged out the usb port of launchpad(standalone mode) It does not working at event_pend().

I used default environment and example(sensor node network configuration) and only check the timer.

Thanks.

Void tickFxn(UArg arg0)
{
// Timer_getFreq(timer1, freq);
 static UInt16 toggle = 0;
 toggle++;

 if((toggle % 10) == 0){
  PIN_setOutputValue(ledPinHandle, Board_LED3,!PIN_getOutputValue(Board_LED3));

     /* Save latest value */
     latestAdcValue = (uint16_t)rand();
     //latestAdcValue = toggle;

     /* Post event */
     Event_post(nodeEventHandle, NODE_EVENT_NEW_ADC_VALUE);
//  System_printf("myIsr arg = %d\n", (Int)arg0);
 }
}


static void nodeTaskFunction(UArg arg0, UArg arg1)
{
    /* Open LED pins */
    ledPinHandle = PIN_open(&ledPinState, pinTable);
    if(!ledPinHandle) {
        System_abort("Error initializing board 3.3V domain pins\n");
    }
#if 1

 Timer_Params timerParams;
 Timer_Handle myTimer;
 Error_Block eb;

 Error_init(&eb);

#else
    /* Start the SCE ADC task with 1s sample period and reacting to change in ADC value.
     * A change mask of 0xFF0 means that changes in the lower 4 bits does not trigger a wakeup.*/
    SceAdc_init(0x00010000, 0xFF0);
    SceAdc_registerAdcCallback(adcCallback);
    SceAdc_start();
#endif

#ifdef YTS
 char buf[8];

 UART_Handle uart;
    UART_Params uartParams;
    const char echoPrompt[] = "\fStart cc1310...\r\n";

    /* Create a UART with data processing off. */
    UART_Params_init(&uartParams);
    uartParams.writeDataMode = UART_DATA_BINARY;
    uartParams.readDataMode = UART_DATA_BINARY;
    uartParams.readReturnMode = UART_RETURN_FULL;
    uartParams.readEcho = UART_ECHO_OFF;
    uartParams.baudRate = 9600;
    uartParams.dataLength = UART_LEN_8;
    uartParams.stopBits = UART_STOP_ONE;
    uartParams.parityType = UART_PAR_NONE;

    uart = UART_open(Board_UART0, &uartParams);

    if (uart == NULL) {
        System_abort("Error opening the UART");
    }

    UART_write(uart, echoPrompt, sizeof(echoPrompt));

    Timer_Params_init(&timerParams);
    //timerParams.extFreq.lo = 24000000;   //Timer Frequency
    //timerParams.extFreq.hi = 0;
    timerParams.runMode = Timer_RunMode_CONTINUOUS; //periodic timer
    timerParams.startMode = Timer_StartMode_AUTO;
    timerParams.periodType = Timer_PeriodType_MICROSECS;
    timerParams.period = 100000; //100msec
    timerParams.arg = 1;
    myTimer =  Timer_create(Timer_ANY, tickFxn, &timerParams, &eb);
    if (myTimer == NULL) {
     System_abort("Timer create failed");
    }
    Timer_start(myTimer);
    PIN_setOutputValue(ledPinHandle, Board_LED3, 1);

#endif

    while(1) {
        /* Wait for event */
        uint32_t events = Event_pend(nodeEventHandle, 0, NODE_EVENT_ALL, BIOS_WAIT_FOREVER);

//Here hang in or halted????

        /* If new ADC value, send this data */
        if(events & NODE_EVENT_NEW_ADC_VALUE) {
            /* Toggle activity LED */
            PIN_setOutputValue(ledPinHandle, NODE_ACTIVITY_LED,!PIN_getOutputValue(NODE_ACTIVITY_LED));

         /* Send ADC value to concentrator */
            NodeRadioTask_sendAdcData(latestAdcValue);

            sprintf(buf, "0x%04x\r\n", latestAdcValue);
            UART_write(uart, buf, sizeof(buf));
        }
    }
}

  • Hi,

    what you describe sounds like that the timer doesn't work in standby. Standby is only enabled when running without the debugger. I wonder how the Timer module is implemented for the CC13xx and if it correctly sets power constraints. For your application, I recommend using the Clock module. The API is very similar.

    I recommend to let XDC generate the boilerplate init code for you. Just copy the following code into your .cfg file or use the GUI to setup an additional clock instance:

    /* ================ Application Specific Instances ================ */
    var clock0Params = new Clock.Params();
    clock0Params.instance.name = " myTimer";
    clock0Params.period = 100000;
    clock0Params.startFlag = true;
    Program.global.periodicClock = Clock.create("&tickFxn(", 100000, clock0Params);

    Then you can drop all your Timer-related setup code above and just need to provide the function tickFxn (ist must not be static). From your application code, you can access myTimer by just declaring it:

    // myTimer is defined and initialized in an externally generated source file
    extern const Clock_Handle myTimer;
  • Hi! Richard,

    Thank you very much!
    I accepted the your suggestion.
    It is easy and simple.

    Best regards
    TS Yoon.