MAKEFILE what is LDSECTION and how do I determine its value

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
sonictj
 
Posts: 9
Joined: Sat Jul 04, 2009 11:58 pm

MAKEFILE what is LDSECTION and how do I determine its value

Post by sonictj »

I'm trying to use an atmega640 with the arduino environment, and I think I'm nearly there. I just don't know what value to set LDSECTION for my device. I checked datasheets and could not find any corrisponding values to other mcu's listed. I'm kinda lost on how to find it. I assume that this is the bootloader starting address in the flash, but I could not find any correlations.

Thanks

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: MAKEFILE what is LDSECTION and how do I determine its value

Post by mtbf0 »

assuming the mega640 has 64k flash, you want 64k - 1k, or 0x10000 - 0x400, which is 0xfc00, so

Code: Select all

LDSECTION  = --section-start=.text=0xFC00
i think. if i'm wrong, keep in mind that i don't know what i'm talking about.

sonictj
 
Posts: 9
Joined: Sat Jul 04, 2009 11:58 pm

Re: MAKEFILE what is LDSECTION and how do I determine its value

Post by sonictj »

I figured it out its simply the number listed as the boot reset address in words. You have to convert to bytes via multiply by two. In this case my boot reset address was 0x7800 (determined by BOOTSZ1:0 fuses). So I simply multiplied by two, to get 0xF000.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”