Skip to main content
STrop
Associate II
Sep 30, 2019 12:30 UTC
Question

STM32L4R9-Discovery and external PSRAM

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

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
Sep 30, 2019 12:55 UTC

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
STrop
STropAuthor
Associate II
Oct 1, 2019 09:11 UTC

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