cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U575I-EV DCMI OV5640, camera unresponsive when configure for 1080p JPEGs

afok-esmart
Associate III

I've been working with an STM32CubeIDE project based primarily off STM32CubeU5 MCU package v1.4.0 (Projects\STM32U575I-EV\Examples\DCMI\DCMI_ContinousCap_EmbeddedSynchMode). The main changes I've made is changing the image format to JPEG and playing around w/ various resolutions. I'm able to retrieve images when resolution is as high as 720p. But when I increased the resolution to 1920x1080, the camera does not seem to be outputting data anymore (OV5640_Config() returns OV5640_OK, but I no longer receive interrupts for when the buffers are filled up). I would appreciate any help w/ getting the camera module to be able to produce 1080p JPEGs.

--------

Changes I made to try achieving 1920x1080 - I used these values in OV5640_SetResolution():

  • OV5640_TIMING_DVPHO_HIGH, 0x07
  • OV5640_TIMING_DVPHO_LOW, 0x80
  • OV5640_TIMING_DVPVO_HIGH, 0x04
  • OV5640_TIMING_DVPVO_LOW, 0x38
4 REPLIES 4
KDJEM.1
ST Employee

Hello @afok-esmart ,

Are you using Embedded (or internal) synchronization mode ?

Please note, when using the embedded synchronization mode, the DCMI does not support the compressed data (JPEG) and the crop feature. 

For more information, I advise you to take a look to AN5020 and precisely 5.6.5 JPEG section.

To simplify the use of this specific feature, it is recommended to divide the image into equal buffers. When capturing high resolution images, the user must secure that the memory destination has a sufficient size.
Example: In case of a resolution that is 1920x1080, the image size is 1036800 words (32 bits). This size must be
divided into equal buffers, with a maximum size of 65535 for each of them.

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.

No, I'm not using embedded synchronization mode. I've configured the DCMI mode to "Slave 8 bits External Synchro", and the DCMI configuration has JPEG mode enabled (when checking my CubeMX file). As I mentioned, I have already been able to get JPEGs (just in the lower resolutions).

And I believe with that MCU package version, HAL_DCMI_Start_DMA() in stm32u5xx_hal_dcmi.c already handles dividing into equal buffers and setting up buffers that aren't too big. The 'Length' argument I pass in to that function is 38,400; from going into Debug mode, that seems to create 4 buffers (each buffer being 38,400 bytes)

HAL_StatusTypeDef HAL_DCMI_Start_DMA(DCMI_HandleTypeDef *hdcmi, uint32_t DCMI_Mode, uint32_t pData, uint32_t Length)
{
  uint32_t tmp_length = Length;

  /* ..... */

  /* Length should be converted to number of bytes */
  tmp_length = tmp_length * 4U;

  if (tmp_length <= 0xFFFFU)
  {
    /* .... */

    /* Get the number of buffer */
    while (hdcmi->XferSize > 0xFFFFU)
    {
      hdcmi->XferSize = (hdcmi->XferSize / 2U);
      hdcmi->XferCount = hdcmi->XferCount * 2U;
    }

    /* .... */
  }

  /* ..... */
}

 

Hi. Just checking to see if anyone has any updates about this.

KDJEM.1
ST Employee

Hi @afok-esmart ,

Could you please take a look at this discussion: STM32U575 GPDMA DCMI High resolution image may help you.

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.