Skip to main content
Arno1
Senior
February 26, 2020
Solved

Should SFU_LL_Flash_Write be aligned to 64 or 32 bit?

  • February 26, 2020
  • 1 reply
  • 697 views

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

This topic has been closed for replies.
Best answer by Jocelyn RICARD

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

1 reply

Jocelyn RICARD
Jocelyn RICARDBest answer
ST Employee
February 26, 2020

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