cancel
Showing results for 
Search instead for 
Did you mean: 

Need support in using PSRAM as internal RAM using memory mapped mode using QSPI

shii
Associate II

Hi,

I have been working on, interfacing PSRAM(APS6404L) with NUCLEO-H563ZI board.

i'm able to perform read and write operations using QSPI and able to create the memory mapped mode.

 

I have modified the Linker script,i'm able to declare variables on external RAM.

 

but i'm unable to get, how can i use externalRAM to allocate dynamic memory

 

modifications done in Linker script,

/* Memories definition */

MEMORY

{

RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 640K

FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K

PSRAM (xrw) : ORIGIN = 0x90000000, LENGTH = 8M

}

.psram_section(NOLOAD) :

{

. = ALIGN(4);

__psram_section_start__ = .;

*(.psram_section*)

__psram_section_end__ = .;

} > PSRAM

 

ASSERT(LENGTH(PSRAM) >= (__psram_section_end__ - __psram_section_start__),"PSRAM memory overflowed!")

 

 

5 REPLIES 5

Look at _sbrk() implementation 

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

Yes I have seen it, but i could not understand how to make it use. any reference or samples can be helpful. I'm new this .

Well, you'd need to make it PSRAM centric. The top is not bounded by the stack / SP, as you still want that in the fastest most tightly coupled memory. Nor based at the end of the RAM statics.

So, need to generate some symbols in the linker to establish where your PSRAM static initializations end, and where the end of the PSRAM is. Use these to bound the allocation returned by _sbrk() to the primary dynamic allocator.

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

Is it possible to give any example for reference, as i said i'm new to this.could not really get how to do.

There are a number of sbrk and malloc tutorials available on that Interwebby thing.