cancel
Showing results for 
Search instead for 
Did you mean: 

N6 DCMIPP CSI-2 Camera Struggles

rphii
Associate II

Hi everyone,

I have a N6 Discovery Kit with a camera. Additionally, I have an N6 Nucleo Board. Now I want to use the CubeMX and CubeIDE to capture a frame on the Nucleo with the camera. I copied most of the things from the `DCMIPP_ContinuousMode` example but I still can't get it working...

 

 

If anyone has more experience with the DCMIPP and CSI-2 (which is both new to me) and could help, it'd be greatly appreciated, thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi, thank you very much. I finally figured out what the issue was. There were three crucial:

  1. Your suggestion regarding the clocks.
  2. Enable AXISRAM3 and AXISRAM4 (BUFFER_ADDRESS is AXISRAM3)
  3. When I was launching the Application code in debug, using the xxx_LRUN.ld, since FSBL gets skipped, the SystemClock_Config also gets skipped (doesn't get generated into the Application)

 

I am not sure if the changes I made in the RIF also played a role... Anyways, if I get to it, I'll update the repository.

View solution in original post

2 REPLIES 2
pawatJoy
Associate III

Hello rhpii

from my experience your CSI clock is too high, causing the camera pipeline to fail initialization or frame capture.

Based on your example and the code reference you provided, the root cause is indeed likely the CSI clock configuration. The camera sensor (e.g., IMX335) typically expects a CSI clock in the range of 10–30 MHz, but your current setup is feeding it 1600 MHz (from PLL4 Div by 1), which is far beyond the sensor's tolerance. Maybe you should Update your clk configuration in HAL_DCMIPP_MspInit function in stm32n6xx_hal_msp.c

 PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_DCMIPP;
	  	PeriphClkInitStruct.DcmippClockSelection = RCC_DCMIPPCLKSOURCE_IC17;
	  	PeriphClkInitStruct.ICSelection[RCC_IC17].ClockSelection = RCC_ICCLKSOURCE_PLL4;
	  	PeriphClkInitStruct.ICSelection[RCC_IC17].ClockDivider = 8;
	  	if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
	  	{
	  	Error_Handler();
	  	}

	  	PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CSI;
	  	PeriphClkInitStruct.ICSelection[RCC_IC18].ClockSelection = RCC_ICCLKSOURCE_PLL4;
	  	PeriphClkInitStruct.ICSelection[RCC_IC18].ClockDivider =80;
	  	if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
	  	{
	  	Error_Handler();
	  	}

 

i hope this help

Hi, thank you very much. I finally figured out what the issue was. There were three crucial:

  1. Your suggestion regarding the clocks.
  2. Enable AXISRAM3 and AXISRAM4 (BUFFER_ADDRESS is AXISRAM3)
  3. When I was launching the Application code in debug, using the xxx_LRUN.ld, since FSBL gets skipped, the SystemClock_Config also gets skipped (doesn't get generated into the Application)

 

I am not sure if the changes I made in the RIF also played a role... Anyways, if I get to it, I'll update the repository.