Skip to content

Commit 2e880b9

Browse files
author
Janne Kiiskila
committed
Update versions - OS 5.14.1, Client 4.0.0, formatting
Versions were wrong, updating to match current .lib hashes. Adding some formatting - personally I think all the "command like" and JSON -type stuff should be in formatted text mode.
1 parent 80179e5 commit 2e880b9

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

README.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Pelion Client Mbed OS Example
22

33
This is a simplified example with the following features:
4-
- Mbed OS 5.13.0 and Pelion Device Management Client 3.3.0
4+
- Mbed OS 5.14.1 and Pelion Device Management Client 4.0.0
55
- Support for FW Update
66
- 200 lines of code + credential sources
77

@@ -43,15 +43,19 @@ This section is intended for developers to get started, import the example appli
4343

4444
This repository is in the process of being updated and depends on few enhancements being deployed in mbed-cloud-client. In the meantime, follow these steps to import and apply the patches before compiling.
4545

46+
```
4647
mbed import mbed-os-pelion-example
4748
cd mbed-os-pelion-example
49+
```
4850

4951
## Compiling
5052

53+
```
5154
mbed target K64F
5255
mbed toolchain GCC_ARM
5356
mbed device-management init -d arm.com --model-name example-app --force -q
5457
mbed compile
58+
```
5559

5660
## Program Flow
5761

@@ -117,6 +121,7 @@ You can extend or override the default configuration using `mbed_app.json` in th
117121

118122
Then start designing the system memory map, the location of components (whether they are on internal or external memory), and the corresponding base addresses and sizes. You may want to create a diagram similar to the one below to help you to make design decisions:
119123

124+
```
120125
+--------------------------+
121126
| |
122127
| |
@@ -147,30 +152,35 @@ You can extend or override the default configuration using `mbed_app.json` in th
147152
| Bootloader |
148153
| |
149154
+--------------------------+ <-+ 0
155+
```
150156

151157
In cases where the MCU has two separate memory banks, it's appropiate to allocate the bootloader and base application in one bank, and KVSTORE storage at the begining of the second bank followed by a firmware candidate storage.
152158

153159
- **Option 1:** Allocating credentials in internal memory
154160

155161
**This is the preferred option whenever possible**. Make sure `TDB_INTERNAL` is the type of storage selected in `mbed_app.json`. Specify the base address depending on the available memory in the system. The size of this section should be aligned with the flash erase sector. The value should be multiple of 4 with a minimum of 24KB and upwards depending on the use case (for example the usage of certificate chain will increase the need of storage to hold those certificates). An example of this configuration can be seen for the `NUCLEO_F429ZI` platform in this application.
156162

163+
```
157164
"storage.storage_type" : "TDB_INTERNAL"
158165
"storage_tdb_internal.internal_base_address": "(MBED_ROM_START+1024*1024)",
159166
"storage_tdb_internal.internal_size" : "(128*1024)",
167+
```
160168

161169
- **Option 2:** Allocating credentials in external memory:
162170

