This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to increase heap size for Cortex-M4 example?

I am running the "CMSIS-RTOS2 Blinky (uVision Simulator)" example for Cortex-M4 in Arm Dev Studio on Windows. I am using ARM C/C++ Compiler 6.

The example runs ok. I have now added several C++ files to it. These compile and link ok, but when I increase the number of objects ( instantiated by new() ) on the heap the program either crashes or raises a bad_alloc exception.

I have tried increasing the heap allocation in the scatter file but that seems to make no difference. I am therefore wondering whether I am increasing it correctly or whether there is some startup requirement for C++ that I am unaware of.

My scatter file is:

CMSIS-RTOS2 Blinky (uVision Simulator)_Simulation\RTE\Device\ARMCM4\ARMCM4_ac6.sct

and the contents are:

so the heap allocation should be 0xA000.

The linker command is:

so, correct scatter code and, hopefully, correct startup files are used.

My C++ compiler options are:

Can you please suggest what may be wrong?

0