Skip to content
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

Issue 3763: Reduce heap allocation in the GCC linker file #4014

Merged
merged 1 commit into from
Apr 6, 2017

Conversation

mmahadevan108
Copy link
Contributor

Reduce heap allocation in the GCC linker file, this should address the below issues.

#3978
#3763

Status

**READY

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
@mmahadevan108
Copy link
Contributor Author

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 27, 2017

@mmahadevan108 How did you test this patch?

@SeppoTakalo
Copy link
Contributor

I'm OK with the change but this does not fix the Issue #3978

Link: nanostack-border-router
/Users/septak01/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: ./BUILD/K66F/GCC_ARM/nanostack-border-router.elf section `.bss' will not fit in region `m_data'
/Users/septak01/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: region `m_data' overflowed by 19236 bytes
collect2: error: ld returned 1 exit status
[ERROR] /Users/septak01/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: ./BUILD/K66F/GCC_ARM/nanostack-border-router.elf section `.bss' will not fit in region `m_data'
/Users/septak01/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: region `m_data' overflowed by 19236 bytes
collect2: error: ld returned 1 exit status

[mbed] ERROR: "python" returned error code 1.
[mbed] ERROR: Command "python -u /Users/septak01/src/tmp/nanostack-border-router/mbed-os/tools/make.py -t GCC_ARM -m K66F --source . --build ./BUILD/K66F/GCC_ARM" in "/Users/septak01/src/tmp/nanostack-border-router"
---

@SeppoTakalo
Copy link
Contributor

Note that it is the .bss section that does not fit into m_data

On K64F the .data and .bss sections seems to be going into m_data2 which is larger.

Also K64F linker file seems to have all sorts of uVisor related configs, can/should these be made to match?

@mmahadevan108
Copy link
Contributor Author

@SeppoTakalo . Thanks for testing. I will make a separate pull request to move .bss to data_2 Section.

@mmahadevan108
Copy link
Contributor Author

Tested using the mbed-os tests.

__stack_size__ = 0x400;

/* This is the guaranteed minimum available heap size for an application. When
* uVisor is enabled, this is also the maximum available heap size. The
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uvisor is not supported for these targets in this patch (most of them) ,and the comment makes reference to it. Shall be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left this allocation in heap in place just in case we decide to have uvisor on these targets in future.

__heap_size__ = 0x10000;
/* With the RTOS in use, this does not affect the main stack size. The size of
* the stack where main runs is determined via the RTOS. */
__stack_size__ = 0x400;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I asked already, just to be certain - this has no affect for mbed 2 apps (no RTOS) ? As its for GCC

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the mbed 2 tests with GCC work after this change.

@adbridge
Copy link
Contributor

@0xc0170 are you happy review comments are addressed ?

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 30, 2017

@0xc0170 are you happy review comments are addressed ?

Yes, we will fix stack sizes separately for all targets.

@adbridge
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: SUCCESS

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

/morph test

Output

mbed Build Number: 1802

All builds and test passed!

@mmahadevan108
Copy link
Contributor Author

Anything else needed on this one?

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 4, 2017

Anything else needed on this one?

LGTM

@sg- sg- merged commit 6c6c2fa into ARMmbed:master Apr 6, 2017
@mmahadevan108 mmahadevan108 deleted the Update_GCC_ARM_Linker branch April 7, 2017 19:07
aisair pushed a commit to aisair/mbed that referenced this pull request Apr 30, 2024
Ports for Upcoming Targets

3841: Add nRf52840 target ARMmbed/mbed-os#3841
3992: Introducing UBLOX_C030 platform. ARMmbed/mbed-os#3992

Fixes and Changes

3951: [NUCLEO_F303ZE] Correct ARDUINO pin ARMmbed/mbed-os#3951
4021: Fixing a macro to detect when RTOS was in use for the NRF52840_DK ARMmbed/mbed-os#4021
3979: KW24D: Add missing SPI defines and Arduino connector definitions ARMmbed/mbed-os#3979
3990: UBLOX_C027: construct a ticker-based wait, rather than calling wait_ms(), in the  ARMmbed/mbed-os#3990
4003: Fixed OBOE in async serial tx for NRF52 target, fixes #4002 ARMmbed/mbed-os#4003
4012: STM32: Correct I2C master error handling ARMmbed/mbed-os#4012
4020: NUCLEO_L011K4 remove unsupported tool chain files ARMmbed/mbed-os#4020
4065: K66F: Move bss section to m_data_2 Section ARMmbed/mbed-os#4065
4014: Issue 3763: Reduce heap allocation in the GCC linker file ARMmbed/mbed-os#4014
4030: [STM32L0] reduce IAR heap and stack size for small targets ARMmbed/mbed-os#4030
4109: NUCLEO_L476RG : minor serial pin update ARMmbed/mbed-os#4109
3982: Ticker - kl25z bugfix for handling events in the past ARMmbed/mbed-os#3982
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants