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

Let libraries, targets configure bootloader #5909

Merged
merged 6 commits into from Feb 1, 2018

Conversation

Projects
None yet
8 participants
@theotherjimmy
Contributor

theotherjimmy commented Jan 23, 2018

Abstract

This PR lets libraries and targets configure boot loader parameters like any other parameter. This allows a release of a boot loader as an mbed library, with an mbed_lib.json that contains links to the boot loader binaries.

Usage

The following patch, to mbed-os-example-bootloader-blinky, shows how this allows a standalone bootloader directory to contain all information required to merge a boot loader.

diff --git a/bootloader/mbed_lib.json b/bootloader/mbed_lib.json
new file mode 100644
index 0000000..eea6b25
--- /dev/null
+++ b/bootloader/mbed_lib.json
@@ -0,0 +1,24 @@
+{
+    "name": "bootloader_images",
+    "target_overrides": {
+        "K64F": {
+            "target.bootloader_img": "K64F.bin"
+        },
+        "NUCLEO_F429ZI": {
+            "target.bootloader_img": "NUCLEO_F429ZI.bin"
+        },
+        "UBLOX_EVK_ODIN_W2": {
+            "target.bootloader_img": "UBLOX_EVK_ODIN_W2.bin"
+        }
+    }
+}
diff --git a/mbed_app.json b/mbed_app.json
deleted file mode 100644
index 12ced95..0000000
--- a/mbed_app.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-    "target_overrides": {
-        "K64F": {
-            "target.bootloader_img": "bootloader/K64F.bin"
-        },
-        "NUCLEO_F429ZI": {
-            "target.bootloader_img": "bootloader/NUCLEO_F429ZI.bin"
-        },
-        "UBLOX_EVK_ODIN_W2": {
-            "target.bootloader_img": "bootloader/UBLOX_EVK_ODIN_W2.bin"
-        }
-    }
-}

TODO

  • Config Tests

@cmonr cmonr added the needs: review label Jan 23, 2018

@theotherjimmy theotherjimmy force-pushed the theotherjimmy:bl-as-config branch 2 times, most recently from 56e6d39 to 6327d24 Jan 24, 2018

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jan 24, 2018

@sarahmarshy @cmonr @0xc0170 Could you review?

@0xc0170 0xc0170 requested review from cmonr and sarahmarshy Jan 25, 2018

@theotherjimmy theotherjimmy changed the title from Allow libraries to configure bootloader to Allow libraries, targets to configure bootloader Jan 25, 2018

@theotherjimmy theotherjimmy changed the title from Allow libraries, targets to configure bootloader to Let libraries, targets to configure bootloader Jan 25, 2018

@theotherjimmy theotherjimmy changed the title from Let libraries, targets to configure bootloader to Let libraries, targets configure bootloader Jan 25, 2018

@theotherjimmy theotherjimmy force-pushed the theotherjimmy:bl-as-config branch 3 times, most recently from 90398ba to db3e87a Jan 25, 2018

@theotherjimmy theotherjimmy referenced this pull request Jan 26, 2018

Merged

Reserve and Render header in managed BL mode #5950

0 of 1 task complete
@sarahmarshy

This comment has been minimized.

Contributor

sarahmarshy commented Jan 26, 2018

Would it still work at the application level?

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jan 26, 2018

Yes.

self.cc.append("-D%s=0x%x" % define)
self.cppc.append("-D%s=0x%x" % define)
if region.active:
self.ld.append(self.make_ld_define(*define))

This comment has been minimized.

@sarahmarshy

sarahmarshy Jan 26, 2018

Contributor

Will this still work for MBED_APP_START in the linker scripts? It seems like MBED_APP_START_ADDR would be the new define?

This comment has been minimized.

@sarahmarshy

sarahmarshy Jan 26, 2018

Contributor

I just tried these changes with bootloader blinky for K64F and it did not work. I could see that it only -DAPPLICATION_ADDR and -DAPPLICATION_SIZE were passed to the linker. The k64f linker script expects MBED_APP_START.

This comment has been minimized.

@theotherjimmy

theotherjimmy Jan 26, 2018

Contributor

Yep. Let me fix that.

@cmonr

cmonr approved these changes Jan 26, 2018

@sarahmarshy

The linker script defines need to be added to the profile like on master - https://github.com/ARMmbed/mbed-os/blob/master/tools/build_api.py#L301-L304. The current changes do not pass the correct defines to the linker.

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jan 26, 2018

@sarahmarshy The linker defines are passed to the linker, just named incorrectly. The do not need to be part of the profile, just part of the command line.

@theotherjimmy theotherjimmy force-pushed the theotherjimmy:bl-as-config branch 2 times, most recently from 741248d to ca56a49 Jan 26, 2018

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jan 26, 2018

@sarahmarshy That should do it.

@sarahmarshy

Tried with bootloader blinky, and it works now! Good work. LGTM.

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jan 26, 2018

now to rebase #5950

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jan 26, 2018

/morph build

@theotherjimmy theotherjimmy force-pushed the theotherjimmy:bl-as-config branch from 7433ca8 to 6eebc71 Jan 31, 2018

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jan 31, 2018

Rebased
/morph build

@cmonr cmonr added needs: CI and removed needs: work labels Jan 31, 2018

@mbed-ci

This comment has been minimized.

mbed-ci commented Jan 31, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jan 31, 2018

@studavekar Looks like the build experienced a license timeout with the ARM compiler.

@studavekar

This comment has been minimized.

Collaborator

studavekar commented Jan 31, 2018

@studavekar Looks like the build experienced a license timeout with the ARM compiler.

May be issue with license server/connectivity, re-triggering it

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Jan 31, 2018

Build : SUCCESS

Build number : 1028
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5909/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci

This comment has been minimized.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jan 31, 2018

/morph uvisor-test

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 1, 2018

/morph uvisor-test

1 similar comment
@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 1, 2018

/morph uvisor-test

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Feb 1, 2018

@cmonr Poke. Looks ready to merge

@marcuschangarm

This comment has been minimized.

Contributor

marcuschangarm commented Feb 1, 2018

@cmonr double poke. 😄

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Feb 1, 2018

@marcuschangarm

This comment has been minimized.

Contributor

marcuschangarm commented Feb 1, 2018

@0xc0170 fine, we can poke you too! 😆

@cmonr cmonr merged commit bf3693f into ARMmbed:master Feb 1, 2018

19 checks passed

ARM mbed CI Verification build successful.
Details
AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Local events testing has passed
Details
travis-ci/littlefs Local littlefs testing has passed
Details
travis-ci/mbed2-ATMEL Local mbed2-ATMEL testing has passed
Details
travis-ci/mbed2-MAXIM Local mbed2-MAXIM testing has passed
Details
travis-ci/mbed2-NORDIC Local mbed2-NORDIC testing has passed
Details
travis-ci/mbed2-NUVOTON Local mbed2-NUVOTON testing has passed
Details
travis-ci/mbed2-NXP Local mbed2-NXP testing has passed
Details
travis-ci/mbed2-RENESAS Local mbed2-RENESAS testing has passed
Details
travis-ci/mbed2-SILICON_LABS Local mbed2-SILICON_LABS testing has passed
Details
travis-ci/mbed2-STM Local mbed2-STM testing has passed
Details
travis-ci/tools Local tools testing has passed
Details

@cmonr cmonr removed the ready for merge label Feb 1, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Feb 1, 2018

Jeez, can't a guy enjoy a morning taco anymore? 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment