EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Flash memory (info segments) corruption

Started by Dan Muzzey July 13, 2007
I've had several cases recently where the info segments of the flash
memory has gotten corrupted. By corrupted I mean that the data I though
I had stored in the info segments was no longer there. Has anyone else
here seen this or does anyone have any suggestions on how to avoid it?
I've double checked the set up registers and the clocks and everything
appears to be good. We are using an MSP430F449.

Thanks

Dan

Beginning Microcontrollers with the MSP430

Hi,
Sorry.. a bit OT... I've been wondering what kind of data is stored
in the info segment of the flash? I have been downloading the sample
program through the IAR debugger from the beginning of my project
till now. I must admit that I'm taking it for granted until now that
I've started wondering where are my programs stored in the MSP430
chip. Can anyone please spare me some thoughts? And how big is the
program being downloaded to the Flash? Do u check it according to
the size of the .d43 files? Thanks in advance! :)

Cheers,
Gene
--- In m..., "Dan Muzzey" wrote:
>
> I've had several cases recently where the info segments of the
flash
> memory has gotten corrupted. By corrupted I mean that the data I
though
> I had stored in the info segments was no longer there. Has anyone
else
> here seen this or does anyone have any suggestions on how to avoid
it?
> I've double checked the set up registers and the clocks and
everything
> appears to be good. We are using an MSP430F449.
>
>
>
> Thanks
>
>
>
> Dan
>
>
>
We store set up parameter type things in the info segments. The
assumption is that it is a good place to put a piece of data (maybe a
timestamp or a count of power ups) that doesn't change much but needs to
be kept throughout a power reset.

The code itself is stored in Flash memory. Our production programmer
verifies the program after writing it to the chip. We do not verify the
actual size in production.

________________________________

From: m... [mailto:m...] On Behalf
Of Genevieve
Sent: Friday, July 13, 2007 10:14 AM
To: m...
Subject: [msp430] Re: Flash memory (info segments) corruption

Hi,
Sorry.. a bit OT... I've been wondering what kind of data is stored
in the info segment of the flash? I have been downloading the sample
program through the IAR debugger from the beginning of my project
till now. I must admit that I'm taking it for granted until now that
I've started wondering where are my programs stored in the MSP430
chip. Can anyone please spare me some thoughts? And how big is the
program being downloaded to the Flash? Do u check it according to
the size of the .d43 files? Thanks in advance! :)

Cheers,
Gene
--- In m... , "Dan
Muzzey" wrote:
>
> I've had several cases recently where the info segments of the
flash
> memory has gotten corrupted. By corrupted I mean that the data I
though
> I had stored in the info segments was no longer there. Has anyone
else
> here seen this or does anyone have any suggestions on how to avoid
it?
> I've double checked the set up registers and the clocks and
everything
> appears to be good. We are using an MSP430F449.
>
> Thanks
>
> Dan
>
>
>
There was an earlier post on this list that reported this kind of
problem. He found out that it was caused by certain revision of IAR
tool. What tool are you using? Which revision?

--- In m..., "Genevieve" wrote:
>
> Hi,
> Sorry.. a bit OT... I've been wondering what kind of data is stored
> in the info segment of the flash? I have been downloading the sample
> program through the IAR debugger from the beginning of my project
> till now. I must admit that I'm taking it for granted until now that
> I've started wondering where are my programs stored in the MSP430
> chip. Can anyone please spare me some thoughts? And how big is the
> program being downloaded to the Flash? Do u check it according to
> the size of the .d43 files? Thanks in advance! :)
>
> Cheers,
> Gene
> --- In m..., "Dan Muzzey" wrote:
> >
> > I've had several cases recently where the info segments of the
> flash
> > memory has gotten corrupted. By corrupted I mean that the data I
> though
> > I had stored in the info segments was no longer there. Has anyone
> else
> > here seen this or does anyone have any suggestions on how to avoid
> it?
> > I've double checked the set up registers and the clocks and
> everything
> > appears to be good. We are using an MSP430F449.
> >
> >
> >
> > Thanks
> >
> >
> >
> > Dan
> >
> >
> >
> >
>
We are using CrossStudio 1.3build 3 for development. This seems to be
happening out in the field though. A handful of units in the field get
corrupted.

________________________________

From: m... [mailto:m...] On Behalf
Of old_cow_yellow
Sent: Friday, July 13, 2007 10:36 AM
To: m...
Subject: [msp430] Re: Flash memory (info segments) corruption

There was an earlier post on this list that reported this kind of
problem. He found out that it was caused by certain revision of IAR
tool. What tool are you using? Which revision?

