cancel
Showing results for 
Search instead for 
Did you mean: 

ST10F276 soft in IFLASH, data in XFLASH, not clear XFLASH

p-alain
Associate II
Posted on October 31, 2006 at 13:19

ST10F276 soft in IFLASH, data in XFLASH, not clear XFLASH

21 REPLIES 21
najoua
Associate II
Posted on October 27, 2006 at 06:58

Hello Squonk,

Could you please tell me:

1/ what is the toolchain you are using?

2/ in which order the two registers XPERCON and SYSCON are defined? the XPERCON register must be defined before the SYSCON register bacause Register XPERCON cannot be changed after the global enabling of X-Peripherals, i.e. after setting bit XPEN in SYSCON register.

If XFLASHEN bit is set after the global enabling with XPEN-bit in

SYSCON register, no address space is not occupied by the XFLASH where the flash registers are located.

I had reproduced the behavior you are observing( the loop checking the LOCK bit never ends) using the start-up file generated by Tasking as it is, I mean: SYSCON register is defined before XPERCON register. In this case, the XFLASH containing the flash registers is not correctly enabled. Consequenctly, the flash registers (including FCR0L) can not be acceded.

To solve the problem, I changed the order of the two registers (XPERCON is configured before SYSCON) and i disabled the 'Generate system startup code and add it to project' under PROJECT OPTIONS -->STARTUP.

Please let me know if this is your case. Otherwise, we will continue investigating the problem.

Regards,

Najoua.

[ This message was edited by: Najoua on 27-10-2006 10:29 ]

lspr35
Associate II
Posted on October 31, 2006 at 13:19

Hello,

yes, this was the problem. Bit XPEN in SYSCON was already set by the startup - code. I had to reset XPEN first and then I had to modify the XPERCON register. After that XPEN must be set again.

Many thanks