2025-06-26 12:16 AM
I am very new to this field !! So last I had posted regarding the interfacing of DCMI and I got relevent doucuments which where not enough for me to understand the DCMI module. So could you please send relevant videos of interfacing DCMI module step by step.
2025-07-01 3:19 AM
Hello @nishanth;
You can find in AN5020 "Introduction to digital camera interface (DCMI) for STM32 MCUs - Application note" and precisely in DCMI application examples section a step-by-step implementation examples.
Also, I recommend you to look at this video STM32H7 OLT - 55. Peripheral Digital Camera Interface DCMI may help you to understand the DCMI features.
Also, you can check the reference manual section 38 Digital camera interface (DCMI).
Thank you.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-07-24 6:08 AM - edited 2025-07-24 6:11 AM
Hi,
Use DCMIPP, for DCMIPP you dont need to enable DMA, DCMIPP is much better, and besides - DMA for DCMI do not work because of bug's, don't forget to add HAL_DCMIPP_MspInit routine, cubeMX do not generate and without CLK, IRQ and pinout you will get errors and DCMIPP will not work, adjust by you hw.
/* USER CODE BEGIN 4 */
void HAL_DCMIPP_MspInit(DCMIPP_HandleTypeDef *hdcmipp) {
GPIO_InitTypeDef GPIO_InitStruct = { 0 };
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };
//if (hdcmi->Instance == DCMIPP) {
__HAL_RCC_DCMIPP_CLK_ENABLE();
__HAL_RCC_DCMIPP_FORCE_RESET();
__HAL_RCC_DCMIPP_RELEASE_RESET();
HAL_NVIC_SetPriority(DCMIPP_IRQn, 3, 0);
HAL_NVIC_EnableIRQ(DCMIPP_IRQn);
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_DCMIPP;
PeriphClkInitStruct.DcmippClockSelection = RCC_DCMIPPCLKSOURCE_IC17;
PeriphClkInitStruct.ICSelection[RCC_IC17].ClockSelection = RCC_ICCLKSOURCE_PLL3;
PeriphClkInitStruct.ICSelection[RCC_IC17].ClockDivider = 4;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
Error_Handler();
}
__HAL_RCC_GPIOF_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOG_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPION_CLK_ENABLE();
/**DCMI GPIO Configuration
PF1 ------> DCMI_D7
PA1 ------> DCMI_D0
PG3 ------> DCMI_HSYNC
PG15 ------> DCMI_D4
PA10 ------> DCMI_D1
PG1 ------> DCMI_PIXCLK
PG10 ------> DCMI_D2
PG2 ------> DCMI_D6
PB4(NJTRST) ------> DCMI_VSYNC
PN9 ------> DCMI_D5
PA4 ------> DCMI_D3
*/
GPIO_InitStruct.Pin = GPIO_PIN_1;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF9_DCMIPP;
HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_1 | GPIO_PIN_10 | GPIO_PIN_4;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF9_DCMIPP;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_3 | GPIO_PIN_15 | GPIO_PIN_1 | GPIO_PIN_10 | GPIO_PIN_2;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF9_DCMIPP;
HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_4;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF9_DCMIPP;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_9;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF10_DCMIPP;
HAL_GPIO_Init(GPION, &GPIO_InitStruct);
}