Pages: [1]   Go Down
Author Topic: what is LDSECTION and how do I determine it's val  (Read 445 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to determine what the LDSECTION value should be for my MCU (atmega640).  I cannot find how it is calculated, or where it is found.

this is the coorect value for the atmega168 as it is found in the makefile.
LDSECTION  = --section-start=.text=0x3800

any help would be greatly appreciated.
Logged

0
Offline Offline
Faraday Member
**
Karma: 13
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you trying to write a bootloader? It looks like the --section-start parameter specifies the bootloader start address.

You'll have to read the Bootloader Support sections of the ATmega640 datasheet to see where the bootloader start address should be. Multiply this address by 2 since the linker uses byte addresses but the Atmel datasheet usually specify word addresses.

For example, the ATmega168 bootloader (1024 words) starts at 0x1C00, so 0x1C00*2 ==> 0x3800.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ITS ALIVE!!! thanks a ton. I now have a atmega640 working under a atmega640 mcu!!!  I knew I was looking in the right place in the data sheet I just didn't realize I had to multiply by two.
Logged

Pages: [1]   Go Up
Jump to: