Solved
Dynamic memory allocation in PSRAM
- November 1, 2023
- 6 replies
- 3863 views
Hi,
Currently I am using STM32L4R9 discovery board, which has 16-Mbit (2MB) PSRAM. I have been able to allocate static memory inside PSRAM by using following code and also by changing linker script file (.ld). I have attached my edited linker script with this post.
int __attribute__((section (".psram_data"))) psram_buffer[50000];
for(int i=0; i<50000; i++)
{
psram_memory[i] = i;
}But, how can I dynamically allocate memory by using malloc() / calloc() inside PSRAM. If possible, please share some example code with me.
Thank you.
