Skip to content

Add support for Unmanaged Bootloader #4202

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
May 18, 2017

Conversation

theotherjimmy
Copy link
Contributor

@theotherjimmy theotherjimmy commented Apr 19, 2017

Description

This allows a user to build a completely customized bootloader configuration.

The new configuration options are:

  • target.mbed_app_start: The start address of the application
  • target.mbed_app_size: The size of the application

When elided, the defaults are:

  • target.mbed_app_start defaults to the start of ROM
  • target.mbed_app_size defaults to the remaining ROM from the start of the application

Checks are performed to verify that:

  • target.mbed_app_start is a location in ROM
  • target.mbed_app_size + target.mbed_app_start is also a location in ROM or 1 byte past the end of ROM

Tests

  • Manual verification that boot loader still works
  • Manual verification that mbed_app_start and mbed_app_size change the apps start
    and size, respectively
  • Manually verify that boot loader and mbed_app_* are mutually exclusive
  • /morph test
  • Documentation

@theotherjimmy
Copy link
Contributor Author

CC and Review

@theotherjimmy
Copy link
Contributor Author

/morph test

@theotherjimmy theotherjimmy force-pushed the rom-size-injection branch 2 times, most recently from cbe8546 to ab6450d Compare April 19, 2017 21:45
@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 20, 2017

/morph test

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 20, 2017

retest uvisor

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 45

All builds and test passed!

@LiyouZhou
Copy link
Contributor

This could be useful. Thx.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 21, 2017

@theotherjimmy Still underdevelopment (was updated but no mention here why and what has changed) ?

@theotherjimmy
Copy link
Contributor Author

@0xc0170 I changed the names of things after some productive bikeshedding and talking to a partner engineer offline. I should have informed the PR of what happened.

Let's re-run testing, and then we should be good.
/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 64

All builds and test passed!

@theotherjimmy theotherjimmy changed the title Allow app config to override start and size Add support for "Unmanaged Bootloader" builds Apr 25, 2017
@theotherjimmy theotherjimmy changed the title Add support for "Unmanaged Bootloader" builds Add support for Unmanaged Bootloader Apr 25, 2017
@theotherjimmy
Copy link
Contributor Author

theotherjimmy commented May 2, 2017

@marcuschangarm Could you review?

@marcuschangarm
Copy link
Contributor

I'm not familiar enough with the mbed tools system to offer qualified advice.

@theotherjimmy
Copy link
Contributor Author

@marcuschangarm Could you comment on the usability then?

@adbridge
Copy link
Contributor

adbridge commented May 4, 2017

@theotherjimmy please rebase

@marcuschangarm
Copy link
Contributor

Just gave it a spin and it works great! Two things:

  1. Does the mbed_app_start value get defined anywhere so we can use it in the application?
  2. Changing mbed_app_start in the json file does not trigger a full rebuild and *_application.bin is still using the old value.

@theotherjimmy
Copy link
Contributor Author

Does the mbed_app_start value get defined anywhere so we can use it in the application?

as APPLICATION_ADDR

Changing mbed_app_start in the json file does not trigger a full rebuild and *_application.bin is still using the old value.

I'll work on that.

@theotherjimmy
Copy link
Contributor Author

@marcuschangarm I just made all builds link steps depend on their respective mbed_app.json files. That should fix the dependency issue with both this style bootloader and other config issues.

@marcuschangarm
Copy link
Contributor

Hmm...I don't get a rebuild when I modify the mbed_app.json.

I'm on mbed-cli 1.1.1 and mbed-os bbde379 from your branch.

@theotherjimmy
Copy link
Contributor Author

@marcuschangarm the dependency only affects the link step. Would you like all c and c++ files depend to the app config?

@marcuschangarm
Copy link
Contributor

@theotherjimmy it seems safest since you are exposing variables like APPLICATION_ADDR to the application.

@theotherjimmy
Copy link
Contributor Author

I'll get that today

@theotherjimmy
Copy link
Contributor Author

@marcuschangarm That should do it.

@marcuschangarm
Copy link
Contributor

@theotherjimmy Works great! Thank you very much! 🎉

@theotherjimmy
Copy link
Contributor Author

Your welcome @marcuschangarm

Looks like I broke some unit tests. Now to update them...

@0xc0170
Copy link
Contributor

0xc0170 commented May 15, 2017

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 220

All builds and test passed!

@marcuschangarm
Copy link
Contributor

Looks like it is ready to ship! 🎉

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.

8 participants