Hi there,
I'm trying to protect some factory configuration in my flash memory. I thought that I could protect the flash memory from being written (when this is done using the function LPC55S0XFLASH_Program or LPC55S0XFLASH_Erase).
When I configure the MPUs it seems that these functions don't trigger an exception or a hardware fault of any kind as I would expect and as it happened when I try to write in those areas by standard write operations.
Can you confirm that this is how it should happend and/or provide an alternative?
Hello, my name is Pavel, and I will be supporting your case, what kind of part are you using? is this have an S on the making number? example LPC55s69, if yes, the other alternatives that I recommend is using a signed image.
If you want to know more about this there are some apps note that could help you to setup.
The other way is modifying the CPMA and CFPA using the Flash API or using the tool Blhost through PC Host serial interface.
Best regards,
Pavel
Hello Pavel,
we are using LPC5504 and LPC55S04. I'm not sure I understand your comment. How using a signed image can help protect certain data areas from flash?
How can I protect a memory section using CPMA and CFPA?
Hello, I recommend see this links could clear more about the differences of this LPC´s.
[LPC55]: Disable ISP and SWD to utilize code protection - NXP Community
Best regards,
Pavel
Hi Pavel,
thank you for your explanation and the documentation.
The problem with this platform is that what I need is to protect a section of the flash with a system as flexible as MPU. MPUs as I understand does protect against common write operation (like assigning a pointer to that area and then writing in that mem section through the pointer) but not via flash functions APIs.
This memory section which I need to protect can be modified during the product life cycle but only in a controlled way. If it is written by mistake it would end up in a non working product.
As I understood, if we need to protect some flash section against flash functions api the only way is to use PFR which would prevent it from being modified during the product life cycle (PFR is locked after boot) which is not what I'd need.
So, my preferred approach (assumming that I processed all the information right) would be to create a wrapper for the flash API functions which checks the MPU configuration before flash write usage operations and modify only non protected pages.
Hello, I recommend review the app note of secure boot on that mentioned different security boot process to protect the MCU.
Best regards,
Pavel