MHC: This file must not be used if config SUPPORT DYNAMIC ALLOCATION is 0

In MHC’s FreeRTOS configuration options, if you check “Enable static memory allocation” and UNcheck “Enable dynamic memory allocation”, MHC will blithely add “…/portable/MenMang/heap_[n].c” to the build (where [n] is whatever is selected for Memory Management Type). This causes an error at load time:

#error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0

As a workaround, you can go into the Project window and remove the offending file from the project (e.g. right click on the file, select “Remove From Project”). But you have to do that every time you regenerate the MHC code.

A proper fix would be to inhibit the generation of the MemMang heap_[n].c file if “Enable dynamic memory allocation” is de-selected.

(And is unhelpful that the forum firmware prevents me from using “#error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0” as the title, since that’s what people will probably be searching for!!)

Have you made this suggestion to Microchip?

Have you made this suggestion to Microchip?

Have not. I can file it as a standard bug report, but if you (or anyone in the community) knows the group responsible for MHC’s interface to FreeRTOS, let me know so I can better direct the request. Thanks!

Please open a support ticket and copy me on this. Thanks

Hey @rdpoor,
I wanted to reach out and see if you were able to receive assistance with this issue from @Shridhar and Microchip.

I have requested them to open a support ticket.

I have posted the bug report on the microchip forum at:

Cannot disable FreeRTOS dynamic allocation in MHC | Microchip

Shridhar: I didn’t know how to CC you directly, so consider this the CC! :slight_smile:

Update: Doh! I just realized that you mean for me to file a formal Microchip issue. That will take me a bit more time since I don’t have my dev environment at hand (I’m traveling) so I can’t cite the version numbers, etc. That will take a few more days!

Support ticket filed on microchip site:

https://microchipsupport.force.com/s/case/5003l00001Td2vh/detail