AnsweredAssumed Answered

STM32CubeMX Project fails to enable CRC clock

Question asked by hersey.stephen.001 on Dec 21, 2015
Latest reply on Dec 22, 2015 by obid.matic
I'm building a test program under STM32CubeMX 4.12.0 (with latest peripheral libraries as of 12/21/15) that uses the STM32F207's CRC peripheral, and I have discovered that the autogenerated code isn't enabling the CRC peripheral's clock. The CRC peripheral is listed as "Activated" in the Configuration pane, and the stm32f2xx_hal_conf.h header file contains uncommented "#define HAL_CRC_MODULE_ENABLED" as it should, BUT: the debugger shows the CRC clock not enabled in the RCC registers.

To make the peripheral operate, I needed to insert "__HAL_RCC_CRC_CLK_ENABLE()" into one of the user code blocks in main.c. I rather think that the code generator ought to be putting this into MX_CRC_Init(), as that's more or less what the initializer is for. Of course, if I insert the call there manually, the next autogeneration of code will nuke it. Looks like a bug to me.