Skip to content

Add BL parameter definitions as new document #408

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 7 commits into from
Feb 28, 2018

Conversation

theotherjimmy
Copy link
Contributor

@AnotherButler, where should we link this from?

@theotherjimmy theotherjimmy changed the base branch from master to new_engine February 13, 2018 16:37
* `target.restrict_size`

All of these parameters are valid in `targets.json`, `mbed_lib.json` and `mbed_app.json` and may be defined for individual targets and the wildcard target, `*`. A parameter in `mbed_lib.json` overrides a parameter in `targets.json`, and a parameter in `mbed_app.json` overrides one in `mbed_app.json`.

Copy link

Choose a reason for hiding this comment

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

Is this intended? I assume one should be mbed_lib.json.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ha! Good catch. Yes, the second mbed_app.json should be mbed_lib.json in the last sentence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed with a rebase.


### `target.restrict_size`

This parameter restricts the size of the application to be at most the specified size. When `target.bootloader_img` is present, the start of the current application's code segment is computed as above; Otherwise, the start address is the beginning of ROM. The size of the application computed by rounding the end address down to the nearest flash erase block boundary and subtracting the start address. The post-build merge process will pad the resulting boot loader binary to it's end address.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not completely sure what is the difference between restrict_size and mbed_app_size? It seems like you can use them for the same thing: define the size of your application?

I also don't understand the rounding down part: "The size of the application computed by rounding the end address down to the nearest flash erase block boundary and subtracting the start address"

Copy link
Contributor Author

@theotherjimmy theotherjimmy Feb 15, 2018

Choose a reason for hiding this comment

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

I'll have to think about how to phrase that better. The difference is that restrict_size will generate the POST_APPLICATION_* stuff and pad your executable to the size mentioned and do the rounding down thingy.


While the exporters can export a project using the configuration parameters above, there are some limitations.

The exporters do not interpret Mbed OS Configuration, and any changes to configuration parameters, especially boot loader parameter, require you to re-run the `mbed export` command.
Copy link
Contributor

Choose a reason for hiding this comment

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

This problem is common to all configuration changes, right? It sounds like the bootloader is a special case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true. You could, in theory, modify mbed_config.h for other configuration parameters. BL configs don't even allow that.

Amanda Butler and others added 4 commits February 15, 2018 15:08
Copy edit for active voice, consistent spelling across docs and other minor grammar issues.
Copy edit new text, and combine two sections to avoid duplication.
Copy edit for active voice and spelling, and remove duplicate section because we link to its duplicate.
@marcuschangarm
Copy link
Contributor

Much better! It was easy to understand and didn't leave any lingering questions behind!

Further, the exporters do not implement the postbuild merge that bootloader builds use.

For a managed bootloader:
After exporting a project with the `target.mbed_app_start` setting, you are responsible for ensuring that a boot loader is present, if needed. Without flashing this boot loader image, the device will not boot correctly.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an unmanaged BL parameter, and the unmanaged BL description. This should be swapped with the subsequent paragraph, without changing the title.

@theotherjimmy
Copy link
Contributor Author

Much better.

@theotherjimmy
Copy link
Contributor Author

Good to go!

@AnotherButler AnotherButler merged commit 210bd76 into ARMmbed:new_engine Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants