Skip to content

Commit eeb7c01

Browse files
PataterAndrzejKurek
authored andcommitted
Add developer setup guide
Explain how to set up a development environment to work on this example.
1 parent 91bf729 commit eeb7c01

File tree

3 files changed

+92
-0
lines changed

3 files changed

+92
-0
lines changed

Diff for: ATCRYPTOAUTH-XPRO-B-K64F2.jpg

605 KB
Loading

Diff for: ATCRYPTOAUTH-XPRO-B-Shield.jpg

701 KB
Loading

Diff for: setup.md

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
### Install mbed-cli to a venv
2+
3+
Install mbed-cli to a virtual environment, so that all the things mbed-cli
4+
installs automatically don't interfere with other things you have installed as
5+
part of your main environment (which may be managed by your package manager,
6+
etc.).
7+
8+
```sh
9+
virtualenv venvs/mbed
10+
source ~/venvs/mbed/bin/activate
11+
pip install mbed-cli
12+
```
13+
14+
### Install the GCC_ARM toolchain
15+
16+
We'll install arm-none-eabi-gcc to `/opt`. You may want to use `~/.local` or
17+
some other place. Where doesn't matter too much, so long as its in your `$PATH`.
18+
19+
```sh
20+
wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/5_4-2016q3/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 -O gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 && tar -xjf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 -C /opt
21+
rm gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2
22+
```
23+
24+
Remember to add `/opt/gcc-arm-none-eabi-5.4-2016q3/bin` to your `$PATH`.
25+
26+
### Install the ATECC608A example
27+
28+
```sh
29+
git clone git@github.com:ARMmbed/mbed-os-example-atecc608a.git
30+
cd mbed-os-example-atecc608a/
31+
source ~/venvs/mbed/bin/activate
32+
mbed new .
33+
mbed deploy
34+
mbed compile -t GCC_ARM -m K64F --flash --sterm
35+
```
36+
37+
### PSA Crypto driver development
38+
39+
Add any driver files (none created so far) to the mbed-os-atecc608a folder. It
40+
is backed by the
41+
[mbed-os-atecc608a](https://github.com/ARMmbed/mbed-os-atecc608a/tree/mbed-cryptoauthlib)
42+
repo, which any application wanting to use Mbed OS and the ATECC608A will
43+
depend on (same as how this example depends on it).
44+
45+
Any Mbed Crypto changes needed to support your driver work should be done in
46+
`mbed-os/features/mbedtls/mbed-crypto/importer/TARGET_IGNORE/mbed-crypto`, and copied
47+
into Mbed OS's idiosyncratic file layout before use using the importer.
48+
49+
For the first-time setup only, if you need to make any Mbed Crypto changes,
50+
perform the following operations:
51+
52+
```sh
53+
cd mbed-os/features/mbedtls/mbed-crypto/importer
54+
make update
55+
```
56+
57+
For every change you make in Mbed Crypto (which you'd make inside
58+
`mbed-os/features/mbedtls/mbed-crypto/importer/TARGET_IGNORE/mbed-crypto`),
59+
update Mbed OS with those changes by performing the following operations.
60+
61+
```sh
62+
curdir=`pwd`
63+
cd mbed-os/features/mbedtls/mbed-crypto/importer
64+
make
65+
cd $curdir
66+
```
67+
68+
If you don't like having multiple copies of mbed-crypto or mbed-os lying
69+
around, feel free to make symlinks or git worktrees as desired.
70+
71+
### Hardware interface
72+
73+
There are a couple of evaluation and development kits available for ATECC508A.
74+
For interfacing with an Mbed platform I2C and power supply connections have to
75+
be made. Note that ATECC508A requires a 5V supply. Below is an example of
76+
connecting an
77+
[ATCRYPTOAUTH-XPRO-B](http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=ATCRYPTOAUTH-XPRO-B)
78+
([header](http://ww1.microchip.com/downloads/en/DeviceDoc/CryptoAuth-XPRO-B_design_documentation.pdf))
79+
and a K64F:
80+
81+
![ATCRYPTOAUTH-XPRO-B-K64F](ATCRYPTOAUTH-XPRO-B-K64F2.jpg)
82+
83+
For secure connections a shield can be prepared with ATCRYPTOAUTH-XPRO-B. Most
84+
Mbed platforms support Arduino headers and an [Arduino
85+
shield](https://store.arduino.cc/usa/arduino-mega-proto-shield-rev3-pcb) can be
86+
used to prepare a shield for connecting ATCRYPTOAUTH-XPRO-B to an Mbed
87+
platform. See below image showing ATCRYPTOAUTH-XPRO-B on an Arduino shield:
88+
89+
![ATCRYPTOAUTH-XPRO-B-Shield](ATCRYPTOAUTH-XPRO-B-Shield.jpg)
90+
91+
Note: ATCRYPTOAUTH-XPRO-B comes with ATECC508A and ATECC608A ICs. Jumper J5
92+
should be used to enable ATECC508A.

0 commit comments

Comments
 (0)