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.

#pragma data_section delfino C28346

Other Parts Discussed in Thread: TMS320C28346

Hi there,

i need to allocate memory for two data arrays. My project consists of a header file, which includes all variables and arrays I am using within the project.

For allocating the memory for my arrays, I took a look at the Example_2834xMcBSP_DLB_DMA.c example for my TMS320C28346.

There, memory is allocated like this:

#pragma DATA_SECTION(sdata, "DMARAML4")
#pragma DATA_SECTION(rdata, "DMARAML4")
Uint16 sdata[128];    // Sent Data
Uint16 rdata[128];    // Recieved Data

I am trying to allocate my arrays like:

#pragma DATA_SECTION(ADCbuffer1,"DMARAML4");
#pragma DATA_SECTION(ADCbuffer2,"DMARAML4");

  volatile Uint16 ADCbuffer1[512];
  volatile Uint16 ADCbuffer2[512];

All I am getting is a warning "pragma can only be applied to a file level symbol, but not 'ADCbuffer1'".

Furthermore my memory is not where I need it to be (it need's to be DMA accessible), but anywhere else.

How can I allocate the arrays in DMARAML4? And furthermore, how can I get channel1 of the DMA to switch between those two arrays?

Thank you very much in advance!

Johannes Miersch

  • Hi Johannes!

    Johannes Miersch said:

    I am trying to allocate my arrays like:

    #pragma DATA_SECTION(ADCbuffer1,"DMARAML4");
    #pragma DATA_SECTION(ADCbuffer2,"DMARAML4");

      volatile Uint16 ADCbuffer1[512];
      volatile Uint16 ADCbuffer2[512];

    At first. One don't need ";" after #pragma

    #pragma DATA_SECTION(ADCbuffer1,"DMARAML4")
    #pragma DATA_SECTION(ADCbuffer2,"DMARAML4")

    Regards,

    Igor

  • Hey,

    ok, I found right after posting this, that the linker does allocate my arrays in the specific sections if I place the commands in the header file (found it in my .map file).

    Yet I need to find out how I can let the DMA channel 1 switch between both arrays. Has anyone an idea for that?

    Thank's a lot in advance

    Johannes Miersch

  • Hi Igor,

    Thanks for your answer, of course, you're right!

    I have no idea how it made it's way at the end of the pragma definition.

    Regards,

    Johannes