STM32F777BIT6 OTP data reprogramming question?
Hi,
It says on page 107 of stm32f777bit6 manual that:
"Each OTP data block can be programmed until the value 0x00 is programmed in the corresponding OTP lock byte."
I understand that OTP is supposed to be one time programmable but the above statement seems to imply that I can reprogram the OTP data until I write 0x00 in the lock byte.
I haven't programmed the lock byte but I cannot reprogram the OTP. I used these commands:
HAL_FLASH_Unlock();
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_WRPERR);
HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, 0x1FF0F3A0, 0x55555555);
HAL_FLASH_Lock();
It worked the first time but if I change 0x55555555 it doesn't write the new value.
So what's the problem? And if the OTP is only one time programmable then why create a separate lock-byte if you can't reprogram it anyway?
Thanks