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

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 (191) hide show
  1. package/README.md +22 -35
  2. package/dist/as-built.d.ts +33 -0
  3. package/dist/as-built.js +188 -0
  4. package/dist/async/timer-polyfill.js +1 -1
  5. package/dist/boardgen.d.ts +128 -0
  6. package/dist/boardgen.js +1366 -0
  7. package/dist/chips/board-overrides.d.ts +7 -0
  8. package/dist/chips/board-overrides.js +11 -0
  9. package/dist/chips/controllers.d.ts +28 -8
  10. package/dist/chips/controllers.js +49 -12
  11. package/dist/chips/esp32s3.js +49 -0
  12. package/dist/chips/index.d.ts +6 -12
  13. package/dist/chips/index.js +18 -34
  14. package/dist/chips/resolve.d.ts +16 -2
  15. package/dist/chips/resolve.js +298 -15
  16. package/dist/chips/soc/.d.ts +2 -0
  17. package/dist/chips/soc/.js +129 -0
  18. package/dist/chips/soc/esp32.d.ts +2 -0
  19. package/dist/chips/soc/esp32.js +120 -0
  20. package/dist/chips/soc/esp32c3.d.ts +2 -0
  21. package/dist/chips/soc/esp32c3.js +90 -0
  22. package/dist/chips/soc/esp32c6.d.ts +2 -0
  23. package/dist/chips/soc/esp32c6.js +109 -0
  24. package/dist/chips/soc/esp32s3.d.ts +2 -0
  25. package/dist/chips/soc/esp32s3.js +189 -0
  26. package/dist/chips/soc/index.d.ts +2 -0
  27. package/dist/chips/soc/index.js +23 -0
  28. package/dist/chips/soc/nrf52840.d.ts +2 -0
  29. package/dist/chips/soc/nrf52840.js +130 -0
  30. package/dist/chips/soc/rp2040.d.ts +2 -0
  31. package/dist/chips/soc/rp2040.js +141 -0
  32. package/dist/chips/soc/rp2350a.d.ts +2 -0
  33. package/dist/chips/soc/rp2350a.js +145 -0
  34. package/dist/chips/soc/samd21g18a.d.ts +2 -0
  35. package/dist/chips/soc/samd21g18a.js +143 -0
  36. package/dist/chips/soc/stm32f411xe.d.ts +2 -0
  37. package/dist/chips/soc/stm32f411xe.js +251 -0
  38. package/dist/chips/types.d.ts +382 -12
  39. package/dist/chips/xiao-ble.js +33 -0
  40. package/dist/display/profiles.js +1 -1
  41. package/dist/doctor.js +38 -4
  42. package/dist/dt-config/custom-board.d.ts +23 -0
  43. package/dist/dt-config/custom-board.js +227 -0
  44. package/dist/dt-config/kconfig.d.ts +83 -1
  45. package/dist/dt-config/kconfig.js +116 -27
  46. package/dist/dt-config/overlay.js +623 -18
  47. package/dist/framework.manifest.d.ts +20 -30
  48. package/dist/framework.manifest.js +124 -178
  49. package/dist/index.d.ts +4 -1
  50. package/dist/index.js +8 -2
  51. package/dist/lowering/adc.d.ts +26 -5
  52. package/dist/lowering/adc.js +137 -31
  53. package/dist/lowering/ble.js +31 -28
  54. package/dist/lowering/dac.js +9 -9
  55. package/dist/lowering/fs.js +18 -10
  56. package/dist/lowering/gpio.d.ts +2 -0
  57. package/dist/lowering/gpio.js +90 -10
  58. package/dist/lowering/http.js +39 -14
  59. package/dist/lowering/hwtimer.d.ts +4 -0
  60. package/dist/lowering/hwtimer.js +35 -10
  61. package/dist/lowering/i2c.js +46 -54
  62. package/dist/lowering/index.d.ts +5 -5
  63. package/dist/lowering/index.js +15 -16
  64. package/dist/lowering/interrupts.d.ts +22 -5
  65. package/dist/lowering/interrupts.js +104 -22
  66. package/dist/lowering/mqtt.js +12 -6
  67. package/dist/lowering/power.js +0 -4
  68. package/dist/lowering/preferences.js +49 -77
  69. package/dist/lowering/pulse.js +5 -36
  70. package/dist/lowering/pwm.d.ts +32 -3
  71. package/dist/lowering/pwm.js +105 -17
  72. package/dist/lowering/random.js +3 -3
  73. package/dist/lowering/sensor.d.ts +37 -0
  74. package/dist/lowering/sensor.js +119 -0
  75. package/dist/lowering/spi.d.ts +12 -0
  76. package/dist/lowering/spi.js +65 -40
  77. package/dist/lowering/thread.d.ts +14 -0
  78. package/dist/lowering/thread.js +55 -0
  79. package/dist/lowering/timing.js +20 -46
  80. package/dist/lowering/tone.js +18 -5
  81. package/dist/lowering/uart.d.ts +13 -0
  82. package/dist/lowering/uart.js +72 -51
  83. package/dist/lowering/usb.d.ts +34 -0
  84. package/dist/lowering/usb.js +206 -0
  85. package/dist/lowering/wdt.d.ts +1 -1
  86. package/dist/lowering/wdt.js +17 -7
  87. package/dist/lowering/wifi.d.ts +3 -2
  88. package/dist/lowering/wifi.js +120 -111
  89. package/dist/sdk/board-catalog-sync.d.ts +16 -0
  90. package/dist/sdk/board-catalog-sync.js +41 -0
  91. package/dist/sdk/board-data.generated.d.ts +2 -0
  92. package/dist/sdk/board-data.generated.js +4 -0
  93. package/dist/sdk/catalog-walker.d.ts +90 -0
  94. package/dist/sdk/catalog-walker.js +682 -0
  95. package/dist/sdk/dts-reader.d.ts +83 -0
  96. package/dist/sdk/dts-reader.js +596 -0
  97. package/dist/strategy.d.ts +136 -17
  98. package/dist/strategy.js +881 -212
  99. package/dist/toolchain/bossac-touch.d.ts +18 -0
  100. package/dist/toolchain/bossac-touch.js +88 -0
  101. package/dist/toolchain/compat.d.ts +2 -2
  102. package/dist/toolchain/compat.js +8 -3
  103. package/dist/toolchain/debug-config.d.ts +21 -26
  104. package/dist/toolchain/debug-config.js +212 -72
  105. package/dist/toolchain/env-check.d.ts +4 -4
  106. package/dist/toolchain/env-check.js +5 -5
  107. package/dist/toolchain/index.d.ts +66 -1
  108. package/dist/toolchain/index.js +713 -58
  109. package/dist/toolchain/scaffold.d.ts +9 -0
  110. package/dist/toolchain/scaffold.js +84 -7
  111. package/dist/toolchain/west-discover.d.ts +8 -1
  112. package/dist/toolchain/west-discover.js +19 -6
  113. package/dist/toolchain/west-spawn.js +17 -5
  114. package/installer/CHANGELOG.md +473 -0
  115. package/installer/README.md +328 -0
  116. package/installer/environment.yml +46 -0
  117. package/installer/etc/conda/activate.d/zephyr.bat +7 -0
  118. package/installer/etc/conda/activate.d/zephyr.ps1 +12 -0
  119. package/installer/etc/conda/activate.d/zephyr.sh +20 -0
  120. package/installer/etc/conda/deactivate.d/zephyr.bat +6 -0
  121. package/installer/etc/conda/deactivate.d/zephyr.ps1 +6 -0
  122. package/installer/etc/conda/deactivate.d/zephyr.sh +4 -0
  123. package/installer/install.mjs +580 -0
  124. package/installer/install.ps1 +619 -0
  125. package/installer/install.sh +310 -0
  126. package/installer/lib/detect-platform.sh +62 -0
  127. package/installer/lib/fetch-sdk.sh +304 -0
  128. package/installer/lib/init-workspace.sh +153 -0
  129. package/installer/lib/write-activation.sh +76 -0
  130. package/installer/patches/tfm-c-include-separators.patch +19 -0
  131. package/installer/patches/zephyr-tfm-nordic-zephyr-include.patch +24 -0
  132. package/installer/templates/project/.typecad/activate-zephyr.ps1 +31 -0
  133. package/installer/templates/project/.typecad/activate-zephyr.sh +31 -0
  134. package/installer/templates/project/.vscode/settings.json +30 -0
  135. package/installer/templates/project/README.md +58 -0
  136. package/installer/versions.env +110 -0
  137. package/package.json +16 -16
  138. package/src/as-built.ts +206 -0
  139. package/src/boardgen.ts +1428 -0
  140. package/src/chips/controllers.ts +61 -12
  141. package/src/chips/index.ts +35 -54
  142. package/src/chips/resolve.ts +316 -14
  143. package/src/chips/types.ts +388 -13
  144. package/src/display/profiles.ts +1 -1
  145. package/src/doctor.ts +110 -77
  146. package/src/dt-config/custom-board.ts +325 -0
  147. package/src/dt-config/kconfig.ts +177 -19
  148. package/src/dt-config/overlay.ts +1058 -450
  149. package/src/framework.manifest.ts +125 -178
  150. package/src/index.ts +57 -41
  151. package/src/lowering/adc.ts +222 -102
  152. package/src/lowering/ble.ts +32 -28
  153. package/src/lowering/dac.ts +82 -82
  154. package/src/lowering/fs.ts +18 -10
  155. package/src/lowering/gpio.ts +242 -152
  156. package/src/lowering/http.ts +512 -488
  157. package/src/lowering/hwtimer.ts +139 -101
  158. package/src/lowering/i2c.ts +116 -126
  159. package/src/lowering/index.ts +91 -93
  160. package/src/lowering/interrupts.ts +113 -21
  161. package/src/lowering/mqtt.ts +12 -6
  162. package/src/lowering/preferences.ts +327 -354
  163. package/src/lowering/pwm.ts +167 -74
  164. package/src/lowering/random.ts +3 -3
  165. package/src/lowering/sensor.ts +155 -0
  166. package/src/lowering/spi.ts +164 -124
  167. package/src/lowering/thread.ts +63 -0
  168. package/src/lowering/timing.ts +46 -72
  169. package/src/lowering/uart.ts +73 -51
  170. package/src/lowering/usb.ts +221 -0
  171. package/src/lowering/wdt.ts +95 -84
  172. package/src/lowering/wifi.ts +120 -111
  173. package/src/sdk/board-catalog-sync.ts +62 -0
  174. package/src/strategy.ts +888 -229
  175. package/src/toolchain/bossac-touch.ts +112 -0
  176. package/src/toolchain/compat.ts +8 -3
  177. package/src/toolchain/debug-config.ts +666 -522
  178. package/src/toolchain/env-check.ts +9 -9
  179. package/src/toolchain/index.ts +765 -44
  180. package/src/toolchain/scaffold.ts +81 -7
  181. package/src/toolchain/west-discover.ts +334 -316
  182. package/src/toolchain/west-spawn.ts +17 -5
  183. package/src/async/timer-polyfill.ts +0 -107
  184. package/src/chips/esp32.ts +0 -74
  185. package/src/chips/esp32s3.ts +0 -57
  186. package/src/chips/xiao-ble.ts +0 -70
  187. package/src/lowering/power.ts +0 -70
  188. package/src/lowering/pulse.ts +0 -93
  189. package/src/lowering/tone.ts +0 -60
  190. package/src/lowering/worker-backing.ts +0 -94
  191. package/src/lowering/worker.ts +0 -17
