qmk_firmware icon indicating copy to clipboard operation
qmk_firmware copied to clipboard

Framework Laptop 16 Keyboards

Open JohnAZoidberg opened this issue 3 years ago • 9 comments

Building:

qmk compile -kb framework/ansi -km default
qmk compile -kb framework/iso -km default
qmk compile -kb framework/jis -km default
qmk compile -kb framework/numpad -km default
qmk compile -kb framework/gridpad -km default

Other commands:

# Flash firmware (device must be in bootloader mode)
qmk flash -kb framework/ansi -km default

# Render layout with labels
qmk info -kb framework/ansi -km default -m

# Render layout matrix information
qmk info -kb framework/ansi -km default -m

# Show console output of connected QMK devices
qmk console

Resources:

  • https://docs.google.com/document/d/1RaavtL2vZu05KTEV54mU-dpreid1mCNi-XR09XdY6eI/edit#
  • https://docs.qmk.fm/#/platformdev_rp2040
  • https://docs.qmk.fm/#/feature_rgb_matrix

Tasks

  • [x] Make sure it works on our board, not just RasperryPi Pico
    • [x] Change 16MB flash size to 1MB. No need
    • [x] Make sure GPIOs are properly mapped. Pretty sure it's fine. Need to undefine PICO_FL16
  • [x] USB VID and PID (tested)
  • [x] Signal BOOT_DONE
  • [x] Reading key input via ADC
    • [x] Implement logic
    • [x] Make sure the matrix ligns up with the actual electrical matrix
    • [x] Implement actually reading from ADC
  • [x] Single-zone PWM backlight
    • [x] Test that it works
  • [x] Capslock/Numlock LED
    • [x] Test that it works
  • [x] Enable RGB backlight with IS31FL3743A (see docs/feature_rgb_matrix.md)
    • [x] Map LED positions. TODO: Probably needs some adjustment still
    • [x] Fix numpad RGB mapping
    • [x] Pull SDB(GP29) low to put IS31FL3743A into low power mode
    • [x] Make sure mapping from keycode to LED is correct
    • [x] Make sure mapping of LEDs IS31FL3743A matrix is correct
    • [x] Make sure mapping of LEDs to absolute coordinates is correct
    • [x] Make sure it's persisted. Currently it emulated EEPROM in the last 64K of flash. See: platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash_config.h.
  • [x] Try debugging
    • [x] Using HID console (Works with qmk console)
    • [x] Using debugger
  • [x] Split variants
    • [x] Layouts
      • [x] ANSI (78 keys)
      • [x] ISO (79 keys)
      • [x] JIS (83 keys)
      • [x] Numpad (21 keys)
      • [x] Gridpad (23 keys)
    • [x] Fix key position and sizes in info.json
  • [x] Enable VIA support
    • [x] Add configs for each layout
      • [x] ANSI
      • [x] ISO
      • [x] JIS
      • [x] Numpad
      • [x] Gridpad
    • [x] Enable VIA in config.
  • [x] Special Media Keys
    • [x] Airplane Mode Button. Need to include PR2 or https://github.com/qmk/qmk_firmware/pull/19490)
    • [x] Toggle Display (via WIN+P)
    • [x] Keys to control the RGB backlight
  • [x] Support FN lock
  • [x] Support firmware update via software only, without mechanical intervention. This would be used in the factory for flashing the firmware.
  • [x] Figure out a way to put the serial number, which won't be overridden by reflashing QMK
  • [x] Remove mouse report
  • [x] Move spacebar LED to the middle

JohnAZoidberg avatar Dec 16 '22 03:12 JohnAZoidberg

Fixed the build and made sure that GH Actions also tests that.

JohnAZoidberg avatar Dec 20 '22 03:12 JohnAZoidberg

image Debugging via print and uprintf console works

JohnAZoidberg avatar Dec 20 '22 14:12 JohnAZoidberg

Firmware sizes currently:

