AnsweredAssumed Answered

OTP Flash using STM32F4CUBE HAL Flash driver and Keil

Question asked by cobler.ken on Jun 24, 2014
Latest reply on Jun 24, 2014 by cobler.ken
I am not having great success using the HAL Flash driver to flash OTP on the STM32439I-EVAL board. I have used the example FLASH_Erase (under examples). I am using Keil MDK.

I have added the line (around line number 126):
 HAL_FLASH_Program(TYPEPROGRAM_WORD, (uint32_t) 0x1FFF7800, 1);

This is being performed right before the programming the user flash area.

I thought that as long as I left the OTP locks to 0xFF, I could flash the OTP as much as I want. The OTP locks are 0xFF.

However, using the HAL driver, I can get 1 flash and then the OTP word cannot be flashed again. In fact, after using the HAL driver to flash the OTP, the memory location using the STM32 ST-Link GUI Utility is not able to update the OTP memory location (error writing is displayed).

Note: I can use the STM32 ST-Link GUI Utility to write into OTP memory as many times as I want. It's just not working with OTP memory touched by the HAL driver in the CUBE.

Any help?

Ken Cobler