-
Notifications
You must be signed in to change notification settings - Fork 3k
Provide multiple RAM region support for the heap when using GCC #9518
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
Comments
Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-807 |
@ARMmbed/mbed-os-core |
@marcuschangarm - I did some experimentation with linker scripts and _sbrk over here deepikabhavnani@7c13576 GCC memory allocator does not support non-contiguous heap allocations. See commit messages for more info,
Split heap may work if memory is contiguous. Also for now it is |
Similar experiment was done with K64F, since its memory map is contiguous, but RAM banks are physically separate, changes here: deepikabhavnani@da428a1 Code for main
Output
|
Resolved via #9944 |
Uh oh!
There was an error while loading. Please reload this page.
Description
Some MCUs, like the STM32L475, have multiple discrete RAM regions. Accessing memory across these boundaries will cause a hard fault. The current
sbrk
implementation for GCC only allocates heap from one of these regions, leaving unused memory in other regions unavailable.With a custom
sbrk
implementation it is possible to allocate heap from multiple regions (see #9441), but the current Mbed OS tests for stack and heap make assumptions that prevent users from mainlining these changes.It would be useful if Mbed OS defined linker names for multiple regions, e.g.,
__mbed_sbrk_start_0
,__mbed_sbrk_start_1
, etc. and providedsbrk
functions that took advantage of these. It would then just be a matter of linker script and target configuration for each target instead of each target providing its ownsbrk
.Issue request type
The text was updated successfully, but these errors were encountered: