2024-03-25 10:20 PM
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.
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?
Solved! Go to Solution.
2024-03-26 12:31 AM
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,
2024-03-26 12:31 AM
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,
2024-03-26 05:12 PM
Thanks to this, it works properly. thank you