HAL CRC Overview ¶
Introducing CRC ¶
- group CRC_Introduction
-
The CRC hardware abstraction layer provides a set of APIs to configure and control the CRC peripheral on STM32 microcontrollers.
The CRC (Cyclic Redundancy Check) calculation unit is used to compute a CRC code from 8-, 16-, or 32-bit data words and a generator polynomial.
Among other applications, CRC-based techniques are used to verify data transmission or storage integrity. Within the scope of functional safety standards, they offer a means of verifying flash memory integrity.
The CRC calculation unit helps compute a software signature at runtime, to be compared with a reference signature generated at link time and stored at a given memory location.
Module and files ¶
The following diagram illustrates the CRC module and its associated files.
Component diagram ¶
The following diagram illustrates the software components involved in the CRC module. It shows the interactions between the user application, HAL drivers, low-level drivers, and the hardware components.
Configuration table ¶
The following table lists the configuration defines for the HAL CRC module, specifying their locations, default values, and descriptions:
- group CRC_Configuration_Table
-
¶
Configuration inside the CRC driver ¶
Config defines
Description
Default value
Note
PRODUCT
from IDE
NA
Example: STM32C5XX
USE_ASSERT_DBG_PARAM
from IDE
NA
Enable parameter asserts
USE_ASSERT_DBG_STATE
from IDE
NA
Enable state asserts
USE_HAL_CHECK_PARAM
from stm32c5xx_hal_conf.h
0
Runtime parameter check
USE_HAL_CRC_MODULE
from stm32c5xx_hal_conf.h
1
Enable the HAL CRC module
USE_HAL_CRC_CLK_ENABLE_MODEL
from stm32c5xx_hal_conf.h
HAL_CLK_ENABLE_PERIPH_ONLY
Enable HAL_CRC_CLK
USE_HAL_CRC_USER_DATA
from stm32c5xx_hal_conf.h
0
Allow user data usage