cleaning up board config and switch tool

This commit is contained in:
PhosphorosVR
2025-09-06 17:10:46 +02:00
parent ad7b9b8be9
commit 909a2779ac
12 changed files with 284 additions and 3176 deletions

View File

@@ -50,16 +50,23 @@ After this, youre ready for the Quick start below.
## Quick start
### 1) Pick your board (loads the default configuration)
Boards are autodiscovered from the `boards/` directory. First list them, then pick one:
Windows (cmd):
```cmd
python .\tools\switchBoardType.py --board xiao-esp32s3 --diff
python .\tools\switchBoardType.py --list
python .\tools\switchBoardType.py --board seed_studio_xiao_esp32s3 --diff
```
macOS/Linux (bash):
```bash
python3 ./tools/switchBoardType.py --board xiao-esp32s3 --diff
python3 ./tools/switchBoardType.py --list
python3 ./tools/switchBoardType.py --board seed_studio_xiao_esp32s3 --diff
```
- Set `--board` to your target board
- `--diff` shows what changed in the config
Notes:
- Use `--list` to see all detected board keys.
- Board key = relative path under `boards/` with `/` replaced by `_` (and duplicate tail segments collapsed, e.g. `project_babble/project_babble` -> `project_babble`).
- `--diff` shows what will change vs the current `sdkconfig`.
- You can also pass partial or pathlike inputs (e.g. `facefocusvr/eye_L`), the tool normalizes them.
### 2) Build & flash
- Set the target (e.g., ESP32S3).
@@ -118,6 +125,17 @@ If you want to dig deeper: commands are mapped via the `CommandManager` under `c
- UVC doesnt appear on the host?
- Switch mode to UVC via CLI tool, replug USB and wait 20s.
### Adding a new board configuration
1. Create a new config file under `boards/` (you can nest folders): for example `boards/my_family/my_variant`.
2. Populate it with only the `CONFIG_...` lines that differ from the shared defaults. Shared baseline lives in `boards/sdkconfig.base_defaults` and is always merged first.
3. The board key the script accepts will be the relative path with `/` turned into `_` (example: `boards/my_family/my_variant` -> `my_family_my_variant`).
4. Run `python tools/switchBoardType.py --list` to verify its detected, then switch using `-b my_family_my_variant`.
5. If you accidentally create two files that collapse to the same key the last one found wins—rename to keep keys unique.
Tips:
- Use `--diff` after adding a board to sanitycheck only the intended keys change.
- For WiFi overrides on first flash: add none—pass `--ssid` / `--password` when switching if needed.
---
Feedback, issues, and PRs are welcome.