Hi,
I am using LPC11u37 Xpresso board, My question is how to write a array of data into Flash memory and read the data from the Flash memory .Is there any API or any sample code available. Can anyone help me in this regards?
Thanks!
Hi Victor,
Could you tell me, do you just want to define a array of data, like the constant data to the flash defined address? Or you still want to write and erase it?
If you just want to define a constant data array, it's very easy, you just need to define it directly, but the detail method is different with the IDE.
Please tell me what the IDE you are using, now, take IAR as an example, if define the data in the defined address 0x1000, you can define it like this :
|
If you are using MDK, you can use it like this:
const char __DATA_config[] __attribute__((at(0x1000))) ={…}
Buf if you want to write the flash and erase it, you refer to my attached application note.
Wish it helps you!
If you still have question about it, please kindly let me know.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kerry,
Thanks for your reply!
I use Keil IDE and I just want to write some datas(such as an 64-bytes array) to the on-chip flash. Also I find some APIs as below, but i don't know how to do with that.
.....
Can you give me some examples? Thanks.
Hi Victor,
Do you want to also to modify these 64-bytes array in your app code?
If you don't want to modify it, you can just define the constant code, you even don't need to define the specific flash address. But if you want to write these byte to the flash in your app code, you need to use the IAP code to write it.
About the according API usage, you totally can refer to application code which I give you, in that code, there has the samples for your reference.
Wish it helps you!
If you still have question about it, please kindly let me know.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------