@typecad/framework-zephyr 1.0.0-alpha.15 → 1.0.0-alpha.18

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.
Files changed (132) hide show
  1. package/LICENSE +202 -21
  2. package/README.md +49 -87
  3. package/dist/as-built.d.ts +2 -2
  4. package/dist/as-built.js +2 -2
  5. package/dist/boardgen.d.ts +1 -9
  6. package/dist/boardgen.js +228 -45
  7. package/dist/chips/types.d.ts +1 -1
  8. package/dist/debug-codegen.js +1 -1
  9. package/dist/display/touch-adapter.js +1 -1
  10. package/dist/display/ui-adapter.js +549 -549
  11. package/dist/doctor.js +4 -4
  12. package/dist/dt-config/custom-board.js +2 -2
  13. package/dist/dt-config/kconfig.js +18 -12
  14. package/dist/dt-config/overlay.d.ts +2 -2
  15. package/dist/dt-config/overlay.js +2 -2
  16. package/dist/framework.manifest.d.ts +3 -3
  17. package/dist/framework.manifest.js +10 -7
  18. package/dist/index.js +5 -5
  19. package/dist/licenses.d.ts +2 -2
  20. package/dist/licenses.js +8 -8
  21. package/dist/lowering/fs.js +1 -1
  22. package/dist/lowering/gpio.js +0 -32
  23. package/dist/lowering/http.js +264 -32
  24. package/dist/lowering/i2c.js +0 -8
  25. package/dist/lowering/interrupts.js +6 -0
  26. package/dist/lowering/mqtt.js +110 -8
  27. package/dist/lowering/usb.js +11 -11
  28. package/dist/lowering/wdt.js +2 -29
  29. package/dist/sdk/board-catalog-sync.d.ts +1 -3
  30. package/dist/sdk/board-catalog-sync.js +4 -10
  31. package/dist/strategy.d.ts +22 -44
  32. package/dist/strategy.js +152 -155
  33. package/dist/tmp-probe.d.ts +2 -0
  34. package/dist/tmp-probe.js +9 -0
  35. package/dist/toolchain/debug-config.d.ts +50 -90
  36. package/dist/toolchain/debug-config.js +241 -502
  37. package/dist/toolchain/env-check.d.ts +1 -3
  38. package/dist/toolchain/env-check.js +2 -7
  39. package/dist/toolchain/index.d.ts +65 -2
  40. package/dist/toolchain/index.js +432 -55
  41. package/dist/toolchain/runners.d.ts +16 -0
  42. package/dist/toolchain/runners.js +75 -0
  43. package/dist/toolchain/scaffold.d.ts +1 -1
  44. package/dist/toolchain/scaffold.js +12 -12
  45. package/dist/toolchain/west-discover.d.ts +6 -0
  46. package/dist/toolchain/west-discover.js +36 -13
  47. package/dist/toolchain/west-spawn.js +8 -2
  48. package/installer/README.md +328 -328
  49. package/installer/install.sh +2 -2
  50. package/installer/templates/project/.typecad/activate-zephyr.ps1 +1 -1
  51. package/installer/templates/project/.typecad/activate-zephyr.sh +1 -1
  52. package/installer/templates/project/.vscode/settings.json +1 -1
  53. package/installer/templates/project/README.md +2 -2
  54. package/package.json +5 -5
  55. package/src/as-built.ts +206 -206
  56. package/src/boardgen.ts +214 -48
  57. package/src/chips/types.ts +567 -567
  58. package/src/display/touch-adapter.ts +204 -204
  59. package/src/display/ui-adapter.ts +781 -781
  60. package/src/doctor.ts +4 -4
  61. package/src/dt-config/custom-board.ts +2 -2
  62. package/src/dt-config/kconfig.ts +18 -12
  63. package/src/dt-config/overlay.ts +1058 -1058
  64. package/src/framework.manifest.ts +538 -535
  65. package/src/index.ts +5 -5
  66. package/src/licenses.ts +425 -425
  67. package/src/lowering/fs.ts +135 -135
  68. package/src/lowering/gpio.ts +0 -33
  69. package/src/lowering/http.ts +264 -32
  70. package/src/lowering/i2c.ts +0 -9
  71. package/src/lowering/interrupts.ts +6 -0
  72. package/src/lowering/mqtt.ts +109 -8
  73. package/src/lowering/usb.ts +221 -221
  74. package/src/lowering/wdt.ts +2 -25
  75. package/src/sdk/board-catalog-sync.ts +4 -25
  76. package/src/strategy.ts +2265 -2309
  77. package/src/toolchain/debug-config.ts +264 -514
  78. package/src/toolchain/env-check.ts +279 -285
  79. package/src/toolchain/index.ts +1703 -1286
  80. package/src/toolchain/runners.ts +80 -0
  81. package/src/toolchain/scaffold.ts +296 -296
  82. package/src/toolchain/west-discover.ts +35 -13
  83. package/src/toolchain/west-spawn.ts +174 -168
  84. package/dist/async/timer-polyfill.d.ts +0 -10
  85. package/dist/async/timer-polyfill.js +0 -95
  86. package/dist/chips/board-overrides.d.ts +0 -7
  87. package/dist/chips/board-overrides.js +0 -11
  88. package/dist/chips/esp32.d.ts +0 -2
  89. package/dist/chips/esp32.js +0 -71
  90. package/dist/chips/esp32s3.d.ts +0 -2
  91. package/dist/chips/esp32s3.js +0 -103
  92. package/dist/chips/soc/.d.ts +0 -2
  93. package/dist/chips/soc/.js +0 -129
  94. package/dist/chips/soc/esp32.d.ts +0 -2
  95. package/dist/chips/soc/esp32.js +0 -120
  96. package/dist/chips/soc/esp32c3.d.ts +0 -2
  97. package/dist/chips/soc/esp32c3.js +0 -90
  98. package/dist/chips/soc/esp32c6.d.ts +0 -2
  99. package/dist/chips/soc/esp32c6.js +0 -109
  100. package/dist/chips/soc/esp32s3.d.ts +0 -2
  101. package/dist/chips/soc/esp32s3.js +0 -189
  102. package/dist/chips/soc/index.d.ts +0 -2
  103. package/dist/chips/soc/index.js +0 -23
  104. package/dist/chips/soc/nrf52840.d.ts +0 -2
  105. package/dist/chips/soc/nrf52840.js +0 -130
  106. package/dist/chips/soc/rp2040.d.ts +0 -2
  107. package/dist/chips/soc/rp2040.js +0 -141
  108. package/dist/chips/soc/rp2350a.d.ts +0 -2
  109. package/dist/chips/soc/rp2350a.js +0 -145
  110. package/dist/chips/soc/samd21g18a.d.ts +0 -2
  111. package/dist/chips/soc/samd21g18a.js +0 -143
  112. package/dist/chips/soc/stm32f411xe.d.ts +0 -2
  113. package/dist/chips/soc/stm32f411xe.js +0 -251
  114. package/dist/chips/xiao-ble.d.ts +0 -2
  115. package/dist/chips/xiao-ble.js +0 -100
  116. package/dist/lowering/power.d.ts +0 -9
  117. package/dist/lowering/power.js +0 -60
  118. package/dist/lowering/pulse.d.ts +0 -7
  119. package/dist/lowering/pulse.js +0 -51
  120. package/dist/lowering/tone.d.ts +0 -10
  121. package/dist/lowering/tone.js +0 -63
  122. package/dist/lowering/worker-backing.d.ts +0 -14
  123. package/dist/lowering/worker-backing.js +0 -79
  124. package/dist/lowering/worker.d.ts +0 -6
  125. package/dist/lowering/worker.js +0 -14
  126. package/dist/sdk/board-data.generated.d.ts +0 -2
  127. package/dist/sdk/board-data.generated.js +0 -4
  128. package/dist/sdk/catalog-walker.d.ts +0 -90
  129. package/dist/sdk/catalog-walker.js +0 -682
  130. package/dist/sdk/dts-reader.d.ts +0 -83
  131. package/dist/sdk/dts-reader.js +0 -596
  132. package/src/debug-codegen.ts +0 -207
