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.

TMS320F28P650DH: UART code example not working properly

Part Number: TMS320F28P650DH
Other Parts Discussed in Thread: C2000WARE

Dear colleagues,

when I import the UART example from "C2000Ware_6_00_00_00\driverlib\f28p65x\examples\c28x\uart\" it does not work properly. What happens is that the code configures the UART periphery improperly. 

As soon as I step the code and reach the generated block in board.c :

void myUART0_init(){
        //
        // Set myUART0 baud rate and configuration
        //
        UART_setConfig(
            myUART0_BASE, // base address
            200000000, // UART source clock
            115200, // baud rate
            (UART_CONFIG_WLEN_8 | // word length
             UART_CONFIG_STOP_ONE) // stop bits
        );

the debugger jumps to a strange location in uart.c and starts pretty much stepping through the comments section. There is obviously disconnect between the object/binary file. 

To fix that, I need to exclude driverlib.lib from the compilation and include the device/driverlib to the compilation. Then it works properly.

For this reason, i believe that the provided driverlib.lib is not compiled properly and this should be fixed. 

 

To repeat this behavior:

import the "uart_ex1_echoback.projectspec" project for P65x and run it. It won't work properly (the FIFO will be enabled by and word size will be 11.

Best regards, 

Jiri Panacek, ISC

 

To E2E admins: This new contact window is terrible and the text window can't be even resized 

  • Hi Jiri,

    The expert is currently out of office and will get back to you as soon as they return this week. Please expect a delay in response, thank you.

    Best Regards,

    Aishwarya

  • Hi Jiri,

    Apologies for the long delay. What you are seeing is caused by compiler optimizations. The driverlib.lib file was compiled with optimizations turned on, so certain lines of C were "optimized" out. CCS cannot properly match the symbols programmed to the device with the C file you're stepping through when the programmed code is optimized. Even though it looks like you're stepping through comments, this is actually just the optimized code. To step through driverlib code in a way that CCS can make sense of compiler optimizations must be turned off - as you have done by including the device/driverlib folder.

    Please upvote this response if it makes sense.

    Thanks,

    Delaney

  • Hi Delaney, Aishwarya, 

    thanks for you inputs. No worries about the late answer. We are slowly getting close to the end of the year. I know the pressure. Slight smile

    I mentioned two problems:

    1. The debug does not work as the code steps through comments section

    2. The code does not work as intended (register settings is incorrect)

    #### Problem 1 - RESOLVED

    I understand that the driverlib was compiled with optimizations and I also comprehend the problem with stepping the code.

    #### Problem 2 - The code does not work as intended

    However, I still believe that the demo should work out of the box. When I import the project from C2000Ware as is, it does not work and I need to recompile the library to get it working. I asked my intern to do the same and he faced the same issues.

     Best regards, 

    Jiri, Systems & Apps, ISC

  • Hi Jiri,

    For problem 2, one thing to check if you are seeing incorrect register values after stepping over the initializations in Board_init(): can you make sure "Continuous Refresh" is toggled on in your register view? If you have this on and still see incorrect values after initialization is stepped over, please send a screenshot of which registers are incorrect and what you would expect the values to be.

    Best Regards,

    Delaney