Hello,
I am using the fsl_iap.h driver to write internal flash. I'm pretty much using the example code that comes with the SDK for the MCU. The problem is that the IAP calls are returning a success status code, but the task did nothing. It does not erase or write to flash. I'm using the memory viewer to what address 0x8000. It does not erase to all 0xFF and it does not write new data to it.
Below is the code.
Inputs to PTI_FLASH_BlockWrite are as follows in my test code that is not erase or writing.
Start = 0x8000
pSrc = 0x200097ac which points to a 32kbyte RAM buffer.
Notes:
ECRP register is 0x00000000 and I have not touched OTP. MCU Core is running at 180MHz = systemCoreClock
Solved! Go to Solution.
Hello Matt,
I've not been able to detect anything in the code you have provided that might be the reason why it is not working. You are using the functions provided in the driver and the steps taken should be ok. However, the code you have provided is just the block that executes the erase and write I am not able to see if you have in fact initialized the clocks correctly. If you could share a simple example project and attach it to your next post I would appreciate it so I can check it with detail.
Also, could you attempt yo do a mass erase prior to debugging, to check and see if the space in memory does read as FF or it still reads as zeros.
Let me know your results.
Sabina
Hello,
This is on custom hardware. I am not running an example code, bud I did copy paste the above code from the lpcxpresso54608_iap_flash SDK example from SDK 2.7.0.
The MCUXpresso example works on the dev board OM13092 LPCXpresso54608. I can not run the MCUXpresso example on my hardware.
My code does not work on the OM13092 dev board either. So I think it may be a peripheral setting issue like a clock or IAP setting.
I am using SEGGER Embedded Studio. I put the example code in my project and nothing seems to write to flash.
Below is some simpler code to help debug the issue. I also attached a GIF of me stepping through the debugger. You can see the 0x8000 memory view and the local variables. You can see the status returned is 0x00 and the 0x8000 memory is never changes.
Below is an image of address 0x00 of my application binary. So you can see ECRP values.
Hello Matt,
I've not been able to detect anything in the code you have provided that might be the reason why it is not working. You are using the functions provided in the driver and the steps taken should be ok. However, the code you have provided is just the block that executes the erase and write I am not able to see if you have in fact initialized the clocks correctly. If you could share a simple example project and attach it to your next post I would appreciate it so I can check it with detail.
Also, could you attempt yo do a mass erase prior to debugging, to check and see if the space in memory does read as FF or it still reads as zeros.
Let me know your results.
Sabina
I took your idea to confirm that the memory viewer does read 0xFF and you were right. Turns out the code was working fine, but the memory viewer is not updating for some reason. I read the flash region after erase into a RAM buffer and it all reads FF and after I program the flash it reads with the correct data.
It was an IDE issue.
I'm glad that you resolved the issue.If you would like to use another IDE I recommend MCUXPresso, this also has a user friendly memory viewer. If you have any questions on that IDE please don't hesitate to let me know.
Have a good week!
Hello Matt,
Hope you are doing well.
First in order for me to understand the environment that they are working with. Could you please have them confirm if you are working on a custom board or an evaluation board,SDK and IDE version.Also are you basing your code on an example, so that I may try to reproduce this behavior from my end.
Best Regards,
Sabina
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------