cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-N657X0-Q Nucleo board with STEVAL-55G1MBI1

gmali9
Associate

I am using the above 2 EVAL boards from ST. I am trying to get the video pipeline going to the point that I do receive the images in memory and the appropriate frame based interrupts are triggered to verify. I have tooled my code for minimal application and it fails. I have started with ST provided x-cube-n6-ai-h264-usb-uvc reference and am using the STM32Cube_FW_N6_V1.3.0 SDK provided. I am using the STMCubeIDE for development.

From the terse documentation/information it seems that the 2 EVALs procured should be compatible. However, as mentioned in the other post: https://community.st.com/t5/stm32-mcus-boards-and-hardware/stm32n6-fpc-camera/m-p/755889 , I have found the hard way that the sensor MIPI lane polarities are flipped. i.e. Dx_P and Dx_N from the sensor to the Nucleo Eval.

Q1. I have looked through the documentation and have no indication of the MIPI PHY being able to be configured to flip the polarities on the signals. Is this true?

Anyways, I have managed to flip the polarities of the CLK and the D0 by removing the protection diodes U19 and U13 and jumpers from the CN6. NO the signal integrity is not compromised. I have done this on much higher bitrate per lane successfully.

Q2. Interrupts in the correct context/firmware: How do I know if the project that I have is Secure or Non-Secure? Also, are the IRQs fired in the FSBL part or should they be available in the AppS context? i.e. dcmipp_irq and csi_irq? I have also tried the every line interrupt ret = HAL_DCMIPP_PIPE_EnableLineEvent(hdcmipp, DCMIPP_PIPE1, DCMIPP_MULTILINE_128_LINES); by commenting out ret = HAL_DCMIPP_PIPE_DisableLineEvent(hdcmipp, DCMIPP_PIPE1); in the DCMIPP_ReduceSpurious. No luck!

Setup and troubleshooting performed:

1. Camera is setup for 640 x 480 resolution @ 15FPS and perform  CAM_Init(); followed by CAM_DisplayPipe_Start(g_frame, CMW_MODE_CONTINUOUS). Simple!

 

2. I have forced the interrupts to make sure the wiring is correct by forcing the interrupts using  NVIC_SetPendingIRQ(DCMIPP_IRQn); and NVIC_SetPendingIRQ(CSI_IRQn); and they do increment.

3. I have verified that the Camera is configured by scoping the MIPI electrical signals, I confirm that the resolution and FPS match my settings and is present at the output of the U19 and U13 with the jumper shorts.

4. I have tweaked all possible settings I am aware of, to see if it makes a difference as the Sensor is a single lane MIPI and outputs on D1 that goes into the D0 of the STM32. The settings I have tried to play with unsuccessfully are: 

a. lane swapping using 

csi_conf.NumberOfLanes = DCMIPP_CSI_ONE_DATA_LANE/DCMIPP_CSI_TWO_DATA_LANES // just to make sure that the lane D1 from sensor into D0 of STM32 does not make a difference. I am sure the STM32 getting data at D0 should be good enough. 
csi_conf.DataLaneMapping = DCMIPP_CSI_PHYSICAL_DATA_LANES/DCMIPP_CSI_INVERTED_DATA_LANES
csi_conf.PHYBitrate = DCMIPP_CSI_PHY_BT_800/DCMIPP_CSI_PHY_BT_1600 // this one is ridiculous as I never reach more than 40Mbps with raw8 at 15 FPS.

b. Raw8/10 in app.h

#define CAPTURE_FORMAT DCMIPP_PIXEL_PACKER_FORMAT_MONO_Y8_G8_1 // is this for encoder only? or for MIPI rcv too?

c. BPP 1/2/3/4 Although I think the RAW8 means 1 should be good. It is a monochrome sensor and I don't care about image quality right now.

#define CAPTURE_BPP 2

 

d. Virtual channels 0/1/2/3

uint32_t vc = 0; //1/2/3

ret = HAL_DCMIPP_CSI_SetVCConfig(&hcamera_dcmipp, vc, DCMIPP_CSI_DT_BPP8);

e.

#define USE_HAL_DCMI_REGISTER_CALLBACKS 1U /* DCMI register callback disabled */

#define USE_HAL_DCMIPP_REGISTER_CALLBACKS 1U /* DCMIPP register callback disabled */

 

f. the clock configuration is skipped as the FSBL is responsible for configuring most clocks so in cmw_camera.c

__weak HAL_StatusTypeDef MX_DCMIPP_ClockConfig(DCMIPP_HandleTypeDef *hdcmipp)

{

UNUSED(hdcmipp);

 

return HAL_OK;

}

Q3. The sensor gets written with I2C writes at initialization, where do I see what actually is written? i.e. configuration to verify? When calling the CAM_Init() and the CAM_DisplayPipe_Start(), I am assuming the former configures the sensor and the latter the video pipeline/MIPI front end. Is this assumption correct?

Conclusion: With the above steps it is obvious that No interrupt source is being generated (CSI not decoding / DCMIPP not receiving), or Interrupt sources are generated but masked inside DCMIPP/CSI (line-event test helps detect that). Please advise what is missing!

 

1 REPLY 1
Jean_Poire
ST Employee

Hi @gmali9 ,

 

Here are some pieces of answer to your questions.

 

Q1: You can switch clock and data lanes polarity by setting OIF_CTRL register of your sensor (cf p182 of um3224)

Q2: Sorry I can't help you much on this question, as the sensor seems to be running fine, I advise you to post your question in a more stm32 mcu related forum. 

Q3: vd55g1 requires firmware patch to work. This is basically what is written via I2C during initialization. The configuration is written after initialization when you start the sensor -> VD55G1_Setup() called by VD55G1_Start()

I hope my answer will help you solve your issue.

Best regards,

Jean