tirtc-device-builder 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +5 -1
- package/CHANGELOG.md +12 -0
- package/README.md +7 -1
- package/bin/tirtc-device-builder.js +16 -0
- package/package.json +5 -2
- package/skills/tirtc-beken-builder/SKILL.md +128 -0
- package/skills/tirtc-beken-builder/VERSION +1 -0
- package/skills/tirtc-beken-builder/agents/openai.yaml +4 -0
- package/skills/tirtc-beken-builder/assets/bk-avdk-smp-v3.1.1/tirtc_bk_probe.c +151 -0
- package/skills/tirtc-beken-builder/assets/bk-avdk-smp-v3.1.1/tirtc_bk_probe.h +37 -0
- package/skills/tirtc-beken-builder/assets/developer-intake-prompt.md +16 -0
- package/skills/tirtc-beken-builder/assets/probe-report.example.json +73 -0
- package/skills/tirtc-beken-builder/references/architecture.md +75 -0
- package/skills/tirtc-beken-builder/references/bk-research.md +135 -0
- package/skills/tirtc-beken-builder/references/capability-rules.md +47 -0
- package/skills/tirtc-beken-builder/references/hardware-diagnostics.md +82 -0
- package/skills/tirtc-beken-builder/references/probe-porting.md +130 -0
- package/skills/tirtc-beken-builder/references/tirtc-integration.md +46 -0
- package/skills/tirtc-beken-builder/scripts/bk_probe_report.py +397 -0
- package/skills/tirtc-beken-builder/scripts/doctor.py +87 -0
- package/skills/tirtc-esp32-builder/VERSION +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tirtc-device-builder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Codex workflows for building and validating TiRTC device firmware across supported chip platforms.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TangeAI",
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
"tirtc",
|
|
14
14
|
"esp32",
|
|
15
15
|
"esp-idf",
|
|
16
|
+
"beken",
|
|
17
|
+
"bk7258",
|
|
18
|
+
"bk7259",
|
|
16
19
|
"embedded",
|
|
17
20
|
"ai-intercom"
|
|
18
21
|
],
|
|
@@ -29,6 +32,7 @@
|
|
|
29
32
|
],
|
|
30
33
|
"defaultPrompt": [
|
|
31
34
|
"Analyze my ESP32 board and generate a TiRTC project.",
|
|
35
|
+
"Probe my BK7258 or BK7259 board and assess XiaoTai capabilities.",
|
|
32
36
|
"Check ESP-IDF and build my TiRTC ESP32 firmware.",
|
|
33
37
|
"Assess whether this board can support H5 live view and AI intercom."
|
|
34
38
|
]
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
This project follows Semantic Versioning.
|
|
4
4
|
|
|
5
|
+
## 0.11.0
|
|
6
|
+
|
|
7
|
+
- Add the `tirtc-beken-builder` Skill and CLI platform aliases for BK7258 and
|
|
8
|
+
BK7259, covering evidence-first board intake, SDK pinning, hardware
|
|
9
|
+
capability reports and XiaoTai feature gating.
|
|
10
|
+
- Add a BK7258 `bk_avdk_smp` release/v3.1.1 on-device probe component plus a
|
|
11
|
+
host collector, schema validator and deterministic capability assessor for
|
|
12
|
+
display/touch, speaker/microphone formats, Flash and memory diagnostics.
|
|
13
|
+
- Document a separate BK7259 release/v4.0.1 adapter boundary instead of
|
|
14
|
+
assuming BK7258/BK7259 peripheral or ABI compatibility, and package Doctor,
|
|
15
|
+
fixtures, tests and official-source research with the Skill.
|
|
16
|
+
|
|
5
17
|
## 0.10.1
|
|
6
18
|
|
|
7
19
|
- Add a knowledge-only Waveshare ESP32-P4-WIFI6-Touch-LCD-4.3-C V1.0 package
|
package/README.md
CHANGED
|
@@ -2,11 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
TiRTC Device Builder 用于把 ESP32-S3/ESP32-P4 开发板接入 TiRTC。输入可以只有开发板型号,也可以包含原理图、BSP、引脚表和外设示例。安装后的 Agent Skill 会先检查环境、整理有依据的硬件事实,再生成或移植独立的 ESP-IDF 工程并完成板级适配和编译。烧录和实机验证只有在开发者明确给出目标串口并授权后才会执行。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
当前仓库提供两个平台 Skill:
|
|
6
6
|
|
|
7
7
|
| Skill | 平台 | 主要用途 |
|
|
8
8
|
|---|---|---|
|
|
9
9
|
| `tirtc-esp32-builder` | ESP32-S3 / ESP32-P4、ESP-IDF 5.5.x | 板型识别、Hardware IR、工程生成/移植、H5/AI/设备互呼/微信 VoIP、AEC 门禁、编译烧录和分层验收 |
|
|
10
|
+
| `tirtc-beken-builder` | BK7258 / BK7259、Beken Armino | 运行时硬件探测、显示/触摸/音频/内存能力判定、小钛业务移植与实机验收 |
|
|
11
|
+
|
|
12
|
+
BK7258 多媒体项目优先从 Beken 官方 `bk_avdk_smp` 的正式
|
|
13
|
+
`release/v3.1.1.x` tag 开始;移动的 `release/v3.1.1` 分支用于需要最新
|
|
14
|
+
维护改动的开发。BK7259 使用前应按官方支持矩阵选择对应 release,不把
|
|
15
|
+
BK7258 的 BSP、分区或二进制直接套用。
|
|
10
16
|
|
|
11
17
|
H5/AI 的 ESP32-S3 托管模板、协议文档和 TiRTC SDK 已打包在独立的 ESP32 Device Kit 中,安装时会自动下载并校验。ESP32 示例源码由本仓库的 `kit-src/` 维护;设备互呼或微信 VoIP 的移植可参考其中的独立示例。ESP32-P4 使用独立发布的 `tirtc-esp32p4-kit`(小钛 P4 参考固件:hosted C6 Wi-Fi + LVGL UI + 摄像头 + P4 SDK 2.5.0),通过生成器 `--target esp32p4` 复制生成,不能复用 S3 预编译库。
|
|
12
18
|
|
|
@@ -34,6 +34,20 @@ const PLATFORMS = new Map([
|
|
|
34
34
|
summary: "ESP32-S3 / ESP-IDF 5.5.x",
|
|
35
35
|
},
|
|
36
36
|
],
|
|
37
|
+
[
|
|
38
|
+
"beken",
|
|
39
|
+
{
|
|
40
|
+
aliases: new Set([
|
|
41
|
+
"beken",
|
|
42
|
+
"bk",
|
|
43
|
+
"bk7258",
|
|
44
|
+
"bk7259",
|
|
45
|
+
"tirtc-beken-builder",
|
|
46
|
+
]),
|
|
47
|
+
skill: "tirtc-beken-builder",
|
|
48
|
+
summary: "BK7258 / BK7259 / Beken Armino",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
37
51
|
]);
|
|
38
52
|
|
|
39
53
|
function printHelp() {
|
|
@@ -50,9 +64,11 @@ Usage:
|
|
|
50
64
|
|
|
51
65
|
Platforms:
|
|
52
66
|
esp32 ESP32-S3 / ESP-IDF 5.5.x
|
|
67
|
+
beken BK7258 / BK7259 / Beken Armino
|
|
53
68
|
|
|
54
69
|
Examples:
|
|
55
70
|
npx tirtc-device-builder install esp32
|
|
71
|
+
npx tirtc-device-builder install beken
|
|
56
72
|
npx tirtc-device-builder install esp32 --client qwen-code
|
|
57
73
|
npx tirtc-device-builder setup esp32
|
|
58
74
|
npx tirtc-device-builder setup esp32 --install --client gemini
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tirtc-device-builder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Install and run TiRTC device-development Agent Skills across popular coding clients.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -38,6 +38,9 @@
|
|
|
38
38
|
"tirtc",
|
|
39
39
|
"esp32",
|
|
40
40
|
"esp-idf",
|
|
41
|
+
"beken",
|
|
42
|
+
"bk7258",
|
|
43
|
+
"bk7259",
|
|
41
44
|
"embedded",
|
|
42
45
|
"ai-intercom"
|
|
43
46
|
],
|
|
@@ -52,7 +55,7 @@
|
|
|
52
55
|
"pack:esp32-kit": "node scripts/pack-esp32-kit.js",
|
|
53
56
|
"test": "npm run test:node && npm run test:python && npm run validate && npm run validate:tarball && npm run test:package",
|
|
54
57
|
"test:node": "node --test test/*.test.js",
|
|
55
|
-
"test:python": "python3 -m unittest discover -s skills/tirtc-esp32-builder/scripts -p 'test_*.py'",
|
|
58
|
+
"test:python": "python3 -m unittest discover -s skills/tirtc-esp32-builder/scripts -p 'test_*.py' && python3 -m unittest discover -s skills/tirtc-beken-builder/scripts -p 'test_*.py'",
|
|
56
59
|
"validate": "python3 scripts/validate_package.py",
|
|
57
60
|
"validate:tarball": "node scripts/validate-tarball.js",
|
|
58
61
|
"test:package": "node scripts/test-packed-package.js",
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tirtc-beken-builder
|
|
3
|
+
description: Diagnose, port, build, flash, and validate XiaoTai/TiRTC firmware for BK7258, BK7259, and closely related Beken boards using an official Beken SDK project, board evidence, and on-device probes. Use for display/touch, microphone/speaker, Flash/RAM, media/AEC capability, or XiaoTai H5/AI/call integration; exclude ESP32 projects and unsupported guesswork from a SoC name alone.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TiRTC Beken Builder
|
|
7
|
+
|
|
8
|
+
Turn a physical BK board into an evidence-backed XiaoTai port. A probe report is
|
|
9
|
+
the boundary between documentation hypotheses and what the exact firmware saw on
|
|
10
|
+
the exact board. Never infer carrier-board wiring, fitted peripherals, or PCB
|
|
11
|
+
revision from `BK7258`/`BK7259` alone.
|
|
12
|
+
|
|
13
|
+
Read [architecture](references/architecture.md) when planning a new product or
|
|
14
|
+
explaining the platform split and delivery stages.
|
|
15
|
+
Read [BK probe research](references/bk-research.md) when selecting an SDK line,
|
|
16
|
+
implementing a probe, or checking the primary-source basis for an API.
|
|
17
|
+
|
|
18
|
+
## 1. Establish the target
|
|
19
|
+
|
|
20
|
+
1. Read this Skill's `VERSION`, then read
|
|
21
|
+
[hardware diagnostics](references/hardware-diagnostics.md) and
|
|
22
|
+
[TiRTC integration](references/tirtc-integration.md).
|
|
23
|
+
2. Record the exact board model/PCB marking, SoC, official SDK or BSP repository
|
|
24
|
+
and revision, toolchain, bootloader/partition layout, and the requested
|
|
25
|
+
XiaoTai features. Keep unavailable facts `null`.
|
|
26
|
+
3. Prefer the board vendor's working SDK project. Treat a similar board's pin
|
|
27
|
+
map only as a hypothesis. Preserve its bootloader, partition table, RF
|
|
28
|
+
calibration, secure-boot data, and factory data unless the user explicitly
|
|
29
|
+
authorizes changing them.
|
|
30
|
+
4. Inspect the selected SDK headers and examples before naming APIs. Beken SDK
|
|
31
|
+
branches differ; source-visible symbols in the pinned checkout outrank prose
|
|
32
|
+
and this Skill. Start discovery from <https://docs.bekencorp.com/> and
|
|
33
|
+
<https://github.com/bekencorp/>, then pin the concrete page and revision.
|
|
34
|
+
|
|
35
|
+
Run the read-only environment check when a checkout is available:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
python3 <skill-dir>/scripts/doctor.py --sdk-root <bk_avdk_smp>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 2. Build the diagnostic firmware
|
|
42
|
+
|
|
43
|
+
Follow [probe porting](references/probe-porting.md). Add a small diagnostic task
|
|
44
|
+
to the known-working board project and implement the adapter against that pinned
|
|
45
|
+
SDK. It emits one framed JSON object beginning with `TIRTC_BK_PROBE `.
|
|
46
|
+
|
|
47
|
+
Probe in three layers:
|
|
48
|
+
|
|
49
|
+
- **Intrinsic:** chip/revision, Flash JEDEC ID and usable partition bytes, SRAM
|
|
50
|
+
and optional PSRAM totals/free/largest block.
|
|
51
|
+
- **Enumerated:** compiled board profile, initialized LCD/touch/audio drivers,
|
|
52
|
+
controller or codec identities, buses, dimensions and advertised formats.
|
|
53
|
+
- **Active:** LCD pattern, touch coordinates, microphone capture statistics,
|
|
54
|
+
speaker test tone, simultaneous capture/playback, playback reference and AEC.
|
|
55
|
+
|
|
56
|
+
Use targeted, BSP-approved buses and addresses. Generic GPIO toggling, blind
|
|
57
|
+
bus scans, destructive Flash writes, and audio output without an explicit test
|
|
58
|
+
action are outside discovery. A linked driver is `declared`; only a successful
|
|
59
|
+
runtime transaction is `detected`, and only an active observation is `verified`.
|
|
60
|
+
|
|
61
|
+
Collect and assess the report:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
python3 <skill-dir>/scripts/bk_probe_report.py init probe-report.json
|
|
65
|
+
python3 <skill-dir>/scripts/bk_probe_report.py collect serial.log probe-report.json
|
|
66
|
+
python3 <skill-dir>/scripts/bk_probe_report.py validate probe-report.json
|
|
67
|
+
python3 <skill-dir>/scripts/bk_probe_report.py assess probe-report.json
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The probe run is complete when every required field is a measured value,
|
|
71
|
+
explicitly unsupported, or an `unknown` with a named next action. Compilation is
|
|
72
|
+
not evidence that a peripheral exists.
|
|
73
|
+
|
|
74
|
+
## 3. Decide the product shape
|
|
75
|
+
|
|
76
|
+
Read [capability rules](references/capability-rules.md). Run assessment before
|
|
77
|
+
porting business code. Preserve separate conclusions for display-only UI,
|
|
78
|
+
touch UI, button/voice control, H5 uplink, H5 talkback, AI conversation, device
|
|
79
|
+
call, and WeChat VoIP.
|
|
80
|
+
|
|
81
|
+
Do not manufacture a click UI for a display without verified touch. Prefer a
|
|
82
|
+
status/voice UI; use buttons only when the enclosure exposes enough verified
|
|
83
|
+
controls and the product interaction has an unambiguous mapping. Missing screen
|
|
84
|
+
or touch does not by itself block audio-only XiaoTai.
|
|
85
|
+
|
|
86
|
+
AI and call flows require simultaneous capture/playback, a physical playback
|
|
87
|
+
reference, and an evidenced AEC implementation. A half-duplex demo may prove
|
|
88
|
+
basic audio but cannot certify duplex conversation.
|
|
89
|
+
|
|
90
|
+
## 4. Integrate XiaoTai
|
|
91
|
+
|
|
92
|
+
Keep one process-wide TiRTC lifecycle and reuse the stable product architecture:
|
|
93
|
+
Router -> Arbiter -> Coordinator. SDK callbacks copy bounded events and return;
|
|
94
|
+
one state-owning task performs HTTP/MQTT, connection lifecycle, generation
|
|
95
|
+
checks and monotonic deadlines.
|
|
96
|
+
|
|
97
|
+
Put LCD/touch, microphone, codec, amplifier, audio DMA, camera, buttons, memory
|
|
98
|
+
pools and AEC behind a Beken board adapter. Keep service discovery, credentials,
|
|
99
|
+
stream IDs, negotiated formats and H5/AI/CALL/VOIP state outside board code.
|
|
100
|
+
|
|
101
|
+
First prove business protocol behavior with the repository's Linux C reference
|
|
102
|
+
when it is available. Then bind the pinned Beken TiRTC library/header and build
|
|
103
|
+
contract. If no compatible Beken TiRTC binary exists, report `BLOCKED_SDK_ABI`;
|
|
104
|
+
do not substitute an ESP32 archive or claim source compatibility.
|
|
105
|
+
|
|
106
|
+
## 5. Build and verify
|
|
107
|
+
|
|
108
|
+
Build with the exact vendor toolchain and board project. Record the application
|
|
109
|
+
artifact path, version, byte size and SHA-256. Flash only after the user names
|
|
110
|
+
the exact device and authorizes it; preserve factory partitions by default.
|
|
111
|
+
|
|
112
|
+
Re-run the diagnostic report in the same product firmware because standalone
|
|
113
|
+
probe results do not prove final memory margin or driver coexistence. Verify
|
|
114
|
+
startup, network/onboarding, local media, each requested XiaoTai flow, session
|
|
115
|
+
switching/recovery, weak network, and stability separately. Bind runtime results
|
|
116
|
+
to the exact artifact SHA-256 and mark each `PASS`, `FAIL`, or `SKIP`.
|
|
117
|
+
|
|
118
|
+
Return the pinned SDK/BSP revision, probe report, contradictions, capability
|
|
119
|
+
matrix, integration changes, exact artifact identity, HIL results, and remaining
|
|
120
|
+
blockers. Promote a board profile for reuse only after the exact PCB revision
|
|
121
|
+
and its required active probes pass.
|
|
122
|
+
|
|
123
|
+
## Security boundary
|
|
124
|
+
|
|
125
|
+
Keep device keys, Wi-Fi passwords, MQTT/WHIP tokens, certificates, calibration
|
|
126
|
+
data, MAC-derived identifiers and captured user audio outside source and reports.
|
|
127
|
+
Redact logs. Downloads, account access, flashing, erasing, factory-partition
|
|
128
|
+
changes and publishing a reusable board profile retain separate authorization.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.11.0
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#include "tirtc_bk_probe.h"
|
|
2
|
+
|
|
3
|
+
#include <driver/flash.h>
|
|
4
|
+
#include <driver/lcd.h>
|
|
5
|
+
#include <driver/tp.h>
|
|
6
|
+
#include <modules/chip_support.h>
|
|
7
|
+
#include <os/os.h>
|
|
8
|
+
|
|
9
|
+
#if CONFIG_SOC_BK7258
|
|
10
|
+
#define TIRTC_BK_SOC "BK7258"
|
|
11
|
+
#else
|
|
12
|
+
#error "this probe asset is for the BK7258 bk_avdk_smp v3.1.1 line"
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
__attribute__((weak)) const void *tirtc_bk_probe_active_lcd(void)
|
|
16
|
+
{
|
|
17
|
+
return NULL;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
__attribute__((weak)) bool tirtc_bk_probe_audio(tirtc_bk_audio_snapshot_t *out)
|
|
21
|
+
{
|
|
22
|
+
(void)out;
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
__attribute__((weak)) uint32_t tirtc_bk_probe_application_usable_bytes(void)
|
|
27
|
+
{
|
|
28
|
+
return 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static const char *test_name(tirtc_bk_test_t value)
|
|
32
|
+
{
|
|
33
|
+
switch (value) {
|
|
34
|
+
case TIRTC_BK_TEST_PASS:
|
|
35
|
+
return "pass";
|
|
36
|
+
case TIRTC_BK_TEST_FAIL:
|
|
37
|
+
return "fail";
|
|
38
|
+
default:
|
|
39
|
+
return "not_run";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static void emit_endpoint(const tirtc_bk_audio_endpoint_t *endpoint)
|
|
44
|
+
{
|
|
45
|
+
if (!endpoint->present) {
|
|
46
|
+
os_printf("{\"state\":\"unknown\",\"method\":null,\"source\":null,"
|
|
47
|
+
"\"channels\":null,\"sample_rates_hz\":[],\"sample_bits\":[],"
|
|
48
|
+
"\"formats\":[],\"test\":\"not_run\"}");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
os_printf("{\"state\":\"detected\",\"method\":\"board_audio_adapter\","
|
|
52
|
+
"\"source\":\"pinned-bsp\",\"channels\":%u,"
|
|
53
|
+
"\"sample_rates_hz\":[%u],\"sample_bits\":[%u],"
|
|
54
|
+
"\"formats\":[\"pcm_s16le\"],\"test\":\"%s\"}",
|
|
55
|
+
endpoint->channels, (unsigned)endpoint->sample_rate_hz,
|
|
56
|
+
endpoint->sample_bits, test_name(endpoint->test));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
void tirtc_bk_probe_emit(void)
|
|
60
|
+
{
|
|
61
|
+
const lcd_device_t *lcd = (const lcd_device_t *)tirtc_bk_probe_active_lcd();
|
|
62
|
+
tp_device_t *tp = bk_tp_get_device();
|
|
63
|
+
tirtc_bk_audio_snapshot_t audio = {0};
|
|
64
|
+
bool has_audio = tirtc_bk_probe_audio(&audio);
|
|
65
|
+
uint32_t app_bytes = tirtc_bk_probe_application_usable_bytes();
|
|
66
|
+
|
|
67
|
+
os_printf("TIRTC_BK_PROBE {");
|
|
68
|
+
os_printf("\"schema_version\":1,\"artifact_sha256\":null,");
|
|
69
|
+
os_printf("\"identity\":{\"soc\":\"%s\",\"chip_revision\":\"%u\","
|
|
70
|
+
"\"board_model\":null,\"pcb_revision\":null,"
|
|
71
|
+
"\"sdk\":{\"name\":\"bk_avdk_smp\",\"version\":null,"
|
|
72
|
+
"\"revision\":null},\"board_config_sha256\":null},",
|
|
73
|
+
TIRTC_BK_SOC, (unsigned)bk_get_hardware_chip_id_version());
|
|
74
|
+
os_printf("\"flash\":{\"state\":\"measured\","
|
|
75
|
+
"\"method\":\"bk_flash_get_id/current_total_size\","
|
|
76
|
+
"\"source\":\"runtime\",\"jedec_id\":\"0x%08x\","
|
|
77
|
+
"\"recognized\":null,\"physical_bytes\":null,"
|
|
78
|
+
"\"mapped_bytes\":%u,\"application_usable_bytes\":",
|
|
79
|
+
(unsigned)bk_flash_get_id(),
|
|
80
|
+
(unsigned)bk_flash_get_current_total_size());
|
|
81
|
+
if (app_bytes) {
|
|
82
|
+
os_printf("%u},", (unsigned)app_bytes);
|
|
83
|
+
} else {
|
|
84
|
+
os_printf("null},");
|
|
85
|
+
}
|
|
86
|
+
os_printf("\"memory\":{\"internal_sram\":{\"state\":\"measured\","
|
|
87
|
+
"\"total_bytes\":%u,\"free_boot_bytes\":%u,"
|
|
88
|
+
"\"minimum_free_bytes\":%u,\"largest_free_block_bytes\":null},",
|
|
89
|
+
(unsigned)rtos_get_total_heap_size(),
|
|
90
|
+
(unsigned)rtos_get_free_heap_size(),
|
|
91
|
+
(unsigned)rtos_get_minimum_free_heap_size());
|
|
92
|
+
os_printf("\"psram\":{\"state\":\"measured\",\"present\":%s,"
|
|
93
|
+
"\"total_bytes\":%u,\"free_boot_bytes\":%u,"
|
|
94
|
+
"\"minimum_free_bytes\":%u,\"largest_free_block_bytes\":null}},",
|
|
95
|
+
rtos_get_psram_total_heap_size() ? "true" : "false",
|
|
96
|
+
(unsigned)rtos_get_psram_total_heap_size(),
|
|
97
|
+
(unsigned)rtos_get_psram_free_heap_size(),
|
|
98
|
+
(unsigned)rtos_get_psram_minimum_free_heap_size());
|
|
99
|
+
|
|
100
|
+
if (lcd) {
|
|
101
|
+
os_printf("\"display\":{\"state\":\"detected\","
|
|
102
|
+
"\"method\":\"active-board-lcd\",\"source\":\"pinned-bsp\","
|
|
103
|
+
"\"controller\":null,\"bus\":null,\"width_px\":%u,"
|
|
104
|
+
"\"height_px\":%u,\"width_mm\":null,\"height_mm\":null,"
|
|
105
|
+
"\"pixel_format\":null,\"test\":\"not_run\"},",
|
|
106
|
+
lcd->width, lcd->height);
|
|
107
|
+
} else {
|
|
108
|
+
os_printf("\"display\":{\"state\":\"unknown\",\"method\":null,"
|
|
109
|
+
"\"source\":null,\"controller\":null,\"bus\":null,"
|
|
110
|
+
"\"width_px\":null,\"height_px\":null,\"width_mm\":null,"
|
|
111
|
+
"\"height_mm\":null,\"pixel_format\":null,"
|
|
112
|
+
"\"test\":\"not_run\"},");
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (tp) {
|
|
116
|
+
os_printf("\"touch\":{\"state\":\"detected\","
|
|
117
|
+
"\"method\":\"bk_tp_get_device\",\"source\":\"runtime\","
|
|
118
|
+
"\"controller\":null,\"bus\":\"i2c\",\"points\":%u,"
|
|
119
|
+
"\"test\":\"not_run\"},", tp->tp_num);
|
|
120
|
+
} else {
|
|
121
|
+
os_printf("\"touch\":{\"state\":\"unknown\",\"method\":null,"
|
|
122
|
+
"\"source\":null,\"controller\":null,\"bus\":null,"
|
|
123
|
+
"\"points\":null,\"test\":\"not_run\"},");
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
os_printf("\"camera\":{\"state\":\"unknown\",\"method\":null,"
|
|
127
|
+
"\"source\":null,\"sensor\":null,\"output_profiles\":[],"
|
|
128
|
+
"\"test\":\"not_run\"},\"audio\":{\"microphone\":");
|
|
129
|
+
emit_endpoint(&audio.microphone);
|
|
130
|
+
os_printf(",\"speaker\":");
|
|
131
|
+
emit_endpoint(&audio.speaker);
|
|
132
|
+
if (has_audio) {
|
|
133
|
+
os_printf(",\"duplex\":{\"simultaneous\":%s,\"playback_reference\":%s,"
|
|
134
|
+
"\"aec_available\":%s,\"aec_test\":\"%s\"}},",
|
|
135
|
+
audio.simultaneous ? "true" : "false",
|
|
136
|
+
audio.playback_reference ? "true" : "false",
|
|
137
|
+
audio.aec_available ? "true" : "false",
|
|
138
|
+
test_name(audio.aec_test));
|
|
139
|
+
} else {
|
|
140
|
+
os_printf(",\"duplex\":{\"simultaneous\":null,"
|
|
141
|
+
"\"playback_reference\":null,\"aec_available\":null,"
|
|
142
|
+
"\"aec_test\":\"not_run\"}},");
|
|
143
|
+
}
|
|
144
|
+
os_printf("\"controls\":{\"verified_buttons\":0,"
|
|
145
|
+
"\"intent_map_approved\":false},\"integration\":{"
|
|
146
|
+
"\"tirtc_sdk_compatible\":null,\"audio_uplink_pipeline\":null,"
|
|
147
|
+
"\"audio_downlink_pipeline\":null,\"video_uplink_pipeline\":null,"
|
|
148
|
+
"\"session_arbiter\":null,\"device_call_protocol\":null,"
|
|
149
|
+
"\"wechat_voip_protocol\":null},\"requested_features\":[],"
|
|
150
|
+
"\"issues\":[]}\r\n");
|
|
151
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <stdbool.h>
|
|
4
|
+
#include <stdint.h>
|
|
5
|
+
|
|
6
|
+
typedef enum {
|
|
7
|
+
TIRTC_BK_TEST_NOT_RUN = 0,
|
|
8
|
+
TIRTC_BK_TEST_PASS,
|
|
9
|
+
TIRTC_BK_TEST_FAIL,
|
|
10
|
+
} tirtc_bk_test_t;
|
|
11
|
+
|
|
12
|
+
typedef struct {
|
|
13
|
+
bool present;
|
|
14
|
+
uint8_t channels;
|
|
15
|
+
uint32_t sample_rate_hz;
|
|
16
|
+
uint8_t sample_bits;
|
|
17
|
+
tirtc_bk_test_t test;
|
|
18
|
+
} tirtc_bk_audio_endpoint_t;
|
|
19
|
+
|
|
20
|
+
typedef struct {
|
|
21
|
+
tirtc_bk_audio_endpoint_t microphone;
|
|
22
|
+
tirtc_bk_audio_endpoint_t speaker;
|
|
23
|
+
bool simultaneous;
|
|
24
|
+
bool playback_reference;
|
|
25
|
+
bool aec_available;
|
|
26
|
+
tirtc_bk_test_t aec_test;
|
|
27
|
+
} tirtc_bk_audio_snapshot_t;
|
|
28
|
+
|
|
29
|
+
/* Override these weak hooks in the exact board project. Returning NULL/false
|
|
30
|
+
* preserves unknown rather than claiming that a peripheral is absent. */
|
|
31
|
+
const void *tirtc_bk_probe_active_lcd(void);
|
|
32
|
+
bool tirtc_bk_probe_audio(tirtc_bk_audio_snapshot_t *out);
|
|
33
|
+
uint32_t tirtc_bk_probe_application_usable_bytes(void);
|
|
34
|
+
|
|
35
|
+
/* Run after board peripheral initialization. Active speaker/touch tests remain
|
|
36
|
+
* explicit board commands; this snapshot never plays audio or writes Flash. */
|
|
37
|
+
void tirtc_bk_probe_emit(void);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
请使用 `$tirtc-beken-builder` 诊断并接入这块 BK 开发板。
|
|
2
|
+
|
|
3
|
+
- 厂商、完整型号、PCB 丝印/版本:
|
|
4
|
+
- SoC(BK7258/BK7259/其他):
|
|
5
|
+
- 官方 SDK/BSP 路径、仓库 revision:
|
|
6
|
+
- 原理图、BOM、屏幕/触摸/音频器件资料:
|
|
7
|
+
- 已经能运行的 LCD、触摸、录音、播放示例:
|
|
8
|
+
- 目标功能:H5 音频/视频/对讲、AI 对话、设备互呼、微信 VoIP:
|
|
9
|
+
- 输出工程目录:
|
|
10
|
+
|
|
11
|
+
请先实现并运行程序探测,输出 `probe-report.json`:芯片、Flash、内部
|
|
12
|
+
RAM/PSRAM、显示分辨率与主动色块测试、触摸控制器与坐标测试、麦克风
|
|
13
|
+
实际采集格式与统计、扬声器测试、全双工/回采参考/AEC。把 BSP 声明、
|
|
14
|
+
运行时检出和主动实测分开;未知项不要猜。随后按能力矩阵决定小钛产品
|
|
15
|
+
形态并完成可安全执行的移植和构建。本轮未明确授权时不要烧录、擦除或
|
|
16
|
+
改写工厂分区,不要把凭证或用户音频写入仓库和报告。
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"artifact_sha256": null,
|
|
4
|
+
"identity": {
|
|
5
|
+
"soc": "BK7258",
|
|
6
|
+
"chip_revision": null,
|
|
7
|
+
"board_model": null,
|
|
8
|
+
"pcb_revision": null,
|
|
9
|
+
"sdk": {"name": "Beken SDK", "version": null, "revision": null},
|
|
10
|
+
"board_config_sha256": null
|
|
11
|
+
},
|
|
12
|
+
"flash": {
|
|
13
|
+
"state": "unknown",
|
|
14
|
+
"method": null,
|
|
15
|
+
"source": null,
|
|
16
|
+
"jedec_id": null,
|
|
17
|
+
"recognized": null,
|
|
18
|
+
"physical_bytes": null,
|
|
19
|
+
"mapped_bytes": null,
|
|
20
|
+
"application_usable_bytes": null
|
|
21
|
+
},
|
|
22
|
+
"memory": {
|
|
23
|
+
"internal_sram": {"state": "unknown", "total_bytes": null, "free_boot_bytes": null, "minimum_free_bytes": null, "largest_free_block_bytes": null},
|
|
24
|
+
"psram": {"state": "unknown", "present": null, "total_bytes": null, "free_boot_bytes": null, "minimum_free_bytes": null, "largest_free_block_bytes": null}
|
|
25
|
+
},
|
|
26
|
+
"display": {
|
|
27
|
+
"state": "unknown",
|
|
28
|
+
"method": null,
|
|
29
|
+
"source": null,
|
|
30
|
+
"controller": null,
|
|
31
|
+
"bus": null,
|
|
32
|
+
"width_px": null,
|
|
33
|
+
"height_px": null,
|
|
34
|
+
"width_mm": null,
|
|
35
|
+
"height_mm": null,
|
|
36
|
+
"pixel_format": null,
|
|
37
|
+
"test": "not_run"
|
|
38
|
+
},
|
|
39
|
+
"touch": {
|
|
40
|
+
"state": "unknown",
|
|
41
|
+
"method": null,
|
|
42
|
+
"source": null,
|
|
43
|
+
"controller": null,
|
|
44
|
+
"bus": null,
|
|
45
|
+
"points": null,
|
|
46
|
+
"test": "not_run"
|
|
47
|
+
},
|
|
48
|
+
"camera": {
|
|
49
|
+
"state": "unknown",
|
|
50
|
+
"method": null,
|
|
51
|
+
"source": null,
|
|
52
|
+
"sensor": null,
|
|
53
|
+
"output_profiles": [],
|
|
54
|
+
"test": "not_run"
|
|
55
|
+
},
|
|
56
|
+
"audio": {
|
|
57
|
+
"microphone": {"state": "unknown", "method": null, "source": null, "channels": null, "sample_rates_hz": [], "sample_bits": [], "formats": [], "test": "not_run"},
|
|
58
|
+
"speaker": {"state": "unknown", "method": null, "source": null, "channels": null, "sample_rates_hz": [], "sample_bits": [], "formats": [], "test": "not_run"},
|
|
59
|
+
"duplex": {"simultaneous": null, "playback_reference": null, "aec_available": null, "aec_test": "not_run"}
|
|
60
|
+
},
|
|
61
|
+
"controls": {"verified_buttons": 0, "intent_map_approved": false},
|
|
62
|
+
"integration": {
|
|
63
|
+
"tirtc_sdk_compatible": null,
|
|
64
|
+
"audio_uplink_pipeline": null,
|
|
65
|
+
"audio_downlink_pipeline": null,
|
|
66
|
+
"video_uplink_pipeline": null,
|
|
67
|
+
"session_arbiter": null,
|
|
68
|
+
"device_call_protocol": null,
|
|
69
|
+
"wechat_voip_protocol": null
|
|
70
|
+
},
|
|
71
|
+
"requested_features": [],
|
|
72
|
+
"issues": []
|
|
73
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# BK7258/BK7259 XiaoTai architecture
|
|
2
|
+
|
|
3
|
+
This is the implementation plan delivered with the Skill.
|
|
4
|
+
|
|
5
|
+
## Platform boundary
|
|
6
|
+
|
|
7
|
+
Keep Beken in an independent Skill because its SDK, AP/CP image layout,
|
|
8
|
+
toolchain, partitions, media drivers and binary ABI differ from ESP32. Reuse
|
|
9
|
+
Hardware IR ideas, evidence grades, the business state model and acceptance
|
|
10
|
+
levels; do not reuse ESP-IDF board code or an ESP32 TiRTC archive.
|
|
11
|
+
|
|
12
|
+
BK7258 multimedia work starts from official `bk_avdk_smp`. Pin a formal
|
|
13
|
+
`release/v3.1.1.x` tag and match the upper solution tag. Use the moving
|
|
14
|
+
`release/v3.1.1` branch only to evaluate newer maintenance changes. Select
|
|
15
|
+
BK7259 from its own official support matrix and release line.
|
|
16
|
+
|
|
17
|
+
## Diagnostic pipeline
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
documents/schematic/BSP declaration
|
|
21
|
+
-> compiled driver registry
|
|
22
|
+
-> read-only runtime probe
|
|
23
|
+
-> bounded active tests
|
|
24
|
+
-> probe-report.json
|
|
25
|
+
-> UI/media/business capability matrix
|
|
26
|
+
-> Beken adapter + XiaoTai runtime
|
|
27
|
+
-> artifact-bound HIL
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Use `unknown`, `declared`, `detected`, `measured`, `verified`, and
|
|
31
|
+
`unsupported`. Documentation never becomes runtime proof. Preserve
|
|
32
|
+
contradictions and bind active evidence to exact board and firmware identity.
|
|
33
|
+
|
|
34
|
+
## Product decisions
|
|
35
|
+
|
|
36
|
+
- A verified display with verified touch may expose a touch UI.
|
|
37
|
+
- A verified display without verified touch exposes status, QR or animation;
|
|
38
|
+
it has no click targets.
|
|
39
|
+
- Buttons are used only when the physical controls and intent map are verified.
|
|
40
|
+
Otherwise select voice/headless interaction.
|
|
41
|
+
- Audio-only XiaoTai remains valid without a display.
|
|
42
|
+
- AI conversation and call/VoIP require simultaneous capture/playback, a real
|
|
43
|
+
playback reference and AEC verified in far-end, near-end and double-talk.
|
|
44
|
+
|
|
45
|
+
Flash detection reports JEDEC identity, physical bytes and separately usable
|
|
46
|
+
application-partition bytes. Memory reports internal SRAM and PSRAM separately,
|
|
47
|
+
including boot free, minimum free and largest block where supported. Repeat
|
|
48
|
+
measurements in the final firmware's worst requested session.
|
|
49
|
+
|
|
50
|
+
## Integration seam
|
|
51
|
+
|
|
52
|
+
Stable modules own provisioning/binding, service discovery, one TiRTC lifecycle,
|
|
53
|
+
HTTP/MQTT, stream contracts, Router -> Arbiter -> Coordinator, generations and
|
|
54
|
+
deadlines. The Beken adapter owns LCD/touch, audio/camera DMA, codecs, amplifier,
|
|
55
|
+
buttons, memory pools and the AEC reference path. Callbacks enqueue bounded
|
|
56
|
+
copies; the state-owning task performs lifecycle and network work.
|
|
57
|
+
|
|
58
|
+
Before porting, obtain a TiRTC header/library or source package matching the
|
|
59
|
+
Beken CPU ABI, compiler, C library, RTOS and TLS/network stack. With no matching
|
|
60
|
+
package, diagnosis may complete but integration is `BLOCKED_SDK_ABI`.
|
|
61
|
+
|
|
62
|
+
## Delivery stages
|
|
63
|
+
|
|
64
|
+
1. Run Doctor against the pinned SDK.
|
|
65
|
+
2. Add the supplied v3.1.1 read-only probe component and board hooks.
|
|
66
|
+
3. Run LCD/touch/capture/playback/duplex active tests and assess the JSON report.
|
|
67
|
+
4. Prove business protocols with the Linux C reference.
|
|
68
|
+
5. Port the Beken adapter and compatible TiRTC package.
|
|
69
|
+
6. Build, hash, and rerun resource/probe measurements in the final image.
|
|
70
|
+
7. With explicit authorization, flash the exact board and verify each requested
|
|
71
|
+
flow, switching, reconnect, weak network and stability.
|
|
72
|
+
|
|
73
|
+
The shipped implementation is a reusable diagnosis and decision framework. A
|
|
74
|
+
concrete board still needs its exact model/PCB revision, BSP, pin map or
|
|
75
|
+
schematic, requested businesses and a compatible TiRTC SDK package.
|