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.

TM4C129XNCZAD: Uartsend not working

Part Number: TM4C129XNCZAD

Dear Sir,

We have devloped the project using keil amd TM4C129Xcnzad and its fine.

Now I am migrating entire project to CCS.

I have send the command from docklight(serial port terminal utility) and expect the below response from query.

When I keep debug point i am getting the response DHV2.59 where as remove breakpoint then not getting any response from query.

Baud rate is 9600.

The same project working in Keil compiler.

void send_version_HWACK(void)
{

pc_buff[0]='D';
pc_buff[1]='H';
pc_buff[2]='V';
pc_buff[3]='0';
pc_buff[4]='2';
pc_buff[5]='.';
pc_buff[6]='5';
pc_buff[7]='9';
pc_buff[8]='\r';


for (i=0;i<9;i++)
{
UARTSend(&pc_buff[i],1);
for (x=0;x<=20000;x++);


}

}

Is any issue with timing or delay?

  • Hello Rajesh,

    I would recommend you start with one of our TivaWare examples such as hello and use the uartstdio utility we provide to handle this. It really simplifies the UART process and you can just a single API to send your data such as UARTprintf("DHV2.59\r");

  • Dear Ralph 

    I know the UARTPrint but when data is large it wont work.

    Above program working in keil compiled code where as not in CCS compiled code .Making Optimization OFF it also start working CCS.

    I found out the problem is "for loop delay" as mentioned above.  I had make optimization OFF and speed 5 then its is working.

    Can you suggested the system delay loop  ?

    So basically,In CCS  How "for loop delay" treated in optimization. 

    Please suggest system delay  

  • Hello Rajesh,

    Rather than use a delay, check for the UART to be done with the transaction:

        //
        // Wait for the UART module to complete transmitting.
        //
        while(UARTBusy(UART0_BASE))
        {
        }

    I didn't see which UART you are using, so I used the default UART0_BASE for my code above, but you would need to change that UART0_BASE to the one you are using if it is different.

  • Dear Ralph ,

    Ok I will check with UARTBusy.

    Code Composer Studio:Version: 7.0.0.00042 

    Meanwhile can you help me that with  float value

    #HARDWARE_VER 2.64

    sprintf(pcBuffer, "Hardware Version: %0.2f",HARDWARE_VER);
    GrStringDraw(&sContext_Label, pcBuffer, -1,40, 115, 0);

    After executing Grstring draw i am getting error"No source available  for 0x41dffe"

    I

  • In the TI examples, grlib is linked in as a library, so the source for the function GrStringDraw won't be available.

  • Hello Rajesh,

    As Andy stated, this function is inside of a library.

    You just have to add the grlib/string.c file to your project to step into it. See steps on Page 14 of our Getting Started guide for how to add a .c file to your project: https://www.ti.com/lit/pdf/spmu373