EmbeddedRelated.com
Forums

writing parameters into flash

Started by Unknown January 14, 2009
Hello all,

My design needs configuration parameters. These configuration parameters
can be changed during the life of the product and should not be lost
when powering off the product

A way to do that is to store these parameters into msp430 flash (I don't
have external flash available). However, I just don't know how to do it
with the msp430

I suppose that I have to:
- Dedicate a segment into flash for these parameters.
- Allocate to each parameter a flash address.
- Write them and erase the sector with the flash controller.

From what I have read, I suppose that the best place is an info memory
sector.

Does anybody knows an application note describing how to do the three
points above? I am using C code and Code Composer Essentials.

Best regards,

Gregory

Beginning Microcontrollers with the MSP430

ooooh... think carefully about how you do this...

when writing to info. memory you must:

1. read the segment into temporary RAM
2. erase the whole segment
3. re-program the segment with the RAM data from 1. along with any new values

if the device happens to be powered down after 2. (erasure) then all data is lost, UNLESS you
build in some kind of backup service (either hardware, software or both)

personally, i would rather use external memory (such as eeprom)


Darren


-----Original Message-----
From: m... [mailto:m...]On Behalf Of Grory POIRIER
Sent: 14 January 2009 14:04
To: m...
Subject: [msp430] writing parameters into flash

Hello all,

My design needs configuration parameters. These configuration parameters
can be changed during the life of the product and should not be lost
when powering off the product

A way to do that is to store these parameters into msp430 flash (I don't
have external flash available). However, I just don't know how to do it
with the msp430

I suppose that I have to:
- Dedicate a segment into flash for these parameters.
- Allocate to each parameter a flash address.
- Write them and erase the sector with the flash controller.

>From what I have read, I suppose that the best place is an info memory
sector.

Does anybody knows an application note describing how to do the three
points above? I am using C code and Code Composer Essentials.

Best regards,

Gregory



This communication contains information which is confidential

and may also be privileged It is for the exclusive use of the

intended recipient(s). If you are not the intended recipient(s),

please note that any distribution, copying or use of this

communication or the information in it is strictly prohibited.

If you have received this communication in error, please

notify the sender immediately and then destroy any copies of it.

Yes I will have to do this sequence.

This is not a problem for me if datas are accidentally lost. These
parameters are only programmed during calibration => in production.
The user will not have access to them.

Darren Logan a rit :
>
> ooooh... think carefully about how you do this...
>
> when writing to info. memory you must:
>
> 1. read the segment into temporary RAM
> 2. erase the whole segment
> 3. re-program the segment with the RAM data from 1. along with any new
> values
>
> if the device happens to be powered down after 2. (erasure) then all
> data is lost, UNLESS you
> build in some kind of backup service (either hardware, software or both)
>
> personally, i would rather use external memory (such as eeprom)
> Darren
> -----Original Message-----
> From: m...
> [mailto:m... ]On
> Behalf Of Grory POIRIER
> Sent: 14 January 2009 14:04
> To: m...
> Subject: [msp430] writing parameters into flash
>
> Hello all,
>
> My design needs configuration parameters. These configuration parameters
> can be changed during the life of the product and should not be lost
> when powering off the product
>
> A way to do that is to store these parameters into msp430 flash (I don't
> have external flash available). However, I just don't know how to do it
> with the msp430
>
> I suppose that I have to:
> - Dedicate a segment into flash for these parameters.
> - Allocate to each parameter a flash address.
> - Write them and erase the sector with the flash controller.
>
> >From what I have read, I suppose that the best place is an info memory
> sector.
>
> Does anybody knows an application note describing how to do the three
> points above? I am using C code and Code Composer Essentials.
>
> Best regards,
>
> Gregory
>
> This communication contains information which is confidential
> and may also be privileged It is for the exclusive use of the
> intended recipient(s). If you are not the intended recipient(s),
> please note that any distribution, copying or use of this
> communication or the information in it is strictly prohibited.
> If you have received this communication in error, please
> notify the sender immediately and then destroy any copies of it.
>
>
>
>
--
-------------------------------
*Grory POIRIER*
**R&D Engineer

*CYBERFAB*
E-mail : _...@cyberfab.net_
Tel. : +33 476 081 957
Address : 452 rue des Sources
38920 Crolles
FRANCE

there are C code examples on T.I.'s website (under the MSP-430 section, obviously)

go check them out!



-----Original Message-----
From: m... [mailto:m...]On Behalf Of Grory POIRIER
Sent: 14 January 2009 14:24
To: m...
Subject: Re: [msp430] writing parameters into flash

Yes I will have to do this sequence.

This is not a problem for me if datas are accidentally lost. These
parameters are only programmed during calibration => in production.
The user will not have access to them.

