Skip to content

Commit 44d97a5

Browse files
author
Robert Muchsel
authored
Add zero-install openocd binaries and support files, add documentation (#145)
1 parent 35703ae commit 44d97a5

File tree

22 files changed

+259
-7
lines changed

22 files changed

+259
-7
lines changed

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8.9
1+
3.8.10

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MAX78000 Model Training and Synthesis
22

3-
_June 30, 2021_
3+
_July 1, 2021_
44

55
The Maxim Integrated AI project is comprised of five repositories:
66

@@ -412,7 +412,7 @@ if [ $? -eq 1 ] ; then
412412
fi
413413
```
414414

415-
The debugger requires OpenOCD. On Windows, an OpenOCD executable is installed with the SDK. On macOS and Linux, the OpenOCD fork from [https://github.com/MaximIntegratedMicros/openocd.git](https://github.com/MaximIntegratedMicros/openocd.git) must be used. An x86_64 Ubuntu Linux binary is available at https://github.com/MaximIntegratedAI/MAX78000_SDK/blob/master/Tools/OpenOCD/openocd. *Note: A copy of the configuration files and a `run-openocd-maxdap` script are contained in the `hardware` folder of the `ai8x-synthesis` project.*
415+
The debugger requires OpenOCD. On Windows, an OpenOCD executable is installed with the SDK. On macOS and Linux, scripts and binaries are provided in the `openocd` folder of the `ai8x-synthesis` project, see [openocd/Readme.md](openocd/Readme.md).
416416

417417
`gen-demos-max78000.sh` will create code that is compatible with the SDK and copy it into the SDK’s Example directories.
418418

README.pdf

-3.17 KB
Binary file not shown.

docs/RaspberryPi.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Development on Raspberry Pi 4 and 400
2+
3+
*July 1, 2021*
4+
5+
### Requirements and Performance
6+
7+
Software development for MAX78000 is possible on a 64-bit Raspberry Pi OS with the following restrictions:
8+
9+
* A 64-bit OS is required, since the embedded C compiler and PyTorch are only available for 64-bit systems. While the Raspberry Pi 3 does have a 64-bit CPU, the Raspberry Pi 4 and 400 with fan are strongly recommended for performance reasons.
10+
As operating system, use either https://downloads.raspberrypi.org/raspios_lite_arm64/images/
11+
or https://downloads.raspberrypi.org/raspios_arm64/images/.
12+
* Performance for running the synthesis tools is bounded by disk I/O. Consider using a USB 3-connected SSD as mass storage, since I/O performance on SD cards and USB Flash drives will suffer from long latencies.
13+
* The installation will take more time than on an x86_64 system, since more Python “wheels” have to be built from source during installation compared to x86_64.
14+
* Since there is no CUDA on Raspberry Pi, model training will be very slow and a CPU fan is required.
15+
16+
### Installation
17+
18+
First, install the following additional packages on the Raspberry Pi:
19+
20+
```shell
21+
$ sudo apt-get install screen libtool git libusb-1.0-0-dev libgpiod-dev libhidapi-dev \
22+
libftdi-dev zip libbz2-dev libssl-dev libreadline-dev libsqlite3-dev libatlas-base-dev \
23+
libopenblas-dev libopenmpi-dev libomp-dev libncurses5 ninja-build cmake ccache \
24+
libblas-dev libeigen3-dev libprotobuf-dev protobuf-compiler llvm-dev
25+
```
26+
27+
Then follow the instructions for Ubuntu Linux.
28+
29+
#### OpenOCD
30+
31+
The pre-built binary in the `openocd` folder of the `ai8x-synthesis` project works with MAX78000.
32+
33+
To avoid having to use superuser privileges to run OpenOCD, follow the instructions on https://forgge.github.io/theCore/guides/running-openocd-without-sudo.html.
34+
35+
#### Embedded Arm Compiler
36+
37+
The embedded C compiler version 10-2020-q4-major for “aarch64” works on Raspberry Pi OS 64-bit (`gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2`).
38+
39+
#### Embedded RISC-V Compiler
40+
41+
The embedded C compiler version v10.1.0-1.1 for “arm64” works on Raspberry Pi OS 64-bit (`xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-arm64.tar.gz`).
42+
43+
#### Training and Synthesis Projects
44+
45+
Both model training and C code generation will work on a Raspberry Pi 64-bit. Note that model training will be very slow without CUDA.
46+

hardware/run-openocd-maxdap

Lines changed: 0 additions & 2 deletions
This file was deleted.

hardware/run-openocd-olimex

Lines changed: 0 additions & 2 deletions
This file was deleted.

openocd/README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Pre-built OpenOCD
2+
3+
For your convenience, this folder contains the files and binaries needed to run OpenOCD for MAX78000 on macOS Catalina/Big Sur and on Ubuntu Linux 20.04 LTS, as well as 32-bit and 64-bit Raspberry Pi OS 10 “Buster”.
4+
5+
6+
7+
#### Using the Pre-built OpenOCD Binaries
8+
9+
The `run-openocd-maxdap` and `run-openocd-olimex` scripts automatically select an appropriate binary and run OpenOCD with all arguments required for MAX78000.
10+
11+
##### Linux
12+
13+
On Linux, several packages are required:
14+
15+
```shell
16+
$ sudo apt-get install libusb-1.0 libusb-0.1 libhidapi-libusb0 libhidapi-hidraw0
17+
```
18+
19+
##### macOS
20+
21+
On macOS, both the command line developer tools and Homebrew must be installed. Follow the instructions to set up your shell.
22+
23+
```shell
24+
% xcode-select --install
25+
% bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
26+
```
27+
28+
The following additional packages are also required:
29+
30+
```shell
31+
% brew install libusb-compat libftdi hidapi libusb
32+
```
33+
34+
35+
36+
#### Building from Scratch
37+
38+
To obtain the full OpenOCD source code, and to re-build the binaries, please use `git clone https://github.com/MaximIntegratedMicros/openocd.git`.
39+
40+
##### Linux
41+
42+
```shell
43+
$ ./bootstrap
44+
$ ./configure # Linux only, see below for macOS
45+
$ make
46+
$ sudo make install # or use binary from src/
47+
```
48+
49+
##### macOS
50+
51+
On macOS, the following packages are needed to build the binary:
52+
53+
```shell
54+
% brew install autoconf autoconf-archive automake libtool pkg-config
55+
```
56+
57+
You may need to add arguments to `./configure`. The exact paths may vary depending on the MacOSX.sdk release.
58+
59+
```shell
60+
% autoreconf -i -I /opt/homebrew/share/aclocal # on M1 only, and ignore errors
61+
% ./bootstrap
62+
% CFLAGS=-D_FTDI_DISABLE_DEPRECATED ./configure --prefix=/Library/Developer/CommandLineTools/usr \
63+
--with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1
64+
% make
65+
% sudo make install # or use binary from src/
66+
```
67+

openocd/bin/Darwin_arm64/openocd

3.78 MB
Binary file not shown.

openocd/bin/Darwin_x86_64/openocd

3.09 MB
Binary file not shown.

openocd/bin/Linux_aarch64/openocd

3.48 MB
Binary file not shown.

0 commit comments

Comments
 (0)