163171
This is possible when the platform has an storage device wired to the MCU (could be on-board or external component). Make sure `FILESYSTEM` is specified as type of storage. The blockdevice and filesystem should be one of the supported in Mbed OS (see [docs](https://os.mbed.com/docs/mbed-os/latest/porting/blockdevice-port.html)).
164172

165173
An example of this configuration can be seen for the `K64F` platform in the [mbed-cloud-client-example](https://github.com/ARMmbed/mbed-cloud-client-example/blob/master/mbed_app.json#L32)
166174

175+
```
167176
"storage.storage_type" : "FILESYSTEM",
168177
"storage_filesystem.blockdevice" : "SD",
169178
"storage_filesystem.filesystem" : "LITTLE",
170179
"storage_filesystem.internal_base_address" : "(32*1024)",
171180
"storage_filesystem.rbp_internal_size" : "(8*1024)",
172181
"storage_filesystem.external_base_address" : "(0x0)",
173182
"storage_filesystem.external_size" : "(1024*1024*64)",
183+
```
174184

175185
### c. Storage for firmware updates
176186

@@ -198,30 +208,36 @@ You can extend or override the default configuration using `mbed_app.json` in th
198208

199209
An example of this configuration can be seen for the `NUCLEO_F429ZI` platform.
200210

211+
```
201212
"update-client.application-details" : "(MBED_ROM_START + MBED_BOOTLOADER_SIZE)",
202213
"update-client.bootloader-details" : "0x08007300",
203214
"target.bootloader_img" : "bootloader/mbed-bootloader-<target>",
204215
"target.header_offset" : "0x8000",
205216
"target.app_offset" : "0x8400",
217+
```
206218

207219
- **Option 1:** Allocating the firmware update candidate in internal memory
208220

209221
**This is the preferred option whenever possible**. Make sure `ARM_UCP_FLASHIAP` is selected in `update-storage` in `mbed_app.json`. This area should be located at the end of the flash after the KVSTORE area. Specify the `storage-address`, `storage-size` and `storage-page` as required. The `application-details` option should point at the end of the bootloader area. An example of this configuration can be seen for the `NUCLEO_F429ZI` platform.
210222

223+
```
211224
"mbed-cloud-client.update-storage" : "ARM_UCP_FLASHIAP",
212225
"update-client.storage-address" : "(MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS+MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE)",
213226
"update-client.storage-size" : "(1024*1024-MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE)",
214227
"update-client.storage-page" : 1,
228+
```
215229

216230
- **Option 2:** Allocating the firmware update candidate in external memory
217231

218232
When using an external device to the MCU to store the firmware candidate, make sure `ARM_UCP_FLASHIAP_BLOCKDEVICE` is specified as type of `update-storage`. Specify the `storage-address`, `storage-size` and `storage-page` as required.
219233

220234
An example of this configuration can be seen for the `K64F` platform in the [mbed-cloud-client-example](https://github.com/ARMmbed/mbed-cloud-client-example/blob/master/mbed_app.json#L32)
221235

236+
```
222237
"mbed-cloud-client.update-storage" : "ARM_UCP_FLASHIAP_BLOCKDEVICE",
223238
"update-client.storage-address" : "(1024*1024*64)",
224239
"update-client.storage-size" : "((MBED_ROM_START + MBED_ROM_SIZE - APPLICATION_ADDR) * MBED_CONF_UPDATE_CLIENT_STORAGE_LOCATIONS)",
240+
```
225241

226242
## 2. Bootloader configuration
227243

@@ -231,21 +247,23 @@ The bootloader is required to perform FW Updates. The steps below explain how to
231247

232248
1. Edit the bootloader application configuration in this example (`bootloader/bootloader_app.json`) and add a new target entry. An example of this configuration can be seen for the `NUCLEO_F429ZI` platform:
233249

234-
"update-client.firmware-header-version": "2",
235-
"mbed-bootloader.use-kvstore-rot": 0,
236-
"mbed-bootloader.bootloader-size": "APPLICATION_SIZE",
250+
```
251+
"update-client.firmware-header-version" : "2",
252+
"mbed-bootloader.use-kvstore-rot" : 0,
253+
"mbed-bootloader.bootloader-size" : "APPLICATION_SIZE",
237254
"update-client.application-details" : "(MBED_ROM_START + MBED_BOOTLOADER_SIZE)",
238255
"mbed-bootloader.application-start-address": "(MBED_CONF_UPDATE_CLIENT_APPLICATION_DETAILS + MBED_BOOTLOADER_ACTIVE_HEADER_REGION_SIZE)",
239256
"mbed-bootloader.max-application-size" : "(MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE - MBED_CONF_MBED_BOOTLOADER_APPLICATION_START_ADDRESS)",
240257
"update-client.storage-address" : "(MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE + KVSTORE_SIZE)",
241258
"update-client.storage-size" : "(MBED_BOOTLOADER_FLASH_BANK_SIZE - KVSTORE_SIZE)",
242259
"update-client.storage-locations" : 1,
243-
"kvstore-size": "2*64*1024",
244-
"update-client.storage-page": 1
260+
"kvstore-size" : "2*64*1024",
261+
"update-client.storage-page" : 1
262+
```
245263

246264
1. Compile the bootloader using the `bootloader_app.json` configuration you've just edited:
247265

248-
mbed compile -t <TOOLCHAIN> -m <TARGET> --profile=tiny.json --app-config=.../mbed-os-pelion-example/bootloader/bootloader_app.json>
266+
`mbed compile -t <TOOLCHAIN> -m <TARGET> --profile=tiny.json --app-config=.../mbed-os-pelion-example/bootloader/bootloader_app.json>`
249267

250268
<span class="notes">**Note:** `mbed-bootloader` is primarily optimized for `GCC_ARM`, so you may want to compile it with that toolchain.
251269
Before jumping to the next step, you should compile and flash the bootloader and then connect over the virtual serial port to ensure the bootloader is running correctly. You can ignore errors related to checksum verification or falure to jump to application - these are expected at this stage.</span>
@@ -263,7 +281,7 @@ In addition to having an example application succesfully connected to Pelion DM,
263281

264282
See [mbed-os/TESTS/integration/README.md](https://github.com/ARMmbed/mbed-os/blob/sip-workshop/TESTS/integration/README.md) (sip-workshop branch)
265283

266-
`mbed test -t <toolchain> -m <platform> -n *integration-* -DINTEGRATION_TESTS -v `
284+
`mbed test -t <toolchain> -m <platform> -n *integration-* -DINTEGRATION_TESTS -v`
267285

268286
- Pelion Client tests, including firmware update.
269287

0 commit comments

Comments
 (0)