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.

SensorController Stdio uartEmulator can not receive any data

Other Parts Discussed in Thread: CC2650

When I use Sensor Controller Stdio UART Emulator , I can not receive or Transfer any data, why?

First,I used the default example provided by SCS below:

Second, i found the UART Emulator only Provide the function uartEmulator(), and then  generate Code and import it to my SimpleProfile Project in CCS,

Third,Init UART below:

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);

after that i still can not receive or transfer any data , is there anything i have to do before i can successful transfer or receive data.

  • how do you integrate the project into simpleprofile?

    In the code you provided, I could not see any send/receive data related function is called...
    ex:
    scifUartTxPutChar;
    scifUartRxGetChar;

    All the driver functions are in scif.c
  • scif_framework.c
    scif_framework.h
    scif_osal_tirtos.c
    scif_osal_tirtos.h
    scif.c
    scif.h

    I add these H and C files to my project driver list, and add a new task to process UART Emulator data .

    in main loop , i do below:

    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();
    }

    after do this, i still can not receive data. is anything i have missing.
  • There are couple of thing you can try.
    1. Try the stand alone project first
    2. Call scifUartTxPutChar before your while loop
    3.a if none of the above work, then trace your UART signal with logic analyzer.
    3.b if both work, then there might be some conflict when you merge it together with BLE examples.

    Please debug with the step listed above, and then we can take it from there.
  • yes , i will step by step test the list you suggest .

    but i have another doubt: when i use sensor controller stdio "task testing", there is still no data. i can not understand.

    i will like you to determine the few things : when i use SCS UARTEmulator , i should not add any data in "Initialization Code " and "Termination Code ", just only run uartEmulator() function in Execution Code that i can successful use UART ?
  • another thing i fogot

    I use CC2650 Launchpad , BLE Stack 4.2 , and simple_peripheral example

    in this example , is there anything confilct with SCS UART? Shoule be the Timer 0 ,because it has used for Baud rate??