AnsweredAssumed Answered

malloc issue with 4K allocation in STM32F091CC

Question asked by Youssouf Coulibaly on Nov 9, 2017
Latest reply on Nov 9, 2017 by Andrew Neil

Hi all,

 

I have an application when I need to reserve 4Kbytes of memory. This size is fixed during the whole life cycle of my application.

Therefore my first idea was to create a static memory allocation. But I also tried to use the malloc function to reserve 4K memory. I am using C++ and I am calling free function in my Class destructor.

But the problem I am facing is that my application rises a hard fault when i am calling other task (no operating system).

- Task 1 is for memory management function. 

- Task 2 is for UART communication.

 

So I have general question since that is my first time I am working on huge memory allocation is embedded device.

Is with malloc function in STM32F091 we can allocate 4kbytes of memory ?

What is about eh default heap size ? How can I explicitely increase the heap size ?

 

Thanks for your help.

 

Regards

Outcomes