Taking photo using GR-LYCHEE through Pelion Device Management.

This firmware project works for GR-LYCHEE and GR-PEACH.

Steps to build this firmware with Mbed CLI

Import project

$ mbed import http://os.mbed.com/users/coisme/code/Pelion-GR-LYCHEE-camera-firmware/

Setting

  • Ethernet (GR-PEACH only)
    • Change the file name mbed_app.RZ_A1H_Ethernet.json to mbed_app.json
  • Wi-Fi
    • Change the Wi-Fi setting in mbed_app.json, i.e. nsapi.default-wifi-ssid and nsapi.default-wifi-password

If you haven't set your Pelion API key, run the following command.

$ mbed config -G CLOUD_SDK_API_KEY <API_KEY>

Setting for Pelion Device Management

$ mbed dm init -d "example.com" --model-name "PELION_DEMO" -q --force

Compile

For GR-LYCHEE:

$ mbed compile -t GCC_ARM -m GR_LYCHEE

For GR-PEACH:

$ mbed compile -t GCC_ARM -m RZ_A1H

Write the created .bin file to your GR-LYCHEE/PEACH.

That's it! :-)

LED Status Indicator

LEDs next to UB0 show the status of your GR-LYCHEE/PEACH.

LED#GR-LYCHEEGR-PEACHStatusDescription
LED1greenredNormalTurned on after the device is registered to Pelion Device Management successfully.
LED2yellowgreenErrorTurned on when the network initialization failed. Check your Wi-Fi setting.
LED3orangeblueErrorTurned on when the Pelion Device Management Client initialization failed. Check your SD card.
LED4redredErrorTurned on when the network is disconnected. Check your Wi-Fi network status.

Clear device identity

If you want to clear the device's identity, connect to the device via serial terminal. Then input r command. The device flushes the identity storage, then reboot.

Known Issues

  • client_error(6) -> Client in reconnection mode NetworkError appears when connecting to network, but eventually connection will be established.
  • Warning message "MBEDTLS_TEST_NULL_ENTROPY has been enabled. This configuration is not secure and is not suitable for production use" appears when compiling the project for GR-PEACH. This can be ignored in development stage.
