(device_name)flash.ld and (device_name)sram.ld

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

Simple question: why there are two linker script files in Atmel Studio 7 ASF4 project?

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

One links the program to flash, one links the project to SRAM...

:: Morten

 

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

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

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

In my project settings the linker uses flash.ld.

If I delete the sram.ld file I have no compile error and my board works.

So I suppose sram.ld is unused for a "default" project.

Is it needed if I want my code to be executed entirely in ram instead of flash?

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

I think projects defaults to flash for devices with flash. If you want your program to be linked to run from ram (note, linked, it still has to 'get there'), then you can change the -T option in the project properties.
.
I think we provide both since it's not that unusual, and some examples are good.

:: Morten

 

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

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

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

Ok, thank you very much.