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:47:13 2019 +0900
Revision:
29:ed5e9b78ed40
Parent:
26:cb1bb0872318
Added tag v1.3 for changeset 7c220e487ae6

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MACRUM 0:6d2053b84a92 1 {
MACRUM 0:6d2053b84a92 2 "macros": [
Osamu Koizumi 22:4d927fcd97e1 3 "MBED_TRACE_MAX_LEVEL=TRACE_LEVEL_INFO",
MACRUM 0:6d2053b84a92 4 "MBED_CLIENT_USER_CONFIG_FILE=\"mbed_cloud_client_user_config.h\"",
MACRUM 0:6d2053b84a92 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\""
MACRUM 0:6d2053b84a92 9 ],
MACRUM 0:6d2053b84a92 10 "target_overrides": {
MACRUM 0:6d2053b84a92 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 22:4d927fcd97e1 20 "events.shared-stacksize" : 2048,
Osamu Koizumi 22:4d927fcd97e1 21 "nsapi.default-wifi-security" : "WPA_WPA2",
Osamu Koizumi 22:4d927fcd97e1 22 "nsapi.default-wifi-ssid" : "\"SSID\"",
Osamu Koizumi 22:4d927fcd97e1 23 "nsapi.default-wifi-password" : "\"PASSWORD\""
MACRUM 0:6d2053b84a92 24 },
MACRUM 2:a5b5f3df19e8 25 "RZ_A1H": {
Osamu Koizumi 22:4d927fcd97e1 26 "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 27 "target.components_add" : ["FLASHIAP", "WIFI_ESP32"],
Osamu Koizumi 22:4d927fcd97e1 28 "target.network-default-interface-type" : "WIFI",
Osamu Koizumi 22:4d927fcd97e1 29 "esp32.provide-default" : true,
Osamu Koizumi 22:4d927fcd97e1 30 "target.bootloader_img" : "bootloader/mbed-bootloader-gr-peach-internal_flash-no_rot.bin",
Osamu Koizumi 22:4d927fcd97e1 31 "target.header_offset" : "0x10000",
Osamu Koizumi 22:4d927fcd97e1 32 "target.app_offset" : "0x10400",
Osamu Koizumi 22:4d927fcd97e1 33 "update-client.bootloader-details" : "0x1800941C",
Osamu Koizumi 22:4d927fcd97e1 34 "update-client.application-details" : "(MBED_ROM_START+64*1024)",
Osamu Koizumi 22:4d927fcd97e1 35 "update-client.storage-address" : "(MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS+MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE)",
Osamu Koizumi 22:4d927fcd97e1 36 "update-client.storage-size" : "(MBED_ROM_SIZE/2-MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE)",
Osamu Koizumi 22:4d927fcd97e1 37 "update-client.storage-page" : 1,
Osamu Koizumi 22:4d927fcd97e1 38 "mbed-cloud-client.update-storage" : "ARM_UCP_FLASHIAP",
Osamu Koizumi 22:4d927fcd97e1 39 "storage_tdb_internal.internal_base_address": "(MBED_ROM_START+MBED_ROM_SIZE/2)",
Osamu Koizumi 22:4d927fcd97e1 40 "storage_tdb_internal.internal_size" : "(2*24*1024)",
Osamu Koizumi 22:4d927fcd97e1 41 "storage.storage_type" : "TDB_INTERNAL",
Osamu Koizumi 22:4d927fcd97e1 42 "camera-type" : "CAMERA_WIRELESS_CAMERA"
MACRUM 2:a5b5f3df19e8 43 },
MACRUM 0:6d2053b84a92 44 "GR_LYCHEE": {
Osamu Koizumi 22:4d927fcd97e1 45 "target.macros_add" : ["MBEDTLS_USER_CONFIG_FILE=\"mbedTLSConfig_mbedOS.h\""],
Osamu Koizumi 22:4d927fcd97e1 46 "target.components_add" : ["WIFI_ESP32"],
Osamu Koizumi 22:4d927fcd97e1 47 "target.network-default-interface-type" : "WIFI",
Osamu Koizumi 22:4d927fcd97e1 48 "target.bootloader_img" : "bootloader/mbed-bootloader-gr-lychee-internal_flash-no_rot.bin",
Osamu Koizumi 22:4d927fcd97e1 49 "target.header_offset" : "0x10000",
Osamu Koizumi 22:4d927fcd97e1 50 "target.app_offset" : "0x10400",
Osamu Koizumi 22:4d927fcd97e1 51 "update-client.bootloader-details" : "0x1800941C",
Osamu Koizumi 22:4d927fcd97e1 52 "update-client.application-details" : "(MBED_ROM_START+64*1024)",
Osamu Koizumi 22:4d927fcd97e1 53 "update-client.storage-address" : "(MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS+MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE)",
Osamu Koizumi 22:4d927fcd97e1 54 "update-client.storage-size" : "(MBED_ROM_SIZE/2-MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE)",
Osamu Koizumi 22:4d927fcd97e1 55 "update-client.storage-page" : 1,
Osamu Koizumi 22:4d927fcd97e1 56 "mbed-cloud-client.update-storage" : "ARM_UCP_FLASHIAP",
Osamu Koizumi 22:4d927fcd97e1 57 "storage_tdb_internal.internal_base_address": "(MBED_ROM_START+MBED_ROM_SIZE/2)",
Osamu Koizumi 22:4d927fcd97e1 58 "storage_tdb_internal.internal_size" : "(2*24*1024)",
Osamu Koizumi 22:4d927fcd97e1 59 "storage.storage_type" : "TDB_INTERNAL",
Osamu Koizumi 22:4d927fcd97e1 60 "camera-type" : "CAMERA_OV7725"
MACRUM 0:6d2053b84a92 61 }
MACRUM 0:6d2053b84a92 62 },
MACRUM 0:6d2053b84a92 63 "config": {
Osamu Koizumi 13:bc31cb1602de 64 "camera":{
Osamu Koizumi 13:bc31cb1602de 65 "help": "0:disable 1:enable",
Osamu Koizumi 13:bc31cb1602de 66 "value": "1"
Osamu Koizumi 13:bc31cb1602de 67 },
Osamu Koizumi 13:bc31cb1602de 68 "camera-type":{
Osamu Koizumi 13:bc31cb1602de 69 "help": "Please see EasyAttach_CameraAndLCD/README.md",
Osamu Koizumi 13:bc31cb1602de 70 "value": null
Osamu Koizumi 13:bc31cb1602de 71 },
Osamu Koizumi 22:4d927fcd97e1 72 "bootloader-size": {
Osamu Koizumi 22:4d927fcd97e1 73 "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 74 "value" : "(32*1024)",
Osamu Koizumi 22:4d927fcd97e1 75 "macro_name": "MBED_BOOTLOADER_SIZE"
MACRUM 0:6d2053b84a92 76 },
Osamu Koizumi 22:4d927fcd97e1 77 "led-on": {
Osamu Koizumi 26:cb1bb0872318 78 "help" : "Polarity of LED ON, 0 or 1.",
Osamu Koizumi 22:4d927fcd97e1 79 "value" : 1
MACRUM 0:6d2053b84a92 80 }
MACRUM 0:6d2053b84a92 81 }
Osamu Koizumi 22:4d927fcd97e1 82 }