Committer:
Osamu Koizumi
Date:
Fri Jul 12 11:30:22 2019 +0900
Revision:
21:73d38425cc0b
Child:
22:4d927fcd97e1
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Osamu Koizumi 21:73d38425cc0b 1 {
Osamu Koizumi 21:73d38425cc0b 2 "macros": [
Osamu Koizumi 21:73d38425cc0b 3 "ARM_UC_USE_PAL_BLOCKDEVICE=1",
Osamu Koizumi 21:73d38425cc0b 4 "MBED_CLOUD_CLIENT_UPDATE_STORAGE=ARM_UCP_FLASHIAP_BLOCKDEVICE",
Osamu Koizumi 21:73d38425cc0b 5 "MBED_CLIENT_USER_CONFIG_FILE=\"mbed_cloud_client_user_config.h\"",
Osamu Koizumi 21:73d38425cc0b 6 "MBED_CLOUD_CLIENT_USER_CONFIG_FILE=\"mbed_cloud_client_user_config.h\"",
Osamu Koizumi 21:73d38425cc0b 7 "PAL_USER_DEFINED_CONFIGURATION=\"sotp_fs_config_MbedOS.h\"",
Osamu Koizumi 21:73d38425cc0b 8 "PAL_FS_MOUNT_POINT_PRIMARY=\"/fs\"",
Osamu Koizumi 21:73d38425cc0b 9 "MBEDTLS_USER_CONFIG_FILE=\"mbedTLSConfig_mbedOS.h\"",
Osamu Koizumi 21:73d38425cc0b 10 "PAL_DTLS_PEER_MIN_TIMEOUT=5000"
Osamu Koizumi 21:73d38425cc0b 11 ],
Osamu Koizumi 21:73d38425cc0b 12 "target_overrides": {
Osamu Koizumi 21:73d38425cc0b 13 "*": {
Osamu Koizumi 21:73d38425cc0b 14 "platform.stdio-baud-rate" : 115200,
Osamu Koizumi 21:73d38425cc0b 15 "platform.stdio-convert-newlines" : true,
Osamu Koizumi 21:73d38425cc0b 16 "update-client.storage-address" : "(1024*1024*64)",
Osamu Koizumi 21:73d38425cc0b 17 "update-client.storage-size" : "(1024*1024*2)",
Osamu Koizumi 21:73d38425cc0b 18 "update-client.storage-locations" : "1",
Osamu Koizumi 21:73d38425cc0b 19 "mbed-trace.enable" : null,
Osamu Koizumi 21:73d38425cc0b 20 "nsapi.default-wifi-security" : "WPA_WPA2",
Osamu Koizumi 21:73d38425cc0b 21 "nsapi.default-wifi-ssid" : "\"SSID\"",
Osamu Koizumi 21:73d38425cc0b 22 "nsapi.default-wifi-password" : "\"PASSWORD\""
Osamu Koizumi 21:73d38425cc0b 23 },
Osamu Koizumi 21:73d38425cc0b 24 "RZ_A1H": {
Osamu Koizumi 21:73d38425cc0b 25 "target.features_add" : ["BOOTLOADER"],
Osamu Koizumi 21:73d38425cc0b 26 "target.components_add" : ["SD"],
Osamu Koizumi 21:73d38425cc0b 27 "target.macros_add" : ["MBEDTLS_TEST_NULL_ENTROPY", "MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES"],
Osamu Koizumi 21:73d38425cc0b 28 "camera-type" : "CAMERA_WIRELESS_CAMERA",
Osamu Koizumi 21:73d38425cc0b 29 "target.network-default-interface-type" : "ETHERNET",
Osamu Koizumi 21:73d38425cc0b 30 "flash-start-address" : "0x18000000",
Osamu Koizumi 21:73d38425cc0b 31 "flash-size" : "(8*1024*1024)",
Osamu Koizumi 21:73d38425cc0b 32 "sotp-section-1-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 2*(4*1024))",
Osamu Koizumi 21:73d38425cc0b 33 "sotp-section-1-size" : "(4*1024)",
Osamu Koizumi 21:73d38425cc0b 34 "sotp-section-2-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 1*(4*1024))",
Osamu Koizumi 21:73d38425cc0b 35 "sotp-section-2-size" : "(4*1024)",
Osamu Koizumi 21:73d38425cc0b 36 "sotp-num-sections" : 2,
Osamu Koizumi 21:73d38425cc0b 37 "target.bootloader_img" : "bootloader/mbed-bootloader-RZ_A1H.bin",
Osamu Koizumi 21:73d38425cc0b 38 "target.header_offset" : "0x10000",
Osamu Koizumi 21:73d38425cc0b 39 "target.app_offset" : "0x10400",
Osamu Koizumi 21:73d38425cc0b 40 "update-client.application-details" : "(MBED_CONF_APP_FLASH_START_ADDRESS + 64*1024)"
Osamu Koizumi 21:73d38425cc0b 41 },
Osamu Koizumi 21:73d38425cc0b 42 "GR_LYCHEE": {
Osamu Koizumi 21:73d38425cc0b 43 "target.features_add" : ["BOOTLOADER"],
Osamu Koizumi 21:73d38425cc0b 44 "target.components_add" : ["SD"],
Osamu Koizumi 21:73d38425cc0b 45 "target.extra_labels_add" : ["ESP32_DRIVER"],
Osamu Koizumi 21:73d38425cc0b 46 "target.network-default-interface-type" : "WIFI",
Osamu Koizumi 21:73d38425cc0b 47 "flash-start-address" : "0x18000000",
Osamu Koizumi 21:73d38425cc0b 48 "flash-size" : "(8*1024*1024)",
Osamu Koizumi 21:73d38425cc0b 49 "sotp-section-1-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 2*(4*1024))",
Osamu Koizumi 21:73d38425cc0b 50 "sotp-section-1-size" : "(4*1024)",
Osamu Koizumi 21:73d38425cc0b 51 "sotp-section-2-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS + MBED_CONF_APP_FLASH_SIZE - 1*(4*1024))",
Osamu Koizumi 21:73d38425cc0b 52 "sotp-section-2-size" : "(4*1024)",
Osamu Koizumi 21:73d38425cc0b 53 "sotp-num-sections" : 2,
Osamu Koizumi 21:73d38425cc0b 54 "target.bootloader_img" : "bootloader/mbed-bootloader-GR_LYCHEE.bin",
Osamu Koizumi 21:73d38425cc0b 55 "target.header_offset" : "0x10000",
Osamu Koizumi 21:73d38425cc0b 56 "target.app_offset" : "0x10400",
Osamu Koizumi 21:73d38425cc0b 57 "update-client.application-details" : "(MBED_CONF_APP_FLASH_START_ADDRESS + 64*1024)"
Osamu Koizumi 21:73d38425cc0b 58 }
Osamu Koizumi 21:73d38425cc0b 59 },
Osamu Koizumi 21:73d38425cc0b 60 "config": {
Osamu Koizumi 21:73d38425cc0b 61 "camera":{
Osamu Koizumi 21:73d38425cc0b 62 "help": "0:disable 1:enable",
Osamu Koizumi 21:73d38425cc0b 63 "value": "1"
Osamu Koizumi 21:73d38425cc0b 64 },
Osamu Koizumi 21:73d38425cc0b 65 "camera-type":{
Osamu Koizumi 21:73d38425cc0b 66 "help": "Please see EasyAttach_CameraAndLCD/README.md",
Osamu Koizumi 21:73d38425cc0b 67 "value": null
Osamu Koizumi 21:73d38425cc0b 68 },
Osamu Koizumi 21:73d38425cc0b 69 "format-storage-layer-on-error": {
Osamu Koizumi 21:73d38425cc0b 70 "help": "Whether to format the storage layer when it cannot be read - always disable for production devices!",
Osamu Koizumi 21:73d38425cc0b 71 "value": 1
Osamu Koizumi 21:73d38425cc0b 72 },
Osamu Koizumi 21:73d38425cc0b 73 "developer-mode": {
Osamu Koizumi 21:73d38425cc0b 74 "help": "Enable Developer mode to skip Factory enrollment",
Osamu Koizumi 21:73d38425cc0b 75 "value": 1
Osamu Koizumi 21:73d38425cc0b 76 },
Osamu Koizumi 21:73d38425cc0b 77 "main-stack-size": {
Osamu Koizumi 21:73d38425cc0b 78 "value": 6000
Osamu Koizumi 21:73d38425cc0b 79 },
Osamu Koizumi 21:73d38425cc0b 80 "flash-start-address": {
Osamu Koizumi 21:73d38425cc0b 81 "help": "Start address of internal flash. Only used in this config to help the definition of other macros.",
Osamu Koizumi 21:73d38425cc0b 82 "value": null
Osamu Koizumi 21:73d38425cc0b 83 },
Osamu Koizumi 21:73d38425cc0b 84 "flash-size": {
Osamu Koizumi 21:73d38425cc0b 85 "help": "Total size of internal flash. Only used in this config to help the definition of other macros.",
Osamu Koizumi 21:73d38425cc0b 86 "value": null
Osamu Koizumi 21:73d38425cc0b 87 },
Osamu Koizumi 21:73d38425cc0b 88 "sotp-section-1-address": {
Osamu Koizumi 21:73d38425cc0b 89 "help": "Flash sector address for SOTP sector 1",
Osamu Koizumi 21:73d38425cc0b 90 "macro_name": "PAL_INTERNAL_FLASH_SECTION_1_ADDRESS",
Osamu Koizumi 21:73d38425cc0b 91 "value": null
Osamu Koizumi 21:73d38425cc0b 92 },
Osamu Koizumi 21:73d38425cc0b 93 "sotp-section-1-size": {
Osamu Koizumi 21:73d38425cc0b 94 "help": "Flash sector size for SOTP sector 1",
Osamu Koizumi 21:73d38425cc0b 95 "macro_name": "PAL_INTERNAL_FLASH_SECTION_1_SIZE",
Osamu Koizumi 21:73d38425cc0b 96 "value": null
Osamu Koizumi 21:73d38425cc0b 97 },
Osamu Koizumi 21:73d38425cc0b 98 "sotp-section-2-address": {
Osamu Koizumi 21:73d38425cc0b 99 "help": "Flash sector address for SOTP sector 2",
Osamu Koizumi 21:73d38425cc0b 100 "macro_name": "PAL_INTERNAL_FLASH_SECTION_2_ADDRESS",
Osamu Koizumi 21:73d38425cc0b 101 "value": null
Osamu Koizumi 21:73d38425cc0b 102 },
Osamu Koizumi 21:73d38425cc0b 103 "sotp-section-2-size": {
Osamu Koizumi 21:73d38425cc0b 104 "help": "Flash sector size for SOTP sector 2",
Osamu Koizumi 21:73d38425cc0b 105 "macro_name": "PAL_INTERNAL_FLASH_SECTION_2_SIZE",
Osamu Koizumi 21:73d38425cc0b 106 "value": null
Osamu Koizumi 21:73d38425cc0b 107 },
Osamu Koizumi 21:73d38425cc0b 108 "sotp-num-sections": {
Osamu Koizumi 21:73d38425cc0b 109 "help": "Number of SOTP sections",
Osamu Koizumi 21:73d38425cc0b 110 "macro_name": "PAL_INT_FLASH_NUM_SECTIONS",
Osamu Koizumi 21:73d38425cc0b 111 "value": null
Osamu Koizumi 21:73d38425cc0b 112 }
Osamu Koizumi 21:73d38425cc0b 113 }
Osamu Koizumi 21:73d38425cc0b 114 }