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.

LAUNCHCC3235MOD: CC3235 freertos uart CALLBACK mode

Part Number: LAUNCHCC3235MOD
Other Parts Discussed in Thread: CC3235SF

Hi TI engineer

     Now I tesing CC3235 uart function by LAUNCHCC3235MOD,and SDK is simplelink_cc32xx_sdk_6_10_00_05。

I import  SDK example project   uart2callback_CC3235SF_LAUNCHXL_freertos_ccs and  uart2callback_CC3235SF_LAUNCHXL_tirtos_ccs.  The uart function is OK  in tirtos project but  can't recv uart data in freertos project.

If modify uart recv mode to UART2_Mode_BLOCKING  and modify application,uart can recv data.

Does it not support UART2 CALLBACK MODE in freertos?

  • Hello Lemon,

    Callback mode is supported in freertos.

    I just tested the freertos demo on both the CC3235SF and CC3235MOD and they both worked as expected. I am not sure why it wouldnt be working for you. I would make sure you import the project from the correct sdk (which is the 6.10.00.05)  and that you have set up freertos correctly in ccs.

    Kind regards,

    Rogelio

  • Hi Rogelio

        Thanks for reply!

         1、import freertos project is OK. The FREERTOS version is the same as reqiure(FreeRTOS-10.1.1),and  add to CCS

    And the uart2callback freertos project  build is OK

    Run without modifying any code,the uart can't recv data  and out 

    2、Modify the  uart mode to default, and  non't wait sem。uart can recv data and out. Code as  show,red color code is modify,and only modify these code in project

    void *mainThread(void *arg0)
    {
    char input;
    const char echoPrompt[] = "Echoing characters:\r\n";
    UART2_Handle uart;
    UART2_Params uartParams;
    int32_t semStatus;
    uint32_t status = UART2_STATUS_SUCCESS;

    /* Call driver init functions */
    GPIO_init();

    /* Configure the LED pin */
    GPIO_setConfig(CONFIG_GPIO_LED_0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);

    /* Create semaphore */
    semStatus = sem_init(&sem, 0, 0);

    if (semStatus != 0) {
    /* Error creating semaphore */
    while (1);
    }

    /* Create a UART in CALLBACK read mode */
    UART2_Params_init(&uartParams);
    // uartParams.readMode = UART2_Mode_CALLBACK;
    // uartParams.readCallback = callbackFxn;
    uartParams.baudRate = 115200;

    uart = UART2_open(CONFIG_UART2_0, &uartParams);

    if (uart == NULL) {
    /* UART2_open() failed */
    while (1);
    }

    /* Turn on user LED to indicate successful initialization */
    GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_ON);

    /* Pass NULL for bytesWritten since it's not used in this example */
    UART2_write(uart, echoPrompt, sizeof(echoPrompt), NULL);

    /* Loop forever echoing */
    while (1) {
    numBytesRead = 0;

    /* Pass NULL for bytesRead since it's not used in this example */
    status = UART2_read(uart, &input, 1, NULL);

    if (status != UART2_STATUS_SUCCESS) {
    /* UART2_read() failed */
    while (1);
    }

    /* Do not write until read callback executes */
    // sem_wait(&sem);

    // if (numBytesRead > 0)
    {
    status = UART2_write(uart, &input, 1, NULL);

    if (status != UART2_STATUS_SUCCESS) {
    /* UART2_write() failed */
    while (1);
    }
    }
    }
    }

  • Hello Lemon,

    Can I ask how you are testing the UART, I'm personally using Putty.

    -Rogelio