cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure propertly the camera on the STM32F736 discovery?

BTurc.2
Senior

I'm using the STM32F746 discovery board and I'm trying to display the images captured by the camera. The problem is that only one frame is displayed on the LCD display. The camera don't send more captures I think.

Code of the DCMI setup:

1.- Fist I setup the DCMI peripheral using the CubeMX wizand integrated in the STM23CubeIDE and the output of the wizard is:

static void MX_DCMI_Init(void)

{

 hdcmi.Instance = DCMI;

 hdcmi.Init.SynchroMode = DCMI_SYNCHRO_HARDWARE;

 hdcmi.Init.PCKPolarity = DCMI_PCKPOLARITY_RISING;

 hdcmi.Init.VSPolarity = DCMI_VSPOLARITY_HIGH;

 hdcmi.Init.HSPolarity = DCMI_HSPOLARITY_LOW;

 hdcmi.Init.CaptureRate = DCMI_CR_ALL_FRAME;

 hdcmi.Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;

 hdcmi.Init.JPEGMode = DCMI_JPEG_DISABLE;

 hdcmi.Init.ByteSelectMode = DCMI_BSM_ALL;

 hdcmi.Init.ByteSelectStart = DCMI_OEBS_ODD;

 hdcmi.Init.LineSelectMode = DCMI_LSM_ALL;

 hdcmi.Init.LineSelectStart = DCMI_OELS_ODD;

 if (HAL_DCMI_Init(&hdcmi) != HAL_OK)

 {

  Error_Handler();

 }

}

2.- Then I used the function BSP_CAMERA_Init(); from the stm32746g_discovery_camera.h because I realised that the camera has to be configurated via I2C.

3.- With CubeMX i also activate the I2C1 periferal without changing any parameter settings.

The problem that I have Is that it only display the first frame after I use: HAL_DCMI_Start_DMA(&hdcmi, DCMI_MODE_CONTINUOUS, (uint32_t)FRAME_BUFFER, Im_size);

(Where FRAME_BUFFER is the same buffer as the LCD frame buffer)

Also, if I comment the MX_DCMI_Init(); or the BSP_CAMERA_Init(CAMERA_R480x272); instructions, the LCD display noise.

How can I configure propertly the camera? What I want to do is, whenever I want, save a frame from the camera In a memory location passed by argument. Bus first I want to know why does not work.

Thanks for reading!

1 ACCEPTED SOLUTION

Accepted Solutions
BTurc.2
Senior

It wos a DMA configuration problem. The DMA was in Normal mode. Now is in circular and it works!

View solution in original post

1 REPLY 1
BTurc.2
Senior

It wos a DMA configuration problem. The DMA was in Normal mode. Now is in circular and it works!