Building the FCC example
Mbed OS
-
Clone the embedded application's GitHub repository to your local computer:
mbed import https://github.com/PelionIoT/factory-configurator-client-example -
Navigate to the application folder:
cd factory-configurator-client-example -
Detect and configure the target device:
-
If your device is connected to your local computer:
mbed detect mbed target auto -
If your device is not connected to your local computer:
mbed target <target> -
<target>must beK64F,K66F,NUCLEO_F429ZI,UBLOX_EVK_ODIN_W2orNUCLEO_F411RE.
-
-
Set the toolchain:
mbed config <toolchain path> <path to the toolchain binaries> mbed toolchain <toolchain><toolchain path>may beGCC_ARM_PATHorARM_PATH. Needed only if toolchain binaries are not in path.<toolchain>may beGCC_ARMorARM.
Note: To work with the ATECC608A secure element, use
GCC_ARMorARM. -
Compile the application:
mbed compile -D<INTERFACE>Where
<INTERFACE>is:FCE_ETHERNET_INTERFACEfor an Ethernet interface.FCE_SERIAL_INTERFACEfor a serial interface.
Pass the
--app-configargument to specify a JSON file; by default, the script takes thembed_app.jsonfile for a non-PSA target:-
To compile for a PSA target, use
mbed_app_psa_conf.json:mbed compile -D<INTERFACE> --app-config mbed_app_psa_conf.json -
To compile for the ATECC608A secure element, use
mbed_app_atmel_conf.json:mbed compile -D<INTERFACE> --app-config mbed_app_atmel_conf.json
-
Flash the binary to the device.
- Connect the device to your computer over USB. It's listed as a mass storage device.
- Drag and drop
BUILD/<target>/<toolchain>/factory-configurator-client-example.hexto the device. The binary is flashed to the device, and you should see the LED blink rapidly; wait for it to finish. - Press the Reset button to restart the device.
Example of how to build the application for a K64F target (board) using the GCC_ARM toolchain
mbed import https://github.com/PelionIoT/factory-configurator-client-example
cd factory-configurator-client-example
mbed target K64F
mbed toolchain GCC_ARM
mbed compile -DFCE_ETHERNET_INTERFACE
Native Linux
-
Clone the embedded application's GitHub repository to your local computer:
git clone https://github.com/PelionIoT/factory-configurator-client-example -
Navigate to the application folder:
cd factory-configurator-client-example -
Remove the
mbed-os.libfile. -
Deploy the example repository:
mbed deploy -
Compile the application:
-
For a simple build (compiles for both
ReleaseandDebugprofiles), run:python pal-platform/pal-platform.py fullbuild --target x86_x64_NativeLinux_mbedtls --toolchain GCC --external ./../<file-name> --name factory-configurator-client-example.elf -
For a manually configured build, run:
python pal-platform/pal-platform.py deploy --target=x86_x64_NativeLinux_mbedtls generate cd __x86_x64_NativeLinux_mbedtls cmake -G "Unix Makefiles" -DPARSEC_TPM_SE_SUPPORT=<ON|OFF> -DCMAKE_BUILD_TYPE=<build-type> -DCMAKE_TOOLCHAIN_FILE=./../pal-platform/Toolchain/GCC/GCC.cmake -DEXTERNAL_DEFINE_FILE=./../<file-name> make factory-configurator-client-example.elfWhere:
-
<build-type>may beDebugorRelease. -
<file-name>is:linux-config.cmakefor non-PSA platforms (Parsec support is only available on PSA platforms).linux-psa-config.cmakefor PSA platforms and to use Parsec APIs and a software trusted platform module (TPM).
-
DPARSEC_TPM_SE_SUPPORTisONfor use with a TPM andOFFotherwise.
-
Note: The simple build creates binaries under
factory-configurator-client-example/out, whereas the manual build creates the binaries underfactory-configurator-client-example/__x86_x64_NativeLinux_mbedtls. In both cases, there areDebugandReleasesub-directories, respectively, for the two profiles. -