Mbed OS example of Pelion device management LGUPlus Client

Committer:
pimco01
Date:
Fri Feb 21 19:27:19 2020 +0000
Revision:
2:34933ca5af82
Parent:
0:9f917a7bf2da
main.cpp, app.json modify

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MACRUM 0:9f917a7bf2da 1 # Pelion Client Mbed OS Example
MACRUM 0:9f917a7bf2da 2
MACRUM 0:9f917a7bf2da 3 This is a simplified example with the following features:
MACRUM 0:9f917a7bf2da 4 - Mbed OS 5.13 and Pelion Device Management Client 3.3.0
MACRUM 0:9f917a7bf2da 5 - Support for FW Update
MACRUM 0:9f917a7bf2da 6 - 200 lines of code + credential sources
MACRUM 0:9f917a7bf2da 7
MACRUM 0:9f917a7bf2da 8 Note this application is considered **alpha** and given early access to Mbed Partners.
MACRUM 0:9f917a7bf2da 9
MACRUM 0:9f917a7bf2da 10 ## Supported platforms
MACRUM 0:9f917a7bf2da 11
MACRUM 0:9f917a7bf2da 12 This table shows a list of platforms that are supported.
MACRUM 0:9f917a7bf2da 13
MACRUM 0:9f917a7bf2da 14 Platform | Connectivity | Storage for credentials | Storage for FW candidate | Notes
MACRUM 0:9f917a7bf2da 15 ----------------------------------| ------------------| -------------------------| ----------------------- | --------------
MACRUM 0:9f917a7bf2da 16 NXP K64F | Ethernet | Internal Flash | Internal Flash |
MACRUM 0:9f917a7bf2da 17 NXP K66F | Ethernet | Internal Flash | Internal Flash |
MACRUM 0:9f917a7bf2da 18 ST NUCLEO_F429ZI | Ethernet | Internal Flash | Internal Flash |
MACRUM 0:9f917a7bf2da 19 ST NUCLEO_F411RE | WiFi IDW01M1 | SD card | SD card |
MACRUM 0:9f917a7bf2da 20 Ublox UBLOX_EVK_ODIN_W2 | WiFi | SD card | SD card |
MACRUM 0:9f917a7bf2da 21
MACRUM 0:9f917a7bf2da 22 <span class="notes">**(*) Note**: the platforms require further testing</span>
MACRUM 0:9f917a7bf2da 23
MACRUM 0:9f917a7bf2da 24 # Developer guide
MACRUM 0:9f917a7bf2da 25
MACRUM 0:9f917a7bf2da 26 This section is intended for developers to get started, import the example application, compile and get it running on their device.
MACRUM 0:9f917a7bf2da 27
MACRUM 0:9f917a7bf2da 28 ## Requirements
MACRUM 0:9f917a7bf2da 29
MACRUM 0:9f917a7bf2da 30 - Mbed CLI >= 1.10.0
MACRUM 0:9f917a7bf2da 31
MACRUM 0:9f917a7bf2da 32 For instructions on installing and using Mbed CLI, please see our [documentation](https://os.mbed.com/docs/mbed-os/latest/tools/developing-mbed-cli.html).
MACRUM 0:9f917a7bf2da 33
MACRUM 0:9f917a7bf2da 34 - Install the `CLOUD_SDK_API_KEY`
MACRUM 0:9f917a7bf2da 35
MACRUM 0:9f917a7bf2da 36 `mbed config -G CLOUD_SDK_API_KEY ak_1MDE1...<snip>`
MACRUM 0:9f917a7bf2da 37
MACRUM 0:9f917a7bf2da 38 You should generate your own API key. Pelion Device Management is available for any Mbed developer. Create a [free trial](https://os.mbed.com/pelion-free-tier).
MACRUM 0:9f917a7bf2da 39
MACRUM 0:9f917a7bf2da 40 For instructions on how to generate your API key, please see our [documentation](https://cloud.mbed.com/docs/current/integrate-web-app/api-keys.html#generating-an-api-key).
MACRUM 0:9f917a7bf2da 41
MACRUM 0:9f917a7bf2da 42 ## Deploying
MACRUM 0:9f917a7bf2da 43
MACRUM 0:9f917a7bf2da 44 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.
MACRUM 0:9f917a7bf2da 45
MACRUM 0:9f917a7bf2da 46 mbed import mbed-os-pelion-example
MACRUM 0:9f917a7bf2da 47 cd mbed-os-pelion-example
MACRUM 0:9f917a7bf2da 48
MACRUM 0:9f917a7bf2da 49 ## Compiling
MACRUM 0:9f917a7bf2da 50
MACRUM 0:9f917a7bf2da 51 mbed target K64F
MACRUM 0:9f917a7bf2da 52 mbed toolchain GCC_ARM
MACRUM 0:9f917a7bf2da 53 mbed device-management init -d arm.com --model-name example-app --force -q
MACRUM 0:9f917a7bf2da 54 mbed compile
MACRUM 0:9f917a7bf2da 55
MACRUM 0:9f917a7bf2da 56 ## Program Flow
MACRUM 0:9f917a7bf2da 57
MACRUM 0:9f917a7bf2da 58 1. Initialize, connect and register to Pelion DM
MACRUM 0:9f917a7bf2da 59 1. Interact with the user through the serial port (115200 bauds)
MACRUM 0:9f917a7bf2da 60 - Press enter through putty/minicom to simulate button
MACRUM 0:9f917a7bf2da 61 - Press 'i' to print endpoint name
MACRUM 0:9f917a7bf2da 62 - Press Ctrl-C to to unregister
MACRUM 0:9f917a7bf2da 63 - Press 'r' to reset storage and reboot (warning: it generates a new device ID!)
MACRUM 0:9f917a7bf2da 64
MACRUM 0:9f917a7bf2da 65 ## Further information and requirements
MACRUM 0:9f917a7bf2da 66
MACRUM 0:9f917a7bf2da 67 Check the public tutorial for further information:
MACRUM 0:9f917a7bf2da 68
MACRUM 0:9f917a7bf2da 69 [https://www.pelion.com/docs/device-management/current/connecting/mbed-os.html](https://www.pelion.com/docs/device-management/current/connecting/mbed-os.html)
MACRUM 0:9f917a7bf2da 70
MACRUM 0:9f917a7bf2da 71 ## Troubleshooting
MACRUM 0:9f917a7bf2da 72
MACRUM 0:9f917a7bf2da 73 - Device initializes but can't register to Pelion
MACRUM 0:9f917a7bf2da 74
MACRUM 0:9f917a7bf2da 75 Error: `client_error(3) -> Bootstrap server URL is not correctly formed`
MACRUM 0:9f917a7bf2da 76
MACRUM 0:9f917a7bf2da 77 Solution: Format the the storage by pressing 'r' in the serial terminal.
MACRUM 0:9f917a7bf2da 78
MACRUM 0:9f917a7bf2da 79 # Porting process to add support for an Mbed Enabled board
MACRUM 0:9f917a7bf2da 80
MACRUM 0:9f917a7bf2da 81 There are many steps involved in this process. We generally recomend the following steps:
MACRUM 0:9f917a7bf2da 82
MACRUM 0:9f917a7bf2da 83 1. Configure the application using `mbed_app.json`
MACRUM 0:9f917a7bf2da 84 - Configure the default connectivity
MACRUM 0:9f917a7bf2da 85 - Configure the KVSTORE area to store credentials (internal or external memory)
MACRUM 0:9f917a7bf2da 86 - Build the application, program the board and observe whether the application can connect to Pelion DM by using a serial terminal.
MACRUM 0:9f917a7bf2da 87 1. Configure the bootloader using `bootloader_app.json`
MACRUM 0:9f917a7bf2da 88 - Configure the KVSTORE area
MACRUM 0:9f917a7bf2da 89 - Configure the FW Candidate Storage
MACRUM 0:9f917a7bf2da 90 - Build bootloader application, program the board and observe whether this is able to boot.
MACRUM 0:9f917a7bf2da 91 1. Enable application with bootloader using `mbed_app.json`
MACRUM 0:9f917a7bf2da 92 - Enable the usage of the bootloader
MACRUM 0:9f917a7bf2da 93 - Ensure the KVSTORE addresses and FW Candidate storage addresses match with the bootloader configuration
MACRUM 0:9f917a7bf2da 94 - Build the application again (this time combined with bootloader) and check whether it can boot and connect to Pelion DM.
MACRUM 0:9f917a7bf2da 95 - Perform a FW Update and check whether the process can be completed succesfully.
MACRUM 0:9f917a7bf2da 96
MACRUM 0:9f917a7bf2da 97 ## 1. Application configuration
MACRUM 0:9f917a7bf2da 98
MACRUM 0:9f917a7bf2da 99 <span class="notes">**Note**: consider allocating the credentials on internal flash to simplify the application setup process. In addition, consider the use of internal flash to store the firmware candidate image for the FW update process as this would remove the need to use external components. If there isn't enough space, you may need to enable external storage (SD Card, SPI, etc).</span>
MACRUM 0:9f917a7bf2da 100
MACRUM 0:9f917a7bf2da 101 Mbed OS boards should have a default configuration for connectivity and storage in Mbed OS (`targets.json`).
MACRUM 0:9f917a7bf2da 102 You can extend or override the default configuration using `mbed_app.json` in this application. Create a new entry under the target name for your device.
MACRUM 0:9f917a7bf2da 103
MACRUM 0:9f917a7bf2da 104 ### a. Connectivity
MACRUM 0:9f917a7bf2da 105
MACRUM 0:9f917a7bf2da 106 Specify the default IP connectivity type for your target. It's essential with targets that lack default connectivity set in `targets.json` or for targets that support multiple connectivity options. For example:
MACRUM 0:9f917a7bf2da 107
MACRUM 0:9f917a7bf2da 108 "target.network-default-interface-type" : "ETHERNET",
MACRUM 0:9f917a7bf2da 109
MACRUM 0:9f917a7bf2da 110 The possible options are `ETHERNET`, `WIFI` and `CELLULAR`.
MACRUM 0:9f917a7bf2da 111
MACRUM 0:9f917a7bf2da 112 Depending on connectivity type, you might have to specify more configuration options. Review the [documentation](https://os.mbed.com/docs/mbed-os/latest/porting/porting-connectivity.html) for further information.
MACRUM 0:9f917a7bf2da 113
MACRUM 0:9f917a7bf2da 114 ### b. Storage for credentials
MACRUM 0:9f917a7bf2da 115
MACRUM 0:9f917a7bf2da 116 Start by getting familiar with the multiple [storage options](https://os.mbed.com/docs/mbed-os/latest/reference/storage.html) and configurations supported in Mbed OS.
MACRUM 0:9f917a7bf2da 117
MACRUM 0:9f917a7bf2da 118 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:
MACRUM 0:9f917a7bf2da 119
MACRUM 0:9f917a7bf2da 120 +--------------------------+
MACRUM 0:9f917a7bf2da 121 | |
MACRUM 0:9f917a7bf2da 122 | |
MACRUM 0:9f917a7bf2da 123 | |
MACRUM 0:9f917a7bf2da 124 |Firmware Candidate Storage|
MACRUM 0:9f917a7bf2da 125 | |
MACRUM 0:9f917a7bf2da 126 | |
MACRUM 0:9f917a7bf2da 127 | |
MACRUM 0:9f917a7bf2da 128 +--------------------------+ <-+ update-client.storage-address
MACRUM 0:9f917a7bf2da 129 | |
MACRUM 0:9f917a7bf2da 130 | KVSTORE |
MACRUM 0:9f917a7bf2da 131 | |
MACRUM 0:9f917a7bf2da 132 +--------------------------+ <-+ storage_tdb_internal.internal_base_address
MACRUM 0:9f917a7bf2da 133 | |
MACRUM 0:9f917a7bf2da 134 | Free space |
MACRUM 0:9f917a7bf2da 135 | |
MACRUM 0:9f917a7bf2da 136 +--------------------------+
MACRUM 0:9f917a7bf2da 137 | |
MACRUM 0:9f917a7bf2da 138 | |
MACRUM 0:9f917a7bf2da 139 | Active App |
MACRUM 0:9f917a7bf2da 140 | |
MACRUM 0:9f917a7bf2da 141 | |
MACRUM 0:9f917a7bf2da 142 | |
MACRUM 0:9f917a7bf2da 143 +--------------------------+ <-+ mbed-bootloader.application-start-address
MACRUM 0:9f917a7bf2da 144 |Active App Metadata Header|
MACRUM 0:9f917a7bf2da 145 +--------------------------+ <-+ update-client.application-details
MACRUM 0:9f917a7bf2da 146 | |
MACRUM 0:9f917a7bf2da 147 | Bootloader |
MACRUM 0:9f917a7bf2da 148 | |
MACRUM 0:9f917a7bf2da 149 +--------------------------+ <-+ 0
MACRUM 0:9f917a7bf2da 150
MACRUM 0:9f917a7bf2da 151 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.
MACRUM 0:9f917a7bf2da 152
MACRUM 0:9f917a7bf2da 153 - **Option 1:** Allocating credentials in internal memory
MACRUM 0:9f917a7bf2da 154
MACRUM 0:9f917a7bf2da 155 **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.
MACRUM 0:9f917a7bf2da 156
MACRUM 0:9f917a7bf2da 157 "storage.storage_type" : "TDB_INTERNAL"
MACRUM 0:9f917a7bf2da 158 "storage_tdb_internal.internal_base_address": "(MBED_ROM_START+1024*1024)",
MACRUM 0:9f917a7bf2da 159 "storage_tdb_internal.internal_size" : "(128*1024)",
MACRUM 0:9f917a7bf2da 160
MACRUM 0:9f917a7bf2da 161 - **Option 2:** Allocating credentials in external memory:
MACRUM 0:9f917a7bf2da 162
MACRUM 0:9f917a7bf2da 163 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)).
MACRUM 0:9f917a7bf2da 164
MACRUM 0:9f917a7bf2da 165 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)
MACRUM 0:9f917a7bf2da 166
MACRUM 0:9f917a7bf2da 167 "storage.storage_type" : "FILESYSTEM",
MACRUM 0:9f917a7bf2da 168 "storage_filesystem.blockdevice" : "SD",
MACRUM 0:9f917a7bf2da 169 "storage_filesystem.filesystem" : "LITTLE",
MACRUM 0:9f917a7bf2da 170 "storage_filesystem.internal_base_address" : "(32*1024)",
MACRUM 0:9f917a7bf2da 171 "storage_filesystem.rbp_internal_size" : "(8*1024)",
MACRUM 0:9f917a7bf2da 172 "storage_filesystem.external_base_address" : "(0x0)",
MACRUM 0:9f917a7bf2da 173 "storage_filesystem.external_size" : "(1024*1024*64)",
MACRUM 0:9f917a7bf2da 174
MACRUM 0:9f917a7bf2da 175 ### c. Storage for firmware updates
MACRUM 0:9f917a7bf2da 176
MACRUM 0:9f917a7bf2da 177 Before enabling FW updates, it's recomended that the application is able to initialize the network and connect to Pelion DM.
MACRUM 0:9f917a7bf2da 178
MACRUM 0:9f917a7bf2da 179 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.
MACRUM 0:9f917a7bf2da 180
MACRUM 0:9f917a7bf2da 181 - Common configuration
MACRUM 0:9f917a7bf2da 182
MACRUM 0:9f917a7bf2da 183 Regardless of where the firmware candidate is located (internal or external), there is a need to have a bootloader in place. The binary of the booloader can be specified with the `bootloader_img` option. The address and size of the bootloader determines the `application-details` and `bootloader-details` options. The value of `bootloader-details` can be obtained by running the binary on the target and observing the serial output.
MACRUM 0:9f917a7bf2da 184
MACRUM 0:9f917a7bf2da 185 Review the [mbed-bootloader](https://github.com/ARMmbed/mbed-bootloader#configurations) guidelines on how these options should be selected. Review the [bootloader configuration](2.-Bootloader-configuration) section below for more information.
MACRUM 0:9f917a7bf2da 186
MACRUM 0:9f917a7bf2da 187 Copy the compiled bootloader from `mbed-bootloader/BUILDS/<TARGET>/<TOOLCHAIN>-TINY/mbed-bootloader.bin` to `bootloader/mbed-bootloader-<TARGET>.bin`.
MACRUM 0:9f917a7bf2da 188
MACRUM 0:9f917a7bf2da 189 Edit `mbed-os-pelion-example/mbed_app.json` and modify the target configuration to match with the one in `bootloader_app.json`.
MACRUM 0:9f917a7bf2da 190
MACRUM 0:9f917a7bf2da 191 <span class="notes">**Note:**
MACRUM 0:9f917a7bf2da 192
MACRUM 0:9f917a7bf2da 193 - `update-client.application-details` should be identical in both `bootloader_app.json` and `mbed_app.json`.
MACRUM 0:9f917a7bf2da 194
MACRUM 0:9f917a7bf2da 195 - `target.app_offset` is relative offset to `flash-start-address` you specified in `mbed_app.json` and `bootloader_app.json`, and is the hex value of the offset specified by `application-start-address` in `bootloader_app.json`. For example, `(MBED_CONF_APP_FLASH_START_ADDRESS+65*1024)` dec equals `0x10400` hex.
MACRUM 0:9f917a7bf2da 196
MACRUM 0:9f917a7bf2da 197 - `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>
MACRUM 0:9f917a7bf2da 198
MACRUM 0:9f917a7bf2da 199 An example of this configuration can be seen for the `NUCLEO_F429ZI` platform.
MACRUM 0:9f917a7bf2da 200
MACRUM 0:9f917a7bf2da 201 "update-client.application-details" : "(MBED_ROM_START + MBED_BOOTLOADER_SIZE)",
MACRUM 0:9f917a7bf2da 202 "update-client.bootloader-details" : "0x08007300",
MACRUM 0:9f917a7bf2da 203 "target.bootloader_img" : "bootloader/mbed-bootloader-<target>",
MACRUM 0:9f917a7bf2da 204 "target.header_offset" : "0x8000",
MACRUM 0:9f917a7bf2da 205 "target.app_offset" : "0x8400",
MACRUM 0:9f917a7bf2da 206
MACRUM 0:9f917a7bf2da 207 - **Option 1:** Allocating the firmware update candidate in internal memory
MACRUM 0:9f917a7bf2da 208
MACRUM 0:9f917a7bf2da 209 **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.
MACRUM 0:9f917a7bf2da 210
MACRUM 0:9f917a7bf2da 211 "mbed-cloud-client.update-storage" : "ARM_UCP_FLASHIAP",
MACRUM 0:9f917a7bf2da 212 "update-client.storage-address" : "(MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS+MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE)",
MACRUM 0:9f917a7bf2da 213 "update-client.storage-size" : "(1024*1024-MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE)",
MACRUM 0:9f917a7bf2da 214 "update-client.storage-page" : 1,
MACRUM 0:9f917a7bf2da 215
MACRUM 0:9f917a7bf2da 216 - **Option 2:** Allocating the firmware update candidate in external memory
MACRUM 0:9f917a7bf2da 217
MACRUM 0:9f917a7bf2da 218 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.
MACRUM 0:9f917a7bf2da 219
MACRUM 0:9f917a7bf2da 220 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)
MACRUM 0:9f917a7bf2da 221
MACRUM 0:9f917a7bf2da 222 "mbed-cloud-client.update-storage" : "ARM_UCP_FLASHIAP_BLOCKDEVICE",
MACRUM 0:9f917a7bf2da 223 "update-client.storage-address" : "(1024*1024*64)",
MACRUM 0:9f917a7bf2da 224 "update-client.storage-size" : "((MBED_ROM_START + MBED_ROM_SIZE - APPLICATION_ADDR) * MBED_CONF_UPDATE_CLIENT_STORAGE_LOCATIONS)",
MACRUM 0:9f917a7bf2da 225
MACRUM 0:9f917a7bf2da 226 ## 2. Bootloader configuration
MACRUM 0:9f917a7bf2da 227
MACRUM 0:9f917a7bf2da 228 The bootloader is required to perform FW Updates. The steps below explain how to create a new configuration and binary for the bootloader.
MACRUM 0:9f917a7bf2da 229
MACRUM 0:9f917a7bf2da 230 1. Import as a new application the [mbed-bootloader](https://github.com/ARMmbed/mbed-bootloader/) repository.
MACRUM 0:9f917a7bf2da 231
MACRUM 0:9f917a7bf2da 232 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:
MACRUM 0:9f917a7bf2da 233
MACRUM 0:9f917a7bf2da 234 "update-client.firmware-header-version": "2",
MACRUM 0:9f917a7bf2da 235 "mbed-bootloader.use-kvstore-rot": 0,
MACRUM 0:9f917a7bf2da 236 "mbed-bootloader.bootloader-size": "APPLICATION_SIZE",
MACRUM 0:9f917a7bf2da 237 "update-client.application-details" : "(MBED_ROM_START + MBED_BOOTLOADER_SIZE)",
MACRUM 0:9f917a7bf2da 238 "mbed-bootloader.application-start-address": "(MBED_CONF_UPDATE_CLIENT_APPLICATION_DETAILS + MBED_BOOTLOADER_ACTIVE_HEADER_REGION_SIZE)",
MACRUM 0:9f917a7bf2da 239 "mbed-bootloader.max-application-size" : "(MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE - MBED_CONF_MBED_BOOTLOADER_APPLICATION_START_ADDRESS)",
MACRUM 0:9f917a7bf2da 240 "update-client.storage-address" : "(MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE + KVSTORE_SIZE)",
MACRUM 0:9f917a7bf2da 241 "update-client.storage-size" : "(MBED_BOOTLOADER_FLASH_BANK_SIZE - KVSTORE_SIZE)",
MACRUM 0:9f917a7bf2da 242 "update-client.storage-locations" : 1,
MACRUM 0:9f917a7bf2da 243 "kvstore-size": "2*64*1024",
MACRUM 0:9f917a7bf2da 244 "update-client.storage-page": 1
MACRUM 0:9f917a7bf2da 245
MACRUM 0:9f917a7bf2da 246 1. Compile the bootloader using the `bootloader_app.json` configuration you've just edited:
MACRUM 0:9f917a7bf2da 247
MACRUM 0:9f917a7bf2da 248 mbed compile -t <TOOLCHAIN> -m <TARGET> --profile=tiny.json --app-config=.../mbed-os-pelion-example/bootloader/bootloader_app.json>
MACRUM 0:9f917a7bf2da 249
MACRUM 0:9f917a7bf2da 250 <span class="notes">**Note:** `mbed-bootloader` is primarily optimized for `GCC_ARM`, so you may want to compile it with that toolchain.
MACRUM 0:9f917a7bf2da 251 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>
MACRUM 0:9f917a7bf2da 252
MACRUM 0:9f917a7bf2da 253
MACRUM 0:9f917a7bf2da 254 ## Validation and testing
MACRUM 0:9f917a7bf2da 255
MACRUM 0:9f917a7bf2da 256 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:
MACRUM 0:9f917a7bf2da 257
MACRUM 0:9f917a7bf2da 258 - Mbed OS tests (as described in our [documentation](https://os.mbed.com/docs/mbed-os/latest/porting/testing.html))
MACRUM 0:9f917a7bf2da 259
MACRUM 0:9f917a7bf2da 260 `mbed test`
MACRUM 0:9f917a7bf2da 261
MACRUM 0:9f917a7bf2da 262 - Mbed OS integration tests
MACRUM 0:9f917a7bf2da 263
MACRUM 0:9f917a7bf2da 264 See [mbed-os/TESTS/integration/README.md](https://github.com/ARMmbed/mbed-os/blob/sip-workshop/TESTS/integration/README.md) (sip-workshop branch)
MACRUM 0:9f917a7bf2da 265
MACRUM 0:9f917a7bf2da 266 `mbed test -t <toolchain> -m <platform> -n *integration-* -DINTEGRATION_TESTS -v `
MACRUM 0:9f917a7bf2da 267
MACRUM 0:9f917a7bf2da 268 - Pelion Client tests, including firmware update.
MACRUM 0:9f917a7bf2da 269
MACRUM 0:9f917a7bf2da 270 See the [testing](./TESTS/README.md) documentation to validate the configuration in this example.
MACRUM 0:9f917a7bf2da 271
MACRUM 0:9f917a7bf2da 272 # Known-issues
MACRUM 0:9f917a7bf2da 273
MACRUM 0:9f917a7bf2da 274 Please review existing issues on github and report any problem you may see.