Simple Mbed Cloud Client application using features of K64 & K66

Connect to Mbed Cloud!

This example was customized a bit for FRDM-K66 and FRDM-K64F.

It depends on having an SD Card plugged in for storage of credentials. It could be changed later to use a SPI flash or other storage on a shield or wired in.

The app keeps track of how many times switch 2 (SW2) is pressed. The value can be retrieved via a GET request to Mbed Cloud.

Also, it will blink a pattern based on milisecond (ms) timing values that can be sent from Mbed Cloud. The pattern can be sent with a PUT request and the blinking sequence can be triggered by a POST request.

Committer:
maclobdell
Date:
Tue Oct 09 22:08:16 2018 -0500
Revision:
15:df35a45db1cc
Parent:
14:10b59d30bf7e
remove sd driver.  its in mbed-os now.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
maclobdell 9:ae1f6fe932dc 1 {
maclobdell 9:ae1f6fe932dc 2 "macros": [
maclobdell 9:ae1f6fe932dc 3 "MBEDTLS_USER_CONFIG_FILE=\"mbedTLSConfig_mbedOS.h\"",
maclobdell 9:ae1f6fe932dc 4 "PAL_USER_DEFINED_CONFIGURATION=\"sotp_fs_config_MbedOS.h\"",
maclobdell 9:ae1f6fe932dc 5 "MBED_CLIENT_USER_CONFIG_FILE=\"mbed_cloud_client_user_config.h\"",
maclobdell 9:ae1f6fe932dc 6 "MBED_CLOUD_CLIENT_USER_CONFIG_FILE=\"mbed_cloud_client_user_config.h\"",
maclobdell 9:ae1f6fe932dc 7 "PAL_DTLS_PEER_MIN_TIMEOUT=5000",
maclobdell 13:49062a0d117e 8 "MBED_CONF_APP_MAIN_STACK_SIZE=6000",
maclobdell 9:ae1f6fe932dc 9 "ARM_UC_USE_PAL_BLOCKDEVICE=1",
maclobdell 9:ae1f6fe932dc 10 "MBED_CLOUD_CLIENT_UPDATE_STORAGE=ARM_UCP_FLASHIAP_BLOCKDEVICE"
maclobdell 9:ae1f6fe932dc 11 ],
maclobdell 9:ae1f6fe932dc 12 "target_overrides": {
maclobdell 9:ae1f6fe932dc 13 "*": {
maclobdell 9:ae1f6fe932dc 14 "platform.stdio-baud-rate": 115200,
maclobdell 9:ae1f6fe932dc 15 "platform.stdio-convert-newlines": true,
maclobdell 9:ae1f6fe932dc 16 "update-client.storage-address" : "(1024*1024*64)",
maclobdell 9:ae1f6fe932dc 17 "update-client.storage-size" : "(1024*1024*2)",
maclobdell 9:ae1f6fe932dc 18 "update-client.storage-locations": "1",
maclobdell 9:ae1f6fe932dc 19 "mbed-trace.enable": null
maclobdell 12:0a894bf1f5f2 20 },
maclobdell 12:0a894bf1f5f2 21 "K64F": {
maclobdell 13:49062a0d117e 22 "target.features_add" : ["BOOTLOADER"],
maclobdell 13:49062a0d117e 23 "sotp-section-1-address" : "(32*1024)",
maclobdell 13:49062a0d117e 24 "sotp-section-1-size" : "(4*1024)",
maclobdell 13:49062a0d117e 25 "sotp-section-2-address" : "(36*1024)",
maclobdell 13:49062a0d117e 26 "sotp-section-2-size" : "(4*1024)",
maclobdell 13:49062a0d117e 27 "sotp-num-sections" : 2,
maclobdell 13:49062a0d117e 28 "update-client.application-details": "(40*1024)"
maclobdell 12:0a894bf1f5f2 29 },
maclobdell 12:0a894bf1f5f2 30 "K66F": {
maclobdell 14:10b59d30bf7e 31 "target.features_add" : ["BOOTLOADER", "STORAGE"],
maclobdell 14:10b59d30bf7e 32 "target.components_add": ["SD"],
maclobdell 13:49062a0d117e 33 "sotp-section-1-address" : "(32*1024)",
maclobdell 13:49062a0d117e 34 "sotp-section-1-size" : "(4*1024)",
maclobdell 13:49062a0d117e 35 "sotp-section-2-address" : "(36*1024)",
maclobdell 13:49062a0d117e 36 "sotp-section-2-size" : "(4*1024)",
maclobdell 13:49062a0d117e 37 "sotp-num-sections" : 2,
maclobdell 13:49062a0d117e 38 "update-client.application-details": "(40*1024)"
maclobdell 12:0a894bf1f5f2 39 }
maclobdell 9:ae1f6fe932dc 40 },
maclobdell 9:ae1f6fe932dc 41 "config": {
maclobdell 9:ae1f6fe932dc 42 "format-storage-layer-on-error": {
maclobdell 9:ae1f6fe932dc 43 "help": "Whether to format the storage layer when it cannot be read - always disable for production devices!",
maclobdell 9:ae1f6fe932dc 44 "value": 1
maclobdell 9:ae1f6fe932dc 45 },
maclobdell 9:ae1f6fe932dc 46 "developer-mode": {
maclobdell 9:ae1f6fe932dc 47 "help": "Enable Developer mode to skip Factory enrollment",
maclobdell 9:ae1f6fe932dc 48 "value": 1
maclobdell 9:ae1f6fe932dc 49 },
maclobdell 9:ae1f6fe932dc 50 "sotp-section-1-address": {
maclobdell 9:ae1f6fe932dc 51 "help": "Flash sector address for SOTP sector 1",
maclobdell 9:ae1f6fe932dc 52 "macro_name": "PAL_INTERNAL_FLASH_SECTION_1_ADDRESS",
maclobdell 9:ae1f6fe932dc 53 "value": null
maclobdell 9:ae1f6fe932dc 54 },
maclobdell 9:ae1f6fe932dc 55 "sotp-section-1-size": {
maclobdell 9:ae1f6fe932dc 56 "help": "Flash sector size for SOTP sector 1",
maclobdell 9:ae1f6fe932dc 57 "macro_name": "PAL_INTERNAL_FLASH_SECTION_1_SIZE",
maclobdell 9:ae1f6fe932dc 58 "value": null
maclobdell 9:ae1f6fe932dc 59 },
maclobdell 9:ae1f6fe932dc 60 "sotp-section-2-address": {
maclobdell 9:ae1f6fe932dc 61 "help": "Flash sector address for SOTP sector 2",
maclobdell 9:ae1f6fe932dc 62 "macro_name": "PAL_INTERNAL_FLASH_SECTION_2_ADDRESS",
maclobdell 9:ae1f6fe932dc 63 "value": null
maclobdell 9:ae1f6fe932dc 64 },
maclobdell 9:ae1f6fe932dc 65 "sotp-section-2-size": {
maclobdell 9:ae1f6fe932dc 66 "help": "Flash sector size for SOTP sector 2",
maclobdell 9:ae1f6fe932dc 67 "macro_name": "PAL_INTERNAL_FLASH_SECTION_2_SIZE",
maclobdell 9:ae1f6fe932dc 68 "value": null
maclobdell 12:0a894bf1f5f2 69 },
maclobdell 12:0a894bf1f5f2 70 "sotp-num-sections": {
maclobdell 12:0a894bf1f5f2 71 "help": "Number of SOTP sections",
maclobdell 12:0a894bf1f5f2 72 "macro_name": "PAL_INT_FLASH_NUM_SECTIONS",
maclobdell 12:0a894bf1f5f2 73 "value": null
maclobdell 12:0a894bf1f5f2 74 }
maclobdell 9:ae1f6fe932dc 75 }
maclobdell 9:ae1f6fe932dc 76 }