Giter Site home page Giter Site logo

pheki / anne-key Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ah-/anne-key

0.0 2.0 0.0 3.11 MB

Firmware for Anne Pro Keyboard written in Rust

License: Apache License 2.0

GDB 0.17% Makefile 0.48% Rust 93.24% Logos 0.37% Python 5.20% Shell 0.55%

anne-key's Introduction

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

anne-key's People

Contributors

ah- avatar fcoury avatar ghostwheel avatar hdhoang avatar mveerd avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.