cancel
Showing results for 
Search instead for 
Did you mean: 

Using Zephyr, enabling and using STM32F412 CRC peripheral

sbend
Associate II

Hi,

I am trying to initialize and use the internal CRC peripheral in the STM32F412 MCU. My application is based on Zephyr RTOS, using the STM32 HAL.

My application defines the CONFIG_USE_STM32_HAL_CRC, so the stm32f4xx_hal_crc.c is included in the build.

The application builds and links just fine, and I can call the HAL_CRC_Init, HAL_CRC_GetState and HAL_CRC_Calculate without any problems.

Only problem is the calculation is 0 for my 4 test bytes (0x01, 0x02, 0x03, 0x04).

 

Debugging through the code, it does set the "hcrc->Instance->DR" in stm32f4xx_hal_crc.c

Are there any additional settings I need to include? Maybe clock configurations?

1 ACCEPTED SOLUTION

Accepted Solutions

If registers be zero, check you've enabled the peripheral clock before use, either in main.c or your stm32f4xx_hal_msp.c

/* CRC Peripheral clock enable */

__HAL_RCC_CRC_CLK_ENABLE();

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2

If registers be zero, check you've enabled the peripheral clock before use, either in main.c or your stm32f4xx_hal_msp.c

/* CRC Peripheral clock enable */

__HAL_RCC_CRC_CLK_ENABLE();

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sbend
Associate II

Thank you! That solved the issue.