A fork of https://github.com/crosspoint-reader/crosspoint-reader
1# Getting Started
2
3This guide helps you build and run CrossPoint locally.
4
5## Prerequisites
6
7- PlatformIO Core (`pio`) or VS Code + PlatformIO IDE
8- Python 3.8+
9- `clang-format` 21+ in your `PATH` (CI uses clang-format 21)
10- USB-C cable
11- Xteink X4 device for hardware testing
12
13If `./bin/clang-format-fix` fails with either of these errors, install clang-format 21:
14
15- `clang-format: No such file or directory`
16- `.clang-format: error: unknown key 'AlignFunctionDeclarations'`
17
18Examples:
19
20```sh
21# Debian/Ubuntu (try this first)
22sudo apt-get update && sudo apt-get install -y clang-format-21
23
24# If the package is unavailable, add LLVM apt repo and retry
25wget https://apt.llvm.org/llvm.sh
26chmod +x llvm.sh
27sudo ./llvm.sh 21
28sudo apt-get update
29sudo apt-get install -y clang-format-21
30
31# macOS (Homebrew)
32brew install clang-format
33```
34
35Then verify:
36
37```sh
38clang-format-21 --version
39```
40
41The reported major version must be 21 or newer.
42
43## Clone and initialize
44
45```sh
46git clone --recursive https://github.com/crosspoint-reader/crosspoint-reader
47cd crosspoint-reader
48```
49
50If you already cloned without submodules:
51
52```sh
53git submodule update --init --recursive
54```
55
56## Build
57
58```sh
59pio run
60```
61
62## Flash
63
64```sh
65pio run --target upload
66```
67
68## First checks before opening a PR
69
70```sh
71./bin/clang-format-fix
72pio check --fail-on-defect low --fail-on-defect medium --fail-on-defect high
73pio run
74```
75
76## What to read next
77
78- [Architecture Overview](./architecture.md)
79- [Development Workflow](./development-workflow.md)
80- [Testing and Debugging](./testing-debugging.md)