2016-04-10 12:13 AM
Hi all
I'm setting the read out protection to level 1 , in the beginning of my main() fxnAfter setting RDP I generate system reset using HAL_NVIC_SystemReset() fxnAfter the reset I'd expect the RDP to be set to level 1 but it's notonly a hard reset enables the RDP.FLASH_OBProgramInitTypeDef pOBInit;HAL_FLASH_OB_Unlock();HAL_FLASHEx_OBGetConfig(&pOBInit);if (pOBInit.RDPLevel != OB_RDP_LEVEL_1){ pOBInit.RDPLevel = OB_RDP_LEVEL_1; HAL_FLASHEx_OBProgram(&pOBInit); HAL_FLASH_OB_Lock(); Delay1ms(10000); HAL_NVIC_SystemReset();} #stm32l0 #rdp2016-04-12 09:28 AM
Hello Wizz,
Did you used the ST-Link to check the protection level? I think that you have to add unlocking/locking of the Flash in order to enable/disable the flash control register access with: HAL_FLASH_Unlock() / HAL_FLASH_Lock() -ForumSTM32-2016-04-12 10:08 AM
I'd agree the flash needs to be unlocked, before options. It has been my general experience that RDP needs a power-cycle.
2016-04-13 06:05 AM
Hi,
I've added the HAL_FLASH_Unlock & Lock still only power off/on cycle enforces RDP