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

CMake: support OUTPUT_EXT from targets.json #14472

Merged
merged 2 commits into from Mar 29, 2021

Conversation

LDong-Arm
Copy link
Contributor

@LDong-Arm LDong-Arm commented Mar 25, 2021

Summary of changes

Note: This requires ARMmbed/mbed-tools#242 to work fully, but doesn't break compatibility with an older version of mbed-tools in which case the behaviour remains unchanged (i.e. both bin and hex are generated).

The optional OUTPUT_EXT field in Mbed OS targets.json specifies the format of the output image. This is important because

  • some targets only support one image format
  • each post-binary hook outputs one image only

This avoids confusion of having both .hex and .bin images generated while only one of them is usable.

This PR also sets OUTPUT_EXT to bin for ARM_MUSCA_B1 and ARM_MUSCA_S1 as their post-build hook works on the bin file only.

Impact of changes

Migration actions required

Documentation

The use of OUTPUT_EXT is already documented here.


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

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

Manually tested with ARMmbed/mbed-tools#242.


Reviewers

@0xc0170 @hugueskamba @rajkan01 @ARMmbed/mbed-b-tools


By default, Mbed CLI 2 + CMake builds both .bin and .hex images,
unless a target specifies OUTPUT_EXT. The post binary hook for
ARM_MUSCA_S1 and ARM_MUSCA_B1 is run on .bin images only, so we need
to prevent .hex images from being generated and confusing users.
Requires: ARMmbed/mbed-tools#242

The optional `OUTPUT_EXT` field in Mbed OS `targets.json` specifies
the format of the output image. This is important because
* some targets only support one image format
* each post-binary hook outputs one image only

This avoids confusion of having both .hex and .bin images generated
while only one of them is usable.
@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Mar 25, 2021
@ciarmcom
Copy link
Member

@LDong-Arm, thank you for your changes.
@rajkan01 @0xc0170 @hugueskamba @ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@harmut01 harmut01 left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify mergify bot added needs: CI and removed needs: review labels Mar 26, 2021
@Patater Patater added this to Review in progress in Mbed Core Mar 29, 2021
@Patater Patater moved this from Review in progress to Reviewer approved in Mbed Core Mar 29, 2021
@LDong-Arm
Copy link
Contributor Author

@adbridge Shall we start CI on this, thanks!

@Patater
Copy link
Contributor

Patater commented Mar 29, 2021

CI started

@mbed-ci
Copy link

mbed-ci commented Mar 29, 2021

Jenkins CI Test : ✔️ SUCCESS

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-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

@adbridge adbridge merged commit 8075b23 into ARMmbed:master Mar 29, 2021
Mbed Core automation moved this from Reviewer approved & awaiting CI to Done Mar 29, 2021
@mbedmain mbedmain removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Mbed Core
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

7 participants