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/AM3352: Serial port sends extra data

Part Number: AM3352
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

Hi

        I have use uart5 for send data,I sent 13 bytes every 10ms,but sometimes I can get 14 bytes.

I have only change the baudrate to 19200.

the data I get error like this:

the extra data is always 0x0D.

0C FC EB 00 00 00 00 00 00 00 00 00 0D
0C FC EC 00 00 00 00 00 00 00 00 00 0C
0C FC ED 00 00 00 00 00 00 00 00 00 0B
0C FC EE 00 00 00 00 00 00 00 00 00 0A 0D
0C FC EF 00 00 00 00 00 00 00 00 00 09
0C FC F0 00 00 00 00 00 00 00 00 00 08
0C FC F1 00 00 00 00 00 00 00 00 00 07

0C FC 06 00 00 00 00 00 00 00 00 00 F2
0C FC 07 00 00 00 00 00 00 00 00 00 F1
0C FC 08 00 00 00 00 00 00 00 00 00 F0
0C FC 09 00 00 00 00 00 00 00 00 00 EF
0C FC 0A 0D 00 00 00 00 00 00 00 00 00 EE
0C FC 0B 00 00 00 00 00 00 00 00 00 ED
0C FC 0C 00 00 00 00 00 00 00 00 00 EC
0C FC 0D 00 00 00 00 00 00 00 00 00 EB
0C FC 0E 00 00 00 00 00 00 00 00 00 EA

my PDK version is pdk_am335x_1_0_13

  • Hi, 

    Are you using a UART test or example from PDK? If so, which example are you using?

    Regards,
    Frank

  • Hi

       this is my test code,when I send 10 datas ,it is right,but if I sent 13 datas,I can get 14data

    00 01 02 03 04 05 06 07 08 09 0A 0D 0B 0C
    00 01 02 03 04 05 06 07 08 09 0A 0D 0B 0C
    00 01 02 03 04 05 06 07 08 09 0A 0D 0B 0C
    00 01 02 03 04 05 06 07 08 09 0A 0D 0B 0C
    00 01 02 03 04 05 06 07 08 09 0A 0D 0B 0C
    00 01 02 03 04 05 06 07 08 09 0A 0D 0B 0C
    00 01 02 03 04 05 06 07 08 09 0A 0D 0B 0C

    the factory data is 00 01 02 03 04 05 06 07 08 09 0A 0B 0C,don;t contain 0x0D.


    /**
    * @file main_uart_example.c
    *
    * @brief This file tests the UART driver APIs with all the suported
    * input parameters values
    */
    /*
    * Copyright (c) 2014 - 2017, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */

    #ifndef BARE_METAL
    /* XDCtools Header files */
    #include <xdc/std.h>
    #include <xdc/cfg/global.h>
    #include <xdc/runtime/Error.h>
    #include <xdc/runtime/System.h>

    /* BIOS Header files */
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>
    #endif

    #include "stdio.h"
    #include "stdint.h"
    #include "stdlib.h"
    #include "string.h"

    /* UART Header files */
    #include <ti/drv/uart/UART.h>
    #include <ti/drv/uart/UART_stdio.h>
    #include <ti/drv/uart/src/UART_osal.h>
    #include <ti/drv/uart/soc/UART_soc.h>

    #include <ti/drv/uart/test/src/UART_board.h>

    /* GPMC Header files */
    #include <ti/drv/gpmc/GPMC.h>
    #include <ti/drv/gpmc/soc/GPMC_soc.h>

    /* ======== AppLoopDelay ========
    */
    void AppLoopDelay(uint32_t delayVal)
    {
    volatile uint32_t i;

    for (i = 0; i < (delayVal * 1000); i++)
    ;
    }
    void Board_initUART(void)
    {
    Board_initCfg boardCfg;

    boardCfg = BOARD_INIT_PINMUX_CONFIG |
    BOARD_INIT_MODULE_CLOCK |
    BOARD_INIT_UART_STDIO;

    Board_init(boardCfg);
    }
    Void uart_test(UArg arg0, UArg arg1)
    {

    UART_puts("\n start test uart5,please check!!!\n",sizeof("start test uart5,please check!!!\n"));
    UART_HwAttrs uart_cfg;
    UART_Params params;
    UART_Handle uart_handle_5;
    int8_t testbuf[13] = {0,1,2,3,4,5,6,7,8,9,10,11,12};

    UART_socGetInitCfg (5, &uart_cfg);
    UART_socSetInitCfg (5, &uart_cfg);
    UART_Params_init(&params);
    params.parityType = 0;

    uart_handle_5 = UART_open(5,&params);
    if(uart_handle_5 == NULL)
    {
    UART_puts("\n open handle 5 failed!!!\n",sizeof("open handle 5 failed!!!\n"));
    }
    else
    {
    // UART_write(uart_handle_5,&testbuf[0],10);
    while(1)
    {
    UART_write(uart_handle_5,&testbuf[0],13);
    AppLoopDelay(500);
    }
    }
    } /* uart_test */

    /*
    * ======== main ========
    */
    int main(void)
    {
    /* Call board init functions */
    Task_Handle task;
    Error_Block eb;

    Board_initUART();

    Error_init(&eb);
    task = Task_create(uart_test, NULL, &eb);
    if (task == NULL) {
    System_printf("Task_create() failed!\n");
    BIOS_exit(0);
    }

    /* Start BIOS */
    BIOS_start();
    return (0);
    } /* main */

  • Is there any update?

  • Hi,

    Sorry for the delay, I'll take a look at this as soon as possible.

    Regards,
    Frank

  • Hi 

        I have found the cause,I set the writedatemode to UART_DATA_TEXT,I need set it to UART_dATA_BINARY.

  • Hi,

    Thanks much for the response. I'm pleased you were able to resolve the problem!

    Regards,
    Frank