First clone, initialize submodules and install Poetry as defined here.
Do not forget you need to be in a poetry shell environment!
You will need the GCC ARM toolchain for building and OpenOCD for flashing to a device. You will also need Python dependencies for signing.
sudo apt-get install scons gcc-arm-none-eabi libnewlib-arm-none-eabi llvm-dev libclang-dev clangThere is a shell.nix file in the root of the project. Just run the following
before entering the core directory:
nix-shellConsider using Nix. With Nix all you need to do is nix-shell.
For other users:
- Download gcc-arm-none-eabi
- Follow the install instructions
- To install OpenOCD, run
brew install open-ocd - Run
make vendor build_boardloader build_bootloader build_firmware
Install the appropriate target with rustup:
rustup target add thumbv7em-none-eabihf # for TT(Touch)
rustup target add thumbv7m-none-eabi # for T1(Mini/Classic)make vendor build_boardloader build_bootloader build_firmwareUse make upload to upload the firmware to a production device. Do not forget to enter bootloader on the device beforehand.
For flashing firmware to blank device (without bootloader) use make flash.
You need to have OpenOCD installed.
You can also build firmware in debug mode to see log output or run tests.
PYOPT=0 make build_firmwareTo get a full debug build, use:
make build_firmware BITCOIN_ONLY=0 PYOPT=0Use screen to enter the device's console. Do not forget to add your user to the dialout group or use sudo. Note that both the group and the tty name can differ, use ls -l /dev/tty* or ls /dev/tty* | grep usb to find out proper names on your machine.
screen /dev/ttyACM0