In STM32F407VET6 board we can calculate CRC-32/MPEG-2 using following steps:
1. Enable CRC engine at Pinout & Configuration> Computing> CRC mode and Configuration should be activated
2. Save project and generate the project
3. Define data buffer on which we wants to calculate CRC
uint32_t crcArray[4] = {0x00001111, 0x00002222, 0x00003333, 0x00004444};
4. Function call for crc needs to be called in main function as:
crcVal = HAL_CRC_Calculate(&hcrc, crcArray, 4);
Where, uint32 of CRC will be returned.
5. After running the code we will get CRC as shown below:
6. Verify CRC using Online calculator
CRC value calculated on STM32 and online calculator are matching.
No comments:
Post a Comment