Set Value Flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Set Value Flash

1,194 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcossmart on Mon May 14 09:00:04 MST 2012
how to set a value in the flash (0x00008000-256) via the C code lpcxpresso?
0 Kudos
Reply
7 Replies

1,184 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcossmart on Tue May 15 07:55:07 MST 2012
you have example code?
for lpc1114
0 Kudos
Reply

1,184 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcossmart on Mon May 14 13:19:23 MST 2012
you have example code?
for lpc1114
0 Kudos
Reply

1,184 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gbm on Mon May 14 12:29:22 MST 2012
1. Read the CodeRed stuff on linker scripts, frequently linked to in this forum,
2. Create ROM section at 0x7F00.
3. Create a constant in this section. Some idea may be taken from CRP stuff.
4. Think twice. I don't believe you really need this value there.
0 Kudos
Reply

1,184 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcossmart on Mon May 14 12:10:50 MST 2012
It already works on my firmware.
What I need is to define a fixed value in the flash memory through the code in C lpcxpresso.
[COLOR=#333333]address=0x00008000-256[/COLOR]
[COLOR=#333333]value=0x01[/COLOR]
0 Kudos
Reply

1,184 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcossmart on Mon May 14 11:42:14 MST 2012

Quote: gbm
const int32_t myconst = 0x00008000-256;

Doesn't make too  much sense but surely works.


[COLOR=#333333]and how[/COLOR][COLOR=#333333] [/COLOR][COLOR=#333333]do[/COLOR][COLOR=#333333] [/COLOR][COLOR=#333333]you want[/COLOR][COLOR=#333333] [/COLOR][COLOR=#333333]to put the value[/COLOR][COLOR=#333333] [/COLOR][COLOR=#333333]at that address[/COLOR][COLOR=#333333]?[/COLOR]
[COLOR=#333333][/COLOR][COLOR=#333333]address=[/COLOR][COLOR=#333333] [/COLOR][COLOR=#333333]0x00008000-256[/COLOR][COLOR=#333333] [/COLOR][COLOR=#333333]value[/COLOR][COLOR=#333333] [/COLOR][COLOR=#333333]=[/COLOR][COLOR=#333333] [/COLOR][COLOR=#333333]0x01[/COLOR]
0 Kudos
Reply

1,184 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Mon May 14 11:36:34 MST 2012
Basically you need to use the IAP functions described in the User Manual for your part. Also search this forum for  flash wear levelling - there has been code posted.

To write values into flash, you have to write in sectors. You have to erase a sector, and then write it, you cannot use it like ram, as it has a maximum number of erase cycles.
0 Kudos
Reply

1,184 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gbm on Mon May 14 09:40:57 MST 2012
const int32_t myconst = 0x00008000-256;

Doesn't make too  much sense but surely works.
0 Kudos
Reply