Skip to content

Commit e9d023f

Browse files
RaBoomkesyog
authored andcommitted
Improve and correct documentation
1 parent ecf5a80 commit e9d023f

File tree

6 files changed

+73
-1
lines changed

6 files changed

+73
-1
lines changed

doc/src/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55
- [Development]()
66
- [Hardware]()
7+
- [Assembly](./assembly.md)
8+
- [Bringup](./bringup.md)
79
- [Calibration](./calibration.md)

doc/src/assembly.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Assembly
2+
3+
How to assemble the boards into the housings
4+
5+
## Instructions
6+
- Test the scale to make sure that it generally works
7+
- Disassemble fully, keep the screws
8+
<p align="center">
9+
<img src ="assets/disassembly.jpeg" width="600" alt="Partially disassembled scale">
10+
</p>
11+
12+
- Swap over the wires to the new, already populated PCB
13+
- Screw the new PCB back in
14+
<p align="center">
15+
<img src ="assets/soldered.jpeg" width="600" alt="Soldered and semi-assembled scale">
16+
</p>
17+
18+
- Measure the voltage input pins for shorts (to prevent stupid errors)
19+
- Power on the board with batteries or a lab bench power supply
20+
- Do the [Bringup](./bringup.md)
21+
- Close the housing and screw it shut, don't pinch any wires or strip any screws
22+
- Do the [Calibration](./calibration.md)
23+
- Done!

doc/src/assets/disassembly.jpeg

508 KB
Loading

doc/src/assets/soldered.jpeg

342 KB
Loading

doc/src/bringup.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Bringup
2+
3+
How to get the board from being assembled to being functional, using Windows, WSL and a ST-Link
4+
5+
## Requirements on Windows ##
6+
- Working WSL2
7+
- ST-Link, with installed drivers (I used a ST-Link V2-1, borrowed from a Nucleo Board)
8+
- Install usbipd-win on windows: run `winget install --interactive --exact dorssel.usbipd-win` in a windows terminal
9+
- Install required packages in wsl: `sudo apt install build-essential`
10+
- Install rust: https://rustup.rs/
11+
- Install probe-rs: https://probe.rs/
12+
- Install OpenOCD in WSL: `sudo apt install openocd` in wsl
13+
- Download the SoftDevice for the chip from NRF (I used s113_nrf52_7.3.0_softdevice.hex)
14+
15+
16+
## Flashing on Windows ##
17+
- Connect the ST-Link
18+
- Follow these instructions to get the ST-Link connected to WSL: https://learn.microsoft.com/de-de/windows/wsl/connect-usb
19+
- `usbipd list`
20+
- `usbipd bind --busid <busid>`
21+
- `usbipd attach --wsl --busid <busid>`
22+
- Connect the board to the ST-Link correctly
23+
- Power the board
24+
- Run `openocd -f /usr/share/openocd/scripts/interface/stlink.cfg -f /usr/share/openocd/scripts/target/nrf52.cfg`
25+
- In a seperate terminal run `telnet localhost 4444`
26+
- Use `targets` you can check that you can see the nrf52 target
27+
- Run `init`, `halt`, `nrf5 mass_erase`, `program /full/path/.../s113_nrf52_7.3.0_softdevice.hex verify`
28+
- Run `exit`in telnet shell
29+
- Exit OpenOCD with CTRL+C
30+
- Build and flash the code with `cargo run --bin proto1_0 --release`
31+
- Done! Further flashing etc. should not require reflashing the SoftDevice
32+
33+
### Notes:
34+
- If you just want to flash the softdevice in one command you can do it like this: `openocd -f /usr/share/openocd/scripts/interface/stlink.cfg -f /usr/share/openocd/scripts/target/nrf52.cfg -c "init; halt; nrf5 mass_erase; program /full/path/.../s113_nrf52_7.3.0_softdevice.hex preverify verify; shutdown"`
35+
36+
### Sources:
37+
- https://www.jentsch.io/nrf51822-flashen-mit-st-link-v2-und-openocd/
38+
- https://github.com/seemoo-lab/openhaystack/wiki/Flashing-nRF-with-OpenOCD---ST-Link
39+
- https://github.com/lupyuen/stm32bluepill-mynewt-sensor/blob/nrf52/scripts/nrf52/flash-boot.sh
40+
- https://www.youtube.com/watch?v=R5wub5ywzTU&t=197s
41+
- https://www.reddit.com/r/embedded/comments/1k9v4vr/stm32_cmake_stlinkv3pwr_on_windows_in_2025/?show=original
42+
- https://github.com/dorssel/usbipd-win/wiki/WSL-support
43+
- https://discuss.ardupilot.org/t/help-setting-up-openocd-with-st-link-in-wsl2/112271
44+
- https://hackmd.io/@aeefs2Y8TMms-cjTDX4cfw/r1fqAa_Da
45+
- https://learn.microsoft.com/de-de/windows/wsl/connect-usb
46+
47+

doc/src/calibration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ characteristic. This should be the only writable characteristic. This sends the
2121
maximum weight but less than 150kg, the maximum capacity of the scale.
2222
1. Convert the known weight, in kg, to a 32-bit floating point number in little-endian format. Write
2323
`69 <your hex bytes here>` to the same characteristic as earlier. As an example, if your known
24-
weight were 100.0 kg, you would send `690000f042`.
24+
weight were 120.0 kg, you would send `690000f042`.
2525
1. If you mess up entering in either meaurement, feel free to resend the corresponding command.
2626
1. Once you're set, write `0x6A` to the same characteristic to save the calibration.
2727
1. At this point, disconnect from Hangman and test it out using the Tindeq mobile app or something

0 commit comments

Comments
 (0)