cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX Demo7 output_short.avi & ST8464.avi play error

LJONG.18
Associate

I created TouchGFX Demo7 by selecting the STM32F769I Discovery Kit.

After generating code, I ran the run simulator to check that it was running on the PC, and then downloaded the program to the STM32F769I Discovery Kit through Run target.

KakaoTalk_20240326_141631983.jpg

In the photo above, you can no longer move on to the next step.

I also tried converting the file using ffmpeg-2023-06-04-git-b1c3d81e71-full_build, but the result was the same.

How do I get the Kit to work properly?

1 ACCEPTED SOLUTION

Accepted Solutions
LouisB
ST Employee

Hello @LJONG.18 ,

This issue is related to low level callbacks that are not called correctly for the F769I.
HAL_JPEG_DecodeCpltCallback isn't called because Hardware thinks he is still decoding when he decoded all blocks.

The state from jpeg is not updated, HAL_JPEG_STATE_BUSY_DECODING doesn't changes, so next time it tries to decode, it doesn't start as it's stuck

A workaround is adding theses lines :

 

if(HAL_JPEG_GetState(&hjpeg) != HAL_JPEG_STATE_READY){
   HAL_JPEG_Abort(&hjpeg);
}

 

in <YOUR_PROJECT_PATH>\TouchGFX\target\generated\HardwareMJPEGDecoder.cpp :

 

void HardwareMJPEGDecoder::decodeMJPEGFrame(const uint8_t* const mjpgdata, const uint32_t length, uint8_t* outputBuffer, uint16_t bufferWidth, uint16_t bufferHeight, uint32_t bufferStride)
{
   ... 
   do{
    ...
        } while (JpegProcessing_End != 1);
        /// part to add ///
        if(HAL_JPEG_GetState(&hjpeg) != HAL_JPEG_STATE_READY){
        	HAL_JPEG_Abort(&hjpeg);
        }
        /// part to add ///
        /* reset flag */
        Jpeg_HWDecodingEnd = 0;
    }
}

 

Beware, since this file is generated, you will lost all modifications if you regenerate code.

Another simpler way is to disable hardware decoding, but you will lose a lot of FPS.

I hope it helps,

Regards, 

Louis BOUDO
ST Software Developer | TouchGFX

View solution in original post

2 REPLIES 2
LouisB
ST Employee

Hello @LJONG.18 ,

This issue is related to low level callbacks that are not called correctly for the F769I.
HAL_JPEG_DecodeCpltCallback isn't called because Hardware thinks he is still decoding when he decoded all blocks.

The state from jpeg is not updated, HAL_JPEG_STATE_BUSY_DECODING doesn't changes, so next time it tries to decode, it doesn't start as it's stuck

A workaround is adding theses lines :

 

if(HAL_JPEG_GetState(&hjpeg) != HAL_JPEG_STATE_READY){
   HAL_JPEG_Abort(&hjpeg);
}

 

in <YOUR_PROJECT_PATH>\TouchGFX\target\generated\HardwareMJPEGDecoder.cpp :

 

void HardwareMJPEGDecoder::decodeMJPEGFrame(const uint8_t* const mjpgdata, const uint32_t length, uint8_t* outputBuffer, uint16_t bufferWidth, uint16_t bufferHeight, uint32_t bufferStride)
{
   ... 
   do{
    ...
        } while (JpegProcessing_End != 1);
        /// part to add ///
        if(HAL_JPEG_GetState(&hjpeg) != HAL_JPEG_STATE_READY){
        	HAL_JPEG_Abort(&hjpeg);
        }
        /// part to add ///
        /* reset flag */
        Jpeg_HWDecodingEnd = 0;
    }
}

 

Beware, since this file is generated, you will lost all modifications if you regenerate code.

Another simpler way is to disable hardware decoding, but you will lose a lot of FPS.

I hope it helps,

Regards, 

Louis BOUDO
ST Software Developer | TouchGFX

Thanks to this, it works properly. thank you