Skip to content

Commit c47f0e0

Browse files
committed
Add --pad flag to initial signing command
The `--pad` option flag for `imgtool` should be used for firmware that is flashed directly onto the microcontroller (ie: factory-installed firmware). This ensures the trailer TLVs are valid at first bootup.
1 parent 39daf63 commit c47f0e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ The next step is to sign the main application binary.
170170
**Note:** even if the internal main application is not verified (ie: the digital signature is not checked) this step **must** be performed so the appropriate application header info is prepended to the binary. mcuboot will not execute the internal main application if this header info is missing or corrupt.
171171

172172
```
173-
imgtool sign -k signing-keys.pem --align 4 -v 1.2.3+4 --header-size 4096 --pad-header -S 0xC0000 mbed-mcuboot-blinky.hex signed.hex
173+
imgtool sign -k signing-keys.pem --align 4 -v 1.2.3+4 --header-size 4096 --pad-header -S 0xC0000 --pad mbed-mcuboot-blinky.hex signed.hex
174174
```
175175

176176
Explanation of each option:
@@ -181,6 +181,7 @@ Explanation of each option:
181181
- `--header-size 4096`: this must be the same as the value specified in `mcuboot.header-size` configuration (4096 bytes by default)
182182
- `--pad-header`: this tells imgtool to insert the entire header, including any necessary padding bytes.
183183
- `-S 0xC0000`: this specifies the maximum size of the application ("slot size"). It **must** be the same as the configured `mcuboot.slot-size`!
184+
- `--pad`: this should only be used for binaries you plan on initially flashing to your target at the factory. It pads the resulting binary to the slot size and adds initialized trailer TLVs. This is not needed for update binaries.
184185

185186

186187
### Creating the update binary

0 commit comments

Comments
 (0)