Skip to content

Commit 8b351f8

Browse files
authored
Minor improvements to README (ARMmbed#130)
1 parent 0074118 commit 8b351f8

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Generic bootloader to be used in conjunction with [mbed-cloud-client](https://gi
1616

1717
The metadata header is the bootloader update interface. Each stage of the boot sequence leading up to and including the application (except the root bootloader) is paired with a metadata header (containing version, size, hash etc.). Information contained in the metadata header allows validation and ordering of available firmwares.
1818

19-
The firmware metadata header structure can be found [here](https://github.com/ARMmbed/mbed-cloud-client/blob/master/update-client-hub/modules/common/update-client-common/arm_uc_metadata_header_v2.h). There are two header formats, internal and external. The external header format is meant to be used when storing firmware on external storage which is assumed to be insecure. Hence the external header format contains extra security information prevent external tampering of the header data.
19+
The firmware metadata header structure can be found [here](https://github.com/ARMmbed/mbed-cloud-client/blob/master/update-client-hub/modules/common/update-client-common/arm_uc_metadata_header_v2.h). There are two header formats, internal and external. The external header format is used for storing firmware on external storage which is assumed to be insecure. Hence the external header format contains extra security information to prevent external tampering of the header data.
2020

2121
## Configurations
2222

@@ -46,10 +46,10 @@ NOTE: See the [mbed cloud client documentation](https://cloud.mbed.com/docs/curr
4646

4747
The bootloader uses device secret key to authenticate anything that is stored on external storage. The update client must be able to obtain the same key as the bootlaoder. The key is derived from a device root of trust using the algorithm [here](https://github.com/ARMmbed/mbed-cloud-client/blob/master/update-client-hub/modules/common/source/arm_uc_crypto.c#L401).
4848

49-
You may choose to use SOTP to generate and store device RoT. During first boot the mbed cloud client will generate a random number from an available entropy source and storge it in SOTP on internal flash. On subsequent boots, the RoT will be read from SOTP. To enable SOTP RoT, you must set the following:
50-
1. Macro `PAL_USE_INTERNAL_FLASH=1` and `PAL_INT_FLASH_NUM_SECTIONS=2` to indicate that 2 sectors are used for SOTP.
51-
1. Macro `ARM_UC_USE_SOTP=1` to tell bootloader to retrive RoT from SOTP.
52-
1. "sotp-section-1-address", "sotp-section-1-size", "sotp-section-2-address", "sotp-section-2-size". The addresses **Must align to flash erase boundary**. The sizes must be full sector sized and at least 1k large.
49+
You may choose to use NVSTORE to store the device RoT. During first boot mbed cloud client will generate a random number from an available entropy source and storge it in NVSTORE on internal flash. On subsequent boots, the RoT will be read from NVSTORE. To enable NVSTORE RoT, you must set the following:
50+
1. Macro `ARM_BOOTLOADER_USE_NVSTORE_ROT=1` to enable the RoT implementation [here](https://github.com/ARMmbed/mbed-bootloader/blob/master/source/nvstore_rot.cpp).
51+
1. "nvstore.area_1_address", "nvstore.area_1_size", "nvstore.area_2_address", "nvstore.area_2_size". The addresses **Must align to flash erase boundary**. The sizes must be full sector sized and at least 1k.
52+
1. NVSTORE and SOTP are binary compatible hence the bootloader works with any software that uses SOTP as long as the offsets are set the same.
5353

5454
Alternatively you can choose to use a custom device specific RoT by implementing the function `mbed_cloud_client_get_rot_128bit`. An example can be found [here](https://github.com/ARMmbed/mbed-bootloader-internal/blob/master/source/example_insecure_rot.c#L40).
5555

@@ -62,7 +62,9 @@ User **may** set in `mbed_app.json`:
6262
1. `SHOW_PROGRESS_BAR`, Set to 1 to print a progress bar for various processes.
6363

6464
## Flash Layout
65+
6566
### The flash layout for K64F with SOTP and firmware storage on internal flash
67+
6668
```
6769
+--------------------------+
6870
| LittleFS |
@@ -89,24 +91,25 @@ User **may** set in `mbed_app.json`:
8991
|Active App Metadata Header|
9092
| |
9193
+--------------------------+ <-+ update-client.application-details
92-
| SOTP_2 |
93-
+--------------------------+ <-+ sotp-section-2-address
94-
| SOTP_1 |
95-
+--------------------------+ <-+ sotp-section-1-address
94+
| NVSTORE_2 |
95+
+--------------------------+ <-+ nvstore.area_2_address
96+
| NVSTORE_1 |
97+
+--------------------------+ <-+ nvstore.area_1_address
9698
| |
9799
| Bootloader |
98100
| |
99-
| |
100101
+--------------------------+ <-+ 0
101102
```
102103

103104
### Notes on Flash Layout
105+
104106
- Internal Flash Only layout can be enabled by compiling the bootloader with the internal_flash_sotp.json configuration file `--app-config configs/internal_flash_sotp.json`. By default the firmware storage region and filesystem is on [external sd card](#external-storage).
105107
- The default flash layout is tested with GCC_ARM compiler and tiny.json compiler profile only. If a different compiler is used, the bootloader binary size will be larger and the offsets needs to be adjusted.
106-
- The SOTP regions require 1 flash erase sector each with at least 1k of space.
108+
- The NVSTORE regions require 1 flash erase sector each with at least 1k of space.
107109
- The LittleFS requires 2 flash sectors per folder and 1 sector per file as well as 2 sectors for the filesystem itself.
108110

109111
### Alignment
112+
110113
**Flash Erase Boundary**: Flash can usually only be erased in blocks of specific sizes, this is platform specific and hence many regions need to align to this boundary.
111114

112115
**Flash Page Boundary**: Flash can usually only be written in blocks of specific sizes, this is platform specific and hence many regions need to align to this boundary.

0 commit comments

Comments
 (0)