Skip to content

Commit

Permalink
Generate hex image for all targets by default
Browse files Browse the repository at this point in the history
Mbed OS builds .bin images by default for most targets, but many
targets (e.g. ST targets running the latest ST-LINK firmware) also
support .hex files, making this demo much easier to prepare. In
case a target doesn't support .hex files, README.md already contains
steps for merging .hex files into a single one and converting it to
a .bin file.
  • Loading branch information
LDong-Arm committed Aug 24, 2021
1 parent 8280fe6 commit 9159d0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ You should also install the python package `intelhex` if it is not already insta

This python package includes several utility scripts for working with binaries and .hex files.

By default, the demo application and bootloader are built as hex files to support flashing multiple images to different addresses. Some targets need to have the latest debug interface firmwares to support this, for example ST-LINK's firmware upgrader can be found [here](https://www.st.com/en/development-tools/stsw-link007.html). If your target does not support hex images, a single bin image with everything merged together can be used instead as will be described in [Merging it all together](#Merging-it-all-together) below.

### Creating the signing keys and building the bootloader

This section will only cover steps specific to setting up this project with a signing key pair and signing a main application binary. For more advanced use cases and information, such as using alternative signing algorithms to rsa-2048, see the [mcuboot documentation on Image Signing](https://github.com/mcu-tools/mcuboot/blob/master/docs/signed_images.md#image-signing).
Expand Down Expand Up @@ -236,7 +238,9 @@ Other toolchains will have a similar utility to perform this step.

### Merging it all together

To be able to drag-and-drop program the whole demo together, it is necessary to merge all the hex files we created in the last steps together.
Usually, if your targets support hex files, you can drag-and-drop them one at a time to program them into their respective locations.

If your target doesn't support hex files or performs a whole chip erase upon every drag-and-drop action, it is necessary to merge all the hex files we created in the last steps together.

At this step, you should have created three hex files:
- mbed-mcuboot-demo.hex (the bootloader)
Expand Down
1 change: 1 addition & 0 deletions mbed_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"*": {
"target.restrict_size": "0x20000",
"target.c_lib": "small",
"target.OUTPUT_EXT": "hex",
"mcuboot.log-level": "MCUBOOT_LOG_LEVEL_DEBUG",
"mbed-trace.enable": true,
"mbed-trace.fea-ipv6": false
Expand Down

0 comments on commit 9159d0f

Please sign in to comment.