AnsweredAssumed Answered

Syntax to allocate memory assignments to faster memory

Question asked by Terry Biberdorf on Nov 21, 2013
Latest reply on Nov 23, 2013 by Jorge_Gonzalez

I've read through the MCU_Kinetis_Compiler.pdf document and other links on the web and having problems with the syntax needed with the Kinetis GCC compiler to re-direct RAM allocaiton to different sections specified by the linker file.


How this came about:

I now have the TWR-MEM board operating, but the mmem is slow.  I want my emac buffers and ADC buffers to use the internal SRAM, but all other memory to use the slower mmem.


Now I have my linker file modified to specify all memory to use the mmem.  This was easy to do with the linker file modified as follows:





  m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x000001E0

  m_text      (RX) : ORIGIN = 0x00000410, LENGTH = 0x0007FBF0

m_data      (RW) : ORIGIN = 0x60000000, LENGTH = 0x00080000

  m_data_00000000 (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x0001E000

  m_data_20000000 (RW) : ORIGIN = 0x2000E000, LENGTH = 0x00002000

  m_cfmprotrom  (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010



But my confusion now is the #pragma syntax needed in my source code to direct various buffers to use sections: m_data_00000000 and m_data_20000000.


Now I happen to have my network buffers declared as follows:


NET_BUFQ in_bufq[] =



   { 16, 128 },

   { 33, 512 },



I thought it would be as simple as adding the following:

#pragma DATA_SECTION(in_bufq,"m_data_20000000")


But I get the following compiler warning, and my allocation is not where I expect it.



D:/Freescale/CW MCU v10.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/ctime:45:0: warning: ignoring #pragma options align [-Wunknown-pragmas]


D:/Freescale/CW MCU v10.4/MCU/ARM_GCC_Support/ewl/EWL_C/include/ctime:307:0: warning: ignoring #pragma options align [-Wunknown-pragmas]

../Sources/userdata.c:229:0: warning: ignoring #pragma DATA_SECTION  [-Wunknown-pragmas]


Any suggestions on what the correct syntax should be to instruct the tool chain to allocate my buffers to the memory location I want them located in?