Skip to content

Latest commit

 

History

History
74 lines (49 loc) · 2.51 KB

build.md

File metadata and controls

74 lines (49 loc) · 2.51 KB

Build

Clone the repository recursively git clone https://github.com/cryptoadvance/specter-diy.git --recursive

bootloader folder contains a secure bootloader that you can customize with your own firmware signing keys.

Prerequisities

Nix shell

The easiest way to get all necessary tools is to run nix-shell from the root of the repository. You need to have Nix installed.

Prerequisities: Board

To compile the firmware for the board you will need arm-none-eabi-gcc compiler.

Debian/Ubuntu:

sudo apt-get install build-essential gcc-arm-none-eabi binutils-arm-none-eabi gdb-multiarch openocd

Archlinux:

sudo pacman -S arm-none-eabi-gcc arm-none-eabi-binutils openocd base-devel python-case

You might need change default gcc flag settings with CFLAGS_EXTRA="-w". Export it or set the variable before of make to avoid warnings being raised as errors.

MacOS:

brew tap ArmMbed/homebrew-formulae
brew install arm-none-eabi-gcc

On Windows: Install linux subsystem and follow Linux instructions.

Prerequisities: Simulator

You may need to install SDL2 library to simulate the screen of the device.

Linux:

sudo apt install libsdl2-dev

MacOS:

brew install sdl2

Windows:

  • sudo apt install libsdl2-dev on Linux side.
  • install and launch Xming on Windows side
  • set export DISPLAY=:0 on linux part

Build

To build custom bootloader and firmware that you will be able to sign check out the bootloader doc on self-signed firmware. To wipe flash and remove protections on the device with the secure bootloader check out this doc.

To build an open firmware (no bootloader and signature verifications) run make disco. The result is the bin/specter-diy.bin file that you can copy-paste to the board over miniUSB.

To build a simulator run make unix - it will compile a micropython simulator for mac/unix and store it under bin/micropython_unix.

To launch a simulator either run bin/micropython_unix simulate.py or simly run make simulate.

If something is not working you can clean up with make clean

Run Unittests

Currently unittests work only on linuxport, and there are... not many... Contributions are very welcome!

make test