--- In m... ,
"Genevieve" wrote:
>
> Hi,
> Sorry.. a bit OT... I've been wondering what kind of data is stored
> in the info segment of the flash? I have been downloading the sample
> program through the IAR debugger from the beginning of my project
> till now. I must admit that I'm taking it for granted until now that
> I've started wondering where are my programs stored in the MSP430
> chip. Can anyone please spare me some thoughts? And how big is the
> program being downloaded to the Flash? Do u check it according to
> the size of the .d43 files? Thanks in advance! :)
>
> Cheers,
> Gene
> --- In m... , "Dan
Muzzey" wrote:
> >
> > I've had several cases recently where the info segments of the
> flash
> > memory has gotten corrupted. By corrupted I mean that the data I
> though
> > I had stored in the info segments was no longer there. Has anyone
> else
> > here seen this or does anyone have any suggestions on how to avoid
> it?
> > I've double checked the set up registers and the clocks and
> everything
> > appears to be good. We are using an MSP430F449.
> >
> >
> >
> > Thanks
> >
> >
> >
> > Dan
> >
> >
> >
> >
>
If your own code is erasing/writing Flash, you should read TI
Application Note slaa334.

According to that document, if you write to the same 32-byte block of
Flash many times before you erase that segment, it might lose its
marbles. This, of course, is on top of the timing and voltage
requirements.

Info Flash and Main Flash are the same. You are not losing the Main
Flash and only the Info Flash. Thus I think flaws in your own code is
suspected.

--- In m..., "Dan Muzzey" wrote:
>
> We are using CrossStudio 1.3build 3 for development. This seems to be
> happening out in the field though. A handful of units in the field get
> corrupted.
>
>
>
> ________________________________
>
> From: m... [mailto:m...] On Behalf
> Of old_cow_yellow
> Sent: Friday, July 13, 2007 10:36 AM
> To: m...
> Subject: [msp430] Re: Flash memory (info segments) corruption
>
>
>
> There was an earlier post on this list that reported this kind of
> problem. He found out that it was caused by certain revision of IAR
> tool. What tool are you using? Which revision?
>
> --- In m... ,
> "Genevieve" wrote:
> >
> > Hi,
> > Sorry.. a bit OT... I've been wondering what kind of data is stored
> > in the info segment of the flash? I have been downloading the sample
> > program through the IAR debugger from the beginning of my project
> > till now. I must admit that I'm taking it for granted until now that
> > I've started wondering where are my programs stored in the MSP430
> > chip. Can anyone please spare me some thoughts? And how big is the
> > program being downloaded to the Flash? Do u check it according to
> > the size of the .d43 files? Thanks in advance! :)
> >
> > Cheers,
> > Gene
> > --- In m... , "Dan
> Muzzey" wrote:
> > >
> > > I've had several cases recently where the info segments of the
> > flash
> > > memory has gotten corrupted. By corrupted I mean that the data I
> > though
> > > I had stored in the info segments was no longer there. Has anyone
> > else
> > > here seen this or does anyone have any suggestions on how to avoid
> > it?
> > > I've double checked the set up registers and the clocks and
> > everything
> > > appears to be good. We are using an MSP430F449.
> > >
> > >
> > >
> > > Thanks
> > >
> > >
> > >
> > > Dan
> > >
> > >
> > >
> > >
> > >
> >
>
>
>
Thank you for the suggestions. However, I've tried that. I read the
app note and it was decently well written. It clearly explained some
things I was fuzzy on. Unfortunately it didn't tell me I was doing
anything wrong. I'm doing byte writes with a 400KHz clock. If I
understand this correctly it takes 29 cycles to write. Each word will
take two writes (which is okay). So doing the math I come up with the
max write time being 4.64mSeconds. I've got a max write time between
erases of 10mSec so with the 400KHz clock it is impossible to violate
the write rule without also violating the multiple byte write rule which
I'm not doing.

Any other suggestion???

________________________________

From: m... [mailto:m...] On Behalf
Of old_cow_yellow
Sent: Friday, July 13, 2007 1:38 PM
To: m...
Subject: [msp430] Re: Flash memory (info segments) corruption

If your own code is erasing/writing Flash, you should read TI
Application Note slaa334.

According to that document, if you write to the same 32-byte block of
Flash many times before you erase that segment, it might lose its
marbles. This, of course, is on top of the timing and voltage
requirements.

Info Flash and Main Flash are the same. You are not losing the Main
Flash and only the Info Flash. Thus I think flaws in your own code is
suspected.

--- In m... , "Dan
Muzzey" wrote:
>
> We are using CrossStudio 1.3build 3 for development. This seems to be
> happening out in the field though. A handful of units in the field get
> corrupted.
>
> ________________________________
>
> From: m...
[mailto:m... ] On
Behalf
> Of old_cow_yellow
> Sent: Friday, July 13, 2007 10:36 AM
> To: m...
> Subject: [msp430] Re: Flash memory (info segments) corruption
>
> There was an earlier post on this list that reported this kind of
> problem. He found out that it was caused by certain revision of IAR
> tool. What tool are you using? Which revision?
>
> --- In m...
,
> "Genevieve" wrote:
> >
> > Hi,
> > Sorry.. a bit OT... I've been wondering what kind of data is stored
> > in the info segment of the flash? I have been downloading the sample

