-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix heap init error in rtos-less code #10078
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
Fix heap init error in rtos-less code #10078
Conversation
@ccli8, thank you for your changes. |
Fix looks fine to me but having |
Any update? How about make it "right" first and then refactor? |
@ARMmbed/mbed-os-core @ARMmbed/mbed-os-hal Please review. |
Any update? |
CI started |
Test run: FAILEDSummary: 2 of 9 test jobs failed Failed test jobs:
|
@mprse The above failures for mbed 2 - |
I am slightly confused about Also not all targets define them in |
NUCLEO_F030R8/ These targets are failing to build. |
Because they are not OS5, only OS2 |
@ccli8 Would it be other way to fix this ? Pulling this header file has implications for mbed 2 targets. Heap definitions should be placed somewhere else and pulled in to retarget. |
Thanks, missed that one today.
@deepikabhavnani how to address this? |
Generally, there is a problem with Mbed 2 and ARM compiler builds for targets which specify The default defines for mbed-os/platform/mbed_retarget.cpp Lines 923 to 931 in ffe9ddf
As far as I remember we assumed that by default only stack region is specified in the scatter files and then default defines are used(from Now since |
Personally, I think that we should add |
I will agree with @mprse on this, we should add |
In rtos-less code, heap is defined by assuming one-region. Through weak-reference to ARM_LIB_HEAP, heap definition is fixed if ARM_LIB_HEAP is defined.
41578f1
to
64515c0
Compare
I make the following modifications:
|
Any update? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me. It would help to describe this via "Release notes" section (add it to your first comment here). This section will be added to the release notes.
I restarted travis, CI will be started once approved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for change 👍
Added "Release Notes" section. |
ci started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
This PR tries to fix heap initialization error in rtos-less code on ARM/ARMC6 toolchain. In rtos-less code,
HEAP_START
is defined in target mbed_rtx.h but not passed to_mbed_user_setup_stackheap
or__rt_lib_init
in mbed_retarget.cpp. The default defines forHEAP_START
/HEAP_SIZE
are for single-region targets. Heap initialization error will occur on two-region targets. We cannot include mbed_rtx.h in mbed_retarget.cpp because Mbed 2 targets don't provide it. Instead, this PR approaches it by weak reference toARM_LIB_HEAP
. Heap definition is fixed ifARM_LIB_HEAP
is defined.Pull request type
Release Notes
On ARM/ARMC6 toolchain, fix heap initialization error for two-region memory model (
ARM_LIB_HEAP
+ARM_LIB_STACK
) in rtos-less code. Original implementation just supports one-region memory model (ARM_LIB_STACK
). This release fixes for two-region memory model.