description |
---|
Flashing RP2040 with TurtlPass Firmware |
Run the script 1-click-setup.sh
to install automatically the arduino-cli
, RP2040 boards, and all the libraries required.
{% hint style="info" %}
$ ./1-click-setup.sh
{% endhint %}
Run the script generate-seed.sh
to generate your unique seed on your local machine. The output file Seed.cpp
will be added to your codebase.
{% hint style="info" %}
$ ./generate-seed.sh
{% endhint %}
{% hint style="danger" %}
Make sure you delete turtlpass-firmware/Seed.cpp
file once you're done with all the steps!
{% endhint %}
Run one of the following commands to compile the firmware to your RP2040 board:
Option A: If you have a touch sensor TTP-223 wired to the PIN 2
arduino-cli compile --clean \
--fqbn "rp2040:rp2040:generic" \
--output-dir ../turtlpass-firmware/build/ \
--build-property "build.extra_flags=\"-D__TURTLPASS_VERSION__=\"2.1.0\"\"" \
--build-property "build.extra_flags=\"-D__TURTLPASS_PIN_TTP223__=2\"" \
../turtlpass-firmware/turtlpass-firmware.ino
Option B: If you don't have a touch sensor TTP-223, fallback to built-in BOOTSEL
button
arduino-cli compile --clean \
--fqbn "rp2040:rp2040:generic" \
--output-dir ../turtlpass-firmware/build/ \
--build-property "build.extra_flags=\"-D__TURTLPASS_VERSION__=\"2.1.0\"\"" \
../turtlpass-firmware/turtlpass-firmware.ino
Run the following command to upload the firmware to your RP2040 board:
{% hint style="info" %}
$ arduino-cli upload --fqbn "rp2040:rp2040:generic" -i ../turtlpass-firmware/build/turtlpass-firmware.ino.bin -p <PORT>
{% endhint %}
Example
arduino-cli upload \
--fqbn "rp2040:rp2040:generic" \
-i ../turtlpass-firmware/build/turtlpass-firmware.ino.bin \
-p /dev/cu.usbmodem14101
{% hint style="danger" %}
Make sure you delete turtlpass-firmware/build/
directory once you're done!
{% endhint %}