STM32H743 Flash compute Crc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-11 7:52 AM
Hi people,
I'm trying to use the flash crc but is not working as expected. If I pass the end address with offset 3 or 7 the result of crc calc will be always the same, 0xba4bbbf0. What the problem here?
FLASH_CRCInitTypeDef flash_crc_init = {
.TypeCRC = FLASH_CRC_ADDR,
.BurstSize = FLASH_CRC_BURST_SIZE_4,
.Bank = FLASH_BANK_2,
.Sector = FLASH_SECTOR_0,
.NbSectors = 1,
.CRCStartAddr = FLASH_BANK2_BASE,
.CRCEndAddr = FLASH_BANK2_BASE + 7
};
uint32_t flash_crc_result = 0;
if(HAL_FLASHEx_Unlock_Bank2() == HAL_OK)
{
HAL_StatusTypeDef hal_status = HAL_FLASHEx_ComputeCRC(&flash_crc_init, flash_crc_result);
}
The address has this values:
Solved! Go to Solution.
- Labels:
-
STM32Cube MCU Packages
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-11 8:25 AM
The data must be aligned to chunks of the 4x flash word size (or whatever you have selected as the burst size). In this case, it must be aligned to 128-bytes. The minimum size is therefore 128 bytes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-11 8:25 AM
The data must be aligned to chunks of the 4x flash word size (or whatever you have selected as the burst size). In this case, it must be aligned to 128-bytes. The minimum size is therefore 128 bytes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-11 8:27 AM
Hello,
You forgot & before flash_crc_result in the HAL_FLASHEx_ComputeCRC() input parameter:
HAL_StatusTypeDef hal_status = HAL_FLASHEx_ComputeCRC(&flash_crc_init, &flash_crc_result);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-11 9:08 AM
That's correct, this document said the same
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-11 9:13 AM
I'm sorry, on my local code is corretc
