address linking

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

Hi,

maybe somebody could help me a little bit. I'm trying to link bootloader to a certain flash address and i have it right in makefile (-Wl,-section-start=-Ttext=0x3800 for mega16), but addresses in .map file is not changing and when i program the chip and read it back with ponyprog, i get all the program at 0x0000. If understand .hex file right it also gives address at the start of flash.
I use AS6. I also read quit a lot of posts here related to my problem but somehow didn't manage to solve it.
Do i have to manually change hex or some other file?

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

You got the syntax wrong. It is:

-Wl,-Ttext=0x3800

You could do it as:

-Wl,-section-start=.text=0x3800

I suppose but -Ttext is a short form for this.

BTW there's a mega16 bootloader project for AS6 here:

http://spaces.atmel.com/gf/proje...

In that I simply has the "Memory Settings" under "Linker" set to position .text to 0x1C00 (and AS6 converts this to 0x3800 when it passes it as a -section-start to the GCC linker).

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

hi cliff,

actually i use -Ttext=0x1C00 in linker/memmory settings.
(-Wl,-section-start=-Ttext=0x3800) is what i find in makefile.

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

Got that, it's
.text=0x1C00 instead of -Ttext=0x1C00, -Ttext is for makefiles and simalar. Now hex file has changed.
Thanks cliff.