Max heap size and allocating memory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-24 10:12 AM
Hi!
I have STM32F407VET6 MCU with 192kB RAM. I need allocate 150kB for storing image after processing data. However I can't allocate such big array. I though I should increase heap size, but I can't increase it more than 120~130kB... I don't know why, my processor have 192kB RAM so what I am doing wrong? #stm32-heap-sram-allocate-memory- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-24 10:55 AM
Download the reference manual and/or the datasheet for the STM32F407, and read the section(s) about the memory, it's layout and it's properties.
That explains why you can't allocate it at once.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-24 11:27 AM
I don't know why, my processor have 192kB RAM so what I am doing wrong?
http://www.merriam-webster.com/dictionary/discontinuous
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-24 1:02 PM
That 192KB is divided into three regions: CCM is the first 64KB, and cannot be used for DMA; SRAM1 is the next 112KB, cached and DMA capable; and last is SRAM2, a 16KB non-cached DMA capable region.
You can allocate 150KB for an image, providing you don't use DMA since it will overlap into the CCM area. But you have to make sure all other program data, stack and heap fit in the remaining 42KB. From your description your other requirements take too much RAM. What does your loader map show for memory allocation? Jack Peacock