2026-05-07 1:33 AM - last edited on 2026-05-07 1:37 AM by mƎALLEm
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
2026-05-07 6:01 AM
Hello @KNaim.1
Please refer to the examples below:
STM32CubeH7/Projects/STM32H743I-EVAL/Applications/LibJPEG at master · STMicroelectronics/STM32CubeH7
2026-05-07 8:16 AM
The example below can't help me is not the same configuration reading from sd card !
2026-05-07 8:20 AM
@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.
2026-05-07 8:26 AM
The example link you give read from sdcard i am in qspi configuration so the flow is not the same
2026-05-07 8:35 AM - edited 2026-05-07 8:37 AM
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.