Giter Site home page Giter Site logo

mohammad1603 / mbed-os-example-cryptoauthlib Goto Github PK

View Code? Open in Web Editor NEW

This project forked from janjongboom/mbed-os-example-cryptoauthlib

0.0 0.0 0.0 32 KB

Mbed OS 5 example program for interacting with Crypto Authentication secure elements

License: Other

C 100.00%

mbed-os-example-cryptoauthlib's Introduction

Mbed OS 5 example program for CryptoAuthLib

Example program to talk to Microchip CryptoAuth devices from Mbed OS. This application currently only supports I2C devices, but modifying it to also deal with SWI or UART should be relatively simple. The underlying library is here: mbed-cryptoauthlib.

Compatible with:

  • ATSHA204A
  • ATECC108A
  • ATECC508A
  • ATECC608A

Right-now it only searches for the CryptoAuth device on the main I2C bus.

How to build

Mbed CLI

  1. Import the program:

    $ mbed import https://github.com/janjongboom/mbed-os-example-cryptoauthlib
    
  2. Build via:

    $ mbed compile -m YOUR_TARGET_NAME -t GCC_ARM
    

Online Compiler

  1. Click Import.
  2. Select Click here to import from URL.
  3. Enter: https://github.com/janjongboom/mbed-os-example-cryptoauthlib
  4. Click OK.
  5. Click Compile.

Running the application

  1. Connect a serial monitor to the device on baud rate 115,200.
    • Under 'terminal settings' (or similar), make sure to select CR+LF for the return key.
  2. Type help to list all commands.

E.g. to see the serial number on ATECC608A:

$ help
Usage:
help - Display Menu
discover - Discover Buses and Devices
204 - Set Target Device to ATSHA204A
108 - Set Target Device to ATECC108A
508 - Set Target Device to ATECC508A
608 - Set Target Device to ATECC608A
info - Get the Chip Revision
sernum - Get the Chip Serial Number
rand - Generate Some Random Numbers
readcfg - Read the Config Zone
lockstat - Zone Lock Status
lockcfg - Lock the Config Zone
lockdata - Lock Data and OTP Zones
all - Run all unit tests, locking as needed.
basic - Run Basic Test on Selected Device
unit - Run Unit Test on Selected Device
otpzero - Zero Out OTP Zone
util - Run Helper Function Tests
clkdivm0 - Set ATECC608A to ClockDivider M0(0x00)
clkdivm1 - Set ATECC608A to ClockDivider M1(0x05)
clkdivm2 - Set ATECC608A to ClockDivider M2(0x0D)
cd - Run Unit Tests on Cert Data
cio - Run Unit Test on Cert I/O
crypto - Run Unit Tests for Software Crypto Functions

$ 608
Device Selected.

$ sernum
serial number:
01 23 22 BA 34 78 82 A4 EE

License

This example application is copyrighted by Microchip. See the LICENSE file.

mbed-os-example-cryptoauthlib's People

Contributors

janjongboom avatar

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.