cancel
Showing results for 
Search instead for 
Did you mean: 

heap allocation on segmented ram

Fibo
Associate II

The ram on the STM32H7 is segmented into non-contiguous sections. How would one be able to dynamically allocate memory in different sections of RAM? eg: put large objects in AXI-SRAM and small object that need fast access on DTCM.

I'm wondering if this is possible without a custom allocator however, links to open-source custom allocators or ideas for writing simple allocator would be appreciated.

5 REPLIES 5
Piranha
Chief II

My lazy approach in Keil was to stuff the additional regions into the the allocators linked-list.

Realistically you probably need different pools

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

Interesting, I also think that different pools are necessary since I would like to explicitly select the pool with which I am working. The "LwMEM" library mentioned by @Piranha​  has the features I'm looking for. Not sure about the reliability since it is under active development. It does have a few unit tests and decent documentation so that is a good start.

These lost something in the forum transition, and I can't edit them, but for completeness, and so I don't have to search again

https://community.st.com/s/question/0D50X00009XkgLxSAJ/stm32f4-extending-the-heap-to-seperate-ram-regions

https://community.st.com/s/question/0D50X00009XkgWSSAZ/locate-heap-in-sdram

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

Code on master branch or under releases is usually passing the tests. Of course it doesn't mean it is bug free 🙂

I welcome you to contribute if you believe you need more features.