2022-11-06 03:31 AM
I found the following bug:
STM32CubeMX generates the following initialization code:
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_DCMI_Init();
MX_I2C1_Init();
MX_I2C2_Init();
MX_UART5_Init();
MX_USART1_UART_Init();
MX_DMA_Init();
MX_USB_DEVICE_Init();
The problem is that MX_DCMI_Init() is also initializing the corresponding DMA. But the DMA clock is not enabled yet! It will be enabled by MX_DMA_Init().
The result is that the DMA for the DCMI is not correctly initialized and the code does not work.
When I enable the clock just before the initialization it works:
/* USER CODE BEGIN SysInit */
__HAL_RCC_DMA2_CLK_ENABLE();
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_DCMI_Init();
MX_I2C1_Init();
MX_I2C2_Init();
MX_UART5_Init();
MX_USART1_UART_Init();
MX_DMA_Init();
MX_USB_DEVICE_Init();
Solved! Go to Solution.
2022-11-06 03:55 AM
This is a cca 3 years old issue.
JW
2022-11-06 03:55 AM
2022-11-06 12:15 PM
This is a relatively nice and reliable workaround for that never-ending CubeMX idiocracy.