@@ -4,7 +4,7 @@ title: Building and using MCUboot with Zephyr
4
4
5
5
# Building and using MCUboot with Zephyr
6
6
7
- MCUboot began its life as the bootloader for Mynewt. It has since
7
+ MCUboot began its life as the bootloader for Mynewt. It has since
8
8
acquired the ability to be used as a bootloader for Zephyr as well.
9
9
There are some pretty significant differences in how apps are built
10
10
for Zephyr, and these are documented here.
@@ -46,10 +46,10 @@ Install additional packages required for development with MCUboot:
46
46
## Building the bootloader itself
47
47
48
48
The bootloader is an ordinary Zephyr application, at least from
49
- Zephyr's point of view. There is a bit of configuration that needs to
50
- be made before building it. Most of this can be done as documented in
51
- the ` CMakeLists.txt ` file in boot/zephyr. There are comments there for
52
- guidance. It is important to select a signature algorithm, and decide
49
+ Zephyr's point of view. There is a bit of configuration that needs to
50
+ be made before building it. Most of this can be done as documented in
51
+ the ` CMakeLists.txt ` file in boot/zephyr. There are comments there for
52
+ guidance. It is important to select a signature algorithm, and decide
53
53
if the primary slot should be validated on every boot.
54
54
55
55
To build MCUboot, create a build directory in boot/zephyr, and build
@@ -93,7 +93,7 @@ board and then just make a copy of it to get started on your own
93
93
application; see samples/zephyr/README.md for a tutorial.
94
94
95
95
The Zephyr ` CONFIG_BOOTLOADER_MCUBOOT ` configuration option
96
- [ documentation] ( http ://docs.zephyrproject.org/reference /kconfig/CONFIG_BOOTLOADER_MCUBOOT .html)
96
+ [ documentation] ( https ://docs.zephyrproject.org/latest /kconfig.html#CONFIG_BOOTLOADER_MCUBOOT )
97
97
provides additional details regarding the changes it makes to the image
98
98
placement and generation in order for an application to be bootable by
99
99
MCUboot.
@@ -105,11 +105,11 @@ With this, build the application as your normally would.
105
105
In order to upgrade to an image (or even boot it, if
106
106
` MCUBOOT_VALIDATE_PRIMARY_SLOT ` is enabled), the images must be signed.
107
107
To make development easier, MCUboot is distributed with some example
108
- keys. It is important to stress that these should never be used for
108
+ keys. It is important to stress that these should never be used for
109
109
production, since the private key is publicly available in this
110
- repository. See below on how to make your own signatures.
110
+ repository. See below on how to make your own signatures.
111
111
112
- Images can be signed with the ` scripts/imgtool.py ` script. It is best
112
+ Images can be signed with the ` scripts/imgtool.py ` script. It is best
113
113
to look at ` samples/zephyr/Makefile ` for examples on how to use this.
114
114
115
115
### Flashing the application
@@ -124,16 +124,16 @@ information. Additionally you will need to make sure that the flash tool does
124
124
not perform a mass erase (erasing the whole of the flash) or else you would be
125
125
deleting MCUboot.
126
126
These images can also be marked for upgrade, and loaded into the secondary slot,
127
- at which point the bootloader should perform an upgrade. It is up to
127
+ at which point the bootloader should perform an upgrade. It is up to
128
128
the image to mark the primary slot as "image ok" before the next reboot,
129
129
otherwise the bootloader will revert the application.
130
130
131
131
## Managing signing keys
132
132
133
133
The signing keys used by MCUboot are represented in standard formats,
134
- and can be generated and processed using conventional tools. However,
134
+ and can be generated and processed using conventional tools. However,
135
135
` scripts/imgtool.py ` is able to generate key pairs in all of the
136
- supported formats. See [ the docs] ( /documentation/imgtool/ ) for more details on
136
+ supported formats. See [ the docs] ( /documentation/imgtool/ ) for more details on
137
137
this tool.
138
138
139
139
### Generating a new keypair
@@ -145,14 +145,14 @@ subcommand:
145
145
$ ./scripts/imgtool.py keygen -k mykey.pem -t rsa-2048
146
146
```
147
147
148
- The argument to ` -t ` should be the desired key type. See the
148
+ The argument to ` -t ` should be the desired key type. See the
149
149
[ the docs] ( /documentation/imgtool/ ) for more details on the possible key types.
150
150
151
151
### Extracting the public key
152
152
153
153
The generated keypair above contains both the public and the private
154
- key. It is necessary to extract the public key and insert it into the
155
- bootloader. The keys live in ` boot/zephyr/keys.c ` , and can be
154
+ key. It is necessary to extract the public key and insert it into the
155
+ bootloader. The keys live in ` boot/zephyr/keys.c ` , and can be
156
156
extracted using imgtool:
157
157
158
158
```
0 commit comments