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` |
Fabio Utzig | 8e0a787 | 2018-04-04 09:20:03 -0300 | [diff] [blame] | 39 | |
| 40 | # Boot serial functionality with Mynewt |
| 41 | |
| 42 | Building with `BOOT_SERIAL: 1` enables some basic management functionality |
| 43 | like listing images and uploading a new image to `slot0`. The serial bootloader |
| 44 | requires that `mtu` is set to a value that is less than or equal to `256`. |
| 45 | This can be done either by editing `~/.newtmgr.cp.json` and setting the `mtu` |
| 46 | for the connection profile, or specifying you connection string manually as in: |
| 47 | |
| 48 | ``` |
| 49 | newtmgr --conntype serial --connstring "dev=/dev/ttyUSB0,mtu=256" image upload -e blinky.img |
| 50 | ``` |
| 51 | |
| 52 | where `/dev/ttyUSB0` is your serial port. |