2025-06-04 1:46 AM
Hi ST Community,
I’m working on a JPEG encoding pipeline using the STM32N6570 Discovery Kit, and I’m running into an issue when storing both my input and output buffers in PSRAM.
Setup:
Linker script (.ld) snippet:
MEMORY
{
AXISRAM1_S (xrw) : ORIGIN = 0x34000400, LENGTH = 1023K
PSRAM (xrw) : ORIGIN = 0x91000000, LENGTH = 16M
}
.psram_section (NOLOAD):
{
. = ALIGN(32);
*(.psram_bss)
. = ALIGN(32);
} >PSRAM
Buffer declarations:
__attribute__((section(".psram_bss")))
__attribute__((aligned(32)))
uint32_t jpgBuffer[160 * 160];
__attribute__((section(".psram_bss")))
__attribute__((aligned(32)))
uint32_t RGB_ImageAddress = {0}; // RGB888 image
Problem:
After running HAL_JPEG_Encode_DMA(...) and reading from jpgBuffer, I get corrupted or incomplete JPEG data:
What I’ve tried:
Questions:
Main.c is attached below for reference. Any help or insights would be greatly appreciated!
Thanks