cancel
Showing results for 
Search instead for 
Did you mean: 

more on scatter file (esp. for RVDK USERS)

mtraman
Associate II
Posted on May 13, 2007 at 03:38

more on scatter file (esp. for RVDK USERS)

1 REPLY 1
mtraman
Associate II
Posted on May 17, 2011 at 09:43

There seems to be a limitation in using the scat_flash scatter loading file given by ST.

The boot bank and non-boot bank sizes are initialised in the file 91x_init.s. After reset only the main flash is enabled with only 32kB of flash memory. If the program uses more memory it has to increase the size of the flash memory by writing to boot bank size register in the FMI. This has to be done before using memory beyond 32kB. Otherwise the microcontroller won't boot from flash.

Consider the following lines from the scatter file

..

..

..

FLASH 0x00000000

{

91x_vect.o (Vect, +First)

91x_init.o(Init)

* (+RO)

}

..

..

..

Though init.o is after vect.o, it can be placed anywhere. Lets suppose it is placed at 0x11000 which is outside the first 32kB. After power up the uc branches to the reset handler placed here, but this memory region is not enabled yet. So, the microcontroller never boots from flash.

To overcome this, force the linker to place the init.o in the first 32kB region:

FLASH_MODE1 0x00000000 0x400

{

MICROCONTROLLER_INIT 0x00000000

{

91x_vect.o (Vect, +First)

91x_init.o(Init)

}

..

..

}

FLASH_MODE2 0x00000400 0x7FC00

{

USER_CODE 0x00000400

{

* (+RO)

}

}

The modified scatter file has been attached.