Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
mgilroy
PostPosted: Apr 05, 2010 - 04:36 PM
Newbie


Joined: Feb 02, 2010
Posts: 4


Hi,

I've written a basic bootloader to aloow me to update my atmega1284p over the air. The application space is split to allow me to have two separate apps in FLASH and the bootloader selects the correct application to run based on an EEPROM setting.

I've compiled the bootloader on its own using the following linker settings:


Code:

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


From my reading of the datasheet this should translate to the bootloader adddress space for a 1024 word bootloader.


The elf file that is generated appears to have the correct address information:

Code:


Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000222  0001f800  0001f800  0000030a  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .jumps        00000276  00000000  00000000  00000094  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .sharedFuncs  00000004  0001fe00  0001fe00  0000052c  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  3 .stab         00000ca8  00000000  00000000  00000530  2**2
                  CONTENTS, READONLY, DEBUGGING
  4 .stabstr      000009b8  00000000  00000000  000011d8  2**0
                  CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:

0001f800 <__vectors>:
   1f800:   0c 94 46 fc    jmp   0x1f88c   ; 0x1f88c <__ctors_end>



However the hex file that is generated is starting at the wrong address 0f 0xfe00

Code:

:10F800000C9446FC0C9465FC0C9465FC0C9465FC13
:10F810000C9465FC0C9465FC0C9465FC0C9465FCE4


Any idea as to how I get the hex file to use the extended addressing?
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Apr 05, 2010 - 04:40 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 69423
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

However the hex file that is generated is starting at the wrong address 0f 0xfe00

Look before this - there should be a 32 bit offset record. The code you show is at (byte address) 0xF800. There will be an offset record that repositions this by 0x00010000 so that the composite address is the correct 0x0001F800 but Intel Hex only has room for 4 hex digits of addressing in each record. Don't worry!

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
mgilroy
PostPosted: Apr 05, 2010 - 04:53 PM
Newbie


Joined: Feb 02, 2010
Posts: 4


OK I see what you mean, the line immediately before had the extended address offset,

Code:

:020000021000EC


I miss read the line, I had thought it was another data record.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits