Generic Pelion Device Management example for various Nuvoton-based boards.

DEPRECATED

This example application is not maintained and not recommended. It uses an old version of Mbed OS, Pelion DM, and Arm toolchain. It doesn't work with Mbed Studio.

Please use: https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-pelion/

This example is known to work great on the following platforms:

Follow the Quick-Start instructions: https://cloud.mbed.com/quick-start

https://os.mbed.com/media/cache/platforms/NuMaker-IoT-M487_board_front_small.jpg.250x250_q85.jpghttps://os.mbed.com/media/cache/platforms/NuMaker-PFM-M487.png.170x170_q85.png https://os.mbed.com/media/cache/platforms/NuMaker-PFM-NUC472Small.png.170x170_q85.png

Example functionality

This example showcases the following device functionality:

  • On timer button increment, simulate Pelion LWM2M button resource change

Use this example with Mbed CLI


1. Import the application into your desktop:

mbed import https://os.mbed.com/teams/Nuvoton/code/pelion-example-common
cd pelion-example-common


2. Install the CLOUD_SDK_API_KEY

mbed config -G CLOUD_SDK_API_KEY <PELION_DM_API_KEY>

For instructions on how to generate your API key, please see the documentation.

3. Initialize firmware credentials (done once per repository). You can use the following command:

mbed dm init -d "<your company name in Pelion DM>" --model-name "<product model identifier>" -q --force

If above command do not work for your Mbed CLI, please consider upgrading Mbed CLI to version 1.8.x or above.

4. Compile and program:

mbed compile -t <toolchain> -m <TARGET_BOARD>

(supported toolchains : GCC_ARM / ARM / IAR)

5. Copy the binary file pelion-example-common.bin to your mbed device.

Note

This platform and application is suitable for evaluation and initial development. For production purposes, we recommend to use a different variant with built-in security features

