2016-08-09 04:09 AM
Hi,
I want to implement read/write functions as well as write protection for EEPROM memory in Nucleo STM32L031K6. From STM examples, I see that: - For Flash memory, the write protection can be set using OptionsBytes: e.g OB_WRP_Pages0to31, OB_WRP_Pages32to63. Each of thess OB_WRP_Pages correspond to a specified Section.- However for Data EEPROM, there is no such a ''Section''. So my question is: Is it possible to configure Data EEPROM to be write protected ? And if it is, then how to do that (and example code would be great) ? Thanks Bien
#stm32l031 #eeprom #flash
2016-08-30 08:38 AM
Hi,
As mentioned in the : - The user can protect part of the NVM (Flash program memory, data EEPROM and Option bytes areas) - In the Flash program memory, it is possible to add another write protection with the sector granularity. When PcROP is disabled (WPRMODE = 0), the bits of WRPROT are used to enable the write protection on the sectors. For more details, you can refer to this manual , in section 3 Flash program memory and data EEPROM (FLASH) and in section 3.4 Memory protection.You can have a look to this example under 0, which describes how to configure and use the Flash to enable and disable the write protection of the internal FLASH memory:STM32Cube_FW_L0_V1.7.0\Projects\STM32L031K6-Nucleo\Examples\FLASH\FLASH_WriteProtectionYou can inspire from this example to achieve your goal and modify it or add your own code.Regards