cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4R9-Discovery and external PSRAM

STrop
Associate II

Hello,

I am currently working with a STM32L4R9-Discovery board with STemWin using demonstration project.

I want to use the external PSRAM as a memory for the LCD GFXMMU framebuffer

from LCDConf.c :

#if defined ( __ICCARM__ )
#pragma location="FrameBufferSection"
__root
#else
__attribute__((section(".FrameBufferSection")))
#endif
/* 365040 : Ex 24bpp => (390 * 390) * 3 - ((390 * 390) * 3 * 20%) */
static uint8_t PhysFrameBuffer[BSP_LCD_PHYS_FB_SIZE * NUM_BUFFERS * GUI_NUM_LAYERS * NUM_VSCREENS];

and Linker.ld

PSRAM (rx)      : ORIGIN = 0x60000800, LENGTH = 16384K   /*   16 Mbytes */
 
....
 
  .FrameBufferSection : 
  {
    . = ALIGN(32);
  	KEEP(*(.FrameBufferSection))
  } >PSRAM
  
  
 

I use 0x60000000 as base address for PSRAM following FMC bank 1 address (from DM00310109.pdf)

I also initialize the PSRAM Memory using by calling "BSP_PSRAM_Init();" as demonstrate in BSP example.

I am able to build the project and generate a hex file but using ST-Link utility with external loader configured i got this error :

"No elf loader found for this configuration"

Did I miss something in documentation or example ?

Thanks

Simon

2 REPLIES 2

The ST-LINK tools cannot access external memory subsystems without an External Loader module to configure/access the memory.

For things that don't need to be initialized use NOLOAD sections. For those that do you'll need to direct the initial content into FLASH, and have your code in startup_stm32xxxx.s copy and zero as necessary.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
STrop
Associate II

Using BSP_PSRAM_Init as done in STM32L4R9I-DISCOVERY "BSP" example in "STemWin Demonstration" my firmware crash into HardFault_Handler, I have miss some initialization code ?

I also try without calling BSP_PSRAM_Init to write random data into a buffer allocated in PSRAM.

The write operation result in a buffer full of 0x0.

Since in STM32L4R9I-DISCOVERY "BSP" example specific function are used to read and write data into this external PSRAM function. Is it possible to use it for direct access as the internal SRAM ?

Thanks

Simon