> > program through the IAR debugger from the beginning of my project
> > till now. I must admit that I'm taking it for granted until now that

> > I've started wondering where are my programs stored in the MSP430
> > chip. Can anyone please spare me some thoughts? And how big is the
> > program being downloaded to the Flash? Do u check it according to
> > the size of the .d43 files? Thanks in advance! :)
> >
> > Cheers,
> > Gene
> > --- In m...
, "Dan
> Muzzey" wrote:
> > >
> > > I've had several cases recently where the info segments of the
> > flash
> > > memory has gotten corrupted. By corrupted I mean that the data I
> > though
> > > I had stored in the info segments was no longer there. Has anyone
> > else
> > > here seen this or does anyone have any suggestions on how to avoid

> > it?
> > > I've double checked the set up registers and the clocks and
> > everything
> > > appears to be good. We are using an MSP430F449.
> > >
> > >
> > >
> > > Thanks
> > >
> > >
> > >
> > > Dan
> > >
> > >
> > >
> > >
> > >
> >
>
Hi,

I've had ESD events corrupt RAM that I was writing to information memory
before resulting in 'bad data'. The information memory was correct,
unfortunately the data I was writing was not. Have you had ESD issues in
the past with this product? Any strange asserts or unexpected data in
your datalogs?

When you dump information memory is it scrambled or completely erased?
Are you using both pages and ensuring that if a watchdog or rest occurs
during a write you can restore from the other page? Are you locking the
flash after writing to it?

Michael

________________________________

From: m... [mailto:m...] On Behalf
Of Dan Muzzey
Sent: July 13, 2007 12:21 PM
To: m...
Subject: RE: [msp430] Re: Flash memory (info segments) corruption

Thank you for the suggestions. However, I've tried that. I read the
app note and it was decently well written. It clearly explained some
things I was fuzzy on. Unfortunately it didn't tell me I was doing
anything wrong. I'm doing byte writes with a 400KHz clock. If I
understand this correctly it takes 29 cycles to write. Each word will
take two writes (which is okay). So doing the math I come up with the
max write time being 4.64mSeconds. I've got a max write time between
erases of 10mSec so with the 400KHz clock it is impossible to violate
the write rule without also violating the multiple byte write rule which
I'm not doing.

Any other suggestion???

________________________________

From: m...
[mailto:m... ] On
Behalf
Of old_cow_yellow
Sent: Friday, July 13, 2007 1:38 PM
To: m...
Subject: [msp430] Re: Flash memory (info segments) corruption

If your own code is erasing/writing Flash, you should read TI
Application Note slaa334.

According to that document, if you write to the same 32-byte block of
Flash many times before you erase that segment, it might lose its
marbles. This, of course, is on top of the timing and voltage
requirements.

Info Flash and Main Flash are the same. You are not losing the Main
Flash and only the Info Flash. Thus I think flaws in your own code is
suspected.

--- In m...
, "Dan
Muzzey" wrote:
>
> We are using CrossStudio 1.3build 3 for development. This seems to be
> happening out in the field though. A handful of units in the field get
> corrupted.
>
> ________________________________
>
> From: m...

[mailto:m...
] On
Behalf
> Of old_cow_yellow
> Sent: Friday, July 13, 2007 10:36 AM
> To: m...

> Subject: [msp430] Re: Flash memory (info segments) corruption
>
> There was an earlier post on this list that reported this kind of
> problem. He found out that it was caused by certain revision of IAR
> tool. What tool are you using? Which revision?
>
> --- In m...

,
> "Genevieve" wrote:
> >
> > Hi,
> > Sorry.. a bit OT... I've been wondering what kind of data is stored
> > in the info segment of the flash? I have been downloading the sample

> > program through the IAR debugger from the beginning of my project
> > till now. I must admit that I'm taking it for granted until now that

> > I've started wondering where are my programs stored in the MSP430
> > chip. Can anyone please spare me some thoughts? And how big is the
> > program being downloaded to the Flash? Do u check it according to
> > the size of the .d43 files? Thanks in advance! :)
> >
> > Cheers,
> > Gene
> > --- In m...

, "Dan
> Muzzey" wrote:
> > >
> > > I've had several cases recently where the info segments of the
> > flash
> > > memory has gotten corrupted. By corrupted I mean that the data I
> > though
> > > I had stored in the info segments was no longer there. Has anyone
> > else
> > > here seen this or does anyone have any suggestions on how to avoid

