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
hgaurav
PostPosted: Apr 27, 2012 - 10:23 AM
Hangaround


Joined: Nov 07, 2006
Posts: 130


yup i have already done that as
Code:

void program_page (uint32_t,uint8_t*)__attribute__((section (".bootloader")));


hgaurav
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Apr 27, 2012 - 11:10 AM
10k+ Postman


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

And does the .map file confirm that is where the SPM functions are located?

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
hgaurav
PostPosted: Apr 27, 2012 - 12:08 PM
Hangaround


Joined: Nov 07, 2006
Posts: 130


Code:
LOAD linker stubs

.bootloader     0x00007e01       0x74
 .bootloader    0x00007e01       0x74 GHCrimper32V_1.o
                0x00007e01                program_page


yes sir as above section of map file confirmed this

hgaurav
 
 View user's profile Send private message  
Reply with quote Back to top
hgaurav
PostPosted: Apr 30, 2012 - 12:26 PM
Hangaround


Joined: Nov 07, 2006
Posts: 130


Dear Sir,

it works with placing program_page in BLS using
Code:

asm(".org 0x7E00");


but the flash memory size is increased enormously by 72% to 174%....but it writes what i intended into the flash i.e. : 0x00

best regards,
hgaurav
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Apr 30, 2012 - 12:49 PM
10k+ Postman


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

Never use .org with a relocating linker - it does not do what you think it does. (it's relative, not absolute).

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
hgaurav
PostPosted: Apr 30, 2012 - 01:12 PM
Hangaround


Joined: Nov 07, 2006
Posts: 130


Eureka....Eureka ...its working...!!!
Code:

page=0x5F00;
   for(;page<(0x7D00);page+=0x80){
      program_page(page,buf);
   }


but it is strange for me...page initialize in for loop does not works....Thanks from the bottom of my heart...Cliff Sir

Best Regards,
hgaurav
 
 View user's profile Send private message  
Reply with quote Back to top
hgaurav
PostPosted: Apr 30, 2012 - 01:14 PM
Hangaround


Joined: Nov 07, 2006
Posts: 130


Quote:
but the flash memory size is increased enormously by 72% to 174%


whats the reason?
best regards,
hgaurav
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Apr 30, 2012 - 02:16 PM
10k+ Postman


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

Quote:

but the flash memory size is increased enormously by 72% to 174%

Because, as I say ORG is relative. If something is already built to locate at 0xFE00 say and then you .org 0xFE00 then what's produced will be at 0xFE00 bytes on from 0xFE00. That is 0x1FC00 and there will be records in the .hex file to position code at this address - way beyond the end of the memory.

BTW I can think of no reason why separately initialising the page counter makes it work - most odd.

_________________
 
 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