2022-09-25 18:51:26 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
git submodule update --init --recursive
|
|
|
|
|
sudo apt update
|
2024-10-01 09:34:22 +02:00
|
|
|
|
|
|
|
|
if [[ $1 == "pico" ]]; then
|
|
|
|
|
sudo apt install -y cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
|
2022-09-25 18:51:26 +02:00
|
|
|
git clone https://github.com/raspberrypi/pico-sdk
|
|
|
|
|
cd pico-sdk
|
2025-02-19 10:58:43 +01:00
|
|
|
git checkout tags/2.1.1
|
2022-09-25 18:51:26 +02:00
|
|
|
git submodule update --init
|
|
|
|
|
cd ..
|
2024-09-25 13:24:44 +02:00
|
|
|
git clone https://github.com/raspberrypi/picotool
|
|
|
|
|
cd picotool
|
2024-09-25 13:49:20 +02:00
|
|
|
git submodule update --init
|
2024-09-25 13:24:44 +02:00
|
|
|
mkdir build
|
|
|
|
|
cd build
|
2024-09-25 15:36:45 +02:00
|
|
|
cmake -DPICO_SDK_PATH=../../pico-sdk ..
|
2024-09-25 13:24:44 +02:00
|
|
|
make -j`nproc`
|
|
|
|
|
sudo make install
|
|
|
|
|
cd ../..
|
2024-09-19 20:27:00 +02:00
|
|
|
mkdir build_pico
|
|
|
|
|
cd build_pico
|
2022-09-25 18:51:26 +02:00
|
|
|
cmake -DPICO_SDK_PATH=../pico-sdk ..
|
2024-10-01 09:34:22 +02:00
|
|
|
make
|
2024-12-27 02:11:31 +01:00
|
|
|
cd ..
|
2024-10-01 09:34:22 +02:00
|
|
|
elif [[ $1 == "esp32" ]]; then
|
|
|
|
|
sudo apt install -y git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
|
|
|
|
|
git clone --recursive https://github.com/espressif/esp-idf.git
|
|
|
|
|
cd esp-idf
|
|
|
|
|
./install.sh esp32s3
|
|
|
|
|
. ./export.sh
|
|
|
|
|
cd ..
|
|
|
|
|
idf.py set-target esp32s3
|
|
|
|
|
idf.py all
|
2024-12-27 02:11:31 +01:00
|
|
|
mkdir -p release
|
|
|
|
|
cd build
|
2024-12-27 02:23:11 +01:00
|
|
|
esptool.py --chip ESP32-S3 merge_bin -o ../release/pico_fido_esp32-s3.bin @flash_args
|
2024-12-27 02:11:31 +01:00
|
|
|
cd ..
|
2025-02-19 11:17:58 +01:00
|
|
|
cd esp-idf
|
|
|
|
|
./install.sh esp32s2
|
|
|
|
|
. ./export.sh
|
|
|
|
|
cd ..
|
|
|
|
|
idf.py set-target esp32s2
|
|
|
|
|
idf.py all
|
|
|
|
|
mkdir -p release
|
|
|
|
|
cd build
|
|
|
|
|
esptool.py --chip ESP32-S2 merge_bin -o ../release/pico_fido_esp32-s2.bin @flash_args
|
|
|
|
|
cd ..
|
2024-10-01 09:34:22 +02:00
|
|
|
else
|
|
|
|
|
mkdir build
|
|
|
|
|
cd build
|
|
|
|
|
cmake -DENABLE_EMULATION=1 ..
|
|
|
|
|
make
|
|
|
|
|
fi
|