2024-04-25 01:03 AM
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!")
2024-04-25 01:57 AM
Look at _sbrk() implementation
2024-04-25 03:03 AM
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 .
2024-04-25 09:24 AM
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.
2024-05-02 02:36 AM
Is it possible to give any example for reference, as i said i'm new to this.could not really get how to do.
2024-05-02 06:22 AM
There are a number of sbrk and malloc tutorials available on that Interwebby thing.