Everything here is done on Ubuntu 22.04
Install some dependencies : sudo apt install cmake gcc-arm-none-eabi g++ git
.
Clone the Pico SDK, then clone the Tamarin firmware and build it:
mkdir -p tamarin; cd $_
git clone https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk; git submodule update --init
export PICO_SDK_PATH=$(pwd)
cd ../
git clone https://github.com/stacksmashing/tamarin-firmware.git; cd $(basename $_ .git)
mkdir build; cd $_
cmake ..
make -j
If there is no error when building the firmware, the build
directory should look like this:
λ /tmp/tamarin/tamarin-firmware/build(main*) » ls
CMakeCache.txt lightning_tx.pio.h tamarin_firmware.dis
CMakeFiles Makefile tamarin_firmware.elf
cmake_install.cmake pico-sdk tamarin_firmware.elf.map
elf2uf2 pioasm tamarin_firmware.hex
generated probe.pio.h tamarin_firmware.uf2
lightning_rx.pio.h tamarin_firmware.bin
Now plug the RP Pico and press the BOOTSEL
button (the only button on the board) at the same time.
A new block device should be detected
λ /tmp/tamarin/tamarin-firmware/build(main*) » lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
[..]
sdb 8:16 1 128M 0 disk
└─sdb1 8:17 1 128M 0 part
Mount this device and copy the file named tamarin_firmware.uf2
in the directory:
λ /tmp/tamarin/tamarin-firmware/build(main*) » sudo mkdir -p /mnt/pico
λ /tmp/tamarin/tamarin-firmware/build(main*) » sudo mount /dev/sdb1 $_
λ /tmp/tamarin/tamarin-firmware/build(main*) » sudo cp tamarin_firmware.uf2 $_
λ /tmp/tamarin/tamarin-firmware/build(main*) » sudo umount $_
Run the dmesg command, a new USB cable is detected:
usb 1-4: New USB device found, idVendor=2b3e, idProduct=0004, bcdDevice= 1.00
usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-4: Product: Tamarin Cable
usb 1-4: Manufacturer: stacksmashing
usb 1-4: SerialNumber: 31337
cdc_acm 1-4:1.0: ttyACM0: USB ACM device
cdc_acm 1-4:1.3: ttyACM1: USB ACM device
/dev/ttyACM0
is the main device to interact with the firware/dev/ttyACM1
is for the DCSD
minicom -D /dev/ttyACM0 -b 115200