package/src/doctor.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // ---------------------------------------------------------------------------
2
2
  // @typecad/framework-zephyr — Zephyr environment doctor
3
3
  //
4
- // `cuttlefish doctor` (Zephyr framework) — verify west (the Zephyr build tool)
4
+ // `typecad-hal doctor` (Zephyr framework) — verify west (the Zephyr build tool)
5
5
  // is installed + responsive, the Zephyr RTOS is inside the framework's declared
6
6
  // compat range, and the configured board target exists in the checkout. Exits 0
7
7
  // if the environment is OK, non-zero otherwise. Follows the same contract
@@ -12,7 +12,7 @@
12
12
  import { existsSync, readFileSync } from 'node:fs';
13
13
  import { join } from 'node:path';
14
14
  import * as ui from '@typecad/cuttlefish/utils/ui';
15
- import { loadCuttlefishConfig } from '@typecad/cuttlefish/config-loader';
15
+ import { loadTypecadConfig } from '@typecad/cuttlefish/config-loader';
16
16
  import { checkZephyrEnv } from './toolchain/env-check.js';
17
17
  import { PINNED_ZEPHYR_MANIFEST_REV, PINNED_ZEPHYR_SDK_VERSION, sdkFingerprint } from '@typecad/cuttlefish/board-catalog';
18
18
  import { resolveChipFromBoard } from './chips/resolve.js';
@@ -26,7 +26,7 @@ export function runDoctor(): void {
26
26
  ui.printHeader();
27
27
  ui.printStep('Checking Zephyr environment...');
28
28
 
29
- const config = loadCuttlefishConfig(process.cwd());
29
+ const config = loadTypecadConfig(process.cwd());
30
30
  const buildTarget = config?.buildTarget;
31
31
 
32
32
  const result = checkZephyrEnv(buildTarget);
@@ -71,7 +71,7 @@ export function runDoctor(): void {
71
71
  ui.printInfo(`Board target .... ${buildTarget}${arrow}`);
72
72
  }
73
73
  } else {
74
- ui.printInfo('(no buildTarget in cuttlefish.config.ts — skipping board check)');
74
+ ui.printInfo('(no buildTarget in typecad-hal.config.ts — skipping board check)');
75
75
  }