@@ -0,0 +1,473 @@
1
+ # @typecad/zephyr-installer
2
+
3
+ ## 1.0.0-alpha.14
4
+
5
+ ### Minor Changes
6
+
7
+ - ## ccache in the build env: fresh build dirs replay from cache
8
+
9
+ The micromamba env now installs `ccache` (conda-forge, all platforms). Zephyr's
10
+ `cmake/modules/ccache.cmake` automatically routes compiles and links through
11
+ ccache whenever it is on PATH — no extra wiring. Build dirs that legitimately
12
+ start fresh (config/board changes, the framework's dependency-cycle recovery)
13
+ then hit the cache for every unchanged Zephyr library object instead of
14
+ recompiling ~280 files from scratch. ccache's per-user default cache dir is
15
+ shared across projects; opt out with `USE_CCACHE=0`.
16
+ - ## `--delete`: uninstall everything after explicit confirmation
17
+
18
+ ```sh
19
+ npx @typecad/zephyr-installer --delete # shows what will be removed, asks 'yes'
20
+ ```
21
+
22
+ Removes everything the installer created:
23
+
24
+ - the conda env (`$MAMBA_ROOT_PREFIX/envs/<name>`)
25
+ - the Zephyr SDK (`$MAMBA_ROOT_PREFIX/zephyr-sdk/`)
26
+ - the west workspace (`~/zephyrproject`)
27
+ - micromamba itself (`$MAMBA_ROOT_PREFIX`) — **only when no other conda envs
28
+ exist**; otherwise the root is kept and the other envs are named in the summary
29
+
30
+ Safety model (destructive ops default-deny):
31
+
32
+ - Shows the exact paths **with on-disk sizes** before anything is touched.
33
+ - Requires typing `yes` exactly (Enter/cancel aborts with nothing deleted).
34
+ - Non-interactive stdin without `--yes` **refuses** (unlike install/modify,
35
+ which proceed) — `--delete --yes` is the explicit scripting form.
36
+ - The shell-profile hook from `micromamba shell init` is deliberately NOT
37
+ edited automatically; the summary names the file to trim by hand.
38
+ - Per-item results report `deleted`/`skipped` (locked files skip with the OS
39
+ error instead of aborting the rest).
40
+ - ## Selective platform installation + `--modify` reconfiguration
41
+
42
+ A full install downloads the 1.5 GB SDK bundle (all 25+ toolchains). Most users
43
+ need one or two platforms. The installer now downloads the ~10 MB minimal bundle
44
+ (cmake config + sdk_version) plus only the selected toolchains:
45
+
46
+ ```sh
47
+ npx @typecad/zephyr-installer # interactive platform checklist
48
+ npx @typecad/zephyr-installer --modify # add/remove platforms later
49
+ npx @typecad/zephyr-installer --platforms arm,esp32 # non-interactive
50
+ npx @typecad/zephyr-installer --platforms all # full bundle (previous behavior)
51
+ ```
52
+
53
+ ### Platform groups
54
+
55
+ | Group | Toolchain(s) | Covers | ~Download |
56
+ |-------|-------------|--------|-----------|
57
+ | ARM Cortex-M | `arm-zephyr-eabi` | nRF, RP2040, STM32, SAMD | ~150 MB |
58
+ | ESP32 | `xtensa-espressif_esp32{,s2,s3}_zephyr-elf` | ESP32/S2/S3 | ~300 MB |
59
+ | RISC-V | `riscv64-zephyr-elf` | ESP32-C3/C6 | ~120 MB |
60
+ | x86 | `x86_64-zephyr-elf` | native_sim | ~100 MB |
61
+ | aarch64 | `aarch64-zephyr-elf` | ARM64 boards | ~100 MB |
62
+ | All | (full bundle) | everything | ~1.5 GB |
63
+
64
+ ### Interactive checklist
65
+
66
+ ```
67
+ Select platform toolchains to install:
68
+
69
+ [1] ARM Cortex-M (nRF, RP2040, STM32, SAMD, ...) ~150 MB installed
70
+ [2] ESP32 / ESP32-S2 / ESP32-S3 (Xtensa) ~300 MB
71
+ [3] RISC-V (ESP32-C3/C6, generic RISC-V) ~120 MB
72
+ [4] x86 / native_sim ~100 MB
73
+ [a] All (full bundle, ~1.5 GB download / ~11 GB extracted)
74
+
75
+ Enter selection (e.g. '1 2', 'arm,esp32', or 'all'):
76
+ ```
77
+
78
+ ### `--modify` (reconfigure an existing install)
79
+
80
+ Re-runs the checklist with installed toolchains marked, then applies the delta:
81
+ new selections download (idempotent per-toolchain), deselections delete their
82
+ toolchain dirs. Skips the env/workspace steps — SDK platforms only. The
83
+ selection persists in `$SDK_INSTALL_DIR/.typecad-platforms`.
84
+
85
+ ### Line-ending safety
86
+
87
+ `.gitattributes` now forces `*.sh`/`*.mjs`/`*.env`/`environment.yml` to LF-only
88
+ (`text eol=lf`), preventing CRLF conversion on Windows checkouts that would
89
+ break bash on Linux with `$'\r': command not found`.
90
+
91
+ ### Patch Changes
92
+
93
+ - ## Fix: recover from a broken `.west/` (missing config) instead of failing west update
94
+
95
+ `init-workspace` checked only for `.west/` and skipped `west init` when present. But a
96
+ workspace can have `.west/` without `.west/config` (interrupted/partial init), which
97
+ makes `west update` fail:
98
+
99
+ ```
100
+ west.configuration.MalformedConfig: local configuration file not found
101
+ ```
102
+
103
+ Now requires BOTH `.west/` and `.west/config`; if `.west/` exists without its config,
104
+ it removes the partial `.west/` and re-initializes. The cloned `zephyr/` and `modules/`
105
+ are preserved — `west update` re-syncs them, so there's no full re-clone. Mirrored in
106
+ `install.sh` and `install.ps1`.
107
+ - ## Fix: `npx @typecad/zephyr-installer` did nothing (symlinked-bin guard)
108
+
109
+ The entry-point guard compared `import.meta.url` to `path.resolve(process.argv[1])`,
110
+ but `path.resolve` does NOT follow symlinks. npx (and global installs) run the bin
111
+ through a symlink (`node_modules/.bin/zephyr-installer` → `…/install.mjs`), so the
112
+ guard evaluated false and `install.mjs` exited without dispatching — `npx …` produced
113
+ no output. Running `node …/install.mjs` directly worked because that path isn't a
114
+ symlink.
115
+
116
+ Fixed by resolving symlinks on both sides (`realpathSync`) before comparing — the
117
+ canonical "is main module" check that survives symlinked bins.
118
+
119
+ Also: the confirmation gate's non-interactive path now PROCEEDS instead of aborting.
120
+ Some npx invocations don't forward a TTY for stdin; the old behavior aborted there
121
+ ("Non-interactive stdin with no --yes — aborting"). It now proceeds (the user invoked
122
+ it explicitly; `--yes` remains the explicit no-prompt flag), so `npx` works whether or
123
+ not it forwards a TTY.
124
+
125
+ ## Unreleased
126
+
127
+ - ## dfu-util in the Windows env + pyusb everywhere
128
+
129
+ west flash's dfu-util runner (STM32 ROM DFU bootloader boards, e.g. the
130
+ WeAct Black Pill) shells out to dfu-util, and a missing executable dies
131
+ with a raw FileNotFoundError. conda-forge has no dfu-util, so the Windows
132
+ installer now fetches MSYS2's mingw64 dfu-util package plus its
133
+ libusb/libwinpthread DLLs (SHA256-pinned in versions.env) into the env's
134
+ Library/bin — on the activation PATH and on the PATH of the
135
+ 'micromamba run -n zephyr west flash' the framework spawns. install.sh
136
+ prints the per-OS install command instead (no auto-sudo). environment.yml
137
+ also gains pyusb, which silences the "runner rtsflash could not be
138
+ imported" warning west prints on every invocation.
139
+
140
+ ## 1.0.0-alpha.13
141
+
142
+ ### Minor Changes
143
+
144
+ - 95c3692: ## ccache in the build env: fresh build dirs replay from cache
145
+
146
+ The micromamba env now installs `ccache` (conda-forge, all platforms). Zephyr's
147
+ `cmake/modules/ccache.cmake` automatically routes compiles and links through
148
+ ccache whenever it is on PATH — no extra wiring. Build dirs that legitimately
149
+ start fresh (config/board changes, the framework's dependency-cycle recovery)
150
+ then hit the cache for every unchanged Zephyr library object instead of
151
+ recompiling ~280 files from scratch. ccache's per-user default cache dir is
152
+ shared across projects; opt out with `USE_CCACHE=0`.
153
+
154
+ ## 1.0.0-alpha.12
155
+
156
+ ### Minor Changes
157
+
158
+ - 7e8cccd: ## `--delete`: uninstall everything after explicit confirmation
159
+
160
+ ```sh
161
+ npx @typecad/zephyr-installer --delete # shows what will be removed, asks 'yes'
162
+ ```
163
+
164
+ Removes everything the installer created:
165
+
166
+ - the conda env (`$MAMBA_ROOT_PREFIX/envs/<name>`)
167
+ - the Zephyr SDK (`$MAMBA_ROOT_PREFIX/zephyr-sdk/`)
168
+ - the west workspace (`~/zephyrproject`)
169
+ - micromamba itself (`$MAMBA_ROOT_PREFIX`) — **only when no other conda envs
170
+ exist**; otherwise the root is kept and the other envs are named in the summary
171
+
172
+ Safety model (destructive ops default-deny):
173
+
174
+ - Shows the exact paths **with on-disk sizes** before anything is touched.
175
+ - Requires typing `yes` exactly (Enter/cancel aborts with nothing deleted).
176
+ - Non-interactive stdin without `--yes` **refuses** (unlike install/modify,
177
+ which proceed) — `--delete --yes` is the explicit scripting form.
178
+ - The shell-profile hook from `micromamba shell init` is deliberately NOT
179
+ edited automatically; the summary names the file to trim by hand.
180
+ - Per-item results report `deleted`/`skipped` (locked files skip with the OS
181
+ error instead of aborting the rest).
182
+
183
+ - 4824892: ## Selective platform installation + `--modify` reconfiguration
184
+
185
+ A full install downloads the 1.5 GB SDK bundle (all 25+ toolchains). Most users
186
+ need one or two platforms. The installer now downloads the ~10 MB minimal bundle
187
+ (cmake config + sdk_version) plus only the selected toolchains:
188
+
189
+ ```sh
190
+ npx @typecad/zephyr-installer # interactive platform checklist
191
+ npx @typecad/zephyr-installer --modify # add/remove platforms later
192
+ npx @typecad/zephyr-installer --platforms arm,esp32 # non-interactive
193
+ npx @typecad/zephyr-installer --platforms all # full bundle (previous behavior)
194
+ ```
195
+
196
+ ### Platform groups
197
+
198
+ | Group | Toolchain(s) | Covers | ~Download |
199
+ | ------------ | ------------------------------------------- | ------------------------ | --------- |
200
+ | ARM Cortex-M | `arm-zephyr-eabi` | nRF, RP2040, STM32, SAMD | ~150 MB |
201
+ | ESP32 | `xtensa-espressif_esp32{,s2,s3}_zephyr-elf` | ESP32/S2/S3 | ~300 MB |
202
+ | RISC-V | `riscv64-zephyr-elf` | ESP32-C3/C6 | ~120 MB |
203
+ | x86 | `x86_64-zephyr-elf` | native_sim | ~100 MB |
204
+ | aarch64 | `aarch64-zephyr-elf` | ARM64 boards | ~100 MB |
205
+ | All | (full bundle) | everything | ~1.5 GB |
206
+
207
+ ### Interactive checklist
208
+
209
+ ```
210
+ Select platform toolchains to install:
211
+
212
+ [1] ARM Cortex-M (nRF, RP2040, STM32, SAMD, ...) ~150 MB installed
213
+ [2] ESP32 / ESP32-S2 / ESP32-S3 (Xtensa) ~300 MB
214
+ [3] RISC-V (ESP32-C3/C6, generic RISC-V) ~120 MB
215
+ [4] x86 / native_sim ~100 MB
216
+ [a] All (full bundle, ~1.5 GB download / ~11 GB extracted)
217
+
218
+ Enter selection (e.g. '1 2', 'arm,esp32', or 'all'):
219
+ ```
220
+
221
+ ### `--modify` (reconfigure an existing install)
222
+
223
+ Re-runs the checklist with installed toolchains marked, then applies the delta:
224
+ new selections download (idempotent per-toolchain), deselections delete their
225
+ toolchain dirs. Skips the env/workspace steps — SDK platforms only. The
226
+ selection persists in `$SDK_INSTALL_DIR/.typecad-platforms`.
227
+
228
+ ### Line-ending safety
229
+
230
+ `.gitattributes` now forces `*.sh`/`*.mjs`/`*.env`/`environment.yml` to LF-only
231
+ (`text eol=lf`), preventing CRLF conversion on Windows checkouts that would
232
+ break bash on Linux with `$'\r': command not found`.
233
+
234
+ ### Patch Changes
235
+
236
+ - ## Upgrade to Zephyr SDK 1.0.1 (Zephyr 4.4-compatible)
237
+
238
+ Zephyr 4.4 requires the SDK 1.0.x line, which renamed its artifacts — installing
239
+ 1.0.x with the old names (or 0.17.4 against Zephyr 4.4) produced build errors.
240
+
241
+ - `versions.env`: `ZEPHYR_SDK_VERSION=1.0.1` + `ZEPHYR_SDK_BUNDLE_SUFFIX=_gnu`
242
+ (1.0.x dropped "full" bundles; `_gnu` = all GNU toolchains + host tools).
243
+ - **Full-bundle names** append the suffix everywhere (`install.sh`,
244
+ `install.ps1`, `install.mjs` summary):
245
+ `zephyr-sdk-1.0.1_<plat>_gnu.<ext>`.
246
+ - **Selective-install toolchain tarballs use the flavor infix** — 1.0.x names
247
+ them `toolchain_gnu_<plat>_<target>.<ext>` (0.17.x had no infix). Without
248
+ this, every `--platforms`/`--modify` download would 404. The minimal bundle
249
+ name is unchanged (`_minimal`, no flavor).
250
+ - Fresh SHA256s from the release's official `sha256.sum` for linux-x86_64,
251
+ linux-aarch64, macos-aarch64, and windows-x86_64 — verification is now
252
+ enforced on all four.
253
+ - **macOS Intel (`macos-x86_64`) has no 1.0.x build** — `SHA256_macos_x86_64`
254
+ is the explicit `NONE` sentinel and `fetch-sdk` fails fast with guidance
255
+ (use an ARM Mac, or `--sdk-version 0.17.4` for the Zephyr 4.3.x line).
256
+ - ESP32 note: the xtensa-espressif toolchains are **individual 1.0.x assets**
257
+ (`toolchain_gnu_<plat>_xtensa-espressif_esp32s3_zephyr-elf.tar.xz`, verified
258
+ in `sha256.sum`) so `--platforms esp32` works; the `_gnu` bundle itself may
259
+ not preinstall them, in which case Zephyr's espressif HAL fetches them during
260
+ the first ESP32 build.
261
+
262
+ All artifact URLs HEAD-checked against the v1.0.1 release (bundle, minimal,
263
+ and toolchain tarballs → 200). Tests updated: new hashes pinned, `_gnu` bundle
264
+ name asserted across entry points, toolchain-infix wiring guarded.
265
+
266
+ ## 1.0.0-alpha.11
267
+
268
+ ### Patch Changes
269
+
270
+ - 66f04cf: ## Fix: recover from a broken `.west/` (missing config) instead of failing west update
271
+
272
+ `init-workspace` checked only for `.west/` and skipped `west init` when present. But a
273
+ workspace can have `.west/` without `.west/config` (interrupted/partial init), which
274
+ makes `west update` fail:
275
+
276
+ ```
277
+ west.configuration.MalformedConfig: local configuration file not found
278
+ ```
279
+
280
+ Now requires BOTH `.west/` and `.west/config`; if `.west/` exists without its config,
281
+ it removes the partial `.west/` and re-initializes. The cloned `zephyr/` and `modules/`
282
+ are preserved — `west update` re-syncs them, so there's no full re-clone. Mirrored in
283
+ `install.sh` and `install.ps1`.
284
+
285
+ - 66f04cf: ## Fix: `npx @typecad/zephyr-installer` did nothing (symlinked-bin guard)
286
+
287
+ The entry-point guard compared `import.meta.url` to `path.resolve(process.argv[1])`,
288
+ but `path.resolve` does NOT follow symlinks. npx (and global installs) run the bin
289
+ through a symlink (`node_modules/.bin/zephyr-installer` → `…/install.mjs`), so the
290
+ guard evaluated false and `install.mjs` exited without dispatching — `npx …` produced
291
+ no output. Running `node …/install.mjs` directly worked because that path isn't a
292
+ symlink.
293
+
294
+ Fixed by resolving symlinks on both sides (`realpathSync`) before comparing — the
295
+ canonical "is main module" check that survives symlinked bins.
296
+
297
+ Also: the confirmation gate's non-interactive path now PROCEEDS instead of aborting.
298
+ Some npx invocations don't forward a TTY for stdin; the old behavior aborted there
299
+ ("Non-interactive stdin with no --yes — aborting"). It now proceeds (the user invoked
300
+ it explicitly; `--yes` remains the explicit no-prompt flag), so `npx` works whether or
301
+ not it forwards a TTY.
302
+
303
+ ## 1.0.0-alpha.10
304
+
305
+ ### Patch Changes
306
+
307
+ - 63433ea: ## Pin cmake <4 (Zephyr 4.3.x is incompatible with CMake 4.x)
308
+
309
+ Fresh installs resolved `cmake 4.4.x` (the `cmake>=3.20` constraint had no
310
+ upper bound), and `west build` then failed at CMake configure:
311
+
312
+ ```
313
+ CMake Error at .../cmake/modules/FindZephyr-sdk.cmake:57 (if):
314
+ if given arguments:
315
+ "(" "zephyr" "STREQUAL" ")" "OR" ...
316
+ Unknown arguments specified
317
+ ```
318
+
319
+ Zephyr 4.3.x's `FindZephyr-sdk.cmake` uses an **unquoted** `${ZEPHYR_TOOLCHAIN_VARIANT}`
320
+ in an `if()`. When that variable is undefined it expands to nothing; CMake **3.x**
321
+ treats the empty expansion leniently (as an empty string), but CMake **4.x**
322
+ rejects it as an unknown argument. Zephyr 4.3.x predates CMake 4.x.
323
+
324
+ `environment.yml` now constrains `cmake>=3.20,<4` so conda resolves a 3.x
325
+ (currently 3.31.x). Loosen once a Zephyr revision that supports CMake 4.x is
326
+ pinned in `versions.env`. Guarded by a test asserting the upper bound is present.
327
+
328
+ - 69c0f79: ## Install per-module Python requirements (esptool for ESP32, etc.)
329
+
330
+ After `requirements-base.txt`, the installer now also installs the
331
+ **build-relevant** module `requirements.txt` files — HAL `scripts/`/`zephyr/`
332
+ dirs (esptool for espressif, vendor flash/script tools for atmel/stm32/silabs/
333
+ etc.) and top-level lib codegen (nanopb, zcbor). It deliberately does NOT do a
334
+ recursive find of every `requirements.txt`, which would also pull
335
+ docs/test/harness/example requirements (mbedtls docs, openthread test harness,
336
+ cmsis tests, lvgl docs, tf-m tools) — heavy and conflict-prone.
337
+
338
+ Without this, board-specific tooling was missing from the env. For ESP32 the
339
+ post-link image step ran a stale **system** `esptool` (the env had none) which
340
+ rejected Zephyr's invocation:
341
+
342
+ ```
343
+ esptool: error: unrecognized arguments: --flash-mode --flash-freq 80m --flash-size 8MB
344
+ ```
345
+
346
+ The espressif HAL pins `esptool>=5.0.2` in its own `requirements.txt`; installing
347
+ the per-module requirements puts a matching `esptool` (5.x) in the env, where the
348
+ activated `Scripts/` shadows the system one. Each module requirements file is
349
+ installed warn-and-continue so one bad pin can't abort the whole install.
350
+
351
+ Board support itself is universal — `west update` fetches every module and the
352
+ SDK full bundle ships every cross-toolchain (arm, riscv, xtensa, …) — so rp2040,
353
+ samd, nrf, stm32, etc. build with just the base env; only a few modules add
354
+ Python tools (esptool), which this step covers.
355
+
356
+ Mirrored in `install.sh` and `install.ps1`; guarded by a regression test
357
+ asserting both target `modules/hal/` (not a recursive find).
358
+
359
+ - 3aaec5f: ## Pin SHA256 for the linux-x86_64 + windows-x86_64 SDK bundles
360
+
361
+ `versions.env` shipped with every `SHA256_*` set to `TODO`, so `fetch-sdk`
362
+ skipped verification with a warning. Pinned the two bundles exercised by real
363
+ installs (each computed by the installer against the official Zephyr SDK 0.17.4
364
+ release bundle):
365
+
366
+ - `linux-x86_64`: `83f2f327…3d1116b6`
367
+ - `windows-x86_64`: `51d550eb…d9384ecd`
368
+
369
+ Verification is now enforced on those platforms — a mismatch aborts the install
370
+ instead of continuing. The other three (`linux-aarch64`, `macos-x86_64`,
371
+ `macos-aarch64`) remain `TODO` until a real install on each platform computes
372
+ and pins them (the installer prints the computed hash on first download).
373
+
374
+ Also adds a regression test that locks the two pinned values so a typo or
375
+ accidental `TODO`-reset in `versions.env` is caught.
376
+
377
+ - e540f4e: ## Install Zephyr's Python build requirements into the env
378
+
379
+ After `west update`, the installer now runs
380
+ `pip install -r $ZEPHYR_BASE/scripts/requirements-base.txt` into the `zephyr`
381
+ conda env. Without this, `west build` failed at CMake configure:
382
+
383
+ ```
384
+ CMake Error at .../zephyr_module.cmake:73 (message):
385
+ Missing jsonschema dependency
386
+ ```
387
+
388
+ `environment.yml` only carried `pyelftools` + `packaging`; Zephyr additionally
389
+ requires `jsonschema`, `pykwalify`, `PyYAML`, `intelhex`, `canopen`, `patool`,
390
+ `psutil`, `pyserial`, `requests`, `semver`, `tqdm`, `reuse`, `anytree`, and
391
+ `windows-curses` (Windows). Letting Zephyr's own pinned requirements file drive
392
+ the install tracks the Zephyr revision and avoids maintaining a separate list
393
+ that goes stale or misses deps.
394
+
395
+ Mirrored in `install.sh` (POSIX) and `install.ps1` (Windows), fail-fast on a
396
+ pip failure. Guarded by a regression test asserting both scripts wire
397
+ `requirements-base.txt`.
398
+
399
+ ## 1.0.0-alpha.9
400
+
401
+ ### Patch Changes
402
+
403
+ - 88414b0: ## Fix: SDK download aborted on POSIX (write-activation heredoc bug)
404
+
405
+ On Linux/macOS the installer aborted right after conda-env creation, before the
406
+ Zephyr SDK downloaded:
407
+
408
+ ```
409
+ lib/write-activation.sh: line 58: env: unbound variable
410
+ ```
411
+
412
+ `write-activation.sh` built `env-vars.ps1` with an **unquoted** bash heredoc and
413
+ used backticks to "escape" `$env:` — but in an unquoted heredoc a backtick is
414
+ **command substitution**, not an escape. The resulting `` `$env:…` `` ran as a
415
+ command, expanded the unbound `env` under `set -u`, and (with `set -e`) aborted
416
+ the whole install. Both `` `$env `` lines fired, both attributed to the
417
+ heredoc's start line (58).
418
+
419
+ This only triggered on POSIX, where `install.sh` runs: Windows uses
420
+ `install.ps1`, which writes `env-vars.ps1` via a PowerShell here-string (where
421
+ backtick _is_ the escape), so it never appeared there — which is why alpha.8
422
+ shipped with it.
423
+
424
+ Fix: backslash-escape (`\$env:`) for a literal `$` in the unquoted heredoc.
425
+ Added a regression test (`tests/packages/zephyr-installer/write-activation.test.ts`)
426
+ that sources `write-activation.sh` under `set -eu` and asserts the env-vars
427
+ files are written cleanly with literal `$env:` — the existing tests only ran
428
+ `--dry-run`, which skips `write_activation()`, so the path was uncovered.
429
+
430
+ ## 1.0.0-alpha.8
431
+
432
+ ### Minor Changes
433
+
434
+ - ## Cross-platform Zephyr toolchain installer
435
+
436
+ New **`@typecad/zephyr-installer`** package: a one-command, cross-platform
437
+ (Linux / macOS / Windows-native) installer for a working Zephyr build
438
+ environment on micromamba + the official Zephyr SDK. No preinstalled
439
+ conda/Python/toolchain required.
440
+
441
+ `node packages/zephyr-installer/install.mjs` dispatches to `install.sh` (POSIX)
442
+ or `install.ps1` (Windows) and: downloads micromamba, creates a `zephyr` conda
443
+ env (host tools from conda-forge; `dtc`/`openocd` on POSIX and `7zip` on Windows
444
+ installed as platform-specific extras, since micromamba ignores `environment.yml`
445
+ line selectors), fetches + SHA256-verifies the Zephyr SDK full bundle (located
446
+ outside the env prefix, idempotent, no `setup.sh`/`sudo` — relies on
447
+ `ZEPHYR_SDK_INSTALL_DIR`), and runs `west init --mr <rev>` + `west update` for a
448
+ vanilla Zephyr workspace.
449
+
450
+ Run via `npx @typecad/zephyr-installer` (or the `zephyr-installer` /
451
+ `typecad-zephyr-install` bin): the entry point prints a summary of what it
452
+ will do — versions, bundle name, ~sizes, install locations — and waits for
453
+ Enter before proceeding. `--yes` skips the prompt (CI); `--dry-run` prints the
454
+ resolved plan and exits.
455
+
456
+ Activation hooks export `ZEPHYR_BASE` + `ZEPHYR_SDK_INSTALL_DIR`, so once
457
+ activated, `framework-zephyr`'s west discovery (Strategy 1 — `west` on PATH)
458
+ finds the new install with zero code changes. A `templates/project/` ships
459
+ machine-agnostic activators (`.typecad/activate-zephyr.{ps1,sh}`) plus a VS Code
460
+ terminal profile that auto-activates on terminal open.
461
+
462
+ Windows hardening (verified on PowerShell 5.1): downloads via `curl.exe` (not
463
+ `Invoke-WebRequest`, which fails to resolve `api.anaconda.org` through the
464
+ system proxy stack), explicit Windows `tar.exe` (MSYS `tar` mis-parses `C:\`
465
+ paths), fail-fast `$LASTEXITCODE` checks on every native-exe call (no false
466
+ "done" cascades), partial-env-prefix detection with an actionable error, and
467
+ `micromamba shell init` so activation works in new shells without manual
468
+ hook-loading.
469
+
470
+ `@typecad/framework-zephyr` (patch): the actionable "west not found" error in
471
+ `west-spawn.ts` now points users at the installer (`node packages/zephyr-installer/install.mjs`).
472
+
473
+ Tests: 24 across dispatcher (incl. confirmation gate), dry-run, versions, and templates.