NuMaker Pelion Device Management example
Fork of mbed-os-example-pelion by
mbed_cloud_client_user_config.h@0:f78ec4a22e67, 2019-10-09 (annotated)
- Committer:
- ccli8
- Date:
- Wed Oct 09 14:19:44 2019 +0800
- Revision:
- 0:f78ec4a22e67
Support Nuvoton targets
Based on mbed-os-pelion-example master/mbed-bootloader 4.1.0/mbed-cloud-client 4.0.0,
support Nuvoton targets:
1. Support Nuvoton targets:
- NUMAKER_PFM_NUC472
- NUMAKER_PFM_M487
- NUMAKER_IOT_M487 V1.3
Compared to V1.2, V1.3 adds support for ESP8266 RTS/CTS/RST pins. V1.3 is incompatible with V1.2 on ESP8266.
- NUMAKER_IOT_M263A
2. Change storage to NUSD (SD card in SDIO bus mode) from SD (SD card SPI bus mode)
(1) Add COMPONENT_NUSD.lib.
(2) Add component NUSD (target.components_add).
(3) Change default BlockDevice to NUSD:
Override BlockDevice::get_default_instance (nusd.provide-default-blockdevice).
Required since mbed-cloud-client 2.1.0 (arm_uc_blockdevice_ext) or in:
mbed-bootloader/modules/storage/pal-blockdevice/source/arm_uc_pal_blockdevice_mbed.cpp
(4) Enable kvstore with blockdevice type being "other".
i) Override get_other_blockdevice() (nusd.provide-kvstore-other-blockdevice).
ii) Configure storage type to "FILESYSTEM".
iii)Configure file system type to "LITTLE".
vi) Configure block device type to "other".
v) Configure external size to 64MiB, which cannot overlap with update-client.
storage-address/update-client.storage-size.
3. Change back UARTSerial tx/rx buffer size from 1024/1024 to 256/256. This can reduce
memory footprint by (1024 - 256) * 2 = 1.5KiB. Because this configuration influences
both ESP8266 and default console (platfrom/mbed_retarget.cpp), memory reduction can
achieve 1.5KiB x 2 = 3KiB.
4. Enlarge ESP8266 'send tcp data' timeout on Nuvoton targets
Pelion connection has some failure rate with this. Enlarging ESP8266_SEND_TIMEOUT
can just relieve the issue. A ticket has raised to address it:
https://github.com/ARMmbed/mbed-os/issues/11544
5. Requirements for mbed-os version:
- mbed-os 5.13.0 (or afterwards) to support kvstore with block device type being "other"
- mbed-os 5.13.1 (or afterwards) to fix 'undefined pal_plat_osEntropyInject(...)' error
- mbed-os 5.14.0 (or afterwards) to support NUMAKER_IOT_M263A
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ccli8 |
0:f78ec4a22e67 | 1 | // ---------------------------------------------------------------------------- |
ccli8 |
0:f78ec4a22e67 | 2 | // Copyright 2019 ARM Ltd. |
ccli8 |
0:f78ec4a22e67 | 3 | // |
ccli8 |
0:f78ec4a22e67 | 4 | // SPDX-License-Identifier: Apache-2.0 |
ccli8 |
0:f78ec4a22e67 | 5 | // |
ccli8 |
0:f78ec4a22e67 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); |
ccli8 |
0:f78ec4a22e67 | 7 | // you may not use this file except in compliance with the License. |
ccli8 |
0:f78ec4a22e67 | 8 | // You may obtain a copy of the License at |
ccli8 |
0:f78ec4a22e67 | 9 | // |
ccli8 |
0:f78ec4a22e67 | 10 | // http://www.apache.org/licenses/LICENSE-2.0 |
ccli8 |
0:f78ec4a22e67 | 11 | // |
ccli8 |
0:f78ec4a22e67 | 12 | // Unless required by applicable law or agreed to in writing, software |
ccli8 |
0:f78ec4a22e67 | 13 | // distributed under the License is distributed on an "AS IS" BASIS, |
ccli8 |
0:f78ec4a22e67 | 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
ccli8 |
0:f78ec4a22e67 | 15 | // See the License for the specific language governing permissions and |
ccli8 |
0:f78ec4a22e67 | 16 | // limitations under the License. |
ccli8 |
0:f78ec4a22e67 | 17 | // ---------------------------------------------------------------------------- |
ccli8 |
0:f78ec4a22e67 | 18 | |
ccli8 |
0:f78ec4a22e67 | 19 | #ifndef MBED_CLOUD_CLIENT_USER_CONFIG_H |
ccli8 |
0:f78ec4a22e67 | 20 | #define MBED_CLOUD_CLIENT_USER_CONFIG_H |
ccli8 |
0:f78ec4a22e67 | 21 | |
ccli8 |
0:f78ec4a22e67 | 22 | #define MBED_CLOUD_CLIENT_ENDPOINT_TYPE "default" |
ccli8 |
0:f78ec4a22e67 | 23 | #define MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP |
ccli8 |
0:f78ec4a22e67 | 24 | #define MBED_CLOUD_CLIENT_LIFETIME 3600 |
ccli8 |
0:f78ec4a22e67 | 25 | |
ccli8 |
0:f78ec4a22e67 | 26 | #ifdef MBED_CONF_MBED_CLIENT_SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE |
ccli8 |
0:f78ec4a22e67 | 27 | #define SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE MBED_CONF_MBED_CLIENT_SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE |
ccli8 |
0:f78ec4a22e67 | 28 | #else |
ccli8 |
0:f78ec4a22e67 | 29 | #define SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE 512 |
ccli8 |
0:f78ec4a22e67 | 30 | #endif |
ccli8 |
0:f78ec4a22e67 | 31 | |
ccli8 |
0:f78ec4a22e67 | 32 | /* set flag to enable update support in mbed Cloud client */ |
ccli8 |
0:f78ec4a22e67 | 33 | #define MBED_CLOUD_CLIENT_SUPPORT_UPDATE |
ccli8 |
0:f78ec4a22e67 | 34 | |
ccli8 |
0:f78ec4a22e67 | 35 | /* set download buffer size in bytes (min. 1024 bytes) */ |
ccli8 |
0:f78ec4a22e67 | 36 | #define MBED_CLOUD_CLIENT_UPDATE_BUFFER 1024 |
ccli8 |
0:f78ec4a22e67 | 37 | |
ccli8 |
0:f78ec4a22e67 | 38 | #define MBED_CLOUD_DEV_UPDATE_CERT |
ccli8 |
0:f78ec4a22e67 | 39 | #define MBED_CLOUD_DEV_UPDATE_ID |
ccli8 |
0:f78ec4a22e67 | 40 | |
ccli8 |
0:f78ec4a22e67 | 41 | #endif /* MBED_CLOUD_CLIENT_USER_CONFIG_H */ |