Install PICO-FIDO in RP2040-zero
Pico-FIDO di RP2040-Zero
Membuat FIDO2 Security Key dari Waveshare RP2040-Zero menggunakan firmware pico-fido, tanpa PicoKey App berbayar.
Perangkat yang Dibutuhkan
- RP2040-Zero (Waveshare)
- Kabel USB-C
- PC/Laptop Windows + Chrome/Edge untuk testing
- Linux/macOS untuk compile firmware
Langkah 1: Persiapan
Clone pico-sdk
git clone https://github.com/raspberrypi/pico-sdk ~/pico-sdk
cd ~/pico-sdk
git submodule update --init
Clone pico-fido
git clone https://github.com/polhenarejos/pico-fido ~/pico-fido
cd ~/pico-fido
git submodule update --init --recursive
Langkah 2: Edit Source Code
Dua perubahan kecil agar tombol BOOTSEL berfungsi sebagai touch button tanpa commissioning berbayar.
Edit button.c
nano ~/pico-fido/pico-keys-sdk/src/button.c
Cari bagian ini di dalam fungsi button_wait, lalu hapus:
uint32_t button_timeout = 0;
if (phy_data.up_btn_present) {
button_timeout = phy_data.up_btn * 1000;
}
if (button_timeout == 0) {
return 0;
}
Ganti dengan:
uint32_t button_timeout = 15000; // hardcode 15 detik
Edit phy.c
nano ~/pico-fido/pico-keys-sdk/src/fs/phy.c
Cari fungsi phy_init yang aslinya seperti ini:
int phy_init(void) {
memset(&phy_data, 0, sizeof(phy_data_t));
return phy_load();
}
Ubah menjadi:
int phy_init(void) {
memset(&phy_data, 0, sizeof(phy_data_t));
int ret = phy_load();
if (!phy_data.up_btn_present) {
phy_data.up_btn = 15;
phy_data.up_btn_present = true;
}
return ret;
}
Langkah 3: Compile
cd ~/pico-fido
mkdir build
cd build
PICO_SDK_PATH=~/pico-sdk cmake .. \
-DPICO_BOARD=waveshare_rp2040_zero \
-DUSB_VID=0x2e8a \
-DUSB_PID=0x10fe
make -j4
✅ File pico_fido.uf2 tersedia di folder build/ setelah compile selesai.
Langkah 4: Flash ke Board
Factory Reset (disarankan)
wget https://datasheets.raspberrypi.com/soft/flash_nuke.uf2
Tahan tombol BOOT, colokkan USB, lepas BOOT. Board muncul sebagai RPI-RP2.
cp flash_nuke.uf2 /media/$USER/RPI-RP2/
Flash Firmware
Masukkan board ke mode bootloader lagi, lalu:
cp ~/pico-fido/build/pico_fido.uf2 /media/$USER/RPI-RP2/
Langkah 5: Verifikasi
lsusb | grep "2e8a"
Output yang diharapkan:
Bus 001 Device 0XX: ID 2e8a:10fe Pol Henarejos Pico Key
Langkah 6: Test WebAuthn
- Gunakan Windows + browser Chrome atau Edge
- Buka https://demo.yubico.com/webauthn
- Klik Register
- LED berubah kuning → tekan tombol BOOTSEL sebentar
- Registrasi berhasil ✓
Referensi Warna LED
| Warna | Status | Keterangan |
|---|---|---|
| π΅ Biru | SUSPENDED | Idle, menunggu perintah |
| π’ Hijau kedip lambat | MOUNTED | Aktif, siap digunakan |
| π’ Hijau kedip cepat | PROCESSING | Sedang memproses |
| π‘ Kuning | BUTTON | Tekan BOOTSEL sekarang! |
| π΄ Merah | NOT_MOUNTED | Tidak dikenali browser (normal di Linux) |
Catatan Penting
⚠️ Linux: LED kemungkinan selalu merah karena permission HID. Gunakan Windows untuk testing WebAuthn di browser.
⚠️ Keamanan: RP2040 tidak memiliki secure boot. Data di flash dapat dibaca. Jangan gunakan untuk data sensitif.
βΉ️ Tombol Touch: Menggunakan tombol BOOTSEL bawaan RP2040-Zero. Tidak perlu hardware tambahan.
Firmware: github.com/polhenarejos/pico-fido
Board: Waveshare RP2040-Zero
Komentar
Posting Komentar