cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5G9BJYXQ JPEG perpheral DMA not working.

shubhenduatadben
Associate III

HI,

    I'm capturing image as RGB565 using camera over DCMI on DMA. Capturing is complete and data is available. Now I need it to convert into JPEG format. 

    But, the JPEG in/out DMA is not working. Any help will be appreciated.

 

snippet: 

	MX_DCMIQueue_Config();
	HAL_DMAEx_List_LinkQ(&handle_GPDMA1_Channel12, &DCMIQueue);
	__HAL_LINKDMA(&hdcmi, DMA_Handle, handle_GPDMA1_Channel12);

	MX_JPEGInQueue_Config();
	HAL_DMAEx_List_LinkQ(&handle_GPDMA1_Channel13, &JPEGInQueue);
	__HAL_LINKDMA(&hjpeg, hdmain, handle_GPDMA1_Channel13);

	MX_JPEGOutQueue_Config();
	HAL_DMAEx_List_LinkQ(&handle_GPDMA1_Channel14, &JPEGOutQueue);
	__HAL_LINKDMA(&hjpeg, hdmaout, handle_GPDMA1_Channel14);

  Thatnks-
Shubhendu

Using following:
1. STM32CubeIDEVersion: 1.16.1
2. MCU: STM32U5G9BJYXQ
3. Camera: OV7725

Screenshot 2026-03-16 at 6.00.37 PM.png

Screenshot 2026-03-16 at 6.01.32 PM.png

Screenshot 2026-03-16 at 6.03.49 PM.png

Screenshot 2026-03-16 at 6.06.16 PM.png

Screenshot 2026-03-16 at 6.09.29 PM.png

Screenshot 2026-03-16 at 6.00.43 PM.png

Screenshot 2026-03-16 at 6.00.57 PM.png

Screenshot 2026-03-16 at 6.01.18 PM.png

       

@devjeet-adben 

2 REPLIES 2
MOBEJ
ST Employee

Hello @shubhenduatadben , 

Please  could you have a look at this CubeU5 JPEG example on GitHub link :

It shows how to use the JPEG hardware decoder and encoder with DMA (init, DMA config, callbacks).
you can use the same JPEG + DMA configuration pattern as a reference to fix your JPEG in/out DMA and then adapt it for encoding your RGB565 camera data.
Thank you , 
Br

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi @MOBEJ 

    Thank you for your response. I have been able to encode a 320x240 RGB565 image. But My application requirement is to encode 640x480 RGB656 image to JPEG. 
    The example here demonstrates linear DMA but, as my application requires handling data size larger than a linear DMA can handle, I need to use linked-list DMA. Can you please guide me how can I implement that. Any example or documentation available for the particular purpose? I have configured the DMA following AN5593 and RM0456. 
    The stack-dump at the error is attached hereafter, would like to know what might be the cause. The particular error flag I can view on debugging is HAL_DMA_ERROR_TE.

 
 
 
 

Screenshot 2026-03-21 234610.png