Stm32h743iit6 preload at boot image background using LibJPeg
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