diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1f398bdf53a518991eac8cc0202749d525a0a4c7..4c526f7ebae695198fcd4502f0ec568ce527c688 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,12 +15,13 @@ build: - reform2-keyboard-fw/keyboard-3_NEO2-standalone.hex - reform2-trackball-fw/Mouse.hex - reform2-trackpad-fw/Mouse.hex + - reform2-trackball2-fw/build/reform2-trackball2-fw.uf2 - reform2-lpc-fw/firmware-20_R3.bin - reform2-lpc-fw/firmware-25_R2.bin script: | set -x apt update - apt-get --no-install-recommends -y install git build-essential avr-libc gcc-avr gcc-arm-none-eabi libnewlib-arm-none-eabi + apt-get --no-install-recommends -y install ca-certificates git build-essential avr-libc gcc-avr gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib libusb-1.0-0-dev cmake python3 # use the timestamp of the latest git commit to set reproducible S_D_E if [ -z ${SOURCE_DATE_EPOCH:+x} ] && git -C . rev-parse 2>/dev/null; then SOURCE_DATE_EPOCH=$(git log -1 --format=%ct) @@ -42,6 +43,9 @@ build: done make -C reform2-trackball-fw make -C reform2-trackpad-fw + cd reform2-trackball2-fw + ./build.sh + cd .. make -C reform2-lpc-fw lpcrc for rev in 20_R3 25_R2; do make -C reform2-lpc-fw REFORM_LPC_OPTIONS="-DREFORM_MOTHERBOARD_REV=REFORM_MBREV_$rev -DFW_STRING3=\\\"$VERSION\\\"" diff --git a/reform2-keyboard-fw/download-fw.sh b/reform2-keyboard-fw/download-fw.sh new file mode 100755 index 0000000000000000000000000000000000000000..d44be03da6e133dd113b64c2509c5181da1f4032 --- /dev/null +++ b/reform2-keyboard-fw/download-fw.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +programname=$0 +fwver=$1 + +function usage { + echo "usage: $programname variant" + echo "" + echo "to download the firmware for the keyboard built into your MNT Reform:" + echo "" + echo " $programname 3_US # (if you have a QWERTY-US keyboard V3)" + echo " $programname 3 # (if you have a non-US keyboard V3)" + echo " $programname 2_US # (if you have a QWERTY-US keyboard V2)" + echo " $programname 2 # (if you have a non-US keyboard V2)" + echo "" + echo "if you want to flash a standalone USB keyboard, use one of the following:" + echo "" + echo " $programname 3_US-standalone" + echo " $programname 3-standalone" + echo " $programname 2_US-standalone" + echo " $programname 2-standalone" + echo "" + exit 1 +} + +if [ "$fwver" != "3_US" ] && [ "$fwver" != "2_US" ] && [ "$fwver" != "3" ] && [ "$fwver" != "2" ]; then + usage +fi + +mkdir -p bin +wget -O keyboard.hex "https://source.mnt.re/reform/reform/-/jobs/artifacts/master/raw/reform2-keyboard-fw/keyboard-$fwver.hex?job=build" + diff --git a/reform2-keyboard-fw/flash.sh b/reform2-keyboard-fw/flash.sh index c18b0b52a89477aef73e1bb39f584521fb0d7652..f0be8f84398b02eb29744175ae37368879b0e656 100755 --- a/reform2-keyboard-fw/flash.sh +++ b/reform2-keyboard-fw/flash.sh @@ -3,7 +3,7 @@ set -eu if [ ! -e ./keyboard.hex ]; then - echo "keyboard.hex doesn't exist" >&2 + echo "keyboard.hex doesn't exist. build it or use ./download-fw.sh to download it." >&2 exit 1 fi diff --git a/reform2-trackball-fw/download-fw.sh b/reform2-trackball-fw/download-fw.sh new file mode 100755 index 0000000000000000000000000000000000000000..171be4d186993f4e733bb93af73f71b13051b2ce --- /dev/null +++ b/reform2-trackball-fw/download-fw.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +wget -O Mouse.hex "https://source.mnt.re/reform/reform/-/jobs/artifacts/master/raw/reform2-trackball-fw/Mouse.hex?job=build" diff --git a/reform2-trackball2-fw/.gitignore b/reform2-trackball2-fw/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..8ea19d9f689ffe3d7581041afa33aa9e0b1d4456 --- /dev/null +++ b/reform2-trackball2-fw/.gitignore @@ -0,0 +1,3 @@ +picotool +pico-sdk +tinyusb diff --git a/reform2-trackball2-fw/CMakeLists.txt b/reform2-trackball2-fw/CMakeLists.txt index 1fdaef0784804b22b9b904c7851ba1e9d467a2b5..0a1866fee24b4513e4211d32689afb351f707865 100644 --- a/reform2-trackball2-fw/CMakeLists.txt +++ b/reform2-trackball2-fw/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5) -include(${CMAKE_CURRENT_SOURCE_DIR}/../../tinyusb/hw/bsp/family_support.cmake) +include(${CMAKE_CURRENT_SOURCE_DIR}/tinyusb/hw/bsp/family_support.cmake) # gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>) family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR}) @@ -25,7 +25,7 @@ target_include_directories(${PROJECT} PUBLIC # Configure compilation flags and libraries for the example... see the corresponding function # in hw/bsp/FAMILY/family.cmake for details. -family_configure_device_example(${PROJECT}) +family_configure_device_example(${PROJECT} noos) target_link_libraries(${PROJECT} PRIVATE pico_stdlib tinyusb_device tinyusb_board hardware_pwm hardware_i2c) diff --git a/reform2-trackball2-fw/README.md b/reform2-trackball2-fw/README.md index 83e78877c52c0ef3c5746da7ab97f75bf7123d56..d84c8d18cceea3f8ddfa5a5ce7cb381d71b5f48f 100644 --- a/reform2-trackball2-fw/README.md +++ b/reform2-trackball2-fw/README.md @@ -4,7 +4,7 @@ Required: `cmake`, `tinyusb`, `pico-sdk`. -Two folders up (next to the main `reform` repo), clone the following: +Clone the following repositories: `git clone https://github.com/hathach/tinyusb` `git clone https://github.com/raspberrypi/pico-sdk` diff --git a/reform2-trackball2-fw/build.sh b/reform2-trackball2-fw/build.sh index a42179bccf2fe22f55ac820aab08831281b4fbf2..7005b4b6a502cbf98864374f64509f356655107e 100755 --- a/reform2-trackball2-fw/build.sh +++ b/reform2-trackball2-fw/build.sh @@ -1,6 +1,9 @@ #!/bin/bash -export PICO_SDK_PATH=$(pwd)/../../pico-sdk +sudo apt install build-essential pkg-config libusb-1.0-0-dev cmake +git clone https://github.com/raspberrypi/pico-sdk +git clone https://github.com/hathach/tinyusb +export PICO_SDK_PATH="$(pwd)/pico-sdk" mkdir -p build cd build diff --git a/reform2-trackball2-fw/download-fw.sh b/reform2-trackball2-fw/download-fw.sh new file mode 100755 index 0000000000000000000000000000000000000000..4bfc566582bfe94d16dca028e5e876e92d5fb24b --- /dev/null +++ b/reform2-trackball2-fw/download-fw.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +mkdir -p build +wget -O build/reform2-trackball2-fw.uf2 "https://source.mnt.re/reform/reform/-/jobs/artifacts/master/raw/reform2-trackball2-fw/reform2-trackball2-fw.uf2?job=build" diff --git a/reform2-trackball2-fw/flash.sh b/reform2-trackball2-fw/flash.sh index 118943a45630ea30dc1ad800bbe5828c5ce7a4be..7c2750c0d4e4b9ad5d91bd9dba2b2331c6722d5a 100755 --- a/reform2-trackball2-fw/flash.sh +++ b/reform2-trackball2-fw/flash.sh @@ -4,7 +4,7 @@ echo "Flash MNT Reform Trackball2 (RP2040):" select yn in "Flash" "Exit"; do case $yn in - Flash ) picotool load build/reform2-trackball2-fw.uf2;; + Flash ) picotool load --force build/reform2-trackball2-fw.uf2;; Exit ) exit;; esac done diff --git a/reform2-trackball2-fw/install-picotool.sh b/reform2-trackball2-fw/install-picotool.sh new file mode 100755 index 0000000000000000000000000000000000000000..525ae64c99de99c2aeeaba40f48a12ea8b1819f1 --- /dev/null +++ b/reform2-trackball2-fw/install-picotool.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +sudo apt install build-essential pkg-config libusb-1.0-0-dev cmake +git clone https://github.com/raspberrypi/pico-sdk +export PICO_SDK_PATH="$(pwd)/pico-sdk" +git clone https://github.com/raspberrypi/picotool +cd picotool +mkdir build +cd build +cmake .. +make -j4 +sudo make install diff --git a/reform2-trackball2-fw/src/main.c b/reform2-trackball2-fw/src/main.c index 05f711016563b95a053e0c5ed5de73ad2ac40945..bd4dcced0fdfc8685d5b299647e3225682c27518 100644 --- a/reform2-trackball2-fw/src/main.c +++ b/reform2-trackball2-fw/src/main.c @@ -28,7 +28,7 @@ #include <stdio.h> #include <string.h> -#include "bsp/board.h" +#include "bsp/board_api.h" #include "tusb.h" #include "pico/stdlib.h" diff --git a/reform2-trackpad-fw/download-fw.sh b/reform2-trackpad-fw/download-fw.sh new file mode 100755 index 0000000000000000000000000000000000000000..17994f7c76290905b1815830a7c8bdbbad78fa86 --- /dev/null +++ b/reform2-trackpad-fw/download-fw.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +wget -O Mouse.hex "https://source.mnt.re/reform/reform/-/jobs/artifacts/master/raw/reform2-trackpad-fw/Mouse.hex?job=build"