Question
STM32L Flash HalfPageProgram problem
Posted on April 18, 2015 at 23:00
Hi,
I am not able to program the flash of a STM32L151RC using ''half page'' programming.Normal programming (word by word) works fine.I have tried it using the 2 latest GCC compilers (4.8.4), and I have tried with the 2 latest HAL drivers (1.1.0 and 1.1.1).The code below stops working when the 32 words are being written to flash. The debugger stops working. When running the code without a debugges, it also doesn't work.Am I the only one with this observation?Best regardsMartinHAL_FLASH_Unlock();__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_WRPERR);__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_PGAERR);__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_SIZERR);__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR);__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERRUSR);__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_RDERR);uint32 data[32] = { 0 };if (HAL_FLASHEx_HalfPageProgram(0x08004000, data) == HAL_OK){// Success}else{// Error} #stm32l-hal-driver-flash-write #iap-flash-half-page-program