AnsweredAssumed Answered

HAL_FLASH_Program returns with error

Question asked by Clonimus74 on Jan 25, 2018
Latest reply on Jan 30, 2018 by Clonimus74

Hi,

 

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.

 

Any ideas?

 

address = 0x0800A000;

HAL_FLASH_Unlock();
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_ALL_ERRORS);

if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_FAST_AND_LAST, address, (uint32_t)&decripted_firmware_data[0]) != HAL_OK)
{
/* Lock the Flash to disable the flash control register access (recommended
to protect the FLASH memory against possible unwanted operation) *********/
HAL_FLASH_Lock();
return eFAIL;
}

 

Thank you

Outcomes