Skip to content

Maxim: Add bare metal support to targets #14465

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

Merged
merged 4 commits into from
Apr 15, 2021

Conversation

harmut01
Copy link
Contributor

@harmut01 harmut01 commented Mar 24, 2021

Summary of changes

Fixes #13139

Add heap load region to scatter file and update targets.json to
provide baremetal support to the following targets: SDT32620B,
SDT32625B, MAX32620FTHR, MAX32625MBED, MAX32625PICO,
and MAX32630FTHR.

Impact of changes

Maxim targets

Migration actions required

None

Documentation

None


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[x] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@harmut01 harmut01 requested review from hugueskamba, 0xc0170 and a team March 24, 2021 15:34
@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Mar 24, 2021
@ciarmcom ciarmcom requested a review from a team March 24, 2021 16:00
@ciarmcom
Copy link
Member

@harmut01, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}

; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
RW_IRAM1 (0x20000000+0x110) (0x28000-0x110-Stack_Size) { ; RW data
RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-VECTOR_SIZE-Stack_Size) { ; RW data
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-VECTOR_SIZE-Stack_Size) { ; RW data
RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-MBED_RAM_FIXED_SIZE) { ; RW data

@ahmetalincak
Copy link

Thanks for the changes. I also worked on this issue and have a merged PR #14080 . I guess I missed this SDT32620B target. Also I haven't changed the scatter files. Do they really have effect on behavior? @harmut01

@harmut01
Copy link
Contributor Author

@ahmetalincak the main change in the scatter files is the addition of heap load regions, this is intended to enable the ARM compiler to build with the small c library. The remaining are largely to make the scatter files consistent with those in other targets (see this for example).

@harmut01 harmut01 changed the title Maxim: Add bare metal support to targets Maxim: Add bare metal support to targets for Arm Compiler 6 Mar 24, 2021
@harmut01
Copy link
Contributor Author

I've update the title to more accurately reflect the changes.

@hugueskamba
Copy link
Collaborator

Thanks for the changes. I also worked on this issue and have a merged PR #14080 . I guess I missed this SDT32620B target. Also I haven't changed the scatter files. Do they really have effect on behavior? @harmut01

Microlib does not support selectable one or two region memory models as the standard library (stdlib) does.
Microlib provides only the two region memory model with separate stack and heap regions.

Source: https://developer.arm.com/documentation/dui0475/m/the-arm-c-micro-library/differences-between-microlib-and-the-default-c-library

@hugueskamba
Copy link
Collaborator

This PR adds bare-metal support for both ARM and GCC_ARM unlike what the title says.

@harmut01 harmut01 changed the title Maxim: Add bare metal support to targets for Arm Compiler 6 Maxim: Add bare metal support to targets Mar 25, 2021
@harmut01 harmut01 requested a review from hugueskamba March 25, 2021 14:14
ARM_LIB_STACK (0x20000000+0x80000) EMPTY -Stack_Size { ; stack
ARM_LIB_HEAP AlignExpr(+0, +16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE - (AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_RAM_START)){ ; heap growing up
}
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -Stack_Size { ; stack growing down

Add heap load region to scatter file and update `targets.json` to
provide baremetal support to the following targets: SDT32620B,
SDT32625B, MAX32620FTHR, MAX32625MBED, MAX32625PICO, and MAX32630FTHR.
@adbridge
Copy link
Contributor

@hugueskamba could you please re-review based on the updates.

@harmut01 harmut01 requested a review from hugueskamba March 31, 2021 13:24
@harmut01 harmut01 requested a review from hugueskamba March 31, 2021 15:28
Copy link
Collaborator

@hugueskamba hugueskamba left a comment

Choose a reason for hiding this comment

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

LGTM (assuming you attempted to build one of the Mbed targets affected by the linker file changes).

@harmut01
Copy link
Contributor Author

@0xc0170 can we start CI on this?

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 12, 2021

CI started

@mbed-ci
Copy link

mbed-ci commented Apr 12, 2021

Jenkins CI Test : ❌ FAILED

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_cmake-example-test

@mergify mergify bot added needs: work and removed needs: CI labels Apr 12, 2021
@harmut01
Copy link
Contributor Author

@0xc0170 it appears CI timed out on while running mbed-os-example-crash-reporting for an unrelated target.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 15, 2021

CI restarted

@mbed-ci
Copy link

mbed-ci commented Apr 15, 2021

Jenkins CI Test : ✔️ SUCCESS

Build Number: 2 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

@0xc0170 0xc0170 merged commit 016d725 into ARMmbed:master Apr 15, 2021
@mergify mergify bot removed the ready for merge label Apr 15, 2021
@mbedmain mbedmain removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Apr 26, 2021
Copy link

@ahmetalincak ahmetalincak left a comment

Choose a reason for hiding this comment

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

Please re-review this commit to fix MBED MAXIM parts for ARMC6 compiler.

@0xc0170 @harmut01 @hugueskamba

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.

Maxim targets don't compile with blinky-baremetal
9 participants