Coder Social home page Coder Social logo

mbed-os-example-devicekey's Introduction

mbed-os-example-devicekey

Device key example for Mbed OS

Getting started with DeviceKey

This is an example of an application that uses the DeviceKey APIs. The application injects a dummy root of trust (ROT) if true random number generator (TRNG) is not avalable. The application also invoke the derive key API several times in diffrent conditions and print the result.

Required hardware

  • An mbed-os supported development board.
  • A micro-USB cable.

Mbed OS build tools

Mbed CLI 2

Starting with version 6.5, Mbed OS uses Mbed CLI 2. It uses Ninja as a build system, and CMake to generate the build environment and manage the build process in a compiler-independent manner. If you are working with Mbed OS version prior to 6.5 then check the section Mbed CLI 1.

  1. Install Mbed CLI 2.
  2. From the command-line, import the example: mbed-tools import mbed-os-example-devicekey
  3. Change the current directory to where the project was imported.

Mbed CLI 1

  1. Install Mbed CLI 1.
  2. From the command-line, import the example: mbed import mbed-os-example-devicekey
  3. Change the current directory to where the project was imported.

Building and running

  1. Connect a USB cable between the USB port on the target and the host computer.

  2. Run the following command to build the example project and program the microcontroller flash memory:

    • Mbed CLI 2
    $ mbed-tools compile -m <TARGET> -t <TOOLCHAIN> --flash --sterm
    • Mbed CLI 1
    $ mbed compile -m <TARGET> -t <TOOLCHAIN> --flash --sterm

Your PC may take a few minutes to compile your code.

The binary is located at:

  • Mbed CLI 2 - ./cmake_build/<TARGET>/develop/<TOOLCHAIN>/mbed-os-example-devicekey.bin

  • Mbed CLI 1 - ./BUILD/<TARGET>/<TOOLCHAIN>/mbed-os-example-devicekey.bin.

You can manually copy the binary to the target, which gets mounted on the host computer through USB, rather than using the --flash option.

You can also open a serial terminal separately, rather than using the --sterm option, with the following command:

  • Mbed CLI 2

    $ mbed-tools sterm
  • Mbed CLI 1

    $ mbed sterm

The expected log can be found in tests/devicekey.log.

Troubleshooting

If you have problems, you can review the documentation for suggestions on what could be wrong and how to fix it.

License and contributions

The software is provided under Apache-2.0 license. Contributions to this project are accepted under the same license. Please see contributing.md for more info.

This project contains code from other projects. The original license text is included in those source files. They must comply with our license guide

mbed-os-example-devicekey's People

Contributors

0xc0170 avatar adbridge avatar evedon avatar gpsimenos avatar harmut01 avatar harrisonmutai-arm avatar ldong-arm avatar mbedmain avatar patater avatar rajkan01 avatar rwalton-arm avatar saheerb avatar urutva avatar yossi2le avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mbed-os-example-devicekey's Issues

DeviceKey Root of Trust not generated

Description of defect

When running this example on a board with TRNG, and if the board's flash doesn't contain a Root of Trust already, the example fails:

--- Error, derive key failed with error code -5 ---

This is because the generation of Root of Trust is missing. Since ARMmbed/mbed-os#12385 was merged, the Root of Trust is not automatically generated anymore.

Target(s) affected by this defect ?

Any target with TRNG (e.g. DISCO_L475VG_IOT01A)

Toolchain(s) (name and version) displaying this defect ?

Any

What version of Mbed-os are you using (tag or sha) ?

mbed-os-6.9.0

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

Any

How is this defect reproduced ?

Erase any existing DeviceKey Root of Trust (if any), then build and run this example on a DISCO_L475VG_IOT01A board (for example).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.