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:
Thu Oct 17 13:31:21 2019 +0900
Revision:
28:7c220e487ae6
Parent:
26:cb1bb0872318
Remove Wi-Fi setting

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Osamu Koizumi 21:73d38425cc0b 1 {
Osamu Koizumi 21:73d38425cc0b 2 "macros": [
Osamu Koizumi 22:4d927fcd97e1 3 "MBED_TRACE_MAX_LEVEL=TRACE_LEVEL_INFO",
Osamu Koizumi 21:73d38425cc0b 4 "MBED_CLIENT_USER_CONFIG_FILE=\"mbed_cloud_client_user_config.h\"",
Osamu Koizumi 21:73d38425cc0b 5 "MBED_CLOUD_CLIENT_USER_CONFIG_FILE=\"mbed_cloud_client_user_config.h\"",
Osamu Koizumi 22:4d927fcd97e1 6 "ARM_UC_USE_PAL_BLOCKDEVICE=1",
Osamu Koizumi 22:4d927fcd97e1 7 "PAL_PLATFORM_DEFINED_CONFIGURATION=\"mbedOS_SST.h\"",
Osamu Koizumi 22:4d927fcd97e1 8 "PAL_USER_DEFINED_CONFIGURATION=\"mbedOS_SST.h\""
Osamu Koizumi 21:73d38425cc0b 9 ],
Osamu Koizumi 21:73d38425cc0b 10 "target_overrides": {
Osamu Koizumi 21:73d38425cc0b 11 "*": {
Osamu Koizumi 22:4d927fcd97e1 12 "target.features_add" : ["BOOTLOADER", "STORAGE"],
Osamu Koizumi 22:4d927fcd97e1 13 "platform.stdio-baud-rate" : 115200,
Osamu Koizumi 22:4d927fcd97e1 14 "platform.stdio-convert-newlines" : true,
Osamu Koizumi 22:4d927fcd97e1 15 "platform.stdio-buffered-serial" : true,
Osamu Koizumi 22:4d927fcd97e1 16 "platform.stdio-flush-at-exit" : true,
Osamu Koizumi 22:4d927fcd97e1 17 "rtos.main-thread-stack-size" : 5120,
Osamu Koizumi 22:4d927fcd97e1 18 "update-client.storage-locations" : 1,
Osamu Koizumi 22:4d927fcd97e1 19 "mbed-trace.enable" : null,
Osamu Koizumi 28:7c220e487ae6 20 "events.shared-stacksize" : 2048
Osamu Koizumi 21:73d38425cc0b 21 },
Osamu Koizumi 21:73d38425cc0b 22 "RZ_A1H": {
Osamu Koizumi 22:4d927fcd97e1 23 "target.macros_add" : ["MBEDTLS_USER_CONFIG_FILE=\"mbedTLSConfig_mbedOS.h\"", "MBEDTLS_TEST_NULL_ENTROPY", "MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES", "PAL_USE_HW_TRNG=0"],
Osamu Koizumi 22:4d927fcd97e1 24 "target.components_add" : ["FLASHIAP"],
Osamu Koizumi 22:4d927fcd97e1 25 "target.network-default-interface-type" : "ETHERNET",
Osamu Koizumi 22:4d927fcd97e1 26 "target.bootloader_img" : "bootloader/mbed-bootloader-gr-peach-internal_flash-no_rot.bin",
Osamu Koizumi 22:4d927fcd97e1 27 "target.header_offset" : "0x10000",
Osamu Koizumi 22:4d927fcd97e1 28 "target.app_offset" : "0x10400",
Osamu Koizumi 22:4d927fcd97e1 29 "update-client.bootloader-details" : "0x1800941C",
Osamu Koizumi 22:4d927fcd97e1 30 "update-client.application-details" : "(MBED_ROM_START+64*1024)",
Osamu Koizumi 22:4d927fcd97e1 31 "update-client.storage-address" : "(MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS+MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE)",
Osamu Koizumi 22:4d927fcd97e1 32 "update-client.storage-size" : "(MBED_ROM_SIZE/2-MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE)",
Osamu Koizumi 22:4d927fcd97e1 33 "update-client.storage-page" : 1,
Osamu Koizumi 22:4d927fcd97e1 34 "mbed-cloud-client.update-storage" : "ARM_UCP_FLASHIAP",
Osamu Koizumi 22:4d927fcd97e1 35 "storage_tdb_internal.internal_base_address": "(MBED_ROM_START+MBED_ROM_SIZE/2)",
Osamu Koizumi 22:4d927fcd97e1 36 "storage_tdb_internal.internal_size" : "(2*24*1024)",
Osamu Koizumi 22:4d927fcd97e1 37 "storage.storage_type" : "TDB_INTERNAL",
Osamu Koizumi 22:4d927fcd97e1 38 "camera-type" : "CAMERA_WIRELESS_CAMERA"
Osamu Koizumi 21:73d38425cc0b 39 }
Osamu Koizumi 21:73d38425cc0b 40 },
Osamu Koizumi 21:73d38425cc0b 41 "config": {
Osamu Koizumi 21:73d38425cc0b 42 "camera":{
Osamu Koizumi 21:73d38425cc0b 43 "help": "0:disable 1:enable",
Osamu Koizumi 21:73d38425cc0b 44 "value": "1"
Osamu Koizumi 21:73d38425cc0b 45 },
Osamu Koizumi 21:73d38425cc0b 46 "camera-type":{
Osamu Koizumi 21:73d38425cc0b 47 "help": "Please see EasyAttach_CameraAndLCD/README.md",
Osamu Koizumi 21:73d38425cc0b 48 "value": null
Osamu Koizumi 21:73d38425cc0b 49 },
Osamu Koizumi 22:4d927fcd97e1 50 "bootloader-size": {
Osamu Koizumi 22:4d927fcd97e1 51 "help" : "Helper macro to enable calculation of rom regions. target.header_offset and target.app_offset still needs to be calculated manually, though.",
Osamu Koizumi 22:4d927fcd97e1 52 "value" : "(32*1024)",
Osamu Koizumi 22:4d927fcd97e1 53 "macro_name": "MBED_BOOTLOADER_SIZE"
Osamu Koizumi 21:73d38425cc0b 54 },
Osamu Koizumi 22:4d927fcd97e1 55 "led-on": {
Osamu Koizumi 26:cb1bb0872318 56 "help" : "Polarity of LED ON, 0 or 1.",
Osamu Koizumi 22:4d927fcd97e1 57 "value" : 1
Osamu Koizumi 21:73d38425cc0b 58 }
Osamu Koizumi 21:73d38425cc0b 59 }
Osamu Koizumi 21:73d38425cc0b 60 }