Firmware for Anne Pro Keyboard written in Rust
Switch branches/tags
untagged-fe24018a5b009a34352d untagged-fc4b888f0bc1bdadb6c9 untagged-ce492f7fd6c4b1306025 untagged-cdb71e7b6aa27140e1dc untagged-af01263dea67a39a0a8c untagged-95691101d320b6cb259f untagged-452789f49bcb7ec416fa untagged-967ac228b67068bb07af untagged-56f42571679bd4b349a9 untagged-9e3b60093c4b167463f7 untagged-8a4d4df86d647a4f93da 2018-05-22-229-master-43d5e93 2018-05-22-226-master-0360ab4 2018-05-09-214-master-14ceb8a 2018-04-12-209-master-aee0f1b 2018-04-10-204-master-65fff7b 2018-04-05-201-master-aa448d0 2018-04-02-197-master-b4f4424 2018-03-27-190-master-64bcb78 2018-03-26-187-master-03aa9af 2018-03-24-184-master-9d25ec6 2018-03-22-180-master-2ab69c0 2018-03-22-178-master-86750fb 2018-03-20-175-master-6d33409 2018-03-18-170-master-2324272 2018-03-17-167-master-25927cb 2018-03-15-162-master-2bd5a84 2018-03-15-156-master-a508021 2018-03-14-154-master-e5f8528 2018-03-14-151-master-9b1a92b 2018-03-14-149-master-60c27f4 2018-03-14-146-master-b61f382 2018-03-13-138-master-81c22cb 2018-03-13-135-master-f34aef7 2018-03-13-133-master-a790259 2018-03-10-127-master-f4fe08f 2018-03-10-125-master-d6c2825 2018-03-10-123-master-2247a2b 2018-03-10-121-master-533667a 2018-03-10-117-master-f7edc88 2018-03-10-114-master-a974a5c 2018-03-10-112-master-cbf514a 2018-03-10-110-master-6fd3934 2018-03-10-108-master-b9c527f 2018-03-10-104-master-de4e7e5 2018-03-10-102-master-f97e868 2018-03-10-99-master-010cc1f 2018-03-07-92-master-3cd8cd7 2018-03-06-90-master-9820d8b 2018-03-06-87-master-5dd7438 2018-03-06-82-master-cdd05cb 2018-03-06-79-master-3007d57 2018-03-05-77-master-a12dbf5 2018-03-04-71-master-a0b1819 2018-03-03-67-master-79207b0 2018-03-02-64-master-575c7bb 2018-03-02-59-df19670 2018-03-01-57-b099e63 2018-03-01-56-d5ee9fa 2018-03-01-55-e323e32 2018-03-01-53-38780a9 2018-03-01-49-d4df100 2018-03-01-43-60bc89c 2018-03-01-42-8df23f0 2018-03-01-40-48e9d06 2018-03-01-38-22e39df 2018-03-01-37-3488300 2018-03-01-28-759ec86 2018-02-28-26-8336342 2018-02-28-24-58de0cf 2018-02-28-23-814dc5f 2018-02-28-22-a936c6b 2018-02-28-21-5b0ce60 2018-02-28-20-2bf1a74 2018-02-28--d5214a1 20180228191027-9f9379e
Nothing to show
Clone or download
ah- Merge pull request #68 from hdhoang/book
update README with USB, LED, and nightly status
Latest commit ac02810 Jun 2, 2018

README.md

Firmware for Anne Pro Keyboard written in Rust

Travis Build Status

This is an alternative firmware for the Anne Pro Keyboard, with the goal of being more stable than the original firmware and adding extra features.

Status

This project is still under heavy development and probably not quite ready yet to serve as your only keyboard.

Working today:

  • Basic keyboard functionality
  • Bluetooth (as a keyboard)
  • LED control (switching on/off, changing themes)
  • USB charging
  • Drop in replacement as a simple firmware update
  • Partial bluetooth communication with the Anne Pro App (tested with Anne Pro Mac App)

Not yet implemented:

  • USB (sends keys concurrently with BT, hangs on connect/disconnect)
  • Media controls / special keys
  • Uploading custom lighting settings
  • Uploading custom keymaps
  • Power Management
  • BT setup mode with LEDs etc.

Community

We hang out in the Anne Pro Dev discord. Please observe the Rust Code of Conduct within our community.

Flashing

You can find the latest build on the Releases page. Download anne-key.dfu. If LEDs aren't working with latest build, you can try build 209 , or the following procedure: reboot into DFU mode by holding down Fn+Space+Esc, then exit with Esc.

Then you can either follow the obins firmware update steps (click Update manual) or use dfu-util.

dfu-util

First you'll need to install dfu-util.

To flash your Anne Pro connect via USB, then hold down the Esc button, press the little reset switch on the back and finally release Esc.

Now your keyboard is in DfuSe mode. It should show up in dfu-util:

$ dfu-util -l
dfu-util 0.9

...

Found DFU: [0483:df11] ver=0200, devnum=23, cfg=1, intf=0, path="20-2", alt=2, name="@BluetoothFlash  /0x1c000000/14*256 a,192*256 g", serial="057C37553731"
Found DFU: [0483:df11] ver=0200, devnum=23, cfg=1, intf=0, path="20-2", alt=1, name="@Internal Flash  /0x0c000000/64*256 a,192*256 g", serial="057C37553731"
Found DFU: [0483:df11] ver=0200, devnum=23, cfg=1, intf=0, path="20-2", alt=0, name="@Internal Flash  /0x08000000/64*256 a,192*256 g", serial="057C37553731"

Then you can flash your keyboard firmware:

$ dfu-util --alt 0 --intf 0 --download anne-key.dfu

...

file contains 1 DFU images
parsing DFU image 1
image for alternate setting 0, (1 elements, total size = 5104)
parsing element 1, address = 0x08004000, size = 5096
Download        [=========================] 100%         5096 bytes
Download done.
done parsing DfuSe file

And that's it. Press the reset button again to exit the bootloader and return to normal keyboard mode and you're done!

If your keyboard is running our firmware, you can reboot to DFU mode by holding down Fn+Space+Escape.

If you want to return to the original firmware you can flash the original firmware with:

$ dfu-util --alt 0 --intf 0 --download "anne pro key 1.4.dfu"

Documentation & Hacking

You can find some documentation on hardware on GitBooks. Many fellow projects provide insights into the obins firmware and app protocol:

  1. Reverse-engineering
  1. Alternate control apps
  1. Alternate firmware

To build your own firmware, you need the nightly-2018-05-15 rust toolchain with the following components:

  • nightly rust as default: rustup override set nightly-2018-05-15 within your checkout
  • thumbv7m std: rustup target add thumbv7m-none-eabi
  • ARM linker: usually named arm-none-eabi-ld, please check with your OS

Then, make dfu in the top directory will build your anne-key.dfu.

To analyze the firmware's code size, you need cargo-bloat:

  • cargo install cargo-bloat
  • make bloat
  • make bloat BLOAT_ARGS="--crates" # passing arguments to cargo-bloat

Our CI requires consistent formatting, please run rustfmt before you submit PRs:

  • rustup component add rustfmt-preview
  • make fmt

Troubleshooting

error[E0463]: can't find crate for compiler_builtins

Run the following command before running make dfu:

rustup target add thumbv7m-none-eabi

error: linker arm-none-eabi-ld not found

You need to install the ARM tools. If you're on macOS run the following:

brew install caskroom/cask/gcc-arm-embedded