# How to concretize start address of heap in RAM

**URL:** <https://forums.freertos.org/t/how-to-concretize-start-address-of-heap-in-ram/15770>\
**Category:** Kernel\
**Created:** [September 6, 2022, 12:47pm UTC](https://forums.freertos.org/t/how-to-concretize-start-address-of-heap-in-ram/15770 "2022-09-06T12:47:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![addi](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@addi](https://forums.freertos.org/u/addi)\
**Post date:** [September 6, 2022, 12:47pm UTC](https://forums.freertos.org/t/how-to-concretize-start-address-of-heap-in-ram/15770/1 "2022-09-06T12:47:22Z")

</div>

Hello!

Ive got MCU without flash and have to write code in RAM and allocate C heap in RAM, stack, and FreeRTOS heap in the same region of RAM(256KB).  
Cause of that I need to demarcate the heaps at least

As I know, to do that, I have configAPPLICATION\_ALLOCATED\_HEAP define but I dont know how can I applicate it in my case

Please help!

---

<div class="post-metadata">

**Author:** ![hs2](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@hs2](https://forums.freertos.org/u/hs2)\
**Post date:** [September 6, 2022, 1:31pm UTC](https://forums.freertos.org/t/how-to-concretize-start-address-of-heap-in-ram/15770/2 "2022-09-06T13:31:09Z")

</div>

You could leave the allocation of a heap to one of FreeRTOS provided memory managers.  
Internally it’s just a byte array of the specified heap size usually in .bss section i.e. RAM.  
See e.g. [heap\_4.c](https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/6324f6fc3e26d8b550fe54d474cd1ea89e238622/portable/MemMang/heap_4.c#L85)

---

<div class="post-metadata">

**Author:** ![addi](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@addi](https://forums.freertos.org/u/addi)\
**Post date:** [September 6, 2022, 3:44pm UTC](https://forums.freertos.org/t/how-to-concretize-start-address-of-heap-in-ram/15770/3 "2022-09-06T15:44:21Z")

</div>

Thank you for your replay, so what meaning keeps configAPPLICATION\_ALLOCATED\_HEAP then?

---

<div class="post-metadata">

**Author:** ![hs2](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@hs2](https://forums.freertos.org/u/hs2)\
**Post date:** [September 6, 2022, 4:59pm UTC](https://forums.freertos.org/t/how-to-concretize-start-address-of-heap-in-ram/15770/4 "2022-09-06T16:59:30Z")

</div>

At least flexibility. For instance some MCUs have multiple physical RAMs. One might want to put the FreeRTOS heap into a specific RAM bank. This custom setup has to be provided by application code.

---

<div class="post-metadata">

**Author:** ![addi](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@addi](https://forums.freertos.org/u/addi)\
**Post date:** [September 28, 2022, 8:22am UTC](https://forums.freertos.org/t/how-to-concretize-start-address-of-heap-in-ram/15770/5 "2022-09-28T08:22:32Z")

</div>

Thanks a lot!  
Can you advice what way is preferred in my case?(when I have got internal RAM only)

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [September 28, 2022, 9:26am UTC](https://forums.freertos.org/t/how-to-concretize-start-address-of-heap-in-ram/15770/6 "2022-09-28T09:26:53Z")

</div>

Leave `configAPPLICATION_ALLOCATED_HEAP` undefined - this should work in your case. Let us know if you face any problem.

---

<div class="post-metadata">

**Author:** ![addi](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@addi](https://forums.freertos.org/u/addi)\
**Post date:** [September 28, 2022, 9:31am UTC](https://forums.freertos.org/t/how-to-concretize-start-address-of-heap-in-ram/15770/7 "2022-09-28T09:31:37Z")

</div>

Thanks! Ill do it then