76
76
 
77
77
  // Probe methods — from the board package's table, via the board constants
@@ -94,7 +94,7 @@ export function generateCustomBoard(
94
94
  '# package (or add a board package) instead of this file.',
95
95
  'board:',
96
96
  ` name: ${name}`,
97
- ` full_name: Cuttlefish custom board (${chip.soc})`,
97
+ ` full_name: TypeCAD custom board (${chip.soc})`,
98
98
  ` vendor: ${CUSTOM_BOARD_VENDOR}`,
99
99
  ' socs:',
100
100
  ` - name: ${soc}`,
@@ -126,7 +126,7 @@ export function generateCustomBoard(
126
126
  ...cb.dtsIncludes.map((inc) => `#include <${inc}>`),
127
127
  '',
128
128
  '/ {',
129
- ` model = "Cuttlefish custom board (${chip.soc})";`,
129
+ ` model = "TypeCAD custom board (${chip.soc})";`,
130
130
  ` compatible = "${CUSTOM_BOARD_VENDOR},${name.replace(/_/g, '-')}";`,
131
131
  '',
132
132
  ' chosen {',
@@ -341,12 +341,16 @@ export function resolveKconfigFragments(
341
341
  // pinned-CA handshake fails with EPERM at connect (the insecure path
342
342
  // skips verification, so it works either way).
343
343
  m.set('CONFIG_MBEDTLS_X509_CRT_PARSE_C', 'y');
344
- // KNOWN LIMITATION on this Zephyr tree: pinned-CA (verified TLS) fails at
345
- // connect — the tf-psa-crypto mbedTLS needs a wider symbol matrix
346
- // (RSA public-key parse + PEM/DER glue) than the single-ciphersuite
347
- // select pulls in, and forcing the extra symbols regresses the insecure
348
- // path. insecure() HTTPS is fully verified; caCert() chain verification
349
- // stays open until the upstream matrix is mapped.
344
+ // KNOWN LIMITATION on this Zephyr tree: pinned-CA (verified TLS) was
345
+ // observed failing at connect with EPERM — the tf-psa-crypto mbedTLS
346
+ // needs a wider symbol matrix (RSA public-key parse + PEM/DER glue)
347
+ // than the single-ciphersuite select pulls in, and forcing the extra
348
+ // symbols regressed the insecure path (two hardware cycles proved it
349
+ // upstream). CAVEAT: that diagnosis predates the 2026-09 fix of the
350
+ // request-fact reset ordering (every option — including caCert — was
351
+ // being wiped before each send, which alone reproduces connect
352
+ // failures); the matrix limitation needs a hardware re-run to confirm
353
+ // it still applies. insecure() HTTPS and no-CA https are unaffected.
350
354
  // Handshake/protocol buffers allocate from the mbedTLS heap; MBEDTLS_HEAP_SIZE
351
355
  // must hold ~2x MBEDTLS_SSL_MAX_CONTENT_LEN plus working state. 65000 fits on
352
356
  // the ESP32; mbedTLS requires the full libc and PEM (not DER) cert format.
@@ -400,12 +404,14 @@ export function resolveKconfigFragments(
400
404
  // pinned-CA handshake fails with EPERM at connect (the insecure path
401
405
  // skips verification, so it works either way).
402
406
  m.set('CONFIG_MBEDTLS_X509_CRT_PARSE_C', 'y');
403
- // KNOWN LIMITATION on this Zephyr tree: pinned-CA (verified TLS) fails at
404
- // connect — the tf-psa-crypto mbedTLS needs a wider symbol matrix
405
- // (RSA public-key parse + PEM/DER glue) than the single-ciphersuite
406
- // select pulls in, and forcing the extra symbols regresses the insecure
407
- // path. insecure() HTTPS is fully verified; caCert() chain verification
408
- // stays open until the upstream matrix is mapped.
407
+ // KNOWN LIMITATION on this Zephyr tree: pinned-CA (verified TLS) was
408
+ // observed failing at connect with EPERM — the tf-psa-crypto mbedTLS
409
+ // needs a wider symbol matrix (RSA public-key parse + PEM/DER glue)
410
+ // than the single-ciphersuite select pulls in. CAVEAT: that diagnosis
411
+ // was made on the HTTPS path and predates the 2026-09 request-fact
412
+ // reset-ordering fix (options were wiped before every send, which
413
+ // alone reproduces connect failures); it is shared here because mqtts
414
+ // pins its CA through the same matrix — re-verify on hardware.
409
415
  m.set('CONFIG_MBEDTLS_ENABLE_HEAP', 'y');
410
416
  // 2x SSL_MAX_CONTENT_LEN record buffers + CA-chain parse state +
411
417
  // handshake working memory. 65000 fit insecure-mode handshakes but the