cancel
Showing results for 
Search instead for 
Did you mean: 

Placing data in Bank 1 Sector 0

bhushan_shanthi
Associate II
Posted on April 09, 2007 at 17:44

Placing data in Bank 1 Sector 0

3 REPLIES 3
bhushan_shanthi
Associate II
Posted on May 17, 2011 at 09:40

Hi Rave,

Thank you for the response. I will create a new load region in the scatter file as suggested.

While we are on the topic of scatter loading, I was wondering to know if I need to use scatter loading to allocate heap and stack for optimal use of RAM (Please see post ''Startup file heap size for using malloc()'', posted on 8 April 2007)

I request you to give me some inputs on this.

Kind Regards,

Vasisht

bhushan_shanthi
Associate II
Posted on May 17, 2011 at 09:40

Hi,

I am using MCBSTR9 board with Keil and STR9 libraries. I want to place an array of 255 bytes starting from first location of bank 1 sector 0 flash. During program execution, the contents of this array are read by the program. Also, the contents of this array will need to be changed by erasing and writing (not frequently) during program execution. I have two questions based on this:

1. How should I define the array to be placed in starting location of Bank 1-Sector 0? Do I have to use scatter loading? or is there a simpler way of doing this.

If anybody has a working example, please send it.

2. To read contents of this array, does Keil compiler allow for void pointers to point to bank 1- sector 0?

Thanks in advance.

Regards,

Vasisht.

mohamed23
Associate II
Posted on May 17, 2011 at 09:40

Hi Vasisht,

In my understanding this possible and is not very complex :

1. How should I define the array to be placed in starting location of Bank 1-Sector 0? Do I have to use scatter loading? or is there a simpler way of doing this.

>> Yes, this is possible using scatter-loading, Just define const data and using scatter loader you can create a new load region that points to Bank1 sector 0. Or you can also copy this const array from Your bank0 to bank1 at reset , just before jumping to you main program.

2. To read contents of this array, does Keil compiler allow for void pointers to point to bank 1- sector 0?

>> Yes of course, using pointer you can point to any address memory in the flash and all ARM compilers ( like Keil) provide this ANSI C feature, but you have to pay attention to your cast ( byte, Half word , word) and also to address alignement.

I hope this helps you.

Rave 8-) 8-)