ARM -- reserve RAM outside of bss or data

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, I know exactly how to do this when the IDE isn't in the way; I just edit the linker ld file and I have a nice day.

 

I want to reserve a word at a specific location for special treatment, either by defining a special segment or by defining the start of memory to be at 0x2000 0004 instead of 0x2000 0000.  (It's for clean bootloader to application communication, BTW).

 

How do I do that in AtmelStudio?

Tim

Last Edited: Sat. Feb 9, 2019 - 08:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Modify the linker script? It should be in your project if I remember correctly.

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Morten is right. Unlike AVR, when you use AS7 for ARM it lists the script as an editable component. Presumably (unlike AVR) it mustn't keep single copies of all the scripts in a core location but must copy them each time a project is created?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Moving to ARM area.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks.

Tim

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, I dug into this a bit, and previous developer dealt with reserving space in .text by editing the linker flags (Project->my_project Properties->ARM/GNU Linker->Miscellaneous->Linker Flags.

 

-Wl,--entry=Reset_Handler -Wl,--section-start=.text=0x1000 -Wl,--cref -mthumb -T../src/ASF/sam0/utils/linker_scripts/samd20/gcc/samd20j16_flash.ld

 

I'm not sure if this is the best way to do it for the RAM.  We need this to be different between production code (which makes room for a bootloader) and debug code (which otherwise doesn't fit in RAM).  For the change I'm contemplating we could just have the spot reserved forever.

Tim