Add README.
[gps-watch.git] / README
1 gps-watch
2 =========
3
4 This is custom firmware for the Decathlon Kalenji OnMove 220 and
5 OnMove 500 GPS watches.
6
7
8 Supported features
9 ------------------
10
11 * Show GPS fix status
12 * Display current time (UTC)
13 * Start recording, stop recording
14 * Display meters travelled in current recording
15 * Display pace in current recording
16 * Shell interface that offers listing, removing and retrieving of recordings
17
18
19 Unsupported features
20 --------------------
21
22 * Backlight
23 * Battery level measurement
24 * Pulse measurement unit
25
26
27 Supported watch models
28 ----------------------
29
30 This firmware is known to work with Decathlon Kalenji OnMove 220 and
31 OnMove 500 watches.
32
33
34 Build
35 -----
36
37 This firmware is written in Rust and C and thus the build requires `rustc`
38 and gcc for ARM Cortex M0+ targets. By default, the build system uses
39 the `arm-none-eabi` toolchain for the latter.
40
41 Run `scons` to build the firmware and test programs.
42
43
44 Installation
45 ------------
46
47 This firmware can be installed on supported watches without opening them up.
48 To do so, we will first install an intermediate bootloader at the flash's
49 location for the application firmware (0x8000) and run it.
50 Afterwards, we can install the final bootloader at flash offset 0x0,
51 then we can install the custom application firmware at 0x8000.
52
53 Note that doing this has the potential to brick your watch.
54
55 Instructions:
56 1. Register udev rules with the system:
57 ```
58 sudo install -o root -g root -m 0644 contrib/99-gps-watch.rules /etc/udev/rules.d
59 sudo udevadm control -R
60 ```
61 2. Connect watch via USB.
62 3. Mount watch's USB mass storage to `/mnt`.
63 4. Install intermediate bootloader. Instructions vary slightly depending on your watch's model.
64
65 For OnMove 220:
66 ```cp build-target/gps-watch-bootloader-intermediate.frm /mnt/firm220.frm```
67 For OnMove 500:
68 ```cp build-target/gps-watch-bootloader-intermediate.frm /mnt/firm500.frm```
69 5. Unmount watch's USB mass storage.
70 6. Press watch's "Brightness" (middle left) button to initiate firmware update.
71 7. Install final bootloader:
72 ```
73 tools/update-firmware -d /dev/gps-watch-bootloader-intermediate -o 0x0 -l 4 -wv build-target/gps-watch-bootloader-final.bin
74 ```
75 8. Start final bootloader and prepare to press and hold the "Brightness" button (middle left):
76 ```
77 tools/update-firmware -d /dev/gps-watch-bootloader-intermediate -l 4 -s
78 ```
79 9. Press and hold the "Brightness" button to avoid booting into application code.
80 10. Install and start application firmware:
81 ```
82 tools/update-firmware -d /dev/gps-watch-bootloader -o 0x8000 -l 4 -wvs build-target/gps-watch-application.bin
83 ```
84 11. After a couple of seconds, the watch should show up as `/dev/gps-watch`.
85
86 To update a watch to a later build, run the following command while the watch
87 is still in the bootloader (see below):
88 ```
89 tools/update-firmware -d /dev/gps-watch-bootloader -o 0x8000 -l 4 -wvs build-target/gps-watch-application.bin
90 ```
91
92
93 Usage
94 -----
95
96 Connect the watch via USB, start a terminal program and point it at `/dev/gps-watch` to use the serial interface. Run the `help` command to get a list of supported commands.
97
98 Note that the `clear_storage` command has the potential to brick your watch.
99 Do *not* run it unless you have opened up your watch and connected it to a debugger!
100
101 To start a new recording, or to stop a running recording, press and hold the "Play" button (upper right) for 1.5s.
102 While a recording is running, press the "Next" or "Previous" button (lower left and lower right) to cycle through display of time, distance and pace.
103
104 To retrieve a recording, run the `get` command in the shell interface, then make
105 your terminal send an upper case `R` within 5s. This instructs the watch to
106 send the recording's data in Y encoding (`yenc`). Running `tools/gpxify` on the
107 decoded data yields a GPX file.
108
109 To reset the watch, press the upper left and lower right buttons at the same time.
110 The bootloader will avoid starting the application code if the "Brightness" button (middle left) is pressed in the first 3s after startup.