Writing to flash LPC1768

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

Writing to flash LPC1768

4,421 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by SrWalterR on Wed Nov 02 10:40:43 MST 2011
I am new at this and moving over from mbed. I am interested in some examples of erasing/writing/reading to flash on a LPC1768.  With the IAP from mbed this was simple, is there something similar in Expresso?
0 Kudos
Reply
12 Replies

2,284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by FlySnake on Thu Nov 03 10:19:33 MST 2011
This is almost the same code in C. Works in LPCXpresso + LPC1768
0 Kudos
Reply

2,284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Thu Nov 03 09:37:07 MST 2011
Might be worth looking at the RDB1768 usb bootloader example supplied with LPCXpresso. This contains a whole bunch of IAP related code.

HTH!
0 Kudos
Reply

2,284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by SrWalterR on Thu Nov 03 09:28:50 MST 2011
Thanks FallGuy, I am aware of the C Vs. C++ issue. Hence the question concerning a re-write...
0 Kudos
Reply

2,284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Thu Nov 03 09:15:11 MST 2011
That is C++ and not C. LPCXpresso does not support C++
0 Kudos
Reply

2,284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by SrWalterR on Thu Nov 03 09:10:05 MST 2011
Hey Snake, the link you sent turns out to be the IAP.h file I am used to using, have you rewriten it for Expresso? It seems LPCExpresso does not like the [SIZE=2]

[U]class IAP { public: ....[/U]

[SIZE=3]structure.[/SIZE]
[/SIZE][SIZE=2][/SIZE]
0 Kudos
Reply

2,284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by SrWalterR on Thu Nov 03 08:40:58 MST 2011
What is a fly snake?  The basic functionality is the same in both IDE's as IAP is in the boot loader.  But mbed has some functions in their IAP.h that allow simple calls (that may be subjective as I am used to using them) to use flash that I have used before.  I am stealing/writing a couple of them that I use so I can have them for my other programs.  In the end, it will all be pretty much the same - just a matter of how much work it takes to get there...  Thanks for the link!
0 Kudos
Reply

2,284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by FlySnake on Thu Nov 03 00:09:08 MST 2011

Quote: SrWalterR
[COLOR=#5174a3]hzrnbgy[/COLOR]  I have just spent the better part of the day researching the best way to implement a flash write/read on an LPC1768 using the LPCExpresso IDE.  Unlike with mbed, it seems you are pretty much on your own. If you read AN1008.pdf it gives some good information and I am starting from there. Have a great day.:)


Is there any difference between mbed and lpcxpresso regards to IAP? As far as I know this is pure internal functionality not dependent of peripheral.
I used this example for mbed http://mbed.org/users/okano/programs/IAP_internal_flash_write/5ypjo as a start point of developing app in lpcxpresso
0 Kudos
Reply

2,284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by SrWalterR on Wed Nov 02 18:47:43 MST 2011
To allocate space for the IAP commands
     http://support.code-red-tech.com/CodeRedWiki/ReserveIAPRam
Another very useful ap note
    AN11071
0 Kudos
Reply

2,284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by SrWalterR on Wed Nov 02 15:06:58 MST 2011
[COLOR=#5174a3]hzrnbgy[/COLOR]  I have just spent the better part of the day researching the best way to implement a flash write/read on an LPC1768 using the LPCExpresso IDE.  Unlike with mbed, it seems you are pretty much on your own. If you read AN1008.pdf it gives some good information and I am starting from there. Have a great day.:)
0 Kudos
Reply

2,284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Wed Nov 02 13:58:06 MST 2011
You *can* write to the internal flash. It is known as IAP and is described in the User Manual. There are also many posting here about it - just search for IAP [Note - use the Sticky thread at the top of the forum for searching and not the forum search, which requires a minimum of 4 characters!]
0 Kudos
Reply

2,284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by SrWalterR on Wed Nov 02 13:21:13 MST 2011
Wow, now I am really confused.  I know the data sheet says you can use flash and it is a very convienent way to store calibration and other data.  I may be forced back to mbed.:mad:
0 Kudos
Reply

2,284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hzrnbgy on Wed Nov 02 12:50:14 MST 2011
the mbed has a built in stand alone flash memory next to the LPC1768 which makes it easy to write to "flash"

Im not sure if you can write to flash directly from your LPC1768 application to your LPCs flash/code memory space
0 Kudos
Reply