New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NCS36510] Reduce default heap size allocated by IAR to 1/4 of RAM #4187

merged 1 commit into from Apr 24, 2017


None yet
7 participants

maclobdell commented Apr 14, 2017


The IAR linker file allocates the heap size by default to 0x4000, which for this target is causing the mbed-os-example-mesh-minimal application not to be able to fit into the RAM. It has been changed to 0x3000 (12K, which is 1/4 of the total 48K RAM). This change both passes all mbed OS tests and allows the mesh minimal example to compile with IAR and run.

helps fix ARMmbed/mbed-os-example-mesh-minimal#63

cc: @pradeep-gr @radhika-raghavendran @danclement @jacobjohnson-ON
please review and confirm this looks good to you.





Related PRs


branch PR



Deploy notes


Steps to test or reproduce


[NCS36510] Reduce default heap size allocated by IAR to 1/4 of total …

Allows mesh minimal example to compile with IAR.

This comment has been minimized.


danclement commented Apr 14, 2017

@maclobdell no issues from me. The networking team will find any possible issues as they add the device to large networks as a router (routing tables = more RAM I'm assuming)


This comment has been minimized.


radhika-raghavendran commented Apr 17, 2017

This change is ok with me.
I remember this being changed to be a larger size in order to pass the stack and heap tests at the beginning mbed-os porting for our platform, now we can change it to a smaller size.
However, I would like to know if there is a recommended heap size for mbed-os? I can see that the heap size is configured to 0x400(1K) for GCC_ARM, and there is not fixed size for ARMCC compiler. Please let us know if we need to change the heap sizes for other compilers too.

Adding @danish-iftikhar


This comment has been minimized.


bulislaw commented Apr 18, 2017

Heap should be set dynamically to 'remaining memory' for GCC and ARM, as far as i know it's impossible to do that for IAR. So it's more or less per platform exercise to maintain balance and don't waste too much memory. @0xc0170


This comment has been minimized.


bulislaw commented Apr 18, 2017

Actually a lot of platforms hard code it to 1/4 of RAM not only for IAR.


This comment has been minimized.


0xc0170 commented Apr 18, 2017

/morph test

1 similar comment

This comment has been minimized.


0xc0170 commented Apr 20, 2017

/morph test


This comment has been minimized.

mbed-bot commented Apr 20, 2017


Your command has finished executing! Here's what you wrote!

/morph test


mbed Build Number: 48

All builds and test passed!

@theotherjimmy theotherjimmy merged commit 39061b0 into ARMmbed:master Apr 24, 2017

4 checks passed

Cam-CI uvisor Build & Test Success
ci/morph-test Job has completed
continuous-integration/jenkins/pr-head This commit looks good
continuous-integration/travis-ci/pr The Travis CI build passed

exmachina-auto-deployer pushed a commit to exmachina-dev/mbed-os that referenced this pull request May 16, 2017

Merge tag 'mbed-os-5.4.5' of into feature/…

Release mbed OS 5.4.5 and mbed lib v142

Ports for Upcoming Targets

Fixes and Changes

4059: [Silicon Labs] Rename targets ARMmbed#4059
4115: Support for Qt Creator Generic project export and associated Makefile ARMmbed#4115
3915: Feature vscode ARMmbed#3915
4205: tests: race test - add not supported for single threaded env ARMmbed#4205
4187: [NCS36510] Reduce default heap size allocated by IAR to 1/4 of RAM ARMmbed#4187
4145: test - add nanostack to examples.json file ARMmbed#4145
4093: New feature - update a branch instead of a fork, plus general improvements. ARMmbed#4093
4225: fixed missing device_name for xDot and removed progen ARMmbed#4225
4243: Config: config header file should contain new line ARMmbed#4243
4251: Fix C++11 build error w/ u-blox EVK-ODIN-W2 ARMmbed#4251
4236: STM32 Fixed warning related to __packed redefinition ARMmbed#4236
4224: Add `mbed new .` output to export ARMmbed#4224
4190: LPC4088: Enable LWIP feature ARMmbed#4190
4136: Error when bootloader is specified but does not exist ARMmbed#4136
3881: Remove debug links to printf/exit in NDEBUG builds ARMmbed#3881
4260: Inherit Xadow M0 target from LPC11U35_501 ARMmbed#4260
4249: Add consistent button names across targets ARMmbed#4249
4254: Removed unused variable in TARGET_NXP/lpc17_emac.c ARMmbed#4254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment