Skip to content

Commit

Permalink
Support NUMAKER_IOT_M487
Browse files Browse the repository at this point in the history
1.  Support Nuvoton targets:
    -   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.
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:
    ARMmbed/mbed-os#11544
  • Loading branch information
ccli8 committed Jan 9, 2020
1 parent c9c2dfd commit b3bf7c5
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Board | Connectivity | Storage for credentials and
`Embedded Planet EP_AGORA` | Cellular | SPIF | Build-only
`ST NUCLEO_H743ZI2` | Ethernet | Internal Flash | Build-only
`ST NUCLEO_L4R5ZI` | Wi-Fi ESP8266 | Internal Flash | Build-only
`Nuvoton NUMAKER_IOT_M487` | Wi-Fi ESP8266 | SD card (NUSD) | Build-only

Build-only = This target is currently verified only via compilation, and is not verified at runtime.

Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions drivers/storage/COMPONENT_NUSD.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/OpenNuvoton/NuMaker-mbed-SD-driver/#56406071a4468a8302c0717a4467a241d152ade2
31 changes: 31 additions & 0 deletions mbed_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,37 @@
"esp8266.cts" : "PA_11",
"esp8266.provide-default" : true
},
"NUMAKER_IOT_M487": {
"target.extra_labels_add" : ["PSA"],
"target.network-default-interface-type" : "WIFI",
"target.bootloader_img" : "bootloader/mbed-bootloader-m487_iot-block_device-kvstore-v4.1.0.bin",
"bootloader-size" : "(64*1024)",
"target.header_offset" : "0x12000",
"target.app_offset" : "0x12400",
"target.components_add" : ["NUSD"],
"nusd.provide-default-blockdevice" : true,
"nusd.provide-kvstore-other-blockdevice" : true,
"update-client.bootloader-details" : "0x0",
"update-client.application-details" : "0x12000",
"update-client.storage-address" : "(1024*1024*64)",
"update-client.storage-size" : "((MBED_ROM_START + MBED_ROM_SIZE - APPLICATION_ADDR) * MBED_CONF_UPDATE_CLIENT_STORAGE_LOCATIONS)",
"update-client.storage-locations" : 1,
"mbed-cloud-client.update-storage" : "ARM_UCP_FLASHIAP_BLOCKDEVICE",
"storage.storage_type" : "FILESYSTEM",
"storage_filesystem.filesystem" : "LITTLE",
"storage_filesystem.blockdevice" : "other",
"storage_filesystem.internal_base_address" : "(MBED_ROM_START + MBED_BOOTLOADER_SIZE)",
"storage_filesystem.rbp_internal_size" : "(2*4*1024)",
"storage_filesystem.external_base_address" : "(0x0)",
"storage_filesystem.external_size" : "(1024*1024*64)",
"esp8266.tx" : "PH_8",
"esp8266.rx" : "PH_9",
"esp8266.rts" : "A2",
"esp8266.cts" : "A3",
"esp8266.rst" : "PH_3",
"esp8266.provide-default" : true,
"target.macros_add" : ["MBEDTLS_USER_CONFIG_FILE=\"mbedTLSConfig_mbedOS_SW_TRNG_PSA.h\"", "MBEDTLS_PSA_CRYPTO_C", "MBEDTLS_ENTROPY_NV_SEED", "PAL_USE_HW_TRNG=0", "ESP8266_SEND_TIMEOUT=8000"]
},
"DISCO_L475VG_IOT01A": {
"target.macros_add" : ["MBEDTLS_USER_CONFIG_FILE=\"mbedTLSConfig_mbedOS.h\""],
"target.network-default-interface-type" : "WIFI",
Expand Down

0 comments on commit b3bf7c5

Please sign in to comment.