Committer:
cyliang
Date:
Tue Apr 16 10:53:01 2019 +0800
Revision:
2:f07ccb7164d3
Parent:
0:e0138281f21d
SMCC 2.2.1.2 migration for 3 NuMaker platforms

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Sam Chu 0:e0138281f21d 1 {
Sam Chu 0:e0138281f21d 2 "target_overrides": {
Sam Chu 0:e0138281f21d 3 "*": {
cyliang 2:f07ccb7164d3 4 "target.components_remove" : ["FLASHIAP"],
cyliang 2:f07ccb7164d3 5 "platform.stdio-baud-rate" : 115200,
cyliang 2:f07ccb7164d3 6 "platform.stdio-convert-newlines" : true,
cyliang 2:f07ccb7164d3 7 "mbed-trace.enable" : null,
cyliang 2:f07ccb7164d3 8 "nsapi.default-wifi-security" : "WPA_WPA2",
cyliang 2:f07ccb7164d3 9 "nsapi.default-wifi-ssid" : "\"SSID\"",
cyliang 2:f07ccb7164d3 10 "nsapi.default-wifi-password" : "\"Password\""
Sam Chu 0:e0138281f21d 11 },
Sam Chu 0:e0138281f21d 12 "NUMAKER_PFM_NUC472": {
cyliang 2:f07ccb7164d3 13 "target.components_add" : ["NUSD"],
cyliang 2:f07ccb7164d3 14 "target.network-default-interface-type" : "ETHERNET",
cyliang 2:f07ccb7164d3 15 "drivers.uart-serial-rxbuf-size" : 1024,
cyliang 2:f07ccb7164d3 16 "drivers.uart-serial-txbuf-size" : 1024,
cyliang 2:f07ccb7164d3 17 "device-management.flash-start-address" : "0x0",
cyliang 2:f07ccb7164d3 18 "device-management.flash-size" : "(512*1024)",
cyliang 2:f07ccb7164d3 19 "device-management.sotp-section-1-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 2*(4*1024))",
cyliang 2:f07ccb7164d3 20 "device-management.sotp-section-1-size" : "(4*1024)",
cyliang 2:f07ccb7164d3 21 "device-management.sotp-section-2-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 1*(4*1024))",
cyliang 2:f07ccb7164d3 22 "device-management.sotp-section-2-size" : "(4*1024)",
cyliang 2:f07ccb7164d3 23 "update-client.application-details" : "(MBED_CONF_APP_FLASH_START_ADDRESS + 64*1024)",
cyliang 2:f07ccb7164d3 24 "update-client.storage-address" : "(64*1024*1024)",
cyliang 2:f07ccb7164d3 25 "update-client.storage-size" : "(2*1024*1024)",
cyliang 2:f07ccb7164d3 26 "update-client.storage-locations" : "1",
cyliang 2:f07ccb7164d3 27 "target.features_add" : ["BOOTLOADER"],
cyliang 2:f07ccb7164d3 28 "target.bootloader_img" : "bootloader/mbed-bootloader-NUMAKER_PFM_NUC472.bin",
cyliang 2:f07ccb7164d3 29 "target.header_offset" : "0x10000",
cyliang 2:f07ccb7164d3 30 "target.app_offset" : "0x10400",
cyliang 2:f07ccb7164d3 31 "button-pressed-state" : 0
Sam Chu 0:e0138281f21d 32 },
Sam Chu 0:e0138281f21d 33 "NUMAKER_PFM_M487": {
cyliang 2:f07ccb7164d3 34 "target.components_add" : ["NUSD"],
cyliang 2:f07ccb7164d3 35 "target.network-default-interface-type" : "ETHERNET",
cyliang 2:f07ccb7164d3 36 "drivers.uart-serial-rxbuf-size" : 1024,
cyliang 2:f07ccb7164d3 37 "drivers.uart-serial-txbuf-size" : 1024,
cyliang 2:f07ccb7164d3 38 "device-management.flash-start-address" : "0x0",
cyliang 2:f07ccb7164d3 39 "device-management.flash-size" : "(512*1024)",
cyliang 2:f07ccb7164d3 40 "device-management.sotp-section-1-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 2*(4*1024))",
cyliang 2:f07ccb7164d3 41 "device-management.sotp-section-1-size" : "(4*1024)",
cyliang 2:f07ccb7164d3 42 "device-management.sotp-section-2-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 1*(4*1024))",
cyliang 2:f07ccb7164d3 43 "device-management.sotp-section-2-size" : "(4*1024)",
cyliang 2:f07ccb7164d3 44 "update-client.application-details" : "(MBED_CONF_APP_FLASH_START_ADDRESS + 64*1024)",
cyliang 2:f07ccb7164d3 45 "update-client.storage-address" : "(64*1024*1024)",
cyliang 2:f07ccb7164d3 46 "update-client.storage-size" : "(2*1024*1024)",
cyliang 2:f07ccb7164d3 47 "update-client.storage-locations" : "1",
cyliang 2:f07ccb7164d3 48 "target.features_add" : ["BOOTLOADER"],
cyliang 2:f07ccb7164d3 49 "target.bootloader_img" : "bootloader/mbed-bootloader-NUMAKER_PFM_M487.bin",
cyliang 2:f07ccb7164d3 50 "target.header_offset" : "0x10000",
cyliang 2:f07ccb7164d3 51 "target.app_offset" : "0x10400",
cyliang 2:f07ccb7164d3 52 "button-pressed-state" : 0
Sam Chu 0:e0138281f21d 53 },
Sam Chu 0:e0138281f21d 54 "NUMAKER_IOT_M487": {
cyliang 2:f07ccb7164d3 55 "target.components_add" : ["NUSD"],
cyliang 2:f07ccb7164d3 56 "target.network-default-interface-type" : "WIFI",
cyliang 2:f07ccb7164d3 57 "esp8266.tx" : "PH_8",
cyliang 2:f07ccb7164d3 58 "esp8266.rx" : "PH_9",
cyliang 2:f07ccb7164d3 59 "esp8266.provide-default" : true,
cyliang 2:f07ccb7164d3 60 "drivers.uart-serial-rxbuf-size" : 1024,
cyliang 2:f07ccb7164d3 61 "drivers.uart-serial-txbuf-size" : 1024,
cyliang 2:f07ccb7164d3 62 "device-management.flash-start-address" : "0x0",
cyliang 2:f07ccb7164d3 63 "device-management.flash-size" : "(512*1024)",
cyliang 2:f07ccb7164d3 64 "device-management.sotp-section-1-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 2*(4*1024))",
cyliang 2:f07ccb7164d3 65 "device-management.sotp-section-1-size" : "(4*1024)",
cyliang 2:f07ccb7164d3 66 "device-management.sotp-section-2-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 1*(4*1024))",
cyliang 2:f07ccb7164d3 67 "device-management.sotp-section-2-size" : "(4*1024)",
cyliang 2:f07ccb7164d3 68 "update-client.application-details" : "(MBED_CONF_APP_FLASH_START_ADDRESS + 64*1024)",
cyliang 2:f07ccb7164d3 69 "update-client.storage-address" : "(64*1024*1024)",
cyliang 2:f07ccb7164d3 70 "update-client.storage-size" : "(2*1024*1024)",
cyliang 2:f07ccb7164d3 71 "update-client.storage-locations" : "1",
cyliang 2:f07ccb7164d3 72 "target.features_add" : ["BOOTLOADER"],
cyliang 2:f07ccb7164d3 73 "target.bootloader_img" : "bootloader/mbed-bootloader-NUMAKER_IOT_M487.bin",
cyliang 2:f07ccb7164d3 74 "target.header_offset" : "0x10000",
cyliang 2:f07ccb7164d3 75 "target.app_offset" : "0x10400",
cyliang 2:f07ccb7164d3 76 "button-pressed-state" : 0
Sam Chu 0:e0138281f21d 77 }
cyliang 2:f07ccb7164d3 78 },
Sam Chu 0:e0138281f21d 79 "config": {
Sam Chu 0:e0138281f21d 80 "format-storage-layer-on-error": {
Sam Chu 0:e0138281f21d 81 "help": "Whether to format the storage layer when it cannot be read - always disable for production devices!",
Sam Chu 0:e0138281f21d 82 "value": 1
Sam Chu 0:e0138281f21d 83 },
Sam Chu 0:e0138281f21d 84 "main-stack-size": {
Sam Chu 0:e0138281f21d 85 "value": 6000
Sam Chu 0:e0138281f21d 86 },
cyliang 2:f07ccb7164d3 87 "use-button": {
cyliang 2:f07ccb7164d3 88 "help": "Whether the target has a button",
cyliang 2:f07ccb7164d3 89 "macro_name": "USE_BUTTON",
cyliang 2:f07ccb7164d3 90 "value": true
Sam Chu 0:e0138281f21d 91 },
cyliang 2:f07ccb7164d3 92 "button-pressed-state": {
cyliang 2:f07ccb7164d3 93 "help": "Value of the button when pressed",
cyliang 2:f07ccb7164d3 94 "value": 1
Sam Chu 0:e0138281f21d 95 },
cyliang 2:f07ccb7164d3 96 "no_led": {
cyliang 2:f07ccb7164d3 97 "help": "This flag disables the heartbeat thread in tests. This is useful for platforms that don't have an LED or the LED is used for other functionality like LED on the SPI clockline etc",
Sam Chu 0:e0138281f21d 98 "value": null
Sam Chu 0:e0138281f21d 99 },
cyliang 2:f07ccb7164d3 100 "tests-fs-size": {
cyliang 2:f07ccb7164d3 101 "help": "Maximum size of the file system used for tests",
Sam Chu 0:e0138281f21d 102 "value": null
Sam Chu 0:e0138281f21d 103 }
Sam Chu 0:e0138281f21d 104 }
Sam Chu 0:e0138281f21d 105 }