NRF memory management and FreeRTOS coexistence

We use FreeRTOS with nRF SDK driver library. The driver library is working well because it doesn't dynamically allocate any memory. So I can simple take entire memory block from __HeapLimit below and let FreeRTOS heap to mamage the memory.

However, the NRF_LOG module uses nrf_memobj and nrf_balloc to dynamically allocate memory. And it appears to use memory below __HeapLimit.

Question is: How exactly does it work? How much memory shall I reserve for NRF_LOG and what memory block is safe for FreeRTOS to manage?

Thanks

Qingjun

Parents Reply
  • Thank you for your answer. It is exactly what I did.

    I guess I didn't ask the question clearly. The question should be: what is the boundary of NRF heap?

    Without NRF_LOG I don't use any heap. So the boundary is __HeapLimit address, which is the same as __bss_end__ because heap size is 0.

    But NRF_LOG uses dynamic heap allocation. And it can't be disabled even if I just want a non-deferred log. What API shall I call in order to get the end of the NRF heap?

Children
Related