> ls -lh .build/*uf2
-rw-rw-r-- 1 zoid zoid 98K Jan  5 17:47 .build/lotus_ansi_default.uf2
-rw-rw-r-- 1 zoid zoid 95K Jan  5 18:15 .build/lotus_gridpad_default.uf2
-rw-rw-r-- 1 zoid zoid 85K Jan  5 18:14 .build/lotus_iso_default.uf2
-rw-rw-r-- 1 zoid zoid 85K Jan  5 18:15 .build/lotus_jis_default.uf2
-rw-rw-r-- 1 zoid zoid 84K Jan  5 18:15 .build/lotus_numpad_default.uf2

Much of that is UF2 overhead. The last byte in the .hex file is 0xC244 (49732), so the FW is roughly 50K big.

JohnAZoidberg avatar Jan 05 '23 10:01 JohnAZoidberg

Testing while twisting potentiometer to provide ADC voltage, set the threshold at 3V:

Framework Computer Inc:Lotus Keyboard:1: Col 10 - Row 5 - State: 0, Voltage: 3.11                                                                                                             
Framework Computer Inc:Lotus Keyboard:1: 5 ms (200 Hz)                                                                                                                                        
Framework Computer Inc:Lotus Keyboard:1: Temperature: 19.88                                                                                                                                   
Framework Computer Inc:Lotus Keyboard:1: ADC Voltage: 3.9                                                                                                                                     
Framework Computer Inc:Lotus Keyboard:1: Col 10 - Row 6 - State: 0, Voltage: 3.09                                                                                                              
Framework Computer Inc:Lotus Keyboard:1: 6 ms (166 Hz)                                                                                                                                        
Framework Computer Inc:Lotus Keyboard:1: Temperature: 19.88                                                                                                                                   
Framework Computer Inc:Lotus Keyboard:1: ADC Voltage: 3.5                                                                                                                                     
Framework Computer Inc:Lotus Keyboard:1: Col 10 - Row 7 - State: 0, Voltage: 3.05                                                                                                              
Framework Computer Inc:Lotus Keyboard:1: 5 ms (200 Hz)                                                                                                                                        
Framework Computer Inc:Lotus Keyboard:1: Temperature: 19.64                                                                                                                                   
Framework Computer Inc:Lotus Keyboard:1: ADC Voltage: 3.2                                                                                                                                     
Framework Computer Inc:Lotus Keyboard:1: Col 11 - Row 0 - State: 0, Voltage: 3.09                                                                                                              
Framework Computer Inc:Lotus Keyboard:1: 6 ms (166 Hz)                                                                                                                                        
Framework Computer Inc:Lotus Keyboard:1: Temperature: 19.88                                                                                                                                   
Framework Computer Inc:Lotus Keyboard:1: ADC Voltage: 2.98                                                                                                                                    
Framework Computer Inc:Lotus Keyboard:1: Col 11 - Row 1 - State: 1, Voltage: 2.98                                                                                                             
Framework Computer Inc:Lotus Keyboard:1: 5 ms (200 Hz)                                                                                                                                        
Framework Computer Inc:Lotus Keyboard:1: Temperature: 19.64                                                                                                                                   
Framework Computer Inc:Lotus Keyboard:1: ADC Voltage: 2.96                                                                                                                                    
Framework Computer Inc:Lotus Keyboard:1: Col 11 - Row 2 - State: 1, Voltage: 2.96                                                                                                             
Framework Computer Inc:Lotus Keyboard:1: 5 ms (200 Hz)                                                                                                                                        
Framework Computer Inc:Lotus Keyboard:1: Temperature: 19.64                                    
Framework Computer Inc:Lotus Keyboard:1: ADC Voltage: 2.92                                     
Framework Computer Inc:Lotus Keyboard:1: Col 11 - Row 3 - State: 1, Voltage: 2.92              
Framework Computer Inc:Lotus Keyboard:1: 6 ms (166 Hz)                                         
Framework Computer Inc:Lotus Keyboard:1: Temperature: 19.64                                    
Framework Computer Inc:Lotus Keyboard:1: ADC Voltage: 2.87                                     
Framework Computer Inc:Lotus Keyboard:1: Col 11 - Row 4 - State: 1, Voltage: 2.87              
Framework Computer Inc:Lotus Keyboard:1: 5 ms (200 Hz)                                         
Framework Computer Inc:Lotus Keyboard:1: Temperature: 19.88                                    
Framework Computer Inc:Lotus Keyboard:1: ADC Voltage: 2.83                                     
Framework Computer Inc:Lotus Keyboard:1: Col 11 - Row 5 - State: 1, Voltage: 2.83              
Framework Computer Inc:Lotus Keyboard:1: 6 ms (166 Hz)                                         
Framework Computer Inc:Lotus Keyboard:1: Temperature: 19.88                                    
Framework Computer Inc:Lotus Keyboard:1: ADC Voltage: 2.80                                     
Framework Computer Inc:Lotus Keyboard:1: Col 11 - Row 6 - State: 1, Voltage: 2.80              

JohnAZoidberg avatar Jan 07 '23 13:01 JohnAZoidberg

Works out of the box with a raspberry pi pico. Does not drive the column GPIOs because GP29 is not present on the pico, which we need to use for SDB to enable the RGB controller. I remapped that to GP22 for now. Will have to undefine PICO_LOTUS when we do a build for the factory next week.

JohnAZoidberg avatar Jan 07 '23 13:01 JohnAZoidberg

Printing many times per cycle on the console slows QMK down A LOT! Will have to measure latency without logging every matrix scan.

JohnAZoidberg avatar Jan 07 '23 17:01 JohnAZoidberg

Current ANSI FW size:

Without LTO: 61924 With LTO: 49668

JohnAZoidberg avatar Jan 11 '23 00:01 JohnAZoidberg

@JohnAZoidberg Sorry to hijack this PR but is it the current best source to build a custom firmware (=> not using VIA's web UI) ?

pdalpra avatar Feb 20 '24 23:02 pdalpra

@JohnAZoidberg Sorry to hijack this PR but is it the current best source to build a custom firmware (=> not using VIA's web UI) ?

v0.2.9 is the latest version. You can find it here https://github.com/FrameworkComputer/qmk_firmware/tree/v0.2.9/

Blue-Sauce avatar Feb 20 '24 23:02 Blue-Sauce