Description
Description
We are currently reworking one of our example applications which we regularly test in several targets with IAR, ARMCC and GCC_ARM. However, one of our tests keeps failing with a heap out-of-memory error for KW24D and IAR (for reference, the failure logs are here). I looked around online (as I do not actually have access to the board or compiler) and I think that the problem is most likely due to the fixed heap size that IAR requires setting at compile time. I understand that the allocator used by this toolchain has some limitations, which (I suppose) we have to accept. Some related tickets:
- Inconsistent heap sizes between toolchains, especially IAR #3466
- Issues with the fixed heap size in IAR #3681
Taking a quick look at the IAR linker script for KW24D, it looks to me that the default size is set to 16KB, which is probably insufficient for the application we are working with. Specially considering the fact that the target has 64KB RAM (I think) and static data only takes about 9KB.
With this in mind, is it possible to configure the heap size at compile time (or runtime!) using the build system or some public API? For example, I think there is a similar option for stack: MBED_CONF_RTOS_MAIN_THREAD_STACK_SIZE
and MBED_CONF_APP_MAIN_STACK_SIZE
. It would be ideal to have something similar to configure the heap size for systems with limitations like IAR.
Note: I think an alternative solution would be to simply increase the heap size value in the linker script, but I am not sure what would be a sensible value that would not break other applications. IMHO, there probably isn't a one-size-fits-all value...
Issue request type
[x] Question
[ ] Enhancement
[ ] Bug