I use STM43L476 and try to use fast flash program to program 256 bytes (decripted_firmware_data buffer).
The flash area is erased (all 0xFF), but the function HAL_FLASH_Program always returns with HAL_ERROR and no single bte is programmed.
My system clock is 80MHz.
address = 0x0800A000;
if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_FAST_AND_LAST, address, (uint32_t)&decripted_firmware_data) != HAL_OK)
/* Lock the Flash to disable the flash control register access (recommended
to protect the FLASH memory against possible unwanted operation) *********/