Skip to main content
KNaim.1
Associate III
May 7, 2026
Question

Stm32h743iit6 preload at boot image background using LibJPeg

  • May 7, 2026
  • 4 replies
  • 155 views

Here is the config:

mcu stm32h743iit6
flash 4 lines 1 bank 32mb W25Q256JV
sdram 32mb W9825G6KH

here is the flow 

1 read image background from qspi 
2 decode image with axi sram at 

#define JPEG_WORKSPACE_BASE 0x24040000 // AXI SRAM (fast)

#define JPEG_WORKSPACE_SIZE (256 * 1024) // 512KB (up from 256KB)
3 copy buffer to external sdram
4 dma2d copy and display image .

 

scenario1 is ok

LIBJPEG_DecodeToBuffer((uint32_t)IMG_NEW6, IMG_NEW6_SIZE, (uint32_t*)DECODE_BUFFER1);
 uint32_t decode_time = HAL_GetTick() - start;
 printf("✅ JPEG decode: %lu ms\n", decode_time);

 // Test 3: Display the image
 start = HAL_GetTick();
 //Display_ImageAt_Fast((uint32_t*)DECODE_BUFFER1, 1024, 600, 0, 0);
 Display_ImageAt((uint32_t*)DECODE_BUFFER1, 1024, 600, 0, 0);
 HAL_Delay(4000);
 Clear_SDRAM();

 LIBJPEG_DecodeToBuffer((uint32_t)IMG_NEW8, IMG_NEW8_SIZE, (uint32_t*)DECODE_BUFFER3);
 // uint32_t decode_time = HAL_GetTick() - start;
 printf("✅ JPEG decode: %lu ms\n", decode_time);


 Display_ImageAt((uint32_t*)DECODE_BUFFER3, 1024, 600, 0, 0);
 HAL_Delay(4000);
 Clear_SDRAM();


scenario2 not ok predecode all images and copy to define sdram buffers

 /* LIBJPEG_DecodeToBuffer((uint32_t)IMG_NEW6, IMG_NEW6_SIZE, (uint32_t*)DECODE_BUFFER1);
 printf("✓ IMG_NEW6 -> BUFFER1\n");
 SCB_CleanDCache_by_Addr((uint32_t*)DECODE_BUFFER1, 1024*600*3);
 HAL_Delay(1000);
 LIBJPEG_DecodeToBuffer((uint32_t)IMG_NEW8, IMG_NEW8_SIZE, (uint32_t*)DECODE_BUFFER3);
 printf("✓ IMG_NEW8 -> BUFFER3\n");
 SCB_CleanDCache_by_Addr((uint32_t*)DECODE_BUFFER3, 1024*600*3);
 HAL_Delay(1000);
 LIBJPEG_DecodeToBuffer((uint32_t)IMG_NEW7, IMG_NEW7_SIZE, (uint32_t*)DECODE_BUFFER2);
 printf("✓ IMG_NEW7 -> BUFFER2\n");
 SCB_CleanDCache_by_Addr((uint32_t*)DECODE_BUFFER2, 1024*600*3);
 HAL_Delay(1000);
 LIBJPEG_DecodeToBuffer((uint32_t)IMG_NEW9, IMG_NEW9_SIZE, (uint32_t*)DECODE_BUFFER4);
 printf("✓ IMG_NEW9 -> BUFFER4\n");
 SCB_CleanDCache_by_Addr((uint32_t*)DECODE_BUFFER4, 1024*600*3);
 HAL_Delay(1000);
 LIBJPEG_DecodeToBuffer((uint32_t)IMG_NEW10, IMG_NEW10_SIZE, (uint32_t*)DECODE_BUFFER5);
 SCB_CleanDCache_by_Addr((uint32_t*)DECODE_BUFFER5, 1024*600*3);
 printf("✓ IMG_NEW10 -> BUFFER5\n");
 HAL_Delay(1000);

 Clear_SDRAM();
 Flush all buffers





 Clear_SDRAM();
 printf("\n=== DISPLAYING IMAGES ===\n");

 Display_ImageAt((uint32_t*)DECODE_BUFFER1, 1024, 600, 0, 0);
 HAL_Delay(4000);
 Clear_SDRAM();

 Display_ImageAt((uint32_t*)DECODE_BUFFER3, 1024, 600, 0, 0);
 HAL_Delay(4000);
 Clear_SDRAM();

 Display_ImageAt((uint32_t*)DECODE_BUFFER2, 1024, 600, 0, 0);
 HAL_Delay(4000);
 Clear_SDRAM();

 Display_ImageAt((uint32_t*)DECODE_BUFFER4, 1024, 600, 0, 0);
 HAL_Delay(4000);
 Clear_SDRAM();

 Display_ImageAt((uint32_t*)DECODE_BUFFER5, 1024, 600, 0, 0);
 HAL_Delay(4000);


if some of the community have face this problem and have some ideas please share i am stuck

4 replies

Technical Moderator
May 7, 2026
"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.Saket_Om"
KNaim.1
KNaim.1Author
Associate III
May 7, 2026

The example below can't help me is not the same configuration reading from sd card !

mƎALLEm
Technical Moderator
May 7, 2026

@KNaim.1 wrote:

The example below can't help me is not the same configuration reading from sd card !


Sorry to intervene here:

In your first post you said "1 read image background from qspi "

Now you are saying you are reading it from SDcard.

You need to stick in one configuration and provide more details of your use case. Maybe also the complete project so others can help you efficiently.

Thank you for your understanding.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
KNaim.1
KNaim.1Author
Associate III
May 7, 2026

The example link you give read from sdcard i am in qspi configuration so the flow is not the same

mƎALLEm
Technical Moderator
May 7, 2026

The flow is not the same but the principle is the same: reading from a source and display it into a destination.

We don't provide example for each scenario. So try to split your issue into two parts:

- Fetching the image from the source.

- Display the fetched image in the destination.

Inspire from the the example provided by @Saket_Om and adapt it to your needs.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.