| Author |
Message |
|
|
Posted: Apr 27, 2012 - 10:23 AM |
|

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 |
|
|
| |
|
|
|
|
|
Posted: Apr 27, 2012 - 11:10 AM |
|


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? |
_________________
|
| |
|
|
|
|
|
Posted: Apr 27, 2012 - 12:08 PM |
|

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 |
|
|
| |
|
|
|
|
|
Posted: Apr 30, 2012 - 12:26 PM |
|

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 |
|
|
| |
|
|
|
|
|
Posted: Apr 30, 2012 - 12:49 PM |
|


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). |
_________________
|
| |
|
|
|
|
|
Posted: Apr 30, 2012 - 01:12 PM |
|

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 |
|
|
| |
|
|
|
|
|
Posted: Apr 30, 2012 - 01:14 PM |
|

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 |
|
|
| |
|
|
|
|
|
Posted: Apr 30, 2012 - 02:16 PM |
|


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. |
_________________
|
| |
|
|
|
|
|