Setting up the client binaries
Tip: If you cannot access some of the repositories referenced in this section, contact us to request access.
Prepare the client files
Clone the embedded application's GitHub repository:
mbed import https://github.com/PelionIoT/secure-device-access-client-example
Navigate to the application folder:
Build the client for Mbed OS
If you are using developer credentials, build the target as described below. In production mode, skip steps 1 and 2, and provision and store your credentials on your target, as described in the provisioning documentation.
mbed_cloud_dev_credentials.ctemplate file in the
secure-device-access-client-examplefolder with the
mbed_cloud_dev_credentials.cfile that you downloaded from the Portal.
secure-device-access-client-examplefolder, run the following command to overwrite the
mbed_cloud_trust_anchor_credentials.ctemplate file with your trust anchor:
python create_trust_anchor_dev_cred.py -t "<trust anchor>"
python create_trust_anchor_dev_cred.py -t "-----BEGIN PUBLIC KEY-----MFkaEqYHKoZIzj0CAQYIKoZIzj0GAQcDHgAEbiRnZgdzoBpySFDPVPFp3J7yOmrOXJ09O5qVUMOD5knUjX7YbQBF0ueJWPz6tkTGbzORAwDzvRXYUA7vZpB+og==-----END PUBLIC KEY-----"
Note: Be sure to remove any line breaks (
\r) in the trust anchor before running
Detect and configure the target device:
If your device is connected to your computer:
mbed detect mbed target auto
If your device is not connected to your computer:
mbed target <target>
Set the toolchain:
mbed config <path to the toolchain binaries> mbed toolchain <toolchain>
<path to the toolchain binaries>may be
IAR_PATH. You only need this if toolchain binaries are not in the path.
Compile the application:
mbed compile -DSDA_SERIAL_INTERFACE
Note: You must set
mbed_app.jsonfile to use developer mode.
Flash the binary to the target:
- Connect the target to your computer using USB. The target is listed as a mass storage device.
- Drag and drop
secure-device-access-client-example/BUILD/K64F/GCC_ARM/secure-device-access-client-example.hexto the target. The LED blinks rapidly; wait for it to finish.
- Press the Reset button to restart the device.
Example for K64F and GCC_ARM
mbed import https://github.com/PelionIoT/secure-device-access-client-example cd secure-device-access-client-example mbed target K64F mbed toolchain GCC_ARM mbed compile -DSDA_SERIAL_INTERFACE