Mistake on this page? Email us

Building the FCC example

Mbed OS

  1. Clone the embedded application's GitHub repository to your local computer:

    mbed import https://github.com/PelionIoT/factory-configurator-client-example
    
  2. Navigate to the application folder:

    cd factory-configurator-client-example
    
  3. 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 be K64F, K66F, NUCLEO_F429ZI, UBLOX_EVK_ODIN_W2 or NUCLEO_F411RE.

  4. Set the toolchain:

    mbed config <toolchain path> <path to the toolchain binaries>
    mbed toolchain <toolchain>
    
    • <toolchain path> may be GCC_ARM_PATH or ARM_PATH. Needed only if toolchain binaries are not in path.
    • <toolchain> may be GCC_ARMor ARM.

    Note: To work with the ATECC608A secure element, use GCC_ARM or ARM.

  5. Compile the application:

    mbed compile -D<INTERFACE>
    

    Where <INTERFACE> is:

    • FCE_ETHERNET_INTERFACE for an Ethernet interface.
    • FCE_SERIAL_INTERFACE for a serial interface.

    Pass the --app-config argument to specify a JSON file; by default, the script takes the mbed_app.json file 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
      
  6. Flash the binary to the device.

    1. Connect the device to your computer over USB. It's listed as a mass storage device.
    2. Drag and drop BUILD/<target>/<toolchain>/factory-configurator-client-example.hex to the device. The binary is flashed to the device, and you should see the LED blink rapidly; wait for it to finish.
    3. 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

  1. Clone the embedded application's GitHub repository to your local computer:

    git clone https://github.com/PelionIoT/factory-configurator-client-example
    
  2. Navigate to the application folder:

    cd factory-configurator-client-example
    
  3. Remove the mbed-os.lib file.

  4. Deploy the example repository:

    mbed deploy
    
  5. Compile the application:

    • For a simple build (compiles for both Release and Debug profiles), 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.elf
      

      Where:

      • <build-type> may be Debug or Release.

      • <file-name> is:

      • DPARSEC_TPM_SE_SUPPORT is ON for use with a TPM and OFF otherwise.

    Note: The simple build creates binaries under factory-configurator-client-example/out, whereas the manual build creates the binaries under factory-configurator-client-example/__x86_x64_NativeLinux_mbedtls. In both cases, there are Debug and Release sub-directories, respectively, for the two profiles.