> > it?
> > > I've double checked the set up registers and the clocks and
> > everything
> > > appears to be good. We are using an MSP430F449.
> > >
> > >
> > >
> > > Thanks
> > >
> > >
> > >
> > > Dan
> > >
> > >
> > >
> > >
> > >
> >
>
You are correct. 4.64ms should be safe for F449.
For some other MSP430F, the max. acc. write limit is 4ms, not 10ms.

--- In m..., "Dan Muzzey" wrote:
>
> Thank you for the suggestions. However, I've tried that. I read the
> app note and it was decently well written. It clearly explained some
> things I was fuzzy on. Unfortunately it didn't tell me I was doing
> anything wrong. I'm doing byte writes with a 400KHz clock. If I
> understand this correctly it takes 29 cycles to write. Each word will
> take two writes (which is okay). So doing the math I come up with the
> max write time being 4.64mSeconds. I've got a max write time between
> erases of 10mSec so with the 400KHz clock it is impossible to violate
> the write rule without also violating the multiple byte write rule which
> I'm not doing.
>
>
>
> Any other suggestion???
>
>
>
> ________________________________
>
> From: m... [mailto:m...] On Behalf
> Of old_cow_yellow
> Sent: Friday, July 13, 2007 1:38 PM
> To: m...
> Subject: [msp430] Re: Flash memory (info segments) corruption
>
>
>
> If your own code is erasing/writing Flash, you should read TI
> Application Note slaa334.
>
> According to that document, if you write to the same 32-byte block of
> Flash many times before you erase that segment, it might lose its
> marbles. This, of course, is on top of the timing and voltage
> requirements.
>
> Info Flash and Main Flash are the same. You are not losing the Main
> Flash and only the Info Flash. Thus I think flaws in your own code is
> suspected.
>
> --- In m... , "Dan
> Muzzey" wrote:
> >
> > We are using CrossStudio 1.3build 3 for development. This seems to be
> > happening out in the field though. A handful of units in the field get
> > corrupted.
> >
> >
> >
> > ________________________________
> >
> > From: m...
> [mailto:m... ] On
> Behalf
> > Of old_cow_yellow
> > Sent: Friday, July 13, 2007 10:36 AM
> > To: m...
> > Subject: [msp430] Re: Flash memory (info segments) corruption
> >
> >
> >
> > There was an earlier post on this list that reported this kind of
> > problem. He found out that it was caused by certain revision of IAR
> > tool. What tool are you using? Which revision?
> >
> > --- In m...
> ,
> > "Genevieve" wrote:
> > >
> > > Hi,
> > > Sorry.. a bit OT... I've been wondering what kind of data is stored
> > > in the info segment of the flash? I have been downloading the sample
>
> > > program through the IAR debugger from the beginning of my project
> > > till now. I must admit that I'm taking it for granted until now that
>
> > > I've started wondering where are my programs stored in the MSP430
> > > chip. Can anyone please spare me some thoughts? And how big is the
> > > program being downloaded to the Flash? Do u check it according to
> > > the size of the .d43 files? Thanks in advance! :)
> > >
> > > Cheers,
> > > Gene
> > > --- In m...
> , "Dan
> > Muzzey" wrote:
> > > >
> > > > I've had several cases recently where the info segments of the
> > > flash
> > > > memory has gotten corrupted. By corrupted I mean that the data I
> > > though
> > > > I had stored in the info segments was no longer there. Has anyone
> > > else
> > > > here seen this or does anyone have any suggestions on how to avoid
>
> > > it?
> > > > I've double checked the set up registers and the clocks and
> > > everything
> > > > appears to be good. We are using an MSP430F449.
> > > >
> > > >
> > > >
> > > > Thanks
> > > >
> > > >
> > > >
> > > > Dan
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
> >
> >
> >
> >
> >
> >
>
>
>
We develop medical, implantable products and store critical
calibration data in the information memory segments. Obviously, we
cannot afford for flash memory to be corrupted. We have performed
accelerated stress tests (high temperature, many erase/write cycles)
on the flash memory and have yet to see a problem.

Still, as a precaution, we include a 16-bit CRC with all data stored
in flash memory, including the firmware image itself. So, if any data
are corrupt, we can detect it and have a safe fall-back.

Stuart

--- In m..., "Dan Muzzey" wrote:
>
> I've had several cases recently where the info segments of the flash
> memory has gotten corrupted. By corrupted I mean that the data I though
> I had stored in the info segments was no longer there. Has anyone else
> here seen this or does anyone have any suggestions on how to avoid it?
> I've double checked the set up registers and the clocks and everything
> appears to be good. We are using an MSP430F449.
>
>
>
> Thanks
>
>
>
> Dan
>
>
>

Memfault Beyond the Launch