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.

CCS/CC1350: Sensor Controller Stdio uart Emulator

Part Number: CC1350

Tool/software: Code Composer Studio

Hi,

I am using the default  uart emulation example code given in sensor controller .I generated the code from the sensor controller studio and created related files in ccs but i am not able receive or send the data.

// Initialize the Sensor Controller
scifOsalInit();
scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback);
scifOsalRegisterTaskAlertCallback(scTaskAlertCallback);
scifInit(&scifDriverSetup);

// Start the UART emulator
scifExecuteTasksOnceNbl(BV(SCIF_UART_EMULATOR_TASK_ID));

// Enable baud rate generation
scifUartSetBaudRate(57600);

// Enable RX (10 idle bit periods required before enabling start bit detection)
scifUartSetRxFifoThr(SCIF_UART_RX_FIFO_MAX_COUNT / 2);
scifUartSetRxTimeout(10 * 2);
scifUartSetRxEnableReqIdleCount(10 * 2);
scifUartRxEnable(1);

// Enable events (half full RX FIFO or 10 bit period timeout
scifUartSetEventMask(BV_SCIF_UART_ALERT_RX_FIFO_ABOVE_THR | BV_SCIF_UART_ALERT_RX_BYTE_TIMEOUT);

// Main loop
while (1) {

// Wait for an ALERT callback
Semaphore_pend(Semaphore_handle(&semScTaskAlert), BIOS_WAIT_FOREVER);

// Clear the ALERT interrupt source
scifClearAlertIntSource();

// Echo all characters currently in the RX FIFO
int rxFifoCount = scifUartGetRxFifoCount();
while (rxFifoCount--) {

scifUartTxPutChar((char) scifUartRxGetChar());
}

// Clear the events that triggered this
scifUartClearEvents();

// Acknowledge the alert event
scifAckAlertEvents();
}


}

Is there anything i have to do before i can successful transfer or receive data.

  • Hello,
    please, provide a link to your example and CCS, compiler and SDK versions, also.
  • Hi Tom ,
    link is not there but i will upload complete ccs code
    #include "ex_include_tirtos.h"
    #include "scif.h"


    #define BV(n) (1 << (n))


    // Display error message if the SCIF driver has been generated with incorrect operating system setting
    #if !(defined(SCIF_OSAL_TIRTOS_H) || defined(SCIF_OSAL_TIDPL_H))
    #error "SCIF driver has incorrect operating system configuration for this example. Please change to 'TI-RTOS' or 'TI Driver Porting Layer' in the Sensor Controller Studio project panel and re-generate the driver."
    #endif

    // Display error message if the SCIF driver has been generated with incorrect target chip package
    #ifndef SCIF_TARGET_CHIP_PACKAGE_QFN48_7X7_RGZ
    #error "SCIF driver has incorrect target chip package configuration for this example. Please change to 'QFN48 7x7 RGZ' in the Sensor Controller Studio project panel and re-generate the driver."
    #endif


    // Task data
    Task_Struct myTask;
    Char myTaskStack[1024];


    // Semaphore used to wait for Sensor Controller task ALERT event
    static Semaphore_Struct semScTaskAlert;




    void scCtrlReadyCallback(void) {

    } // scCtrlReadyCallback




    void scTaskAlertCallback(void) {

    // Wake up the OS task
    Semaphore_post(Semaphore_handle(&semScTaskAlert));

    } // scTaskAlertCallback




    void taskFxn(UArg a0, UArg a1) {

    // Initialize the Sensor Controller
    scifOsalInit();
    scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback);
    scifOsalRegisterTaskAlertCallback(scTaskAlertCallback);
    scifInit(&scifDriverSetup);

    // Start the UART emulator
    scifExecuteTasksOnceNbl(BV(SCIF_UART_EMULATOR_TASK_ID));

    // Enable baud rate generation
    scifUartSetBaudRate(57600);

    // Enable RX (10 idle bit periods required before enabling start bit detection)
    scifUartSetRxFifoThr(SCIF_UART_RX_FIFO_MAX_COUNT / 2);
    scifUartSetRxTimeout(10 * 2);
    scifUartSetRxEnableReqIdleCount(10 * 2);
    scifUartRxEnable(1);

    // Enable events (half full RX FIFO or 10 bit period timeout
    scifUartSetEventMask(BV_SCIF_UART_ALERT_RX_FIFO_ABOVE_THR | BV_SCIF_UART_ALERT_RX_BYTE_TIMEOUT);

    // Main loop
    while (1) {

    // Wait for an ALERT callback
    Semaphore_pend(Semaphore_handle(&semScTaskAlert), BIOS_WAIT_FOREVER);

    // Clear the ALERT interrupt source
    scifClearAlertIntSource();

    // Echo all characters currently in the RX FIFO
    int rxFifoCount = scifUartGetRxFifoCount();
    while (rxFifoCount--) {
    scifUartTxPutChar((char) scifUartRxGetChar());
    }

    // Clear the events that triggered this
    scifUartClearEvents();

    // Acknowledge the alert event
    scifAckAlertEvents();
    }

    } // taskFxn




    int main(void) {
    Task_Params taskParams;

    // Initialize the PIN driver
    PIN_init(BoardGpioInitTable);

    // Configure the OS task
    Task_Params_init(&taskParams);
    taskParams.stack = myTaskStack;
    taskParams.stackSize = sizeof(myTaskStack);
    taskParams.priority = 3;
    Task_construct(&myTask, taskFxn, &taskParams, NULL);

    // Create the semaphore used to wait for Sensor Controller ALERT events
    Semaphore_Params semParams;
    Semaphore_Params_init(&semParams);
    semParams.mode = Semaphore_Mode_BINARY;
    Semaphore_construct(&semScTaskAlert, 0, &semParams);

    // Start TI-RTOS
    BIOS_start();
    return 0;

    } // main
  • CCS Version: 8.1.0.00011
    compilerTIv18.1.4.LTS
    and SDK versionstirtos_cc13xx_cc26xx_2_21_00_06

    Regards
    Kumuda
  • I have no experience with a standalone TI-RTOS for cc13xx and cc26xx.
    In your case I would install simplelink_cc13x0_sdk_2_40_00_20 which already contains TI-RTOS for CC13XX: 3.80.01.01.
    Then I would use one of UART examples and modify ot to my own needs.

    Could you give me a link to a manual you are using and a chapter number to your case?

    When you post a source code, please use "Insert Code, Attach Files and more..." and then click '<>' icon to run a syntax highlighter.
  • - Why are you running on a very old TI-RTOs version?
    - Which hardware are you running on?
    - Could you show the pin mapping?
    - Could you probe the UART RX and TX pins to see if you see activity on them.
  • I saw you opened a new thread on the topic but you haven't answered my debug questions in this thread.