cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot enable JPEG decode with DMA on STM32F76xx

GN.1
Associate

Hello,

I am currently trying to play a video using the JPEG decoder on a STM32F76xx chip.

Right now, I can play a video with HAL_JPEG_Decode in polling mode, but the it takes too long (~100ms) and the FPS is low.

My objective, is to use HAL_JPEG_Decode_DMA to display an image.

I copied the code from example project JPEG_DecodingUsingFs_DMA into my own projet, but the program freeze on this line :

JPEG_ENABLE_DMA(hjpeg, JPEG_DMA_IDMA | JPEG_DMA_ODMA);

called from HAL_JPEG_Decode_DMA -> JPEG_DMA_StartProcess (in stm32f7xx_hal_jpeg.c)

This macro sets the IDMAEN and ODMAEN bits of the JPEG control register.

I tried to dig a little bit, and I found the freeze happens specifically when I try to set the IDMAEN bit.

hjpeg->Instance->CR |= JPEG_CR_ODMAEN; // works
hjpeg->Instance->CR |= JPEG_CR_IDMAEN; // freeze

Any ideas on why is it blocking ? Its very strange.

(I do define the JPEG_Msp_Init, and interrupts JPEG_IRQHandler, DMA2_Stream3_IRQHandler, DMA2_Stream4_IRQHandler like expected.)

0 REPLIES 0