2019-03-05 07:19 AM
I am using a STM32 Discovery Board with external SD Ram. I used the memory in RAM so far by creating a Ponter in the SD-Ram address area.
But now my program is getting more and more complex and I could use a memory manager. Can I use the Malloc, Calloc and Free functions to allocate data in the SD Ram address range if I wish?
2019-03-05 07:56 AM
Yes, in GNU/GCC you'll likely need to fix the allocator in syscalls.c so that _sbrk understands the memory region, and that you can't use the stack as the top-of-heap limit.
Don't use SDRAM for the stack, it is relatively slower memory, and will cause a performance drag on everything.
In Keil, you'll what to direct the heap into the SDRAM section, but also want to initialize the SDRAM in SystemInit() so that it is functional when the C runtime code initializes the statics, etc.
You might want to consider multiple memory pools, as some memory is faster than others, some memory is suitable for DMA while others aren't.
2019-03-07 04:03 AM
There's a lot that's new to me. I use the GCC. I was looking for "syscalls" or "_sbrk" in my project. I only found a few files from the µOS++ distribution which are not used. How do I get on with the problem? What do I have to search for?