Monorepo: https://github.com/solokeys/solo2
Hardware: https://github.com/solokeys/solo2-hw
If you follow this document, it will reflash your hacker key into a state where you can not reset into the bootloader, and can not reflash.
This document contains many incorrect and outdated commands.
Do not proceed with this guide unless you can recover a key!!!
Feel free to edit or comment on this getting started page directly
Shortlink: https://solo2.dev
This documentation is CC BY-SA licensed.
Other chat rooms of interest:
make run-dev
runners/lpc55
and calls
using arm-none-eabi-gdb
as runner as configured in .cargo/config.The feature develop
activates useful features during development
See runners/lpc55/Cargo.toml for all features.
To just build: make build-dev
Helpful during development: cargo install bacon; cd runners/lpc55; bacon -j check-dev
Very basic test:
pip install 'fido2~=0.9'
python tests/basic.py
Install Rust/Cargo from rustup.rs:
https://www.rust-lang.org/tools/install
Then perform OS/distro specific steps listed below.
Both VS Code + neovim (nightly 0.5 preview) work well with rust-analyzer.
For debugging setup, please see the debugging section.
On Debian, you need to use the gdb-multiarch
executable instead of arm-none-eabi-gdb
, so either create a symlink or update .cargo/config
.
You can use the following mkShell
expression inside a flake.nix
or shell.nix
, as long as you provide nixpkgs
and nixpkgs-mozilla
.
TODO (doesn't work currently, because of littlefs2 which cannot be easily compiled on macOS)
TODO
There are multiple possibilities for writing firmware to the Solo 2.
lpc55-host
Install the lpc55 utility:
Bring the device into bootloader mode.
It should then show up using the lpc55
tool.
Before writing custom firmware and data onto your Solo's flash, make a backup to ensure that you can go back to a sane state later.
To be able to run custom firmware, we need to disable secure boot.
This is done by disabling the SECURE_BOOT_CFG
/ SEC_BOOT_EN
flag in the CMPA protected flash region page.
First, read the PFR with the lpc55-host
tool:
⚠️ IMPORTANT: You now need to modify the copied file. Only keep the factory
top level object and set secure-boot-configuration
→ secure-boot-enabled: false
.
Your file should look something like this:
After that, we can write the CMPA settings:
After secure boot was disabled, you can flash the self-built firmware.
When you are really sure that the flashing process worked fine, restart the Solo2.
mboot
Install cargo-binutils
:
Install mboot
, for example using pip
and a virtual environemnt:
If you want to perform the following steps without superuser rights, install these UDEV rules:
Check that the device is connected and in bootloader mode:
Compile the firmware and prepare a binary image (see the Overview section for information about the features):
Flash the firmware image to the MCU:
fido-authenticator
fido-authenticator
needs an attestation key and certificate, both with the ID 0. These can be generated using solo2-cli
(requires the dev-pki
feature):
These files (or any other files in the required format) can then be written to the device using the provisioner app. First, run the provisioner app on the prototype:
Then use solo2-cli
to write the key and the certificate to the device:
(Make sure that there is no other pcsc smartcard connected to the device becuase currently, solo2-cli can’t handle multiple available smartcards.)
To debug the firmware on the board, the arm
version of GDB (Debian gdb-multiarch
and Arch arm-none-eabi-gdb
) is required.
If you want to use a J-Link (highly recommended, as it can be used to flash the firmware without bootloader mode), install the J-Link Software and Documentation Pack providing JLinkGDBServer
.
Flash the JLink debugger firmware to the NXP LPC55 devkit (guide – if you figure out how to use probe.rs instead, please share!)
Then you need to connect both the debug port via USB and USB for the LPC55 itself.
For debugging with the Solo 2 Hacker edition, you need a special cable (TC2030-CTX No Legs, 6 PIN, 10 PIN - note the number of pins for the ribbon connector).
This can be used with the Segger JLink EDU mini, which you are allowed to use in private or educational contexts.
Note: The outer metal pins are too long for the spring pins to make contact with the Solo 2. You need to shorten them carefully.
Debug Link
port, run JLinkGDBServer -strict -device LPC55S69 -if SWD -vd
.nc localhost 19021
to connect to the RTT port of the J-Link server. This will show you the delog log output of the firmware via RTT.make build-dev
(see runners/lpc55 for more information on building with logging enabled).arm-none-eabi-gdb -x runners/lpc55/jlink.gdb runners/lpc55/target/thumbv8m.main-none-eabi/release/runner
. This executes the GDB commands from the runners/lpc55/jlink.gdb
file and loads the symbols from the specified runner
binary.If you're not the command-line person but would still like to debug the firmware, the marus25.cortex-debug
VS Code extension will do the heavy-lifting for you.
Note, however, that is does not work as well as plain GDB does.
When setting breakpoints using the VS Code interface, make sure to open the files that are actually compiled in the firmware.
Thus, setting a breakpoint in the fido-authenticator
for example, will require you to open the corresponding file in your .cargo
folder, unless you modified the Cargo.toml
to use a local copy of the source code.
The following is an examplary launch configuration for VS Code: