cancel
Showing results for 
Search instead for 
Did you mean: 

Video decoding for STM32H7B3L.

ABURM
Associate III

Hi.

I am using SDRAM, OctoSPI and 24bit RGB888 TFT screen. Project is working normally with another widgets (button, shape, text area, image etc.). Now i want to use video decoding and video widget. I made the necessary cubemx settings by reading the Video decoding. application steps. As a trial, I prepared a project consisting of 4 images and one video (sample video in touchgfx) in touchgfx. There are 5 screens in the project. Screen1, screen2, screen3, screen4 and screen5. I play the video after showing the images at 2-second intervals. The video widget is in the 5th screen. The program works properly until the 4th screen. But when it comes to the part of playing the video, it going to the "hardfault" procedure. I think I'm making a mistake with the memory settings. Cubemx settings are as follows;

DMA2DDMA2DJPEGJPEGJPEG-MDMAJPEG-MDMAJPEG-MDMAJPEG-MDMALIBJPEGLIBJPEGRTOS-TASKRTOS-TASKRTOS-HEAPRTOS-HEAPTouchGfxTouchGfx

I added the following code in STM32H7B3LIHXQ_FLASH.ld.

MEMORY
{
  ...
  SDRAM      (xrw)    : ORIGIN = 0xD0200000,   LENGTH = 8M
}

BufferSection (NOLOAD) :
{
  *(Video_RGB_Buffer Video_RGB_Buffer.*)
  *(.gnu.linkonce.r.*)
  . = ALIGN(0x4);
} >SDRAM

Where am i making a mistake?

14 REPLIES 14

Hello @ABURM ,

I tried to replicate the issue using your project settings, and I pretty sure I found out where the issue is. 

Could you please change the priority of JPEG input and JPEG output similar to the picture below?
I think you also need to change the Burst Size of JPEG input as well. (similar to the picture)

JPEG settings in MDMAJPEG settings in MDMA

Also, ensure that the JPEG and MDMA interrupts are enabled with correct priority, like this:

JPEG and MDMA interruptJPEG and MDMA interrupt

Please try these settings and let me know about the results.

Mohammad MORADI
ST Software Developer | TouchGFX

Hi @Mohammad MORADI ESFAHANIASL 

This is the working "directframe to buffer" configs.

JPEG_Input1.pngNVIC1.png

This is the "double buffer" configs.

JPEG_Input2.pngRTOS.pngWarning.pngWarning1.png

And the result;

 

Thank you for sharing the result.
To be honest, I'm running out of ideas but it seems like there is an issue with coordinating the buffers. 
I know you already have set the Video_RGB_Buffer in your linker script but, could you please try these settings as well?

First, set Buffer Location in the TouchGFX configuration to 'By Allocation':

Buffer Location configurationBuffer Location configuration

And then, add these lines to your linker script:

MEMORY
{
  ...
  SDRAM      (xrw)    : ORIGIN = 0xD0000000,   LENGTH = 8M
}

TouchGFX_Framebuffer (NOLOAD) : { *(TouchGFX_Framebuffer) } >SDRAM
Video_RGB_Buffer (NOLOAD) : { *(Video_RGB_Buffer) } >SDRAM

I know it sounds trivial but, I'm afraid that there might be an issue with the alignment of buffers because based on the YouTube video and the fact that 'Direct to Framebuffer' works correctly, the video decoding is done right, however, the coordination between the buffers is wrong causing these screen glitches.. Therefore, I would like to know whether there is an alignment issue or the way that buffers are handled. If it is the latter case, you should check the soundness of your TouchGFXHAL.cpp.

Mohammad MORADI
ST Software Developer | TouchGFX

Hi @Mohammad MORADI ESFAHANIASL 

 

I tried your suggestions but the result did not change.🤔

Okay, could you please share the files inside the target folder?  

Mohammad MORADI
ST Software Developer | TouchGFX