You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,9 +44,11 @@ flowchart TD
44
44
|`LED_PIN`|`16`|`0..=29`| The status-LED GPIO for the `ws2812` and `gpio` backends (RP2350A). Default GPIO16 is the Waveshare RP2350-One. Point it at a free GPIO on boards that use 16 for something else; the indicator simply drives whatever pin you pick. (Unused by `pimoroni`, which has fixed PWM pins, and by `none`.) |
45
45
|`LED_KIND`|`ws2812`|`ws2812` / `gpio` / `pimoroni` / `none`| The LED driver backend, and the **boot default** — a non-`none` build compiles all three so the driver/pin/order are runtime-switchable via `rsk hw` / PicoForge (see below). `ws2812` = a single addressable RGB on `LED_PIN` (the Waveshare default). `gpio` = a plain on/off LED on `LED_PIN` — hue/brightness collapse to lit/unlit, but the blink *pattern* still distinguishes statuses. `pimoroni` = a 3-pin PWM RGB (Pimoroni Tiny 2350: R=GPIO18, G=GPIO19, B=GPIO20, common-anode). `none` = no indicator (the status engine still runs; nothing renders it, and the phy LED fields are ignored). |
46
46
|`LED_ORDER`|`rgb`|`rgb` / `grb`| WS2812 wire byte order (`ws2812` backend only). The Waveshare RP2350-One is unusually `rgb` (the default); standard WS2812B parts (e.g. the TenStar RP2350-USB) are `grb`. If a `ws2812` board comes up with red and green swapped (blue fine), flip this to `grb`. |
47
+
|`MAX_LEDS`|`8`|`1`–`64`| PIO state-machine and frame-buffer ceiling for addressable LEDs. The **actual** connected count is set at runtime via `rsk hw --led-num` and must be ≤ `MAX_LEDS`. Default 8 covers the common 1–8 range; boards with more (up to 64) override this.|
47
48
|`FAKE_MKEK` / `FAKE_DEVK`| unset | 64 hex chars |**Test builds only.** Bakes a fake OTP master key / device key into the image instead of reading the OTP fuses, so the whole OTP migration path can be exercised with zero fuse writes. The build prints a loud warning and the key is greppable in the binary. Flashing a FAKE build onto a provisioned device migrates its data under the fake key — going back orphans that data (recovery = per-applet resets). Never flash one on a device you care about. |
48
49
49
-
The `LED_PIN` / `LED_KIND` / `LED_ORDER` values are **boot defaults** only. A
50
+
The `LED_PIN` / `LED_KIND` / `LED_ORDER` / `MAX_LEDS` values are **boot defaults**
51
+
only. A
50
52
non-`none` build compiles all three backends, so the LED pin, driver, and wire
51
53
order are runtime-configurable — no reflash — with `rsk hw` (or PicoForge),
52
54
which write them to the device's `phy` record. The build knobs decide the
**red and green come out swapped** (blue unaffected) has the other byte
21
-
order — the Waveshare RP2350-One is `rgb` (the default), most other WS2812B
22
-
parts are `grb`.
23
-
24
-
A `none` build is the exception: it renders nothing and ignores the phy LED
25
-
fields (there is no backend compiled to switch to).
26
-
27
-
The LED runs on its own high-priority task, so it keeps animating even while
28
-
the firmware blocks waiting for a touch or grinds through a long RSA keygen —
29
-
a frozen LED means the firmware itself is wedged, not just busy.
30
-
31
-
## What the states mean
32
-
33
-
There are four states. Each has a **fixed blink timing** baked into the
34
-
firmware (`firmware/src/led.rs`); only the **color and brightness** are
35
-
configurable.
36
-
37
-
| State | Default color | Blink (on/off) | Means |
6
+
## Build-time knobs
7
+
8
+
Three hardware properties of the indicator are **compile-time** knobs set by build
9
+
flags; a fourth, `MAX_LEDS`, sets the upper bound for the PIO buffer. The actual
10
+
number of connected LEDs is configured at **runtime** via `rsk hw --led-num` (or
11
+
PicoForge) and must be ≤ `MAX_LEDS`.
12
+
13
+
| Knob | Default | When to change it |
14
+
|---|---|---|
15
+
|`LED_KIND`|`ws2812`|`ws2812` (addressable RGB, default), `gpio` (plain on/off), `pimoroni` (3-pin PWM RGB), or `none` (no indicator). See [build.md](build.md). |
16
+
|`LED_PIN`|`16`| A board whose addressable LED is on a different GPIO (`0..=29`). |
17
+
|`LED_ORDER`|`rgb`| A WS2812 board with swapped red/green — set `grb` (the WS2812B standard). The Waveshare RP2350-One is `rgb`; most other parts are `grb`. |
18
+
|`MAX_LEDS`|`8`| A board with **more than 8** daisy-chained addressable LEDs (max `64`). The actual connected count is set at runtime with `rsk hw --led-num`. |
19
+
20
+
```sh
21
+
# example: build for a 4-LED board with standard GRB order
Copy file name to clipboardExpand all lines: docs/hardware.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,8 +29,9 @@ cover it:
29
29
|---|---|---|
30
30
|`FLASH_SIZE`|`4M`| A board with a different QSPI flash chip (e.g. `8M`). `build.rs` regenerates `memory.x` from it. Must be ≥ ~2 MB and ≤ 16 MB. |
31
31
|`LED_PIN`|`16`| A board that uses GPIO16 for something else, or wires its addressable LED elsewhere (RP2350A: GPIO `0..=29`). |
32
-
|`LED_KIND`|`ws2812`|A board with a different indicator: `gpio` (a plain on/off LED on `LED_PIN`), `pimoroni` (3-pin PWM RGB, Pimoroni Tiny 2350), or `none`. Default `ws2812` is the Waveshare addressable RGB. |
32
+
|`LED_KIND`|`ws2812`|`ws2812` (addressable RGB, default), `gpio` (plain on/off), `pimoroni` (3-pin PWM RGB), or `none` (no indicator). See [build.md](build.md). |
33
33
|`LED_ORDER`|`rgb`| A `ws2812` board whose red and green come out swapped (blue fine): set `grb` (the WS2812B standard). The Waveshare RP2350-One is `rgb`; most other parts are `grb`. |
34
+
|`MAX_LEDS`|`8`| A board with **more than 8** daisy-chained addressable LEDs. The buffer ceiling; the actual connected count is set at runtime ([guides/led.md](guides/led.md)). |
34
35
35
36
```sh
36
37
# example: an 8 MB board with a plain LED on GPIO25
0 commit comments