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

config: Add RAM1 memory region parameters to mbed_config.cmake #307

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/20210803174602.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add RAM1 memory region overrides.
6 changes: 6 additions & 0 deletions src/mbed_tools/build/_internal/templates/mbed_config.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ set(MBED_TARGET_DEFINITIONS{% for component in components %}
{%- endif %}
{% if mbed_ram_size is defined %}
MBED_RAM_SIZE={{ mbed_ram_size | to_hex }}
{%- endif %}
{% if mbed_ram1_start is defined %}
MBED_RAM1_START={{ mbed_ram1_start | to_hex }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to also support MBED_RAM_2..MBED_RAM_N? https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L443xC/TOOLCHAIN_ARM/stm32l443xc.sct#L50 seems to want MBED_RAM2_* at least.

Copy link
Contributor

@LDong-Arm LDong-Arm Aug 11, 2021

Choose a reason for hiding this comment

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

Related question: I always wonder whether the naming/numbering rules are documented or everyone happens to use the same convention. How is Mbed CLI 1 handling this? (ignore this)

Copy link
Contributor

@LDong-Arm LDong-Arm Aug 11, 2021

Choose a reason for hiding this comment

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

@rwalton-arm Maybe it depends on whether we ever define mbed_ram2_start in targets.json?

Searching Mbed CLI 1 scripts (in mbed-os/tools/), there's only mbed_ram_start, not even ram1. So I wonder how (or if at all) MBED_RAM1_START is set by Mbed CLI 1. Maybe it's not set, and linker scripts fall back to #if !defined( and use hardcoded values for linking? (Worth checking)

{%- endif %}
{% if mbed_ram1_size is defined %}
MBED_RAM1_SIZE={{ mbed_ram1_size | to_hex }}
{%- endif %}
TARGET_LIKE_MBED
__MBED__=1
Expand Down