You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-31Lines changed: 50 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,26 @@
1
-
# Pelion Client Mbed OS Example
1
+
# Pelion Device Management Client example for Mbed OS
2
2
3
-
This is a simplified example for Mbed OS with the following features:
4
-
- Mbed OS 5.14.1 and Pelion Device Management Client 4.0.0
5
-
- Support for FW Update
6
-
-200 lines of code + credential sources
3
+
This is an basic Device Management client example for Mbed OS with the following features:
4
+
-Support for latest Mbed OS and Device Management Client releases.
5
+
- Support for Developer mode provisioning.
6
+
-Support for FW Update.
7
7
8
-
There is an example of the client for multiple operating systems in [mbed-cloud-client-example](https://github.com/ARMmbed/mbed-cloud-client-example) repository. The underlying client library is the same for both. This Mbed OS only example is simpler as it only supports one OS, but if you want to do development in Linux and Mbed OS at the same time - you should use the [mbed-cloud-client-example](https://github.com/ARMmbed/mbed-cloud-client-example).
8
+
There is a more advanced example of the client with support for multiple operating systems in [mbed-cloud-client-example](https://github.com/ARMmbed/mbed-cloud-client-example) repository. The underlying client library is the same for both. This Mbed OS only example is simpler as it only supports one OS with a limited set of demonstrated features. If you want to do development in Linux and Mbed OS at the same time - you should use the [mbed-cloud-client-example](https://github.com/ARMmbed/mbed-cloud-client-example).
9
9
10
-
## Supported platforms
10
+
<spanclass="notes">**Note:** If you want to use production provisioning modes, or use more advanced client features, those are demonstrated via [mbed-cloud-client-example](https://github.com/ARMmbed/mbed-cloud-client-example).</span>
11
11
12
-
This table shows a list of platforms that are supported.
12
+
## Supported boards
13
13
14
-
Platform | Connectivity | Storage for credentials and FW candidate | Notes
14
+
This table shows a list of boards that are supported.
15
+
16
+
Board | Connectivity | Storage for credentials and FW candidate | Notes
Build-only = This target is currently verified only via compilation, and is not verified at runtime.
24
26
@@ -45,8 +47,8 @@ This section is intended for developers to get started, import the example appli
45
47
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.
46
48
47
49
```
48
-
mbed import mbed-os-pelion-example
49
-
cd mbed-os-pelion-example
50
+
mbed import mbed-os-example-pelion
51
+
cd mbed-os-example-pelion
50
52
```
51
53
52
54
## Compiling
@@ -155,17 +157,17 @@ You can extend or override the default configuration using `mbed_app.json` in th
155
157
156
158
-**Option 1:** Allocating credentials in internal memory
157
159
158
-
**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.
160
+
**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`board in this application.
-**Option 2:** Allocating credentials in external memory:
165
167
166
-
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)).
168
+
This is possible when the board 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)).
167
169
168
-
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)
170
+
An example of this configuration can be seen for the `K64F`board in the [mbed-cloud-client-example](https://github.com/ARMmbed/mbed-cloud-client-example/blob/master/mbed_app.json#L32)
169
171
170
172
"storage.storage_type" : "FILESYSTEM",
171
173
"storage_filesystem.blockdevice" : "SD",
@@ -179,7 +181,7 @@ You can extend or override the default configuration using `mbed_app.json` in th
179
181
180
182
Before enabling FW updates, it's recomended that the application is able to initialize the network and connect to Pelion DM.
181
183
182
-
Once the connection is successfull, you can follow the steps below to enable the platform to receive FW updates. Note the configuration for the application in this section should match with the one on the bootloader - see section below.
184
+
Once the connection is successfull, you can follow the steps below to enable the board to receive FW updates. Note the configuration for the application in this section should match with the one on the bootloader - see section below.
183
185
184
186
- Common configuration
185
187
@@ -199,7 +201,7 @@ You can extend or override the default configuration using `mbed_app.json` in th
199
201
200
202
-`target.header_offset` is also relative offset to the `flash-start-address` you specified in the `bootloader_app.json`, and is the hex value of the offset specified by `update-client.application-details`. For example, `(MBED_CONF_APP_FLASH_START_ADDRESS+64*1024)` dec equals `0x10000` hex.</span>
201
203
202
-
An example of this configuration can be seen for the `NUCLEO_F429ZI`platform.
204
+
An example of this configuration can be seen for the `NUCLEO_F429ZI`board.
@@ -209,7 +211,7 @@ You can extend or override the default configuration using `mbed_app.json` in th
209
211
210
212
-**Option 1:** Allocating the firmware update candidate in internal memory
211
213
212
-
**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.
214
+
**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`board.
@@ -220,7 +222,7 @@ You can extend or override the default configuration using `mbed_app.json` in th
220
222
221
223
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.
222
224
223
-
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)
225
+
An example of this configuration can be seen for the `K64F`board in the [mbed-cloud-client-example](https://github.com/ARMmbed/mbed-cloud-client-example/blob/master/mbed_app.json#L32)
@@ -232,7 +234,7 @@ The bootloader is required to perform FW Updates. The steps below explain how to
232
234
233
235
1. Import as a new application the [mbed-bootloader](https://github.com/ARMmbed/mbed-bootloader/) repository.
234
236
235
-
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:
237
+
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`board:
236
238
237
239
238
240
"update-client.firmware-header-version" : "2",
@@ -254,23 +256,40 @@ The bootloader is required to perform FW Updates. The steps below explain how to
254
256
<spanclass="notes">**Note:**`mbed-bootloader` is primarily optimized for `GCC_ARM`, so you may want to compile it with that toolchain.
255
257
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 failure to jump to application - these are expected at this stage.</span>
256
258
257
-
## Validation and testing
259
+
## Validation and testing for the board configuration
258
260
259
-
In addition to having an example application succesfully connected to Pelion DM, it's required to ensure that the application is working correcly in multiple situations. This can be achived by running the following tests:
261
+
The board needs to pass the underlying Mbed OS tests and be supported by official Mbed OS release.
260
262
261
263
- Mbed OS tests (as described in our [documentation](https://os.mbed.com/docs/mbed-os/latest/porting/testing.html))
262
264
263
-
`mbed test`
265
+
`cd mbed-os`
266
+
`mbed test -m <target> -t <toolchain>`
264
267
265
268
- Mbed OS integration tests
266
269
267
270
See [mbed-os/TESTS/integration/README.md](https://github.com/ARMmbed/mbed-os/blob/sip-workshop/TESTS/integration/README.md) (sip-workshop branch)
268
271
269
-
`mbed test -t <toolchain> -m <platform> -n *integration-* -DINTEGRATION_TESTS -v`
272
+
`cd mbed-os`
273
+
`mbed test -t <toolchain> -m <board> -n *integration-* -DINTEGRATION_TESTS -v`
274
+
275
+
## Validation and testing for the client configuration
276
+
277
+
Basic pelion features are required to work:
278
+
- Connects to Pelion in developer mode.
279
+
- Firmware can be updated.
280
+
- Responsive to REST API commands.
281
+
282
+
This should be verified by executing the Pelion E2E python test library tests.
283
+
284
+
- Install the prerequisites listed in the README of the [pelion-e2e-python-test-library](https://github.com/ARMmbed/pelion-e2e-python-test-library).
285
+
- Configure your API-key as instructed in the same README.
0 commit comments