reform

MNT Reform: Open Source Portable Computer
Log (Feed) | Files | Refs (Tags) | README

commit 5ec5d401f9bb324cbac0ed68835aa705b735b436
parent 631807cba0775b4c44c9961eb4886080a750aa7e
Author: Lukas F. Hartmann <lukas@mntre.com>
Date:   Mon, 11 Mar 2024 22:15:53 +0100

Merge branch 'fw-convenience' of source.mnt.re:reform/reform into fw-convenience

Diffstat:
M.gitlab-ci.yml | 4++++
Areform2-keyboard-fw/download-fw.sh | 32++++++++++++++++++++++++++++++++
Mreform2-keyboard-fw/flash.sh | 2+-
Areform2-trackball-fw/download-fw.sh | 3+++
Areform2-trackball2-fw/.gitignore | 3+++
Mreform2-trackball2-fw/CMakeLists.txt | 4++--
Mreform2-trackball2-fw/README.md | 2+-
Mreform2-trackball2-fw/build.sh | 5++++-
Areform2-trackball2-fw/download-fw.sh | 4++++
Mreform2-trackball2-fw/flash.sh | 2+-
Areform2-trackball2-fw/install-picotool.sh | 12++++++++++++
Mreform2-trackball2-fw/src/main.c | 2+-
Areform2-trackpad-fw/download-fw.sh | 3+++
13 files changed, 71 insertions(+), 7 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml @@ -15,6 +15,7 @@ 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: | @@ -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 @@ -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 @@ -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 @@ -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 @@ -0,0 +1,3 @@ +picotool +pico-sdk +tinyusb diff --git 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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"