clockworkpi / uConsole

This code repository offers downloads for the latest images of various uConsole models, along with kernel patches, firmware for the keyboard and 4G expansion module, hardware schematics, assembly instructions, and essential technical documents.
276 stars 42 forks source link

Please add instructions on how to compile the keyboard firmware #9

Open SamusAranX opened 9 months ago

SamusAranX commented 9 months ago

See title.

cuu commented 9 months ago

The development process is as same as devterm

https://github.com/clockworkpi/DevTerm/wiki/Compile-keyboard-bootloader-and-firmware

Difference

in later uconsole keyboard , I've edited bootloader with following code

diff --git a/config.h b/config.h
index b377f98..f8ce81a 100644
--- a/config.h
+++ b/config.h
@@ -156,7 +156,7 @@
 // Use Boot1 PB2 as the button, as hardly anyone uses this pin as GPIO
 // Need to set the button input mode to just CR_INPUT and not CR_INPUT_PU_PD because the external pullup on the jumplink is very weak
        #define BUTTON_INPUT_MODE       CR_INPUT
-    #define BUTTON_BANK GPIOB
+    #define BUTTON_BANK GPIOD
     #define BUTTON_PIN 2
     #define BUTTON_PRESSED_STATE 1

this modification can make cli flashing more stable, but cause one issue is I can not use Arduino IDE to flash the code

I need to run this command in a right timing manually

for example if you compiled the code in IDE ,try uploading once upload will fail and you will get a console command output from Arduino IDE like (verbose output in Arduino IDE) in bottom:

/root/.arduino15/packages/stm32duino/tools/stm32tools/2021.5.31/linux/maple_upload ttyACM0 2 1EAF:0003 /tmp/arduino_build_303517/devterm_keyboard_mini.ino.bin /home/cuu/data/Downloads/arduino-1.8.13

I use root to run arduino ide btw

so copy this command in terminal (dont close arduino IDE)

and plug the keyboard ,right after the LED on the keyboard started to flash

press Enter in terminal to run above cli command, then the flashing will success

tricky way but it works

uconsole_keyboard_flash.tar.gz works by this mod bootloader

so try not to flash the bootloader unless you know what is going on