Carles Cufi | ecc34bb | 2018-01-22 18:02:46 +0100 | [diff] [blame] | 1 | # Running mynewt apps with MCUboot |
| 2 | |
| 3 | Due to small differences between Mynewt's bundled bootloader and MCUboot, |
| 4 | when building an app that will be run with MCUboot as the bootloader and |
| 5 | which at the same time requires to use `newtmgr` to manage images, MCUboot |
| 6 | must be added as a new dependency for this app. |
| 7 | |
| 8 | First you need to add the repo to your `project.yml`: |
| 9 | |
| 10 | ``` |
| 11 | project.repositories: |
| 12 | - mcuboot |
| 13 | |
| 14 | repository.mcuboot: |
| 15 | type: github |
| 16 | vers: 0-dev |
| 17 | user: runtimeco |
| 18 | repo: mcuboot |
| 19 | ``` |
| 20 | |
| 21 | Then update your app's `pkg.yml` adding the extra dependency: |
| 22 | |
| 23 | ``` |
| 24 | pkg.deps: |
| 25 | - "@mcuboot/boot/bootutil" |
| 26 | ``` |
| 27 | |
| 28 | Also remove any dependency on `boot/bootutil` (mynewt's bundled bootloader) |
| 29 | which might exist. |
| 30 | |
| 31 | To configure MCUboot check all the options available in |
| 32 | `boot/mynewt/mcuboot_config/syscfg.yml`. |
| 33 | |
| 34 | Also, MCUboot uses a different image header struct as well as slightly |
| 35 | different TLV structure, so images created by `newt` have to be generated |
| 36 | in this new format. That is done by passing the extra parameter `-2` as in: |
| 37 | |
| 38 | `newt create-image <target> <version> <pubkey> -2` |