cancel
Showing results for 
Search instead for 
Did you mean: 

How to write progrm and data in the same bank

nanuradha
Associate II
Posted on April 23, 2007 at 06:46

How to write progrm and data in the same bank

6 REPLIES 6
nanuradha
Associate II
Posted on May 17, 2011 at 09:41

Hi,

I am using 256k flash as boot flash.Can i use the same flash for data storage.Program will be in sector0 of primary flash.Can data be stored in sector1 of primary flash.If any body worked on this please help us.

Thanks&Regards

Anu

jgoril
Associate II
Posted on May 17, 2011 at 09:41

Hi. IMHO... it is impossible to execute code and write into same bank simultaneously. You must copy your code into RAM and execute from RAM if you want to write or erase sector1.

BTW, in my projects I sometimes need to pre-load some register with a constant. It is compiled using LDR Rx, [PC, #offset] instruction. Constants are placed just after executable code.

nanuradha
Associate II
Posted on May 17, 2011 at 09:41

Can we attach data file with code and download to flash at the same time using JTAG.Is there any way to keep data in primry flash.

jgoril
Associate II
Posted on May 17, 2011 at 09:41

You have code and some constant data table. You want to write your code into sector0 and data table into sector1 of primary flash. Do I undertand you right? So... simply produce one programming file regarding to format specified in programming manual and download it using JTAG.

nanuradha
Associate II
Posted on May 17, 2011 at 09:41

Can you explain it clearly.I know the format of how to program code file but not data.If we protect the sectors(1,2,3) of primary flash,will they get erased during programming into sector 0 of primary flash.

jgoril
Associate II
Posted on May 17, 2011 at 09:41

The .obj file, as specified, is simple hex file with some additional rules. From programmer point of view, the code or the data - it is the same. Just place your data at address, where you want to have it. In this way you can produce one programming file carrying both - code and data. So all the content will be programmed at once.

Erasing of unused sectors before programming is programmer-dependent. However, using one programming file it is irrelevant. In the worst case, during re-programming the data you will reprogram also the code (with the same code)...