Forums

IAR: MSP430F21x1 flash erase

Started by reym...@... March 1, 2006
Dear all,


Once more a problem with IAR's latest environment


Setup:
MSP430F21x1 /  MSP-FET430UIF  /  IAR EW 3.40A professional


Intention:
I want to initialize the information flash like this:
*.c  ->
const char xyz[] @ 0x1000 = 1,2,3,4 ;

*.txt  ->
@1000
01 02 03 04
This is just to check, if the compiler and linker did everything as
intended,
of course I'm not using this file for C-Spy.

Then I want to program this into the device via the FET-Tool. Without
killing
the oscillator calibration values.


Problem:
Does not work!   :-)  Of course... why should I post this message...
(Writing to program-flash always works fine.)


MSP430F21x1:
Info-flash segment ist being written, but not erased!  (Very strange!!!)
When I check  "Allow erase/write access to locked flash memory"  the
info-flash
ist beeing erased, but calibration values are lost.

I checked this on a MSP430F123 also:
Everything works fine, no matter whether I check "Allow erase/write
access to locked flash memory".   Of course, this device does not have
calibration
values.



Any comments highly appreciated!


Regards
Dirk





Beginning Microcontrollers with the MSP430

--- In msp430@msp4..., reymannd@... wrote:

> MSP430F21x1:
> Info-flash segment ist being written, but not erased!  (Very 
strange!!!)
> When I check  "Allow erase/write access to
locked flash memory"  the
> info-flash
> ist beeing erased, but calibration values are lost.

Isn't this the expected behaviour?
Info flash sement A is protected (locked) against erasure (LOCKA bit 
in FCTL3).
When you erase it, the flash calibration values are also erased. If 
you want to keep them, you have to read them before erasure and then 
reprogram them.

Wolfgang

> 
> I checked this on a MSP430F123 also:
> Everything works fine, no matter whether I check "Allow erase/write
> access to locked flash memory".   Of course, this device does not 
have
> calibration
> values.
> 
> 
> 
> Any comments highly appreciated!
> 
> 
> Regards
> Dirk
>





Dear Wolfgang!

>> MSP430F21x1:
>> Info-flash segment ist being written, but not erased!  (Very 
>> strange!!!)
>> When I check  "Allow erase/write access to locked flash
memory" the
>> info-flash
>> ist beeing erased, but calibration values are lost.

> Isn't this the expected behaviour?
> Info flash sement A is protected (locked) against erasure (LOCKA bit
> in FCTL3).

Sorry, I cant't agree.
LOCKA should (and does) only affect info flash segment A.
But I was talking about segment D  (0x1000...0x103F).

Actually in my code I'm erasing and writing these memory locations
without problems and without touching LOCKA.

It's just the problem when writing the initial values from withing
C-Spy.

Regards
Dirk