Skip to main content
Visitor II
April 25, 2024
Question

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

  • April 25, 2024
  • 2 replies
  • 1991 views

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!")

 

 

    This topic has been closed for replies.

    2 replies

    Graduate II
    April 25, 2024

    Look at _sbrk() implementation 

    shiiAuthor
    Visitor II
    April 25, 2024

    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 .

    Graduate II
    April 25, 2024

    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.

    shiiAuthor
    Visitor II
    May 2, 2024

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