cancel
Showing results for 
Search instead for 
Did you mean: 

Should SFU_LL_Flash_Write be aligned to 64 or 32 bit?

Arno1
Senior

In the code it says the following:

/**
  * @brief  This function writes a data buffer in flash (data are 32-bit aligned).
  * @note   After writing data buffer, the flash content is checked.
  * @param  pFlashStatus: FLASH_StatusTypeDef
  * @param  pDestination: Start address for target location
  * @param  pSource: pointer on buffer with data to write
  * @param  Length: number of bytes (it has to be 64-bit aligned).
  * @retval SFU_ErrorStatus SFU_SUCCESS if successful, SFU_ERROR otherwise.
  */
SFU_ErrorStatus SFU_LL_FLASH_Write(SFU_FLASH_StatusTypeDef *pFlashStatus, void  *pDestination, const void *pSource, uint32_t Length)
{
...
}

The brief says 32-bit aligned and the length parameter says 64-bit aligned so which one is it? I thought I read it is either 32 or 64 depending on platform, based on sizeof of SFU_LL_FLASH_write_t.

Thanks,

Arno

1 ACCEPTED SOLUTION

Accepted Solutions
Jocelyn RICARD
ST Employee

Hello Arno,

yes the brief is misleading.

The actual alignment depends on the sizeof SFU_LL_FLASH_write_t for target platform.

Best regards

Jocelyn

View solution in original post

1 REPLY 1
Jocelyn RICARD
ST Employee

Hello Arno,

yes the brief is misleading.

The actual alignment depends on the sizeof SFU_LL_FLASH_write_t for target platform.

Best regards

Jocelyn