NuMaker connection with AWS IoT thru MQTT/HTTPS
Dependencies: MQTT
Revision 42:fa6f7f79a112, committed 2021-02-26
- Comitter:
- ccli8
- Date:
- Fri Feb 26 13:31:36 2021 +0800
- Parent:
- 41:b878d7cd7035
- Child:
- 43:6ff444e04d50
- Commit message:
- Fix conditional TRNG & NV seed injection
1. Do provision (NV seed injection) only if DEVICE_FLASH is present
2. Add TARGET_PSA_Target (defined on Mbed OS 6) for conditional code
This bugfix is for target without DEVICE_FLASH but with TRNG so that it can compile and run.
Changed in this revision
--- a/pre-main/provision.cpp Fri Mar 27 14:32:06 2020 +0800 +++ b/pre-main/provision.cpp Fri Feb 26 13:31:36 2021 +0800 @@ -60,6 +60,8 @@ void provision(void) { +#if DEVICE_FLASH + int kv_reset(const char *kvstore_path); /* Initialize kvstore */ @@ -117,7 +119,7 @@ printf("\rReset kvstore...OK\r\n"); -#if !DEVICE_TRNG && !TARGET_PSA +#if !DEVICE_TRNG && !TARGET_PSA && !TARGET_PSA_Target #if !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) /* Inject trivial seed for development */ @@ -140,7 +142,7 @@ printf("\rInject NV seed...OK\r\n"); #endif /* !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) */ -#endif /* #if !DEVICE_TRNG && !TARGET_PSA */ +#endif /* #if !DEVICE_TRNG && !TARGET_PSA && !TARGET_PSA_Target */ /* Mark the device as provisioned */ kv_status = inner_store->set(KV_KEY_PROVISION, "1", 1, KVStore::WRITE_ONCE_FLAG); @@ -149,4 +151,6 @@ } printf("Provision for development...OK\r\n"); + +#endif /* #if DEVICE_FLASH */ }
--- a/targets/TARGET_NUVOTON/platform_entropy.cpp Fri Mar 27 14:32:06 2020 +0800 +++ b/targets/TARGET_NUVOTON/platform_entropy.cpp Fri Feb 26 13:31:36 2021 +0800 @@ -16,7 +16,7 @@ * limitations under the License. */ -#if !DEVICE_TRNG && !TARGET_PSA +#if !DEVICE_TRNG && !TARGET_PSA && !TARGET_PSA_Target #include "mbed.h" #include "mbedtls/config.h"