2019-08-09 06:13 AM
Hey,
I transfered the JPEG_DecodingFromFLASH_DMA example code into program, where I try to decode and display a JPEG image which I receive via SPI (thus, the image data is storred in the Flash as well).
Board: STM32F769I-DISCO
The code is unchanged except of the parameters pointing to the data to be decoded and respectively its length in the JPEG_Decode_DMA function:
JPEG_Decode_DMA(&JPEG_Handle, (uint32_t)frame_buffer, frame_size, JPEG_OUTPUT_DATA_BUFFER);
However, when I wait for the JpegProcessingEnd, the JPEG_OutputHandler never returns a ProcessDoneFlag ('1').
do
{
JpegProcessing_End = JPEG_OutputHandler(&JPEG_Handle);
}while(JpegProcessing_End == 0);
From Debugging, I know this is because the state
Jpeg_OUT_BufferTab[JPEG_OUT_Read_BufferIndex].State == JPEG_BUFFER_FULL
will never be reaced.
Respectively, the HAL_JPEG_DataReadyCallback will bever be called wich should set the JPEG_BUFFER_FULL state.
And the JPEG_Process will not be executed which would call the Callback, if I got that correctly.
Any idea where and what I need to check to find out why the Decoding won't work?
(I wasn't able to test the original example code, because its too large for my uVision Licence)
Solved! Go to Solution.
2019-08-09 07:04 AM
Check that you copy HAL_JPEG_MspInit function to your project (from file stm32h7xx_hal_msp.c in JPEG Example project)
2019-08-09 06:50 AM
Hi. Did you transfer example code to your own project? Did you also transfer MDMA configuration?
2019-08-09 06:58 AM
Hi. Thanks for your hint.
I inserted the JPEG code into my project, yes.
My project is modified SPI_Full_Duplex_Com example. And I took the JPEG_Decoding code from the main, inserted the hal_jpeg driver, the decode_dma module and jpeg_utils plus all header files. Till I got no error messeges anymore.
But I am not quite sure about a MDMA? What is that? I couldn't find anything named MDMA in the JPEG_DecodingFromFLASH_DMA project?
2019-08-09 07:04 AM
Check that you copy HAL_JPEG_MspInit function to your project (from file stm32h7xx_hal_msp.c in JPEG Example project)
2019-08-09 07:20 AM
You are right, that is probably the solution! I missed the HAL_JPEG_MspInit function in the stm32f7xx_hal_msp.c, and the Compiler hasn't claimed it, beause its alredy defined as a __WEAK function in the hal_jpeg driver.
Unfortunately, I couldn't test right now, because the project just got to large for the 32K licence, but I will check soon and I am optimistic, that this was the missing point.
2019-08-09 07:30 AM
Good luck)
2019-08-09 08:52 AM
Thanks a lot again.
Besdies the HAL_JPEG_MspInit function, I also missed to copy some JPEG and DMA IRQHandler in stm32f7xx_it.c.
2019-08-12 05:08 AM
However, the JPEG_Decode process still does not succeed. It will be aorted by a JPEG_DMAErrorCallback and I cannot figure out why.
To the JPEG_DMAErrorCallback it will be referred as "hjpeg->hdmain->XferErrorCallback" and "hjpeg->hdmaout->XferErrorCallback", but I cannot find the condition for their calls.
Does anyone have a idea or hint?
2019-08-12 06:32 AM
Hi. What is MDMA Error Code Index?
2019-08-12 06:43 AM
The hjpeg->ErrorCode is 4 (HAL_JPEG_ERROR_DMA, DMA transfer error)
Or is there something more detailed available?