/anne-keyberon

Primary LanguageRustApache License 2.0Apache-2.0

Many thanks to Obins and generations of AnnePro reverse-engineers/devs:

Created from knurling-rs/app-template, license & support info below.

Please observe the Rust Code of Conduct within our community.

Necessary tooling

  • rustup to use toolchain file
  • probe-run
  • flip-link
  • usb device ownership on the probe (you'd better use udev rules):
❯ sudo chown $USER /dev/bus/usb/00B/00D
❯ probe-run --list-probes
the following probes were found:
[0]: STLink V2 (VID: 0483, PID: 3748, Serial: 56C3BF6A0648<snip>, StLink)
  • defmt log level tuning: see features in [Cargo.toml]

On HexCore (née Obins) Anne Pro (2018 with ST MCUs), we have achieved RTT logging over SWD probe:

anne-keyberon on  main [!?] is 📦 v0.1.0 via 🦀 v1.53.0
❯ cargo rrb rtic_schedule
   Compiling anne-keyberon v0.1.0 (B:\code\anne\anne-keyberon)
    Finished release [optimized + debuginfo] target(s) in 1.36s
     Running `probe-run --chip STM32L151C8 target\thumbv7m-none-eabi\release\rtic_schedule`
(HOST) INFO  flashing program (7.61 KiB)
(HOST) INFO  success!
────────────────────────────────────────────────────────────────────────────────
0 INFO  Hello from init! Please wait for the scheduled task
└─ rtic_schedule::init @ src\bin\rtic_schedule.rs:54
1 INFO  idling...
└─ rtic_schedule::idle @ src\bin\rtic_schedule.rs:17
2 INFO  Hello world from turn=100!
└─ rtic_schedule::hello_world_task @ src\bin\rtic_schedule.rs:65
3 INFO  Hello world from turn=30!
└─ rtic_schedule::hello_world_task @ src\bin\rtic_schedule.rs:65
4 INFO  Hello world from turn=30!
└─ rtic_schedule::hello_world_task @ src\bin\rtic_schedule.rs:65
5 INFO  Hello world from turn=30!
└─ rtic_schedule::hello_world_task @ src\bin\rtic_schedule.rs:65
────────────────────────────────────────────────────────────────────────────────
stack backtrace:
   0: __wfi
        at ./asm/lib.rs:50:14
   1: rtic_schedule::idle
        at src\bin/rtic_schedule.rs:19:13
   2: main
        at src\bin/rtic_schedule.rs:13:1
   3: Reset

Next steps:

  • Port stm32-rs/stm32l1xx-hal to PAC 0.13.0, great thanks to @jyrama for heavylifting
  • "use a recent version of the cortex-m crates (e.g. cortex-m 0.6.3 or newer)" because that's Obins' bootloader code at address 0x8002e86
  • Import RTIC
  • Choose a path for usb-device support
  • Add USB to stm32l1xx-hal, looks doable, but overall parameter structure seems risky
  • Add L151 to stm32-hal(2), looks fast-changing, needs much exp & support
  • Clocks, RCC
  • GPIO
  • USB
  • USART for bt
  • UART for led
  • Import keyberon
  • Other keyboards seem to favor Row-output+Column-input, as opposed to anne-key Column-output+Row-input (enable column, read rows, disable column, next column)
  • Reconstruct BT-chip UART+protocol from ah-/anne-key
  • Deal with the LED chip, which is not working on my 2 keyboards, for any Key firmware

Support

app-template is part of the Knurling project, Ferrous Systems' effort at improving tooling used to develop for embedded systems.

If you think that our work is useful, consider sponsoring it via GitHub Sponsors.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.