cancel
Showing results for 
Search instead for 
Did you mean: 

problem to erase sector B1F0 and B1F1. application + bootloader

nir_gr
Associate II
Posted on April 22, 2007 at 14:35

problem to erase sector B1F0 and B1F1. application + bootloader

8 REPLIES 8
nir_gr
Associate II
Posted on April 19, 2007 at 11:45

Hi,

I am working with STR712 IAR environment.

I have a bootloader at sector B0F0

I success to burn my application.The application starts at sector B0F1 .

If I change the switches + reset, the application is running and it seems to work well.

The problem:

Data application are saved at sectors B1F0 and B1F1.

Writing/erasing those sectors stuck the application.

1. I declared flash functions __ramfunc, in order to run from the RAM

2. I disable B1F0 and B1F1 protection.

3. I do not have any problem in debug/ jlink mode.

4. I do not have any problem to burn the application by the bootloader.

Any idea ?

Thanks

Nir

kleshov
Associate II
Posted on April 19, 2007 at 12:27

One thing comes to mind. After power-up, the very first write to flash is special: reads from BOTH banks of flash are not allowed. Consult the flash programming manual for details.

Regards,

- mike

nir_gr
Associate II
Posted on April 19, 2007 at 12:37

Hi Mike,

Do you mean Debug/Readout protection ?

Thanks

Nir

kleshov
Associate II
Posted on April 19, 2007 at 13:47

No. Open the 'STR7 Family Flash Programming' manual Revision 4, read paragraph 2.3.2 'Executing the first Write operation from RAM'.

najoua
Associate II
Posted on April 19, 2007 at 13:50

Hello Nir,

Are you sure that the B1F0 and B1F1 are write unprotected correctly before writing/erasing them?

Could you please:

- send me your unprotect routine?

- tell me what do you mean by ''Writing/erasing those sectors stuck the application''?

Regards,

Najoua.

nir_gr
Associate II
Posted on April 22, 2007 at 11:36

Hi,

I added __ramfunc decleration to the flash functions. Even so in the ''MAP'' file, flash functions are located in the RAM.

As I understand flash functions should be located in the ROM and only after the first calling, they should be copied to the RAM. (__ramfunc)

I did not found anything suspicious in the xcl file.

Any idea what may cause it ?

Thanks

Nir

nir_gr
Associate II
Posted on April 22, 2007 at 11:44

Hi Najoua,

1. I use IAR function

#define FLASH_B1F0 0x00010000

#define FLASH_B1F1 0x00020000

FLASH_WritePrConfig( FLASH_B1F0 | FLASH_B1F1 ,DISABLE);

2. When I declare __ramfun my application stop working, even that I disabled all the flash R/W - I suspect about the function maping - since they located in the RAM.

Thanks

Nir

Regards

Nir

nir_gr
Associate II
Posted on April 22, 2007 at 14:35

Hi,

1. Am I need to add a code at startup that will copy from code_id to code_i ? what about after remaping thr ram ?

2. Am I need to copy DATA_ID at starup ?

Thanks

Nir