Darren Logan a rit :
>
> ooooh... think carefully about how you do this...
>
> when writing to info. memory you must:
>
> 1. read the segment into temporary RAM
> 2. erase the whole segment
> 3. re-program the segment with the RAM data from 1. along with any new
> values
>
> if the device happens to be powered down after 2. (erasure) then all
> data is lost, UNLESS you
> build in some kind of backup service (either hardware, software or both)
>
> personally, i would rather use external memory (such as eeprom)
> Darren
> -----Original Message-----
> From: msp430@yahoogroups. com
> [mailto: msp430@yahoogroups. com ]On
> Behalf Of Grory POIRIER
> Sent: 14 January 2009 14:04
> To: msp430@yahoogroups. com
> Subject: [msp430] writing parameters into flash
>
> Hello all,
>
> My design needs configuration parameters. These configuration parameters
> can be changed during the life of the product and should not be lost
> when powering off the product
>
> A way to do that is to store these parameters into msp430 flash (I don't
> have external flash available). However, I just don't know how to do it
> with the msp430
>
> I suppose that I have to:
> - Dedicate a segment into flash for these parameters.
> - Allocate to each parameter a flash address.
> - Write them and erase the sector with the flash controller.
>
> >From what I have read, I suppose that the best place is an info memory
> sector.
>
> Does anybody knows an application note describing how to do the three
> points above? I am using C code and Code Composer Essentials.
>
> Best regards,
>
> Gregory
>
> This communication contains information which is confidential
> and may also be privileged It is for the exclusive use of the
> intended recipient(s). If you are not the intended recipient(s),
> please note that any distribution, copying or use of this
> communication or the information in it is strictly prohibited.
> If you have received this communication in error, please
> notify the sender immediately and then destroy any copies of it.
>
>
>
>

--
----------------------
*Grory POIRIER*
**R&D Engineer

*CYBERFAB*
E-mail : _gregory.poirier@ cyberfab.net_
Tel. : +33 476 081 957
Address : 452 rue des Sources
38920 Crolles
FRANCE



This communication contains information which is confidential

and may also be privileged It is for the exclusive use of the

intended recipient(s). If you are not the intended recipient(s),

please note that any distribution, copying or use of this

communication or the information in it is strictly prohibited.

If you have received this communication in error, please

notify the sender immediately and then destroy any copies of it.

Hello Gregory!

Sorry I didn't notice your message earlier.
In case you are using the Soroban dev board, (I know you have access
to it) there is a flash access utility in its source code, so that you just
have to call a function to read it and another to write it back.
And in case you use another board, I think it will give you good hints
about what to do.

Pascal

--- In m..., Grory POIRIER wrote:
>
> Hello all,
>
> My design needs configuration parameters. These configuration parameters
> can be changed during the life of the product and should not be lost
> when powering off the product
>
> A way to do that is to store these parameters into msp430 flash (I don't
> have external flash available). However, I just don't know how to do it
> with the msp430
>
> I suppose that I have to:
> - Dedicate a segment into flash for these parameters.
> - Allocate to each parameter a flash address.
> - Write them and erase the sector with the flash controller.
>
> From what I have read, I suppose that the best place is an info memory
> sector.
>
> Does anybody knows an application note describing how to do the three
> points above? I am using C code and Code Composer Essentials.
>
> Best regards,
>
> Gregory
>

Thank you pascal,

That's all what I needed

p_murayama a rit :
>
> Hello Gregory!
>
> Sorry I didn't notice your message earlier.
> In case you are using the Soroban dev board, (I know you have access
> to it) there is a flash access utility in its source code, so that you
> just
> have to call a function to read it and another to write it back.
> And in case you use another board, I think it will give you good hints
> about what to do.
>
> Pascal
>
> --- In m... ,
> Grory POIRIER wrote:
> >
> > Hello all,
> >
> > My design needs configuration parameters. These configuration
> parameters
> > can be changed during the life of the product and should not be lost
> > when powering off the product
> >
> > A way to do that is to store these parameters into msp430 flash (I
> don't
> > have external flash available). However, I just don't know how to do it
> > with the msp430
> >
> > I suppose that I have to:
> > - Dedicate a segment into flash for these parameters.
> > - Allocate to each parameter a flash address.
> > - Write them and erase the sector with the flash controller.
> >
> > From what I have read, I suppose that the best place is an info memory
> > sector.
> >
> > Does anybody knows an application note describing how to do the three
> > points above? I am using C code and Code Composer Essentials.
> >
> > Best regards,
> >
> > Gregory
> >
--
-------------------------------
*Grory POIRIER*
**R&D Engineer

*CYBERFAB*
E-mail : _...@cyberfab.net_
Tel. : +33 476 081 957
Address : 452 rue des Sources
38920 Crolles
FRANCE