rt-claw Platform Port
Port incrementally. Get the library build working first, then platform boot,
then drivers, then QEMU or hardware validation.
Starting Questions
Identify these before editing:
- CPU architecture, SoC, and board name.
- RTOS choice: FreeRTOS, RT-Thread, Zephyr, Linux, or a new backend.
- SDK and compiler toolchain.
- Available QEMU machine, if any.
- Network path: WiFi, Ethernet, cellular, or proxy-only.
- Memory constraints: flash, RAM, and PSRAM.
Platform Layout
platform/<name>/
+-- boards/
| +-- qemu/
| | +-- sdkconfig.defaults
| | +-- partitions.csv
| +-- <board>/
| +-- sdkconfig.defaults
| +-- partitions.csv
+-- main/
| +-- main.c
+-- CMakeLists.txt
+-- SConscript
+-- cross.ini
Use only the files that fit the target platform. ESP-IDF ports use CMake;
RT-Thread ports use SCons; some platforms use generated Meson cross files.
Porting Phases
- Build infrastructure:
- create the platform directory structure
- add a Meson cross file or generator script when needed
- add Makefile build and run targets
- verify Meson produces the expected rt-claw libraries
- OSAL:
- reuse an existing backend when possible
- check task, mutex, semaphore, timer, KV, and network behavior
- for a new RTOS, implement the OSAL under
osal/<rtos>/
- Board abstraction:
- implement early board initialization in platform code
- call
claw_init() after board setup
- add platform shell commands only for platform-specific behavior
- Drivers:
- reuse existing drivers where possible
- put new hardware drivers under
drivers/<subsystem>/<vendor>/
- put public driver headers under
include/drivers/...
- QEMU or hardware:
- configure QEMU machine and networking when available
- add flash and monitor targets for real hardware
- use
scripts/api-proxy.py for QEMU HTTP/TLS limitations when needed
- Documentation:
- update build/run commands
- update platform notes in paired EN/ZH docs when user-facing
- update agent guidance if new workflow commands are introduced
Closest Templates
- New Espressif RISC-V boards: start from
platform/esp32c3/.
- New Espressif S3-style boards: start from
platform/esp32s3/.
- RT-Thread QEMU work: start from
platform/vexpress-a9/.
- FreeRTOS ARM QEMU work: start from
platform/zynq-a9/.
- Zephyr boards: start from
platform/zephyr/.
Verification
make build-<name> or the closest new target.
scripts/check-patch.sh --staged.
- QEMU boots to a shell prompt when QEMU is available.
- AI/API paths work only when credentials and network are available; do not
commit credentials to make them work.
- Existing shared platforms still build when shared code changed.
Rules
- Do not modify
vendor/ submodules.
- Do not put application logic in
platform/ or osal/.
- Do not add a new OSAL backend when an existing backend can serve the target.
- Do not introduce broad platform abstractions before one working platform
needs them.
1---2name: rt-claw-platform-port3description: Use when porting rt-claw to a new hardware platform, board variant, SoC, or RTOS backend.4license: MIT5---6
7# rt-claw Platform Port
8
9Port incrementally. Get the library build working first, then platform boot,
10then drivers, then QEMU or hardware validation.
11
12## Starting Questions
13
14Identify these before editing:
15
16- CPU architecture, SoC, and board name.
17- RTOS choice: FreeRTOS, RT-Thread, Zephyr, Linux, or a new backend.
18- SDK and compiler toolchain.
19- Available QEMU machine, if any.
20- Network path: WiFi, Ethernet, cellular, or proxy-only.
21- Memory constraints: flash, RAM, and PSRAM.
22
23## Platform Layout
24
25```text
26platform/<name>/
27+-- boards/
28| +-- qemu/
29| | +-- sdkconfig.defaults
30| | +-- partitions.csv
31| +-- <board>/
32| +-- sdkconfig.defaults
33| +-- partitions.csv
34+-- main/
35| +-- main.c
36+-- CMakeLists.txt
37+-- SConscript
38+-- cross.ini
39```
40
41Use only the files that fit the target platform. ESP-IDF ports use CMake;
42RT-Thread ports use SCons; some platforms use generated Meson cross files.
43
44## Porting Phases
45
461. Build infrastructure:
47 - create the platform directory structure
48 - add a Meson cross file or generator script when needed
49 - add Makefile build and run targets
50 - verify Meson produces the expected rt-claw libraries
512. OSAL:
52 - reuse an existing backend when possible
53 - check task, mutex, semaphore, timer, KV, and network behavior
54 - for a new RTOS, implement the OSAL under `osal/<rtos>/`
553. Board abstraction:
56 - implement early board initialization in platform code
57 - call `claw_init()` after board setup
58 - add platform shell commands only for platform-specific behavior
594. Drivers:
60 - reuse existing drivers where possible
61 - put new hardware drivers under `drivers/<subsystem>/<vendor>/`
62 - put public driver headers under `include/drivers/...`
635. QEMU or hardware:
64 - configure QEMU machine and networking when available
65 - add flash and monitor targets for real hardware
66 - use `scripts/api-proxy.py` for QEMU HTTP/TLS limitations when needed
676. Documentation:
68 - update build/run commands
69 - update platform notes in paired EN/ZH docs when user-facing
70 - update agent guidance if new workflow commands are introduced
71
72## Closest Templates
73
74- New Espressif RISC-V boards: start from `platform/esp32c3/`.
75- New Espressif S3-style boards: start from `platform/esp32s3/`.
76- RT-Thread QEMU work: start from `platform/vexpress-a9/`.
77- FreeRTOS ARM QEMU work: start from `platform/zynq-a9/`.
78- Zephyr boards: start from `platform/zephyr/`.
79
80## Verification
81
82- `make build-<name>` or the closest new target.
83- `scripts/check-patch.sh --staged`.
84- QEMU boots to a shell prompt when QEMU is available.
85- AI/API paths work only when credentials and network are available; do not
86 commit credentials to make them work.
87- Existing shared platforms still build when shared code changed.
88
89## Rules
90
91- Do not modify `vendor/` submodules.
92- Do not put application logic in `platform/` or `osal/`.
93- Do not add a new OSAL backend when an existing backend can serve the target.
94- Do not introduce broad platform abstractions before one working platform
95 needs them.