Skip to content

Commit

Permalink
Build docs with mdBook
Browse files Browse the repository at this point in the history
  • Loading branch information
ah- committed Mar 1, 2018
1 parent 8df23f0 commit d2cbba4
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ Cargo.lock
*.bin
*.dfu
target/
book/
todo.txt
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ build:
dfu: build
./scripts/generate_dfu.sh

docs:
mdbook build

serve:
mdbook serve

clean:
$(XARGO) clean
rm -f anne-key.bin
rm -f anne-key.dfu
rm -rf book/

.PHONY: all build clean
.PHONY: all build clean docs serve
5 changes: 5 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[book]
title = "Anne Pro Internals"
description = "How the Anne Pro Keyboard really works"
authors = []
src = "docs"
5 changes: 5 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Summary

- [Introduction](./introduction.md)
- [Hardware](./hardware.md)
- [Software](./software.md)
1 change: 1 addition & 0 deletions docs/chapter_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Chapter 1
17 changes: 17 additions & 0 deletions docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Anne Pro Internals
==================

<img src="images/ferris.png" width=30%/> <img src="images/anne.jpg" width=50%/>

[GitHub project](https://github.com/ah-/anne-key)


Contributing to this documentation
----------------------------------

Please help out documenting how the Anne Pro works to help others get started!

To do so edit these Markdown files and send a Pull Request on GitHub.

You can preview your changes locally by building the docs with [mdBook](https://github.com/rust-lang-nursery/mdBook).
Just run `make serve` in the root folder and go to [http://localhost:3000/](http://localhost:3000/).
44 changes: 44 additions & 0 deletions docs/software.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Software
========

Bootloader
----------

Usually an STM32 starts execution via the vector table at `0x0800_0000`, but our user code only starts at `0x0800_4000` as you can see in the `memory.x` file.

This is due to the factory bootloader that lives at `0x0800_0000`. The bootloader checks on startup if the escape key is pressed, and if so it puts the Anne Pro into DFU mode. Otherwise it jumps to our code at `0x0800_4000`.

The bootloader on the main Keyboard STM32 also handles flashing the LED controller. If you're flashing LED, the commands are first sent to the keyboard controller, which forwards them.

It also advertises support for flashing the Bluetooth chip, but this seems to be broken.

### Memory Map
```
Address
..........................
. .
. ... .
. .
+------------------------+
| |
| RAM |
| |
0x2000_0000 +------------------------+
. .
. ... .
. .
. .
+------------------------+
| |
| FLASH |
| (Rust lives here) |
| |
0x0800_4000 +------------------------+
| BOOTLOADER |
0x0800_0000 +------------------------+
. .
. ... .
. .
0x0000_0000 ..........................
```

0 comments on commit d2cbba4

Please sign in to comment.