Hello all,
I have a problem when i try to erase Flash memory of LPC802M001J (currently I use the LPCXpresso802 board OM40000 Rev A)
My step are these (with SWD protocol):
1-> I Read the SYSMEMREMAP register and i found the value 0x02.
2-> I write into the same register the value 0x02.
3-> I send a Kernel into Ram at position 0x10000000. This Kernel is built with MCUXpresso IDE.
4-> I send the IAP command from my driver to uKernel. Into Kernel I send the IAP command to the ROM and then I await the response of the IAP.
5-> When I send the IAP command for Read Part ID, Read UID or Read Boot Code Version, all works well. So IAP responds correctly. The same for Blankcheck command.
Problem:
When I send the Erase Sector command (command code 53), IAP responds with OK (obviously before this command I prepare the sectors for erase with command 50).
But after that command the Flash memory is not blank, only some bits are brought to the blank state.
After Erase:
Any help is appreciated.
Thanks.
Solved! Go to Solution.
Hello MOreno,
Just want to know have you test the IAP_test demo on your board? Dose the Erase function works well?
I test it on my side, it can work well, I change some code, erase the sector 14 page 7 (ox39c0):
Before erase:
After:
You can use the erase driver in this demo, if still can't work, please send your project to me.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hello moreno ortolan,
As Johan mentioned, command code 52 is erase .
How about your code? I recommend you first test the demo code:
LPCXpresso802 board for LPC802 Microcontroller (MCU) | NXP
After download , you can find "IAP_test" demo, it includes erase function.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hello Alice,
thanks for your answer and the links you provided.
In my algorithm I use the erase sector command correctly, i.e. command 52.
In the question of this post I was wrong to copy-paste from the manual the value of the command.
I looked at the code present in that link, I need to configure something inside the device during the init phase before using IAP commands?
Because in my code the IAP responds correctly to the erase command, even if it doesn't perform the procedure correctly.
Could it be a problem related to the internal clock of the device?
Thanks
Hello MOreno,
Just want to know have you test the IAP_test demo on your board? Dose the Erase function works well?
I test it on my side, it can work well, I change some code, erase the sector 14 page 7 (ox39c0):
Before erase:
After:
You can use the erase driver in this demo, if still can't work, please send your project to me.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hello Moreno!
Just too verify, did you mean command code 52 for the erase? As near as I can tell command code 53 is the blank-check function, though given that some erasure took place this is presumably not the root case.
Regards,
Johan