@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.
- package/README.md +22 -35
- package/dist/as-built.d.ts +33 -0
- package/dist/as-built.js +188 -0
- package/dist/async/timer-polyfill.js +1 -1
- package/dist/boardgen.d.ts +128 -0
- package/dist/boardgen.js +1366 -0
- package/dist/chips/board-overrides.d.ts +7 -0
- package/dist/chips/board-overrides.js +11 -0
- package/dist/chips/controllers.d.ts +28 -8
- package/dist/chips/controllers.js +49 -12
- package/dist/chips/esp32s3.js +49 -0
- package/dist/chips/index.d.ts +6 -12
- package/dist/chips/index.js +18 -34
- package/dist/chips/resolve.d.ts +16 -2
- package/dist/chips/resolve.js +298 -15
- package/dist/chips/soc/.d.ts +2 -0
- package/dist/chips/soc/.js +129 -0
- package/dist/chips/soc/esp32.d.ts +2 -0
- package/dist/chips/soc/esp32.js +120 -0
- package/dist/chips/soc/esp32c3.d.ts +2 -0
- package/dist/chips/soc/esp32c3.js +90 -0
- package/dist/chips/soc/esp32c6.d.ts +2 -0
- package/dist/chips/soc/esp32c6.js +109 -0
- package/dist/chips/soc/esp32s3.d.ts +2 -0
- package/dist/chips/soc/esp32s3.js +189 -0
- package/dist/chips/soc/index.d.ts +2 -0
- package/dist/chips/soc/index.js +23 -0
- package/dist/chips/soc/nrf52840.d.ts +2 -0
- package/dist/chips/soc/nrf52840.js +130 -0
- package/dist/chips/soc/rp2040.d.ts +2 -0
- package/dist/chips/soc/rp2040.js +141 -0
- package/dist/chips/soc/rp2350a.d.ts +2 -0
- package/dist/chips/soc/rp2350a.js +145 -0
- package/dist/chips/soc/samd21g18a.d.ts +2 -0
- package/dist/chips/soc/samd21g18a.js +143 -0
- package/dist/chips/soc/stm32f411xe.d.ts +2 -0
- package/dist/chips/soc/stm32f411xe.js +251 -0
- package/dist/chips/types.d.ts +382 -12
- package/dist/chips/xiao-ble.js +33 -0
- package/dist/display/profiles.js +1 -1
- package/dist/doctor.js +38 -4
- package/dist/dt-config/custom-board.d.ts +23 -0
- package/dist/dt-config/custom-board.js +227 -0
- package/dist/dt-config/kconfig.d.ts +83 -1
- package/dist/dt-config/kconfig.js +116 -27
- package/dist/dt-config/overlay.js +623 -18
- package/dist/framework.manifest.d.ts +20 -30
- package/dist/framework.manifest.js +124 -178
- package/dist/index.d.ts +4 -1
- package/dist/index.js +8 -2
- package/dist/lowering/adc.d.ts +26 -5
- package/dist/lowering/adc.js +137 -31
- package/dist/lowering/ble.js +31 -28
- package/dist/lowering/dac.js +9 -9
- package/dist/lowering/fs.js +18 -10
- package/dist/lowering/gpio.d.ts +2 -0
- package/dist/lowering/gpio.js +90 -10
- package/dist/lowering/http.js +39 -14
- package/dist/lowering/hwtimer.d.ts +4 -0
- package/dist/lowering/hwtimer.js +35 -10
- package/dist/lowering/i2c.js +46 -54
- package/dist/lowering/index.d.ts +5 -5
- package/dist/lowering/index.js +15 -16
- package/dist/lowering/interrupts.d.ts +22 -5
- package/dist/lowering/interrupts.js +104 -22
- package/dist/lowering/mqtt.js +12 -6
- package/dist/lowering/power.js +0 -4
- package/dist/lowering/preferences.js +49 -77
- package/dist/lowering/pulse.js +5 -36
- package/dist/lowering/pwm.d.ts +32 -3
- package/dist/lowering/pwm.js +105 -17
- package/dist/lowering/random.js +3 -3
- package/dist/lowering/sensor.d.ts +37 -0
- package/dist/lowering/sensor.js +119 -0
- package/dist/lowering/spi.d.ts +12 -0
- package/dist/lowering/spi.js +65 -40
- package/dist/lowering/thread.d.ts +14 -0
- package/dist/lowering/thread.js +55 -0
- package/dist/lowering/timing.js +20 -46
- package/dist/lowering/tone.js +18 -5
- package/dist/lowering/uart.d.ts +13 -0
- package/dist/lowering/uart.js +72 -51
- package/dist/lowering/usb.d.ts +34 -0
- package/dist/lowering/usb.js +206 -0
- package/dist/lowering/wdt.d.ts +1 -1
- package/dist/lowering/wdt.js +17 -7
- package/dist/lowering/wifi.d.ts +3 -2
- package/dist/lowering/wifi.js +120 -111
- package/dist/sdk/board-catalog-sync.d.ts +16 -0
- package/dist/sdk/board-catalog-sync.js +41 -0
- package/dist/sdk/board-data.generated.d.ts +2 -0
- package/dist/sdk/board-data.generated.js +4 -0
- package/dist/sdk/catalog-walker.d.ts +90 -0
- package/dist/sdk/catalog-walker.js +682 -0
- package/dist/sdk/dts-reader.d.ts +83 -0
- package/dist/sdk/dts-reader.js +596 -0
- package/dist/strategy.d.ts +136 -17
- package/dist/strategy.js +881 -212
- package/dist/toolchain/bossac-touch.d.ts +18 -0
- package/dist/toolchain/bossac-touch.js +88 -0
- package/dist/toolchain/compat.d.ts +2 -2
- package/dist/toolchain/compat.js +8 -3
- package/dist/toolchain/debug-config.d.ts +21 -26
- package/dist/toolchain/debug-config.js +212 -72
- package/dist/toolchain/env-check.d.ts +4 -4
- package/dist/toolchain/env-check.js +5 -5
- package/dist/toolchain/index.d.ts +66 -1
- package/dist/toolchain/index.js +713 -58
- package/dist/toolchain/scaffold.d.ts +9 -0
- package/dist/toolchain/scaffold.js +84 -7
- package/dist/toolchain/west-discover.d.ts +8 -1
- package/dist/toolchain/west-discover.js +19 -6
- package/dist/toolchain/west-spawn.js +17 -5
- package/installer/CHANGELOG.md +473 -0
- package/installer/README.md +328 -0
- package/installer/environment.yml +46 -0
- package/installer/etc/conda/activate.d/zephyr.bat +7 -0
- package/installer/etc/conda/activate.d/zephyr.ps1 +12 -0
- package/installer/etc/conda/activate.d/zephyr.sh +20 -0
- package/installer/etc/conda/deactivate.d/zephyr.bat +6 -0
- package/installer/etc/conda/deactivate.d/zephyr.ps1 +6 -0
- package/installer/etc/conda/deactivate.d/zephyr.sh +4 -0
- package/installer/install.mjs +580 -0
- package/installer/install.ps1 +619 -0
- package/installer/install.sh +310 -0
- package/installer/lib/detect-platform.sh +62 -0
- package/installer/lib/fetch-sdk.sh +304 -0
- package/installer/lib/init-workspace.sh +153 -0
- package/installer/lib/write-activation.sh +76 -0
- package/installer/patches/tfm-c-include-separators.patch +19 -0
- package/installer/patches/zephyr-tfm-nordic-zephyr-include.patch +24 -0
- package/installer/templates/project/.typecad/activate-zephyr.ps1 +31 -0
- package/installer/templates/project/.typecad/activate-zephyr.sh +31 -0
- package/installer/templates/project/.vscode/settings.json +30 -0
- package/installer/templates/project/README.md +58 -0
- package/installer/versions.env +110 -0
- package/package.json +16 -16
- package/src/as-built.ts +206 -0
- package/src/boardgen.ts +1428 -0
- package/src/chips/controllers.ts +61 -12
- package/src/chips/index.ts +35 -54
- package/src/chips/resolve.ts +316 -14
- package/src/chips/types.ts +388 -13
- package/src/display/profiles.ts +1 -1
- package/src/doctor.ts +110 -77
- package/src/dt-config/custom-board.ts +325 -0
- package/src/dt-config/kconfig.ts +177 -19
- package/src/dt-config/overlay.ts +1058 -450
- package/src/framework.manifest.ts +125 -178
- package/src/index.ts +57 -41
- package/src/lowering/adc.ts +222 -102
- package/src/lowering/ble.ts +32 -28
- package/src/lowering/dac.ts +82 -82
- package/src/lowering/fs.ts +18 -10
- package/src/lowering/gpio.ts +242 -152
- package/src/lowering/http.ts +512 -488
- package/src/lowering/hwtimer.ts +139 -101
- package/src/lowering/i2c.ts +116 -126
- package/src/lowering/index.ts +91 -93
- package/src/lowering/interrupts.ts +113 -21
- package/src/lowering/mqtt.ts +12 -6
- package/src/lowering/preferences.ts +327 -354
- package/src/lowering/pwm.ts +167 -74
- package/src/lowering/random.ts +3 -3
- package/src/lowering/sensor.ts +155 -0
- package/src/lowering/spi.ts +164 -124
- package/src/lowering/thread.ts +63 -0
- package/src/lowering/timing.ts +46 -72
- package/src/lowering/uart.ts +73 -51
- package/src/lowering/usb.ts +221 -0
- package/src/lowering/wdt.ts +95 -84
- package/src/lowering/wifi.ts +120 -111
- package/src/sdk/board-catalog-sync.ts +62 -0
- package/src/strategy.ts +888 -229
- package/src/toolchain/bossac-touch.ts +112 -0
- package/src/toolchain/compat.ts +8 -3
- package/src/toolchain/debug-config.ts +666 -522
- package/src/toolchain/env-check.ts +9 -9
- package/src/toolchain/index.ts +765 -44
- package/src/toolchain/scaffold.ts +81 -7
- package/src/toolchain/west-discover.ts +334 -316
- package/src/toolchain/west-spawn.ts +17 -5
- package/src/async/timer-polyfill.ts +0 -107
- package/src/chips/esp32.ts +0 -74
- package/src/chips/esp32s3.ts +0 -57
- package/src/chips/xiao-ble.ts +0 -70
- package/src/lowering/power.ts +0 -70
- package/src/lowering/pulse.ts +0 -93
- package/src/lowering/tone.ts +0 -60
- package/src/lowering/worker-backing.ts +0 -94
- package/src/lowering/worker.ts +0 -17
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ---------------------------------------------------------------------------
|
|
3
|
+
# init-workspace.sh — west init + west update a vanilla Zephyr workspace.
|
|
4
|
+
# Sourced by install.sh. Defines init_workspace(), which reads:
|
|
5
|
+
#
|
|
6
|
+
# ZEPHYR_MANIFEST_URL, ZEPHYR_MANIFEST_REV (versions.env)
|
|
7
|
+
# WORKSPACE_DIR (resolved by install.sh)
|
|
8
|
+
# ENV_NAME (versions.env)
|
|
9
|
+
# MAMBA (micromamba binary path, install.sh)
|
|
10
|
+
# MAMBA_ROOT_PREFIX (resolved by install.sh)
|
|
11
|
+
# DRY_RUN (install.sh flag)
|
|
12
|
+
#
|
|
13
|
+
# Uses `west init -m <url> --mr <rev> <dir>` to pin the manifest to a specific
|
|
14
|
+
# Zephyr tag, then `west update` to fetch zephyr + all manifest projects. The
|
|
15
|
+
# resulting <WORKSPACE_DIR>/zephyr/ is what ZEPHYR_BASE points at.
|
|
16
|
+
#
|
|
17
|
+
# Idempotent: if <WORKSPACE_DIR>/.west already exists, skips init and only
|
|
18
|
+
# updates. micromamba run -n runs west in the env without sourcing activation
|
|
19
|
+
# hooks (west is found on the env's PATH); activation is the user's later step.
|
|
20
|
+
# ---------------------------------------------------------------------------
|
|
21
|
+
|
|
22
|
+
init_workspace() {
|
|
23
|
+
echo "init-workspace: west init $WORKSPACE_DIR"
|
|
24
|
+
echo "init-workspace: manifest: $ZEPHYR_MANIFEST_URL @ $ZEPHYR_MANIFEST_REV"
|
|
25
|
+
|
|
26
|
+
if [ "$DRY_RUN" = "1" ]; then
|
|
27
|
+
echo "init-workspace: [DRY-RUN] would run: $MAMBA run -n $ENV_NAME west init -m $ZEPHYR_MANIFEST_URL --mr $ZEPHYR_MANIFEST_REV $WORKSPACE_DIR"
|
|
28
|
+
echo "init-workspace: [DRY-RUN] would run: $MAMBA run -n $ENV_NAME west update"
|
|
29
|
+
echo "init-workspace: [DRY-RUN] would set ZEPHYR_BASE=$WORKSPACE_DIR/zephyr"
|
|
30
|
+
return 0
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
export MAMBA_ROOT_PREFIX
|
|
34
|
+
if [ -d "$WORKSPACE_DIR/.west" ] && [ -f "$WORKSPACE_DIR/.west/config" ]; then
|
|
35
|
+
echo "init-workspace: $WORKSPACE_DIR already initialized — running west update only"
|
|
36
|
+
# A workspace adopted from a pre-existing install (or initialized by an
|
|
37
|
+
# older installer) can track a branch or an older tag — plain `west update`
|
|
38
|
+
# never moves the manifest repository, so it drifts out of sync with the
|
|
39
|
+
# SDK this installer pins. Re-pin the revision AND check the tag out so
|
|
40
|
+
# west update below syncs modules against the pinned manifest.
|
|
41
|
+
if cur_rev="$(cd "$WORKSPACE_DIR" && "$MAMBA" run -n "$ENV_NAME" west config manifest.revision 2>/dev/null)"; then
|
|
42
|
+
:
|
|
43
|
+
else
|
|
44
|
+
cur_rev=""
|
|
45
|
+
fi
|
|
46
|
+
if [ "$cur_rev" != "$ZEPHYR_MANIFEST_REV" ]; then
|
|
47
|
+
echo "init-workspace: pinning manifest revision -> $ZEPHYR_MANIFEST_REV (was: ${cur_rev:-<unset - default branch>})"
|
|
48
|
+
fi
|
|
49
|
+
# All three steps are idempotent; they must also run when the config
|
|
50
|
+
# already says the right thing but the tree is still on the old revision.
|
|
51
|
+
(cd "$WORKSPACE_DIR" && "$MAMBA" run -n "$ENV_NAME" west config manifest.revision "$ZEPHYR_MANIFEST_REV") \
|
|
52
|
+
|| { echo "init-workspace: west config manifest.revision failed" >&2; return 1; }
|
|
53
|
+
"$MAMBA" run -n "$ENV_NAME" git -C "$WORKSPACE_DIR/zephyr" fetch origin "refs/tags/$ZEPHYR_MANIFEST_REV:refs/tags/$ZEPHYR_MANIFEST_REV" \
|
|
54
|
+
|| { echo "init-workspace: git fetch tag $ZEPHYR_MANIFEST_REV failed" >&2; return 1; }
|
|
55
|
+
"$MAMBA" run -n "$ENV_NAME" git -C "$WORKSPACE_DIR/zephyr" checkout "$ZEPHYR_MANIFEST_REV" \
|
|
56
|
+
|| { echo "init-workspace: git checkout $ZEPHYR_MANIFEST_REV failed (dirty zephyr tree?)" >&2; return 1; }
|
|
57
|
+
else
|
|
58
|
+
if [ -d "$WORKSPACE_DIR/.west" ]; then
|
|
59
|
+
echo "init-workspace: $WORKSPACE_DIR/.west exists but its config is missing (interrupted init?) — re-initializing"
|
|
60
|
+
rm -rf "$WORKSPACE_DIR/.west"
|
|
61
|
+
fi
|
|
62
|
+
mkdir -p "$(dirname "$WORKSPACE_DIR")"
|
|
63
|
+
"$MAMBA" run -n "$ENV_NAME" west init -m "$ZEPHYR_MANIFEST_URL" --mr "$ZEPHYR_MANIFEST_REV" "$WORKSPACE_DIR" \
|
|
64
|
+
|| { echo "init-workspace: west init failed" >&2; return 1; }
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
# west update pulls zephyr + all modules. Slow the first time (large clone).
|
|
68
|
+
echo "init-workspace: running west update (this fetches zephyr + modules)..."
|
|
69
|
+
"$MAMBA" run -n "$ENV_NAME" west update \
|
|
70
|
+
|| { echo "init-workspace: west update failed" >&2; return 1; }
|
|
71
|
+
|
|
72
|
+
# Workspace patches — upstream fixes the pinned manifest revisions don't
|
|
73
|
+
# carry yet (see patches/*.patch). `git apply --check` makes this
|
|
74
|
+
# idempotent: an already-applied (or already-upstreamed) patch is skipped,
|
|
75
|
+
# never a hard failure. Each patch carries a `# typecad-repo: <path>`
|
|
76
|
+
# header naming its workspace repo (first-directory guesses break on
|
|
77
|
+
# nested projects like modules/tee/tf-m/trusted-firmware-m).
|
|
78
|
+
if [ -d "$PKG_DIR/patches" ]; then
|
|
79
|
+
for patch in "$PKG_DIR"/patches/*.patch; do
|
|
80
|
+
[ -f "$patch" ] || continue
|
|
81
|
+
repo_name=$(grep -m1 '^# typecad-repo:' "$patch" | sed 's/^# typecad-repo:[[:space:]]*//')
|
|
82
|
+
if [ -z "$repo_name" ]; then
|
|
83
|
+
echo "init-workspace: WARNING: $(basename "$patch") — no 'typecad-repo:' header, skipping" >&2
|
|
84
|
+
continue
|
|
85
|
+
fi
|
|
86
|
+
repo_dir="$WORKSPACE_DIR/$repo_name"
|
|
87
|
+
if [ ! -d "$repo_dir" ]; then
|
|
88
|
+
echo "init-workspace: WARNING: $(basename "$patch") — $repo_dir not present, skipping" >&2
|
|
89
|
+
continue
|
|
90
|
+
fi
|
|
91
|
+
echo "init-workspace: applying patch $(basename "$patch") to $repo_name..."
|
|
92
|
+
if git -C "$repo_dir" apply --check "$patch" 2>/dev/null; then
|
|
93
|
+
git -C "$repo_dir" apply "$patch" \
|
|
94
|
+
|| { echo "init-workspace: patch apply failed: $(basename "$patch")" >&2; return 1; }
|
|
95
|
+
else
|
|
96
|
+
echo "init-workspace: already applied (or inapplicable) — skipping"
|
|
97
|
+
fi
|
|
98
|
+
done
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
# Install Zephyr's pinned Python build deps (jsonschema, pykwalify, PyYAML,
|
|
102
|
+
# intelhex, canopen, ...) into the env. CMake checks for these and the build
|
|
103
|
+
# fails with e.g. "Missing jsonschema dependency" without them. Letting
|
|
104
|
+
# Zephyr's own requirements file drive this avoids chasing deps one-by-one
|
|
105
|
+
# and tracks the pinned Zephyr revision.
|
|
106
|
+
echo "init-workspace: installing Zephyr Python requirements (requirements-base.txt)..."
|
|
107
|
+
"$MAMBA" run -n "$ENV_NAME" pip install -r "$WORKSPACE_DIR/zephyr/scripts/requirements-base.txt" \
|
|
108
|
+
|| { echo "init-workspace: pip install requirements failed" >&2; return 1; }
|
|
109
|
+
|
|
110
|
+
# imgtool — MCUboot's signing tool. Not in requirements-base.txt, but TF-M /
|
|
111
|
+
# FVP signing steps invoke it as a module (mps4 corstone builds fail with
|
|
112
|
+
# "No module named 'imgtool'" without it).
|
|
113
|
+
echo "init-workspace: installing imgtool (MCUboot signing tool)..."
|
|
114
|
+
"$MAMBA" run -n "$ENV_NAME" pip install imgtool \
|
|
115
|
+
|| echo "init-workspace: WARNING: imgtool install failed — TF-M/FVP signing will not work" >&2
|
|
116
|
+
|
|
117
|
+
# TF-M secure-build tooling: the inner TF-M build's bl2_image_config step
|
|
118
|
+
# parses compile_commands (needs the `clang` python bindings) and Nordic's
|
|
119
|
+
# RTE_Device.h needs devicetree headers — requirements + libclang (native
|
|
120
|
+
# library the python `clang` bindings load) from conda-forge.
|
|
121
|
+
tfm_tools="$WORKSPACE_DIR/modules/tee/tf-m/trusted-firmware-m/tools/requirements.txt"
|
|
122
|
+
if [ -f "$tfm_tools" ]; then
|
|
123
|
+
echo "init-workspace: installing TF-M tools requirements..."
|
|
124
|
+
"$MAMBA" run -n "$ENV_NAME" pip install -r "$tfm_tools" >/dev/null 2>&1 \
|
|
125
|
+
|| echo "init-workspace: WARNING: TF-M tools requirements install failed" >&2
|
|
126
|
+
fi
|
|
127
|
+
echo "init-workspace: installing libclang (conda-forge)..."
|
|
128
|
+
"$MAMBA" install -n "$ENV_NAME" -c conda-forge libclang -y \
|
|
129
|
+
|| echo "init-workspace: WARNING: libclang install failed — TF-M bl2 config step will fail" >&2
|
|
130
|
+
|
|
131
|
+
# Build-relevant per-module Python requirements ONLY. A bare `find -name
|
|
132
|
+
# requirements.txt` would also pull docs/test/harness/example requirements
|
|
133
|
+
# (mbedtls docs, openthread harness, cmsis tests, lvgl docs, tf-m tools) — heavy
|
|
134
|
+
# and conflict-prone. Restrict to locations holding actual build tooling: HAL
|
|
135
|
+
# scripts/zephyr dirs (esptool for espressif, vendor flash/script tools) and
|
|
136
|
+
# top-level lib codegen (nanopb, zcbor). Board support itself is universal —
|
|
137
|
+
# west fetched every module and the SDK ships every cross-toolchain — so these
|
|
138
|
+
# are the few extras a build needs beyond requirements-base.txt.
|
|
139
|
+
echo "init-workspace: installing per-module Python requirements (build tooling only)..."
|
|
140
|
+
for req in \
|
|
141
|
+
"$WORKSPACE_DIR"/modules/hal/*/scripts/requirements.txt \
|
|
142
|
+
"$WORKSPACE_DIR"/modules/hal/*/zephyr/requirements.txt \
|
|
143
|
+
"$WORKSPACE_DIR"/modules/lib/*/requirements.txt \
|
|
144
|
+
"$WORKSPACE_DIR"/modules/lib/*/scripts/requirements.txt
|
|
145
|
+
do
|
|
146
|
+
[ -f "$req" ] || continue
|
|
147
|
+
echo "init-workspace: module requirements: ${req#"$WORKSPACE_DIR"/}"
|
|
148
|
+
"$MAMBA" run -n "$ENV_NAME" pip install -r "$req" >/dev/null 2>&1 \
|
|
149
|
+
|| echo "init-workspace: WARNING: module requirements install failed: $req" >&2
|
|
150
|
+
done
|
|
151
|
+
|
|
152
|
+
echo "init-workspace: done — ZEPHYR_BASE=$WORKSPACE_DIR/zephyr"
|
|
153
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ---------------------------------------------------------------------------
|
|
3
|
+
# write-activation.sh — install conda activation/deactivation hooks into the env.
|
|
4
|
+
# Sourced by install.sh. Defines write_activation(), which reads:
|
|
5
|
+
#
|
|
6
|
+
# ENV_PREFIX (resolved by install.sh: env root)
|
|
7
|
+
# WORKSPACE_DIR (resolved by install.sh)
|
|
8
|
+
# ZEPHYR_SDK_INSTALL_DIR (resolved by install.sh)
|
|
9
|
+
# PKG_DIR (install.sh: this package's root)
|
|
10
|
+
# ZEPHYR_SDK_VERSION (versions.env)
|
|
11
|
+
# DRY_RUN (install.sh flag)
|
|
12
|
+
#
|
|
13
|
+
# Writes three env-vars files (sh / bat / ps1) carrying the RESOLVED paths,
|
|
14
|
+
# then copies the static hooks from etc/conda/ into the env prefix. The hooks
|
|
15
|
+
# are shell-agnostic boilerplate that only source env-vars.* and export
|
|
16
|
+
# ZEPHYR_BASE + ZEPHYR_SDK_INSTALL_DIR — the per-machine values live in one
|
|
17
|
+
# editable file per shell, so re-pointing the SDK never touches hook logic.
|
|
18
|
+
#
|
|
19
|
+
# Why this makes framework-zephyr work with zero code changes: when the env is
|
|
20
|
+
# activated, west (from the conda env) is on PATH and ZEPHYR_BASE is exported,
|
|
21
|
+
# so west-discover.ts's discoverFromPath() (Strategy 1) wins immediately and
|
|
22
|
+
# returns the correct zephyrBase.
|
|
23
|
+
# ---------------------------------------------------------------------------
|
|
24
|
+
|
|
25
|
+
write_activation() {
|
|
26
|
+
local act_dst="$ENV_PREFIX/etc/conda/activate.d"
|
|
27
|
+
local deact_dst="$ENV_PREFIX/etc/conda/deactivate.d"
|
|
28
|
+
local zb="$WORKSPACE_DIR/zephyr"
|
|
29
|
+
|
|
30
|
+
echo "write-activation: hooks -> $act_dst / $deact_dst"
|
|
31
|
+
|
|
32
|
+
if [ "$DRY_RUN" = "1" ]; then
|
|
33
|
+
echo "write-activation: [DRY-RUN] would write env-vars.{sh,bat,ps1} to $ENV_PREFIX/etc/conda/"
|
|
34
|
+
echo "write-activation: [DRY-RUN] would copy activate.d/zephyr.{sh,bat,ps1} + deactivate.d/zephyr.{sh,bat,ps1}"
|
|
35
|
+
echo "write-activation: [DRY-RUN] ZEPHYR_BASE=$zb ZEPHYR_SDK_INSTALL_DIR=$ZEPHYR_SDK_INSTALL_DIR"
|
|
36
|
+
return 0
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
mkdir -p "$act_dst" "$deact_dst"
|
|
40
|
+
|
|
41
|
+
# POSIX (bash/zsh) — sourced by activate.d/zephyr.sh
|
|
42
|
+
cat > "$ENV_PREFIX/etc/conda/env-vars.sh" <<EOF
|
|
43
|
+
# Resolved by the typeCAD Zephyr installer. Sourced by etc/conda/activate.d/zephyr.sh.
|
|
44
|
+
# Edit these two paths to re-point the workspace or SDK without touching the hooks.
|
|
45
|
+
export TYPECAD_ZEPHYR_BASE="$zb"
|
|
46
|
+
export TYPECAD_ZEPHYR_SDK_INSTALL_DIR="$ZEPHYR_SDK_INSTALL_DIR"
|
|
47
|
+
EOF
|
|
48
|
+
|
|
49
|
+
# cmd.exe — called by activate.d/zephyr.bat
|
|
50
|
+
cat > "$ENV_PREFIX/etc/conda/env-vars.bat" <<EOF
|
|
51
|
+
@echo off
|
|
52
|
+
REM Resolved by the typeCAD Zephyr installer. Called by etc/conda/activate.d/zephyr.bat.
|
|
53
|
+
set "TYPECAD_ZEPHYR_BASE=$zb"
|
|
54
|
+
set "TYPECAD_ZEPHYR_SDK_INSTALL_DIR=$ZEPHYR_SDK_INSTALL_DIR"
|
|
55
|
+
EOF
|
|
56
|
+
|
|
57
|
+
# PowerShell — dot-sourced by activate.d/zephyr.ps1.
|
|
58
|
+
# NB: backslash-escape the $ in $env: (\$env:) — in an UNQUOTED heredoc a
|
|
59
|
+
# backtick is command substitution, not an escape, so `` `$env `` would try to
|
|
60
|
+
# expand the unbound `env` under `set -u` and abort. \$ produces a literal $.
|
|
61
|
+
cat > "$ENV_PREFIX/etc/conda/env-vars.ps1" <<EOF
|
|
62
|
+
# Resolved by the typeCAD Zephyr installer. Dot-sourced by etc/conda/activate.d/zephyr.ps1.
|
|
63
|
+
\$env:TYPECAD_ZEPHYR_BASE = "$zb"
|
|
64
|
+
\$env:TYPECAD_ZEPHYR_SDK_INSTALL_DIR = "$ZEPHYR_SDK_INSTALL_DIR"
|
|
65
|
+
EOF
|
|
66
|
+
|
|
67
|
+
# Static hooks (shell-agnostic; they only read env-vars.*).
|
|
68
|
+
cp "$PKG_DIR/etc/conda/activate.d/zephyr.sh" "$act_dst/zephyr.sh"
|
|
69
|
+
cp "$PKG_DIR/etc/conda/activate.d/zephyr.bat" "$act_dst/zephyr.bat"
|
|
70
|
+
cp "$PKG_DIR/etc/conda/activate.d/zephyr.ps1" "$act_dst/zephyr.ps1"
|
|
71
|
+
cp "$PKG_DIR/etc/conda/deactivate.d/zephyr.sh" "$deact_dst/zephyr.sh"
|
|
72
|
+
cp "$PKG_DIR/etc/conda/deactivate.d/zephyr.bat" "$deact_dst/zephyr.bat"
|
|
73
|
+
cp "$PKG_DIR/etc/conda/deactivate.d/zephyr.ps1" "$deact_dst/zephyr.ps1"
|
|
74
|
+
|
|
75
|
+
echo "write-activation: done"
|
|
76
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# typecad-repo: modules/tee/tf-m/trusted-firmware-m
|
|
2
|
+
# Applied by the typeCAD installer after west update (git apply --check guarded).
|
|
3
|
+
diff --git a/tools/modules/c_include.py b/tools/modules/c_include.py
|
|
4
|
+
index 636f31dd0..2ea02646e 100644
|
|
5
|
+
--- a/tools/modules/c_include.py
|
|
6
|
+
+++ b/tools/modules/c_include.py
|
|
7
|
+
@@ -13,7 +13,11 @@ def get_compile_command(compile_commands_file, c_file):
|
|
8
|
+
with open(compile_commands_file, "rt") as f:
|
|
9
|
+
compile_commands = json.load(f)
|
|
10
|
+
|
|
11
|
+
- return [x['command'] for x in compile_commands if c_file in x['file']][0]
|
|
12
|
+
+ # Match on normalized separators: on Windows x['file'] carries
|
|
13
|
+
+ # backslashes while callers pass forward-slash names ("bl1_2/main.c"),
|
|
14
|
+
+ # and the raw substring match then finds nothing (IndexError downstream).
|
|
15
|
+
+ return [x['command'] for x in compile_commands
|
|
16
|
+
+ if os.path.normpath(c_file) in os.path.normpath(x['file'])][0]
|
|
17
|
+
|
|
18
|
+
def get_includes(compile_commands_file, c_file):
|
|
19
|
+
compile_command = get_compile_command(compile_commands_file, c_file).split()
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# typecad-repo: zephyr
|
|
2
|
+
# Applied by the typeCAD installer after west update (git apply --check guarded).
|
|
3
|
+
diff --git a/modules/trusted-firmware-m/nordic/CMakeLists.txt b/modules/trusted-firmware-m/nordic/CMakeLists.txt
|
|
4
|
+
index 48b0a836e07..13b7e370481 100644
|
|
5
|
+
--- a/modules/trusted-firmware-m/nordic/CMakeLists.txt
|
|
6
|
+
+++ b/modules/trusted-firmware-m/nordic/CMakeLists.txt
|
|
7
|
+
@@ -10,10 +10,17 @@ set(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})
|
|
8
|
+
set(partition_includes
|
|
9
|
+
${Trusted\ Firmware\ M_SOURCE_DIR}/platform/ext/target/nordic_nrf/common/${NRF_SOC_VARIANT}/partition
|
|
10
|
+
${CMAKE_BINARY_DIR}/../zephyr/include/generated
|
|
11
|
+
+ # RTE_Device.h (this dir) includes <zephyr/devicetree.h>, which lives in
|
|
12
|
+
+ # the zephyr SOURCE tree — the forwarded generated/ dirs above do not
|
|
13
|
+
+ # carry it. Upstream on Windows the secure/bl2 build (Driver_Flash.c)
|
|
14
|
+
+ # fails with "zephyr/devicetree.h: No such file or directory" without
|
|
15
|
+
+ # this; ZEPHYR_BASE is inherited from the outer build's environment.
|
|
16
|
+
+ $ENV{ZEPHYR_BASE}/include
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
set(board_includes
|
|
20
|
+
${CMAKE_BINARY_DIR}/../zephyr/misc/generated/syscalls_links/include
|
|
21
|
+
+ $ENV{ZEPHYR_BASE}/include
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
target_include_directories(platform_region_defs
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# ---------------------------------------------------------------------------
|
|
2
|
+
# typeCAD Zephyr - per-project env activator (PowerShell).
|
|
3
|
+
#
|
|
4
|
+
# Run: . .\.typecad\activate-zephyr.ps1
|
|
5
|
+
# Auto-run on terminal open: see .vscode/settings.json in this template.
|
|
6
|
+
#
|
|
7
|
+
# Activates the micromamba env created by the typeCAD Zephyr installer. After
|
|
8
|
+
# activation, `west` is on PATH and ZEPHYR_BASE / ZEPHYR_SDK_INSTALL_DIR point
|
|
9
|
+
# at the new install, so `npx cuttlefish build` uses it automatically.
|
|
10
|
+
#
|
|
11
|
+
# Override the env name with $TYPECAD_ZEPHYR_ENV (default: "zephyr").
|
|
12
|
+
# ---------------------------------------------------------------------------
|
|
13
|
+
$ErrorActionPreference = 'Stop'
|
|
14
|
+
$EnvName = if ($env:TYPECAD_ZEPHYR_ENV) { $env:TYPECAD_ZEPHYR_ENV } else { 'zephyr' }
|
|
15
|
+
|
|
16
|
+
# Load the micromamba shell hook if it isn't already available (e.g. this shell
|
|
17
|
+
# was launched with -NoProfile, or shell init hasn't been run on this machine).
|
|
18
|
+
if (-not (Get-Command micromamba -ErrorAction SilentlyContinue)) {
|
|
19
|
+
$mm = Join-Path $env:USERPROFILE 'micromamba\Library\bin\micromamba.exe'
|
|
20
|
+
if (-not (Test-Path $mm)) {
|
|
21
|
+
throw "micromamba not found at $mm. Run the typeCAD Zephyr installer first: node packages/framework-zephyr/installer/install.mjs"
|
|
22
|
+
}
|
|
23
|
+
# NB: the `| Invoke-Expression` pipe form fails under PowerShell (it parses
|
|
24
|
+
# the multi-line hook line-by-line). Capture as an array, join with newlines.
|
|
25
|
+
Invoke-Expression ((& $mm shell hook -s powershell) -join [char]10)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
micromamba activate $EnvName
|
|
29
|
+
|
|
30
|
+
Write-Host "typeCAD Zephyr: activated '$EnvName' -> $((Get-Command west -ErrorAction SilentlyContinue).Source)" -ForegroundColor DarkGray
|
|
31
|
+
Write-Host " ZEPHYR_BASE = $env:ZEPHYR_BASE" -ForegroundColor DarkGray
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# ---------------------------------------------------------------------------
|
|
2
|
+
# typeCAD Zephyr - per-project env activator (bash / zsh).
|
|
3
|
+
#
|
|
4
|
+
# Source: source .typecad/activate-zephyr.sh
|
|
5
|
+
# Auto-run on terminal open: use direnv (.envrc -> source this file) or a VS
|
|
6
|
+
# Code bash terminal profile with --rcfile.
|
|
7
|
+
#
|
|
8
|
+
# Activates the micromamba env created by the typeCAD Zephyr installer. After
|
|
9
|
+
# activation, `west` is on PATH and ZEPHYR_BASE / ZEPHYR_SDK_INSTALL_DIR point
|
|
10
|
+
# at the new install, so `npx cuttlefish build` uses it automatically.
|
|
11
|
+
#
|
|
12
|
+
# Override the env name with $TYPECAD_ZEPHYR_ENV (default: "zephyr").
|
|
13
|
+
# ---------------------------------------------------------------------------
|
|
14
|
+
EnvName="${TYPECAD_ZEPHYR_ENV:-zephyr}"
|
|
15
|
+
|
|
16
|
+
# Load the micromamba shell hook if it isn't already on PATH.
|
|
17
|
+
if ! command -v micromamba >/dev/null 2>&1; then
|
|
18
|
+
mm="$HOME/micromamba/bin/micromamba"
|
|
19
|
+
if [ ! -x "$mm" ]; then
|
|
20
|
+
echo "micromamba not found at $mm. Run the typeCAD Zephyr installer first:" >&2
|
|
21
|
+
echo " node packages/framework-zephyr/installer/install.mjs" >&2
|
|
22
|
+
# `return` when sourced, `exit` when executed.
|
|
23
|
+
return 1 2>/dev/null || exit 1
|
|
24
|
+
fi
|
|
25
|
+
eval "$("$mm" shell hook --shell bash)"
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
micromamba activate "$EnvName"
|
|
29
|
+
|
|
30
|
+
echo "typeCAD Zephyr: activated '$EnvName' -> $(command -v west)"
|
|
31
|
+
echo " ZEPHYR_BASE = $ZEPHYR_BASE"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// typeCAD Zephyr - VS Code terminal auto-activation (Windows).
|
|
3
|
+
//
|
|
4
|
+
// New integrated terminals launch the "zephyr-powershell" profile, which runs
|
|
5
|
+
// .typecad/activate-zephyr.ps1 (-NoExit keeps the shell open afterward). This
|
|
6
|
+
// makes `micromamba activate zephyr` happen automatically, so `west` is on
|
|
7
|
+
// PATH and ZEPHYR_BASE / ZEPHYR_SDK_INSTALL_DIR are set without per-session
|
|
8
|
+
// typing - and `npx cuttlefish build` uses the new install.
|
|
9
|
+
//
|
|
10
|
+
// If this project already has a .vscode/settings.json, MERGE these keys into
|
|
11
|
+
// it by hand rather than overwriting the whole file.
|
|
12
|
+
//
|
|
13
|
+
// To make activation OPT-IN (pick "zephyr-powershell" from the terminal
|
|
14
|
+
// dropdown) instead of automatic, delete the "defaultProfile.windows" line.
|
|
15
|
+
// Do that in multi-framework workspaces (e.g. the typecode monorepo, which
|
|
16
|
+
// also does ESP-IDF/Arduino) so this doesn't clash with other toolchains.
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
{
|
|
19
|
+
"terminal.integrated.defaultProfile.windows": "zephyr-powershell",
|
|
20
|
+
"terminal.integrated.profiles.windows": {
|
|
21
|
+
"zephyr-powershell": {
|
|
22
|
+
// Prefer PowerShell 7 if installed; fall back to Windows PowerShell 5.1.
|
|
23
|
+
"path": [
|
|
24
|
+
"${env:ProgramFiles}\\PowerShell\\7\\pwsh.exe",
|
|
25
|
+
"${env:WINDIR}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
|
|
26
|
+
],
|
|
27
|
+
"args": ["-NoExit", "-File", "${workspaceFolder}\\.typecad\\activate-zephyr.ps1"]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# typeCAD Zephyr — per-project activation template
|
|
2
|
+
|
|
3
|
+
Copy these files into a cuttlefish Zephyr project so that opening a terminal in
|
|
4
|
+
it auto-activates the micromamba env created by the typeCAD Zephyr installer.
|
|
5
|
+
Once active, `west` is on PATH and `ZEPHYR_BASE` / `ZEPHYR_SDK_INSTALL_DIR` are
|
|
6
|
+
set, so `npx cuttlefish build` uses the new install automatically — no
|
|
7
|
+
per-session `micromamba activate` typing.
|
|
8
|
+
|
|
9
|
+
## Files
|
|
10
|
+
|
|
11
|
+
| File | Role |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `.typecad/activate-zephyr.ps1` | Windows activator. Run: `. .\.typecad\activate-zephyr.ps1` |
|
|
14
|
+
| `.typecad/activate-zephyr.sh` | POSIX activator (bash/zsh). Source: `source .typecad/activate-zephyr.sh` |
|
|
15
|
+
| `.vscode/settings.json` | VS Code terminal profile that auto-runs the Windows activator on every new terminal |
|
|
16
|
+
|
|
17
|
+
Both activators are **machine-agnostic** — they find micromamba via
|
|
18
|
+
`$USERPROFILE\micromamba\…` / `$HOME/micromamba/…` and the env name, so the
|
|
19
|
+
same files work across machines with no hardcoded absolute paths.
|
|
20
|
+
|
|
21
|
+
## Install into a project
|
|
22
|
+
|
|
23
|
+
From the project root:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
cp -r packages/framework-zephyr/installer/templates/project/.typecad ./
|
|
27
|
+
mkdir -p .vscode
|
|
28
|
+
cp packages/framework-zephyr/installer/templates/project/.vscode/settings.json ./.vscode/settings.json
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If the project **already** has a `.vscode/settings.json`, **merge** the
|
|
32
|
+
`terminal.integrated.*` keys in by hand — don't overwrite the whole file.
|
|
33
|
+
|
|
34
|
+
## Default vs. opt-in
|
|
35
|
+
|
|
36
|
+
The shipped `settings.json` sets `terminal.integrated.defaultProfile.windows` so
|
|
37
|
+
activation is **automatic** on every new terminal — correct for a dedicated
|
|
38
|
+
Zephyr project. In a **multi-framework** workspace (e.g. the typecode monorepo,
|
|
39
|
+
which also does ESP-IDF/Arduino), delete the `defaultProfile.windows` line so
|
|
40
|
+
the profile is opt-in via the terminal dropdown instead — otherwise every
|
|
41
|
+
terminal inherits the Zephyr env and clashes with the other toolchains.
|
|
42
|
+
|
|
43
|
+
## macOS / Linux
|
|
44
|
+
|
|
45
|
+
VS Code terminal auto-activation on POSIX isn't wired here (the Windows path is
|
|
46
|
+
where the activation friction was highest). Two options:
|
|
47
|
+
|
|
48
|
+
- **direnv** (recommended): add a `.envrc` to the project containing
|
|
49
|
+
`source .typecad/activate-zephyr.sh`. direnv auto-sources it on `cd` in.
|
|
50
|
+
- A VS Code bash terminal profile using `--rcfile` that sources both
|
|
51
|
+
`~/.bashrc` and the activator.
|
|
52
|
+
|
|
53
|
+
The `.sh` activator is safe to source repeatedly and is direnv-compatible.
|
|
54
|
+
|
|
55
|
+
## Override the env name
|
|
56
|
+
|
|
57
|
+
Set `TYPECAD_ZEPHYR_ENV` before activating to target a differently-named env
|
|
58
|
+
(default: `zephyr`), e.g. if you maintain multiple SDK versions side by side.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# ---------------------------------------------------------------------------
|
|
2
|
+
# typeCAD Zephyr installer — pinned versions & download URLs.
|
|
3
|
+
#
|
|
4
|
+
# Single source of truth, sourced by install.sh / install.ps1 / the test suite.
|
|
5
|
+
# Keep this shell-sourceable (KEY=value, no spaces around =, quote anything with
|
|
6
|
+
# special characters). Path defaults that need ${HOME} expansion live in the
|
|
7
|
+
# install scripts, not here — this file holds only versions and URLs.
|
|
8
|
+
#
|
|
9
|
+
# To upgrade the SDK or the Zephyr manifest, change the two values below and
|
|
10
|
+
# re-run install.sh. The SHA256 fields should be filled in from the installer's
|
|
11
|
+
# post-download output (the SDK 0.17.x line ships no checksum file; we pin the
|
|
12
|
+
# hash directly for reproducibility). A value of TODO skips verification with a
|
|
13
|
+
# warning — fill it in after your first verified download.
|
|
14
|
+
# ---------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
# Official Zephyr SDK. 1.0.x dropped "full" bundles: the _gnu bundle = all GNU
|
|
17
|
+
# toolchains + host tools (the previous "full" equivalent). Zephyr 4.4 needs
|
|
18
|
+
# SDK 1.0.x; Zephyr 4.3.x works with 0.17.x (--sdk-version 0.17.4).
|
|
19
|
+
ZEPHYR_SDK_VERSION=1.0.1
|
|
20
|
+
ZEPHYR_SDK_BUNDLE_SUFFIX=_gnu
|
|
21
|
+
SDK_RELEASE_BASE=https://github.com/zephyrproject-rtos/sdk-ng/releases/download
|
|
22
|
+
|
|
23
|
+
# Vanilla Zephyr west manifest (the local west workspace is initialized from this).
|
|
24
|
+
ZEPHYR_MANIFEST_URL=https://github.com/zephyrproject-rtos/zephyr.git
|
|
25
|
+
ZEPHYR_MANIFEST_REV=v4.4.2
|
|
26
|
+
|
|
27
|
+
# micromamba (single static binary) — micro.mamba.pm redirects to the latest
|
|
28
|
+
# build for the requested conda platform subdir.
|
|
29
|
+
MICROMAMBA_BASE=https://micro.mamba.pm/api/micromamba
|
|
30
|
+
|
|
31
|
+
# Name of the conda/mamba environment the installer creates.
|
|
32
|
+
ENV_NAME=zephyr
|
|
33
|
+
|
|
34
|
+
# dfu-util (Windows only) — west flash's dfu-util runner (STM32 ROM DFU
|
|
35
|
+
# bootloader boards, e.g. the WeAct Black Pill) shells out to dfu-util; the
|
|
36
|
+
# tool must be on PATH or the runner dies with a raw FileNotFoundError.
|
|
37
|
+
# conda-forge has no dfu-util build, so the Windows installer fetches MSYS2's
|
|
38
|
+
# mingw64 packages (dfu-util + its libusb / libwinpthread runtime DLLs) and
|
|
39
|
+
# unpacks them into the env's Libraryin — on the activation PATH and on the
|
|
40
|
+
# PATH of the `micromamba run -n zephyr west flash` the framework spawns.
|
|
41
|
+
# install.sh (POSIX) installs via the system package manager instead.
|
|
42
|
+
# NOTE: MSYS2 prunes superseded package versions from the repo — bump these
|
|
43
|
+
# together (name + hash) when a refresh 404s, and verify the new SHA256.
|
|
44
|
+
MSYS2_MINGW64_BASE=https://repo.msys2.org/mingw/mingw64
|
|
45
|
+
DFU_UTIL_PKG=mingw-w64-x86_64-dfu-util-0.11-2
|
|
46
|
+
DFU_UTIL_PKG_SHA256=950652382f6632ac4b7e42d39d0cda19ef593f1a490c56c814e9f65a5aabe89c
|
|
47
|
+
LIBUSB_PKG=mingw-w64-x86_64-libusb-1.0.30-1
|
|
48
|
+
LIBUSB_PKG_SHA256=124edc26b009678a4c5e759481a364abf63ed7f2f49a53092e8bd0a47c0c0740
|
|
49
|
+
LIBWINPTHREAD_PKG=mingw-w64-x86_64-libwinpthread-14.0.0.r98.g19f5121a2-1
|
|
50
|
+
LIBWINPTHREAD_PKG_SHA256=565a7ac155098633ce66096c02c98f274127111758fd25d3f0e5451c4cd21120
|
|
51
|
+
|
|
52
|
+
# bossac (Windows only) — west flash's bossac runner (SAMD SAM-BA bootloader
|
|
53
|
+
# boards — the Arduino Nano 33 IoT, Zero, MKR series) shells out to bossac,
|
|
54
|
+
# and FindHostTools resolves find_program(BOSSAC) at build-configure time; a
|
|
55
|
+
# missing binary bakes BOSSAC-NOTFOUND into the runner args and west flash
|
|
56
|
+
# dies with "required program bossac not found". bossac is in neither the
|
|
57
|
+
# Zephyr SDK nor conda-forge; the official upstream MSI extracts cleanly
|
|
58
|
+
# with 7z and ships a self-contained bossac.exe (system DLLs only).
|
|
59
|
+
BOSSA_URL=https://github.com/shumatech/BOSSA/releases/download/1.9.1/bossa-x64-1.9.1.msi
|
|
60
|
+
BOSSA_SHA256=d6e8fe3a4ef4c31cfecbf8a4c0b52bfc07cf1dff11fb3f565c8ea5d8f7b94a17
|
|
61
|
+
|
|
62
|
+
# Per-platform SHA256 of the SDK bundle, from the release's official sha256.sum
|
|
63
|
+
# (1.0.x publishes one; for 0.17.x these were computed on first download).
|
|
64
|
+
# TODO = not yet pinned; the fetch step skips verification and prints the
|
|
65
|
+
# computed hash so you can pin it. NONE = no build exists for that platform
|
|
66
|
+
# (macOS Intel has no 1.0.x SDK) — the fetch step fails with guidance.
|
|
67
|
+
# Bundle filenames: zephyr-sdk-${ZEPHYR_SDK_VERSION}_${platform}${ZEPHYR_SDK_BUNDLE_SUFFIX}.${ext}
|
|
68
|
+
# (minimal bundle: zephyr-sdk-..._${platform}_minimal.${ext}, unchanged by 1.0.x)
|
|
69
|
+
SHA256_linux_x86_64=37a8c5b5569c2b482d39099c65fe3ddac4e43524996c731907e1e9f5818cbba7
|
|
70
|
+
SHA256_linux_aarch64=6e38018f70af5e90c18cc04c2f8ac5a91c99f5559b25692d1b0de328c3edb88a
|
|
71
|
+
SHA256_macos_x86_64=NONE
|
|
72
|
+
SHA256_macos_aarch64=3dc6346a5888ebbcee19801bf6271627f04819778fe0ef3c7f3c7528e8f4ef2a
|
|
73
|
+
SHA256_windows_x86_64=811cb97797ddf6198eea66b030168d12512f605c7e332ea24d2cbe47b769c472
|
|
74
|
+
|
|
75
|
+
# ---------------------------------------------------------------------------
|
|
76
|
+
# Platform groups — user-facing toolchain selection.
|
|
77
|
+
#
|
|
78
|
+
# The sdk-ng release publishes individual toolchain tarballs
|
|
79
|
+
# (toolchain_${platform}_${target}.${ext}) and a minimal bundle
|
|
80
|
+
# (zephyr-sdk-${version}_${platform}_minimal.${ext} — cmake config +
|
|
81
|
+
# sdk_version, no toolchains, ~10MB). The full 1.5GB bundle ships every
|
|
82
|
+
# toolchain; most users need only one group (~100-300MB).
|
|
83
|
+
#
|
|
84
|
+
# Each PLATFORM_<id> maps a user-facing group to its toolchain targets.
|
|
85
|
+
# install.mjs presents these as the interactive checklist; --platforms
|
|
86
|
+
# accepts comma-separated group ids, or "all" for the full bundle.
|
|
87
|
+
# ---------------------------------------------------------------------------
|
|
88
|
+
PLATFORM_arm="arm-zephyr-eabi"
|
|
89
|
+
PLATFORM_esp32="xtensa-espressif_esp32_zephyr-elf xtensa-espressif_esp32s2_zephyr-elf xtensa-espressif_esp32s3_zephyr-elf"
|
|
90
|
+
PLATFORM_riscv="riscv64-zephyr-elf"
|
|
91
|
+
PLATFORM_arc="arc-zephyr-elf"
|
|
92
|
+
PLATFORM_rx="rx-zephyr-elf"
|
|
93
|
+
PLATFORM_x86="x86_64-zephyr-elf"
|
|
94
|
+
PLATFORM_aarch64="aarch64-zephyr-elf"
|
|
95
|
+
# Human labels for the checklist (shown by install.mjs).
|
|
96
|
+
PLATFORM_arm_LABEL="ARM Cortex-M (nRF, RP2040, STM32, SAMD, ...)"
|
|
97
|
+
PLATFORM_esp32_LABEL="ESP32 / ESP32-S2 / ESP32-S3 (Xtensa)"
|
|
98
|
+
PLATFORM_riscv_LABEL="RISC-V (ESP32-C3/C6, generic RISC-V)"
|
|
99
|
+
PLATFORM_arc_LABEL="ARC EM / HS (DesignWare EMSDP, IoT devkits, ...)"
|
|
100
|
+
PLATFORM_rx_LABEL="Renesas RX (RX261, RX72N, ...)"
|
|
101
|
+
PLATFORM_x86_LABEL="x86 / native_sim"
|
|
102
|
+
PLATFORM_aarch64_LABEL="aarch64 (Cortex-A: FVP, BeaglePlay A53, ...)"
|
|
103
|
+
# Approximate download size per group (shown in the checklist summary).
|
|
104
|
+
PLATFORM_arm_SIZE="~150 MB"
|
|
105
|
+
PLATFORM_esp32_SIZE="~300 MB"
|
|
106
|
+
PLATFORM_riscv_SIZE="~120 MB"
|
|
107
|
+
PLATFORM_arc_SIZE="~180 MB"
|
|
108
|
+
PLATFORM_rx_SIZE="~150 MB"
|
|
109
|
+
PLATFORM_x86_SIZE="~100 MB"
|
|
110
|
+
PLATFORM_aarch64_SIZE="~100 MB"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typecad/framework-zephyr",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
4
|
-
"description": "TypeCAD framework package for the Zephyr RTOS
|
|
3
|
+
"version": "1.0.0-alpha.15",
|
|
4
|
+
"description": "TypeCAD framework package for the Zephyr RTOS \u2014 west/CMake build, devicetree-driven GPIO",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -19,30 +19,30 @@
|
|
|
19
19
|
"default": "./dist/framework.manifest.js"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"zephyr-installer": "installer/install.mjs",
|
|
24
|
+
"typecad-zephyr-install": "installer/install.mjs"
|
|
25
|
+
},
|
|
22
26
|
"files": [
|
|
23
27
|
"dist",
|
|
24
|
-
"src"
|
|
28
|
+
"src",
|
|
29
|
+
"installer"
|
|
25
30
|
],
|
|
26
31
|
"scripts": {
|
|
27
32
|
"build": "tsc",
|
|
28
33
|
"prepublishOnly": "npm run build",
|
|
29
|
-
"test": "vitest run --root ../.. tests/packages/framework-zephyr/manifest.test.ts",
|
|
34
|
+
"test": "vitest run --root ../.. tests/packages/framework-zephyr/manifest.test.ts tests/packages/framework-zephyr/installer-tests/",
|
|
30
35
|
"test:coverage": "npm test && tsx ../../scripts/render-framework-coverage.ts",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"test:hw:timers": "npm exec -- cuttlefish-test tests/42-timers.test.ts",
|
|
35
|
-
"test:http": "tsx ../../tests/hardware/start-server.ts",
|
|
36
|
-
"test:hw:http": "cd ../../tests/hardware && npm exec -- cuttlefish-test http-client.test.ts",
|
|
37
|
-
"test:mqtt": "tsx ../../tests/hardware/start-server.ts",
|
|
38
|
-
"test:hw:mqtt": "cd ../../tests/hardware && npm exec -- cuttlefish-test mqtt-client.test.ts"
|
|
36
|
+
"hal": "node hal/run.mjs",
|
|
37
|
+
"setup": "node installer/install.mjs",
|
|
38
|
+
"dry-run": "node installer/install.mjs --dry-run"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@typecad/cuttlefish": "1.0.0-alpha.
|
|
41
|
+
"@typecad/cuttlefish": "1.0.0-alpha.15",
|
|
42
|
+
"@typecad/hal": "1.0.0-alpha.15"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
|
-
"@typecad/expect": "1.0.0-alpha.
|
|
45
|
-
"@typecad/board-xiao-nrf52840": "1.0.0-alpha.13",
|
|
45
|
+
"@typecad/expect": "1.0.0-alpha.15",
|
|
46
46
|
"typescript": "^5.7.3"
|
|
47
47
|
},
|
|
48
48
|
"license": "MIT",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"zephyr"
|
|
76
76
|
],
|
|
77
77
|
"engines": {
|
|
78
|
-
"node": ">=
|
|
78
|
+
"node": ">=22.11.0"
|
|
79
79
|
},
|
|
80
80
|
"author": "typecad0",
|
|
81
81
|
"sideEffects": false
|