tirtc-device-builder 0.11.0 → 0.11.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tirtc-device-builder",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "Codex workflows for building and validating TiRTC device firmware across supported chip platforms.",
5
5
  "author": {
6
6
  "name": "TangeAI",
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  This project follows Semantic Versioning.
4
4
 
5
+ ## 0.11.1
6
+
7
+ - Pin the BK7258 public baseline to the official Gitee
8
+ `release/v3.1.1.8` tag at commit
9
+ `1cfd56af09a3cb6470f35f1e0c604035ed1b6ee7`; explicitly classify the local
10
+ `3.1.1.8-20260605` GitLab delivery as modified reference material only.
11
+ - Add artifact-derived LCKFB BK7258 XiaoTai gates for ABI/TLS identity,
12
+ AP/CP cache provenance, internal-memory budgets, asynchronous credential
13
+ lifetime, protocol exactness, media truthfulness and hardware acceptance.
14
+ - Define conventional ERROR/WARN/INFO/DEBUG logging: release builds default to
15
+ INFO without complete wire payloads, while controlled DEBUG builds expose
16
+ complete HTTP, MQTT and TiRTC/WHIP inputs and results for integration work.
17
+
5
18
  ## 0.11.0
6
19
 
7
20
  - Add the `tirtc-beken-builder` Skill and CLI platform aliases for BK7258 and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tirtc-device-builder",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "Install and run TiRTC device-development Agent Skills across popular coding clients.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -14,6 +14,10 @@ Read [architecture](references/architecture.md) when planning a new product or
14
14
  explaining the platform split and delivery stages.
15
15
  Read [BK probe research](references/bk-research.md) when selecting an SDK line,
16
16
  implementing a probe, or checking the primary-source basis for an API.
17
+ Read [LCKFB BK7258 lessons](references/lckfb-bk7258-lessons.md) before porting
18
+ XiaoTai/TiRTC to BK7258, reviewing a BK7258 product project, or accepting its
19
+ build. Apply the gates to the target's evidence; copy the case-study constants
20
+ only when its board, SDK and binary identities match.
17
21
 
18
22
  ## 1. Establish the target
19
23
 
@@ -29,8 +33,12 @@ implementing a probe, or checking the primary-source basis for an API.
29
33
  authorizes changing them.
30
34
  4. Inspect the selected SDK headers and examples before naming APIs. Beken SDK
31
35
  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.
36
+ and this Skill. Start discovery from <https://docs.bekencorp.com/>,
37
+ <https://github.com/bekencorp/> and the official Gitee mirror. For the
38
+ reproducible BK7258 Kit baseline, use official Gitee tag
39
+ `release/v3.1.1.8` at commit
40
+ `1cfd56af09a3cb6470f35f1e0c604035ed1b6ee7`. A locally delivered
41
+ `3.1.1.8-20260605` tree is modified reference material, not that baseline.
34
42
 
35
43
  Run the read-only environment check when a checkout is available:
36
44
 
@@ -103,6 +111,12 @@ when it is available. Then bind the pinned Beken TiRTC library/header and build
103
111
  contract. If no compatible Beken TiRTC binary exists, report `BLOCKED_SDK_ABI`;
104
112
  do not substitute an ESP32 archive or claim source compatibility.
105
113
 
114
+ For BK7258 TiRTC product work, run the case-study gates for AP/CP ownership,
115
+ toolchain and TLS ABI identity, clock/signing order, exact HTTP methods,
116
+ asynchronous credential lifetime, failed-connection draining, internal-SRAM
117
+ headroom and capability-report truthfulness. A successful link is not an ABI or
118
+ runtime-media pass.
119
+
106
120
  ## 5. Build and verify
107
121
 
108
122
  Build with the exact vendor toolchain and board project. Record the application
@@ -120,9 +134,15 @@ matrix, integration changes, exact artifact identity, HIL results, and remaining
120
134
  blockers. Promote a board profile for reuse only after the exact PCB revision
121
135
  and its required active probes pass.
122
136
 
123
- ## Security boundary
137
+ ## Security and logging boundary
124
138
 
125
139
  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.
140
+ data, MAC-derived identifiers, captured user audio and captured logs outside
141
+ source control and generated reports. Use the conventional `ERROR`, `WARN`,
142
+ `INFO`, `DEBUG` levels. Product/release firmware defaults to `INFO` and does not
143
+ print complete network request or response payloads. A deliberately enabled
144
+ `DEBUG` build may print complete HTTP, MQTT and TiRTC/WHIP inputs and results,
145
+ including authorization values, for controlled integration work; handle that
146
+ output as sensitive development data and return the build to `INFO` before
147
+ release. Downloads, account access, flashing, erasing, factory-partition changes
148
+ and publishing a reusable board profile retain separate authorization.
@@ -1 +1 @@
1
- 0.11.0
1
+ 0.11.1
@@ -22,10 +22,19 @@ Beken 官方 `bk_idk` README 要求使用 release 分支/tag,而不是随意
22
22
 
23
23
  本次直接核对了:
24
24
 
25
- - BK7258:`bk_avdk_smp release/v3.1.1`,提交 `993df5647f084551a677a2bc741b200cfd75d5f2`;
25
+ - BK7258 Kit 的公开复现基准:官方 Gitee `bk_avdk_smp`
26
+ `release/v3.1.1.8`,提交
27
+ `1cfd56af09a3cb6470f35f1e0c604035ed1b6ee7`;下文固定到
28
+ `993df5647f084551a677a2bc741b200cfd75d5f2` 的链接是早期
29
+ `release/v3.1.1` API 调研证据,不能替代 Kit 的版本基准;
26
30
  - BK7259:`bk_avdk_smp release/v4.0.1`,提交 `584b947920c414230f9909375f008e7d6a2c6c6b`,该提交包含 `bk7259_ap` SoC/BSP、BK7259 音频库、显示与触控实现,可作为公开可复现基线。[BK7259 defconfig](https://github.com/bekencorp/bk_avdk_smp/blob/584b947920c414230f9909375f008e7d6a2c6c6b/ap/middleware/soc/bk7259_ap/bk7259_ap.defconfig) [BK7259 音频能力头](https://github.com/bekencorp/bk_avdk_smp/blob/584b947920c414230f9909375f008e7d6a2c6c6b/ap/include/soc/bk7259/aud_cap.h)
27
31
 
28
- 因此建议 skill 把 SDK baseline 固定为 tag/commit,并为 BK7258 v3.1.1 与 BK7259 v4.0.1 分设 adapter。不要假定两个版本的目录和显示 API 完全相同:v4 已把 panel 注册进一步改为 linker-section 模式。
32
+ 本机名为 `bk_avdk_smp_v3.1.1.8_20260605` 的 GitLab 交付目录含私有
33
+ Tange 组件及音频、DVP、H.264、lwIP、编译选项和工程配置差异,只作为
34
+ 问题案例参考,不能作为公开基准或声称与 Gitee 标签等同。因此 skill 把
35
+ SDK baseline 固定为 tag/commit,并为 BK7258 v3.1.1.8 与 BK7259 v4.0.1
36
+ 分设 adapter。不要假定两个版本的目录和显示 API 完全相同:v4 已把
37
+ panel 注册进一步改为 linker-section 模式。
29
38
 
30
39
  ## 已确认的可探测能力
31
40
 
@@ -127,7 +136,9 @@ skill 流程:识别 SDK/tag 与 target → 导入/生成 board profile → 构
127
136
 
128
137
  ## 推荐落地顺序
129
138
 
130
- 1. 首版支持两条固定基线:BK7258 `v3.1.1.x`、BK7259 `v4.0.1.x`;
139
+ 1. 首版支持两条固定基线:BK7258 官方 Gitee `release/v3.1.1.8`
140
+ (`1cfd56af09a3cb6470f35f1e0c604035ed1b6ee7`) 与 BK7259
141
+ `release/v4.0.1`;
131
142
  2. 先实现 Flash/heap/PSRAM/touch 与 manifest,因这些已有明确官方 API;
132
143
  3. 再实现 profile 驱动的 LCD ID/readback + test pattern;
133
144
  4. 实现 audio format sweep、录音统计与安全声学回环;
@@ -0,0 +1,152 @@
1
+ # LCKFB BK7258 XiaoTai lessons
2
+
3
+ Use this case study for BK7258 XiaoTai/TiRTC ports and reviews. It distils the
4
+ failures fixed in `lckfb-bk7258-xiaotai` through source commit `8a156ff`. These
5
+ are gates, not a generic board profile: retain the decisions, but use the exact
6
+ numbers only when the target matches the identity below.
7
+
8
+ ## Identity gate
9
+
10
+ The reproducible public SDK baseline is:
11
+
12
+ - default LCKFB BK7258 board;
13
+ - official Beken Gitee repository `bekencorp/bk_avdk_smp`, tag
14
+ `release/v3.1.1.8`, commit
15
+ `1cfd56af09a3cb6470f35f1e0c604035ed1b6ee7`;
16
+ - GCC Arm None EABI 10.3.1, Cortex-M33, hard-float;
17
+ - TiRTC-Nano 2.3.0 `mini`, BK7258 hard-float archive;
18
+ - TiRTC build metadata reporting Mbed TLS 2.25.0, linked with the project's
19
+ BK7258 Mbed TLS 2.28.5 compatibility archive;
20
+ - AP + CP + bootloader package and 16 MiB PSRAM.
21
+
22
+ The locally delivered folder named `bk_avdk_smp_v3.1.1.8_20260605` contains a
23
+ private Tange component and changes to audio, DVP, H.264, lwIP, build options and
24
+ project configuration. It is useful only as implementation and fault-history
25
+ evidence. Do not identify it as the public tag, use it for SDK checksums, or make
26
+ it the default Kit source.
27
+
28
+ Hash the TiRTC and compatibility archives and record the SDK commit, compiler,
29
+ float ABI, libc/RTOS and partition maps. AP-only or CP-only output is diagnostic;
30
+ the deliverable is the combined package. A different value makes a new artifact
31
+ that must pass link, DTLS/WHIP and hardware validation again. Disable the SMP
32
+ SDK's ABI-incompatible PSA Mbed TLS 3 path when using this TiRTC package.
33
+ Treat the AP and CP CMake caches as part of the SDK identity: both the cached
34
+ toolchain path and `beken-armino_SOURCE_DIR` must point inside the selected
35
+ official checkout. Reject or clean a cache created by the local modified SDK;
36
+ otherwise a nominally successful package can silently mix SDK implementations.
37
+
38
+ ## Board truth gate
39
+
40
+ The demonstrated LCKFB board uses a 320x240 ST7789V2 SPI display in landscape,
41
+ an active-low KEY on GPIO7, onboard microphone/speaker paths, an 8 MiB Flash and
42
+ 16 MiB PSRAM. It has no fitted touch controller. The optional FT6336 code and
43
+ simulated-I2C GPIO42/43 profile describe a later product board; their presence
44
+ in the source is not evidence of touch on the LCKFB board.
45
+
46
+ Check the actual LCD bus/pin profile before debugging pixels, then validate
47
+ panel rotation and touch rotation independently. On this board expose status,
48
+ AI and call state plus the verified KEY actions; keep touch-only contact, room
49
+ and settings navigation disabled.
50
+
51
+ ## Resource gate
52
+
53
+ Physical capacity did not predict product viability:
54
+
55
+ - 8 MiB Flash was constrained by the AP code partition, not total Flash. The
56
+ demonstrated layout uses 1904 KiB AP code, 1360 KiB CP code and a 680 KiB
57
+ resource partition; a full roughly 1 MiB CJK font still does not fit the
58
+ intended UI budget. Use a product glyph subset and measure the linked image.
59
+ - TiRTC/DTLS needs internal SRAM and sufficiently large contiguous blocks;
60
+ free PSRAM does not replace them. The project reclaimed SRAM by reducing the
61
+ single-session lwIP heap to 80 KiB and TCP send/window sizes to 22 MSS, then
62
+ measured the final workload. Those values are evidence for this product, not
63
+ defaults for every board.
64
+ - Reserve the roughly 80 KiB DVP/H.264 controller block before network/TiRTC
65
+ fragmentation. Place eligible supervisor/task storage in PSRAM while keeping
66
+ DMA/internal-only objects in the correct region.
67
+ - Size deep WebClient/TLS call stacks from high-water evidence. Move large URL,
68
+ authorization and credential buffers off the control-task stack with bounded
69
+ heap ownership. The demonstrated control and bootstrap tasks required more
70
+ headroom than the original 8 KiB assumptions.
71
+ - Keep `CONFIG_LWIP_MEM_STATS` and `CONFIG_LWIP_MEMP_STATS` enabled when the
72
+ selected AVDK allocator references their fields; removing apparently unused
73
+ statistics can break the build.
74
+
75
+ Report boot, post-driver and worst-session internal free/minimum/largest block,
76
+ PSRAM free/minimum/largest block and every static partition/image size. Reject
77
+ the build when only aggregate free bytes are known.
78
+
79
+ ## Platform and protocol gate
80
+
81
+ Lock these semantics with host contract tests instead of rediscovering them on
82
+ hardware:
83
+
84
+ - synchronize network time in the current boot before signed requests or
85
+ TiRTC startup; bridge newlib `_gettimeofday()` to the AON RTC when the SDK
86
+ otherwise links the failing libnosys stub;
87
+ - preserve the platform's exact MAC text/client identity and route product APIs
88
+ through the discovered `device`, `ai`, `call` and `voip` services;
89
+ - preserve HTTP method and body identity: the device-token operation is an
90
+ empty-body POST, not GET and not `{}`. In the demonstrated AVDK WebClient,
91
+ `webclient_post(..., NULL, 0)` also requires explicit response handling;
92
+ - configure the send buffer before `TiRtcInit`, initialize/start one TiRTC
93
+ process, and pass SDK option string lengths with the exact convention used by
94
+ the matching headers/reference. For TiRTC 2.3.0 here, string lengths exclude
95
+ the trailing NUL;
96
+ - treat a positive `TIRTC_OPT_TGTRP_POLL_TIMEOUT` return as the applied timeout,
97
+ not a failure. A false retry loop repeatedly initialized/uninitialized SDK
98
+ task state;
99
+ - retain WHIP peer descriptors and bearer tokens in bounded storage until the
100
+ asynchronous callback completes. Pointers into a freed JSON tree are invalid;
101
+ - keep one outgoing connect in flight. A failed or stale callback that returns a
102
+ connection handle must disconnect/drain that handle before another attempt;
103
+ generation and monotonic-deadline checks prevent late callbacks reviving an
104
+ expired owner.
105
+
106
+ Service URL schemes are a product/deployment contract. Preserve the exact
107
+ descriptor returned for the operation that consumes it; apply any HTTP/WHIP
108
+ normalization only when the pinned platform and TiRTC package require and test
109
+ it. Do not generalize this case study into a universal plain-transport rule.
110
+
111
+ ## Media and capability gate
112
+
113
+ The demonstrated audio contract is 8 kHz, 16-bit mono PCM with 20 ms TiRTC
114
+ G.711 A-law packets; the board path may capture/play in larger chunks. SDK
115
+ callbacks enqueue bounded copies and return. A camera-start failure degrades
116
+ video while leaving an otherwise valid audio session active.
117
+
118
+ BK7258 provides H.264 encoding but no demonstrated H.264 hardware decoder. The
119
+ AVDK virtual H.264 decoder is NAL inspection/logging, not decoded video. The
120
+ validated STREAM direction is native H.264 1280x720 at 10 fps uplink plus
121
+ full-duplex audio. Report call/VoIP as audio-only until their video path passes.
122
+ For local remote-video display, first prove a platform-negotiated 320x240
123
+ JPEG/MJPEG path and hardware JPEG decode; otherwise require server transcoding
124
+ or another SoC.
125
+
126
+ Capability JSON must describe only implemented paths using fields accepted by
127
+ the live profile API. A camera driver, an encoder block or TiRTC `on_video`
128
+ callback alone does not justify bidirectional-video advertising.
129
+
130
+ ## Release gate
131
+
132
+ Require a host contract test plus artifact-bound HIL. At minimum verify:
133
+
134
+ - exact archive hashes, ABI/config/partition invariants and AP-only TiRTC
135
+ ownership;
136
+ - provisioning, binding, clock, signed login and one complete capability report;
137
+ - first uplink/downlink audio frames and first H.264 frame;
138
+ - ten AI enter/exit cycles after background polling starts, with no UsageFault,
139
+ HardFault, reboot, leaked media owner or permanent busy state;
140
+ - camera failure with audio preserved, two consecutive remote-view sessions,
141
+ connect/confirmation timeouts and late-callback rejection;
142
+ - minimum/largest internal heap during DTLS, camera and full-duplex overlap.
143
+
144
+ Use conventional `ERROR`, `WARN`, `INFO`, `DEBUG` levels. The checked-in release
145
+ configuration defaults to `INFO`; at that level log failures, recovery and state
146
+ transitions but not complete network inputs or responses. An explicitly enabled
147
+ `DEBUG` build prints complete HTTP, MQTT and TiRTC/WHIP inputs and results,
148
+ including authorization values, so developers can reproduce protocol failures.
149
+ Contract tests must keep those full-payload format strings behind `BK_LOGD` or
150
+ an equivalent DEBUG guard and reject them at INFO/WARN/ERROR. Treat DEBUG logs as
151
+ sensitive development artifacts, keep them out of source control and restore
152
+ INFO before producing release firmware.
@@ -5,11 +5,13 @@ SDK/BSP project.
5
5
 
6
6
  ## SDK baseline
7
7
 
8
- For BK7258 multimedia work, start with Beken's `bk_avdk_smp`. Prefer the highest
9
- formal `release/v3.1.1.x` tag compatible with the product solution; the moving
10
- `release/v3.1.1` branch contains unreleased maintenance work. Keep an upper-layer
11
- solution and SDK on matching tags. Confirm BK7259 against its own published
12
- support matrix and release line rather than assuming BK7258 compatibility.
8
+ For BK7258 multimedia work, start with Beken's official Gitee `bk_avdk_smp`
9
+ tag `release/v3.1.1.8`, commit
10
+ `1cfd56af09a3cb6470f35f1e0c604035ed1b6ee7`. Do not substitute the locally
11
+ delivered `3.1.1.8-20260605` tree: it contains product/private modifications and
12
+ is reference evidence only. Keep an upper-layer solution and SDK on matching
13
+ tags. Confirm BK7259 against its own published support matrix and release line
14
+ rather than assuming BK7258 compatibility.
13
15
 
14
16
  ## Output contract
15
17
 
@@ -1,6 +1,8 @@
1
1
  # TiRTC integration on Beken
2
2
 
3
3
  Use this reference when moving from hardware diagnosis to XiaoTai business code.
4
+ For BK7258, also read the artifact-derived
5
+ [LCKFB lessons](lckfb-bk7258-lessons.md) and apply its release gates.
4
6
 
5
7
  ## Compatibility gate
6
8
 
@@ -10,6 +12,10 @@ stack and required callbacks. Record their versions and hashes. An ESP32 library
10
12
  is not portable evidence. When a compatible package is unavailable, hardware
11
13
  diagnosis can finish but business integration is `BLOCKED_SDK_ABI`.
12
14
 
15
+ Compatibility includes TLS dependencies. Record the Mbed TLS ABI expected by
16
+ the TiRTC archive and the exact archive/headers selected by the platform build;
17
+ a successful static link still requires a device DTLS/WHIP handshake.
18
+
13
19
  ## Stable/application boundary
14
20
 
15
21
  Stable product modules own:
@@ -42,5 +48,20 @@ screen widget own a second session state machine.
42
48
  7. Re-run the probe/resource snapshot in the final firmware and bind HIL results
43
49
  to its SHA-256.
44
50
 
51
+ Lock exact HTTP method/body semantics, option-length conventions, callback
52
+ object lifetimes and unusual SDK return values in host contract tests. Measure
53
+ internal free/minimum/largest heap during connect; PSRAM totals alone do not
54
+ clear the resource gate.
55
+
45
56
  Use the exact selected TiRTC header for lifecycle and callback details; public
46
57
  documentation is context, not a substitute for the binary's build contract.
58
+
59
+ ## Logging contract
60
+
61
+ Use `ERROR` for failed operations that cannot continue, `WARN` for degraded or
62
+ recoverable behavior, `INFO` for lifecycle/state summaries, and `DEBUG` for wire
63
+ diagnostics. Default product builds to INFO. At DEBUG, log complete HTTP method,
64
+ URL, headers, body and response; MQTT connect/subscribe/publish/receive fields and
65
+ payloads; and TiRTC/WHIP descriptors, authorization values, callback results and
66
+ generation identifiers. At INFO and above, do not print those complete network
67
+ inputs or responses. Lock both sides of this rule in host contract tests.
@@ -1 +1 @@
1
- 0.11.0
1
+ 0.11.1