AnsweredAssumed Answered

Best way to deal with split RAM configuration on Kinetis K series?

Question asked by SCOTT MILLER on Feb 13, 2016
Latest reply on Feb 15, 2016 by SCOTT MILLER

I discovered the hard way that the Kinetis K series parts I'm using (K22FN1M0 and K22DX256) have two banks of RAM and that objects can't span banks.


The default linker file creates two memory regions:


  m_data      (RW) : ORIGIN = 0x1FFFC000, LENGTH = 0x00004000

  m_data_20000000 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00004000


It's apparently left to the user to manually place objects in the .m_data_20000000 section to make use of the second bank.  I can certainly do that, but the same application code is used across two different Kinetis MCUs and one ColdFire MCU.  I'd rather not have to explicitly place everything in the linker file or have to add macros to the code for section placement.


It seems like a simple solution ought to be to place a dummy variable at the boundary.  Is there a down side to doing this?  What's the easiest way to do this with the GNU linker?  I'm not running any code from RAM (bootloader pieces notwithstanding) so performance isn't a concern.