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.

UART Question

Hello,

If I add the following line to my C++ project:

 

#pragma DATA_ALIGN(uartOutput, 128);

static Int8 uartOutput[128];

 

it gives me the following error:

 

error: expression must have a constant value

 

It compiles okay in the Edma Uart Sample Project but that is a C project. I did put this code into an "extern "C"" section but that still doesn't work. As a PS, interrupt driven Uart works just fine, this happens when I try to use DMA with Uart in my project. Any help would be greatly appreciated.

Thanks.

 

  • Hi Mick,

    The syntax of pragma DATA_ALIGN is a little different for C++.  For C++ use:

    #pragma DATA_ALIGN(128);
    static Int8 uartOutput[128];

    The differences can be found in section 7.7.2 of SPRU187N,  C6000 Optimizing Compiler User's Guide.

    You will see an example for pragma DATA_SECTION in section 7.7.4.

    Regards,
    Harry