@typecad/framework-zephyr 1.0.0-alpha.16 → 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.
- package/LICENSE +202 -21
- package/README.md +49 -87
- package/dist/as-built.d.ts +2 -2
- package/dist/as-built.js +2 -2
- package/dist/boardgen.d.ts +1 -9
- package/dist/boardgen.js +228 -45
- package/dist/chips/types.d.ts +1 -1
- package/dist/debug-codegen.js +1 -1
- package/dist/display/touch-adapter.js +1 -1
- package/dist/display/ui-adapter.js +549 -549
- package/dist/doctor.js +4 -4
- package/dist/dt-config/custom-board.js +2 -2
- package/dist/dt-config/kconfig.js +18 -12
- package/dist/dt-config/overlay.d.ts +2 -2
- package/dist/dt-config/overlay.js +2 -2
- package/dist/framework.manifest.d.ts +3 -3
- package/dist/framework.manifest.js +10 -7
- package/dist/index.js +5 -5
- package/dist/licenses.d.ts +2 -2
- package/dist/licenses.js +8 -8
- package/dist/lowering/fs.js +1 -1
- package/dist/lowering/gpio.js +0 -32
- package/dist/lowering/http.js +264 -32
- package/dist/lowering/i2c.js +0 -8
- package/dist/lowering/interrupts.js +6 -0
- package/dist/lowering/mqtt.js +110 -8
- package/dist/lowering/usb.js +11 -11
- package/dist/lowering/wdt.js +2 -29
- package/dist/sdk/board-catalog-sync.d.ts +1 -3
- package/dist/sdk/board-catalog-sync.js +4 -10
- package/dist/strategy.d.ts +22 -44
- package/dist/strategy.js +152 -155
- package/dist/tmp-probe.d.ts +2 -0
- package/dist/tmp-probe.js +9 -0
- package/dist/toolchain/debug-config.d.ts +50 -90
- package/dist/toolchain/debug-config.js +239 -510
- package/dist/toolchain/env-check.d.ts +1 -3
- package/dist/toolchain/env-check.js +2 -7
- package/dist/toolchain/index.d.ts +16 -2
- package/dist/toolchain/index.js +383 -35
- package/dist/toolchain/runners.d.ts +16 -0
- package/dist/toolchain/runners.js +75 -0
- package/dist/toolchain/scaffold.d.ts +1 -1
- package/dist/toolchain/scaffold.js +12 -12
- package/dist/toolchain/west-discover.d.ts +6 -0
- package/dist/toolchain/west-discover.js +36 -13
- package/dist/toolchain/west-spawn.js +8 -2
- package/installer/README.md +328 -328
- package/installer/install.sh +2 -2
- package/installer/templates/project/.typecad/activate-zephyr.ps1 +1 -1
- package/installer/templates/project/.typecad/activate-zephyr.sh +1 -1
- package/installer/templates/project/.vscode/settings.json +1 -1
- package/installer/templates/project/README.md +2 -2
- package/package.json +5 -5
- package/src/as-built.ts +206 -206
- package/src/boardgen.ts +214 -48
- package/src/chips/types.ts +567 -567
- package/src/display/touch-adapter.ts +204 -204
- package/src/display/ui-adapter.ts +781 -781
- package/src/doctor.ts +4 -4
- package/src/dt-config/custom-board.ts +2 -2
- package/src/dt-config/kconfig.ts +18 -12
- package/src/dt-config/overlay.ts +1058 -1058
- package/src/framework.manifest.ts +538 -535
- package/src/index.ts +5 -5
- package/src/licenses.ts +425 -425
- package/src/lowering/fs.ts +135 -135
- package/src/lowering/gpio.ts +0 -33
- package/src/lowering/http.ts +264 -32
- package/src/lowering/i2c.ts +0 -9
- package/src/lowering/interrupts.ts +6 -0
- package/src/lowering/mqtt.ts +109 -8
- package/src/lowering/usb.ts +221 -221
- package/src/lowering/wdt.ts +2 -25
- package/src/sdk/board-catalog-sync.ts +4 -25
- package/src/strategy.ts +2265 -2309
- package/src/toolchain/debug-config.ts +262 -522
- package/src/toolchain/env-check.ts +279 -285
- package/src/toolchain/index.ts +1703 -1359
- package/src/toolchain/runners.ts +80 -0
- package/src/toolchain/scaffold.ts +296 -296
- package/src/toolchain/west-discover.ts +35 -13
- package/src/toolchain/west-spawn.ts +174 -168
- package/dist/async/timer-polyfill.d.ts +0 -10
- package/dist/async/timer-polyfill.js +0 -95
- package/dist/chips/board-overrides.d.ts +0 -7
- package/dist/chips/board-overrides.js +0 -11
- package/dist/chips/esp32.d.ts +0 -2
- package/dist/chips/esp32.js +0 -71
- package/dist/chips/esp32s3.d.ts +0 -2
- package/dist/chips/esp32s3.js +0 -103
- package/dist/chips/soc/.d.ts +0 -2
- package/dist/chips/soc/.js +0 -129
- package/dist/chips/soc/esp32.d.ts +0 -2
- package/dist/chips/soc/esp32.js +0 -120
- package/dist/chips/soc/esp32c3.d.ts +0 -2
- package/dist/chips/soc/esp32c3.js +0 -90
- package/dist/chips/soc/esp32c6.d.ts +0 -2
- package/dist/chips/soc/esp32c6.js +0 -109
- package/dist/chips/soc/esp32s3.d.ts +0 -2
- package/dist/chips/soc/esp32s3.js +0 -189
- package/dist/chips/soc/index.d.ts +0 -2
- package/dist/chips/soc/index.js +0 -23
- package/dist/chips/soc/nrf52840.d.ts +0 -2
- package/dist/chips/soc/nrf52840.js +0 -130
- package/dist/chips/soc/rp2040.d.ts +0 -2
- package/dist/chips/soc/rp2040.js +0 -141
- package/dist/chips/soc/rp2350a.d.ts +0 -2
- package/dist/chips/soc/rp2350a.js +0 -145
- package/dist/chips/soc/samd21g18a.d.ts +0 -2
- package/dist/chips/soc/samd21g18a.js +0 -143
- package/dist/chips/soc/stm32f411xe.d.ts +0 -2
- package/dist/chips/soc/stm32f411xe.js +0 -251
- package/dist/chips/xiao-ble.d.ts +0 -2
- package/dist/chips/xiao-ble.js +0 -100
- package/dist/lowering/power.d.ts +0 -9
- package/dist/lowering/power.js +0 -60
- package/dist/lowering/pulse.d.ts +0 -7
- package/dist/lowering/pulse.js +0 -51
- package/dist/lowering/tone.d.ts +0 -10
- package/dist/lowering/tone.js +0 -63
- package/dist/lowering/worker-backing.d.ts +0 -14
- package/dist/lowering/worker-backing.js +0 -79
- package/dist/lowering/worker.d.ts +0 -6
- package/dist/lowering/worker.js +0 -14
- package/dist/sdk/board-data.generated.d.ts +0 -2
- package/dist/sdk/board-data.generated.js +0 -4
- package/dist/sdk/catalog-walker.d.ts +0 -90
- package/dist/sdk/catalog-walker.js +0 -682
- package/dist/sdk/dts-reader.d.ts +0 -83
- package/dist/sdk/dts-reader.js +0 -596
- package/src/debug-codegen.ts +0 -207
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/** The gdb server port west's openocd/jlink runners default to. */
|
|
2
|
+
export declare const DEBUG_SERVER_PORT = 3333;
|
|
3
|
+
/** west's openocd tcl port — pinned in the debugserver invocation and used
|
|
4
|
+
* as the READINESS probe: its listener opens at the END of openocd's init
|
|
5
|
+
* (after the gdb listener and the startup halt), and probe connections
|
|
6
|
+
* there never consume the gdb server's single client slot. */
|
|
7
|
+
export declare const DEBUG_SERVER_TCL_PORT = 6333;
|
|
1
8
|
export interface DebugConfigOptions {
|
|
2
9
|
/** Absolute path to the Zephyr project root (contains CMakeLists.txt + src/). */
|
|
3
10
|
projectRoot: string;
|
|
@@ -11,108 +18,61 @@ export interface DebugConfigOptions {
|
|
|
11
18
|
buildDir: string;
|
|
12
19
|
/** Absolute path to the emitted source map (*.thcppmap.json), if any. */
|
|
13
20
|
sourceMapPath?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Create-time best-effort gdb (from the SDK + the board's silicon) — used
|
|
23
|
+
* only when runners.yaml doesn't exist yet (pre-first-build). The first
|
|
24
|
+
* build's west-resolved gdb replaces it, and a mismatch triggers the
|
|
25
|
+
* artifact rewrite (debugArtifactsNeedRewrite).
|
|
26
|
+
*/
|
|
27
|
+
starterGdbPath?: string;
|
|
14
28
|
}
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* ZEPHYR_SDK_INSTALL_DIR in CMakeCache.txt at configure time, and the
|
|
20
|
-
* xtensa GDB lives at <sdk>/xtensa-espressif_esp32s3_zephyr-elf/bin/... (note
|
|
21
|
-
* the Zephyr-SDK naming, distinct from the ESP-IDF xtensa-esp32s3-elf-gdb).
|
|
22
|
-
*
|
|
23
|
-
* Returns the absolute gdb path on success, or undefined (the launch.json then
|
|
24
|
-
* omits gdbPath and relies on Cortex-Debug's default resolution).
|
|
25
|
-
*/
|
|
26
|
-
export declare function resolveGdbPath(buildDir: string, target: string): string | undefined;
|
|
27
|
-
/** The GDB location inside a Zephyr SDK root, per target architecture:
|
|
28
|
-
* ARM boards use the arm-zephyr-eabi toolchain (verified against
|
|
29
|
-
* zephyr-sdk-0.17.4), Espressif the xtensa-espressif_esp32s3_zephyr-elf one.
|
|
30
|
-
* Returns a forward-slash absolute path or undefined. */
|
|
31
|
-
export declare function gdbPathFromSdkRoot(sdkRoot: string, target?: string): string | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Probe the well-known Zephyr SDK install locations, newest version first:
|
|
34
|
-
* 1. $ZEPHYR_SDK_INSTALL_DIR (the var board.cmake reads)
|
|
35
|
-
* 2. <MAMBA_ROOT_PREFIX | ~/micromamba>/zephyr-sdk/zephyr-sdk-<ver> — the
|
|
36
|
-
* the bundled Zephyr installer layout
|
|
37
|
-
* 3. ~/zephyr-sdk-<ver> — the standalone download layout
|
|
38
|
-
*
|
|
39
|
-
* Only roots that actually contain the esp32s3 GDB are useful to callers;
|
|
40
|
-
* this returns candidate roots (gdbPathFromSdkRoot does the existence check)
|
|
41
|
-
* so tests can inject home/env overrides.
|
|
42
|
-
*/
|
|
43
|
-
export declare function discoverZephyrSdkRoots(opts?: {
|
|
44
|
-
home?: string;
|
|
45
|
-
env?: Record<string, string | undefined>;
|
|
46
|
-
}): string[];
|
|
47
|
-
/**
|
|
48
|
-
* Resolve the OpenOCD binary path. The esp32s3 needs the Espressif OpenOCD
|
|
49
|
-
* fork (openocd-esp32) — not the Zephyr SDK's openocd and not a
|
|
50
|
-
* generic/GDB-stub build — because only it carries the Xtensa + esp_usb_jtag
|
|
51
|
-
* support. ARM targets prefer the Zephyr SDK's own openocd (it ships the
|
|
52
|
-
* interface/target cfgs boards reference); the Espressif fork is only
|
|
53
|
-
* consulted for esp32 targets.
|
|
54
|
-
*
|
|
55
|
-
* Discovery order:
|
|
56
|
-
* 1. ESPRESSIF_TOOLCHAIN_PATH env (the var board.cmake reads) — esp32
|
|
57
|
-
* targets; its openocd-esp32/bin/openocd.exe.
|
|
58
|
-
* 2. The standard ESP-IDF install layout: ~/.espressif/tools/openocd-esp32/
|
|
59
|
-
* <version>/openocd-esp32/bin/openocd.exe (esp32 targets; newest first).
|
|
60
|
-
* 3. A Zephyr SDK root (discoverZephyrSdkRoots) — its
|
|
61
|
-
* tools/opt/openocd/bin/openocd(.exe), any target.
|
|
62
|
-
* Returns undefined if not found (the launch.json then omits openOCDPath and
|
|
63
|
-
* Cortex-Debug falls back to PATH / its openocdPath setting).
|
|
64
|
-
*/
|
|
65
|
-
export declare function resolveOpenOcdPath(target?: string): string | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Resolve where to write the VS Code debug artifacts and how to express paths
|
|
68
|
-
* in them.
|
|
69
|
-
*
|
|
70
|
-
* VS Code reads `.vscode/` from the folder the user has OPENED — and for a
|
|
71
|
-
* cuttlefish project that is almost always the **cuttlefish project root**
|
|
72
|
-
* (the directory containing `cuttlefish.config.ts`), NOT the git repo root.
|
|
73
|
-
* The toolchain's `projectRoot` is the Zephyr *app* dir (e.g.
|
|
74
|
-
* `<projectRoot>/src/out`), which sits below the cuttlefish config dir. So we
|
|
75
|
-
* walk up from `projectRoot` to the nearest `cuttlefish.config.ts` and treat
|
|
76
|
-
* THAT as the workspace root. This makes F5 work when a user opens the project
|
|
77
|
-
* folder directly, and keeps launch.json paths relative to it.
|
|
78
|
-
*
|
|
79
|
-
* Returns { workspaceRoot, appRel } where workspaceRoot is the cuttlefish
|
|
80
|
-
* project root (the `.vscode/` target) and appRel is the Zephyr app dir
|
|
81
|
-
* (`projectRoot`) relative to it (e.g. 'src/out').
|
|
82
|
-
*/
|
|
29
|
+
/** Task labels (also the preLaunchTask/postDebugTask references in launch.json). */
|
|
30
|
+
export declare const DEBUG_BUILD_TASK = "typecad-hal: build + flash (debug)";
|
|
31
|
+
export declare const DEBUG_SERVER_TASK = "typecad-hal: debug server (west)";
|
|
32
|
+
export declare const DEBUG_SERVER_STOP_TASK = "typecad-hal: stop debug server";
|
|
83
33
|
export declare function resolveDebugLocations(projectRoot: string): {
|
|
84
34
|
workspaceRoot: string;
|
|
85
35
|
appRel: string;
|
|
86
36
|
};
|
|
87
37
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* Ported verbatim from the deleted framework-esp32/toolchain/gdb-script.ts —
|
|
94
|
-
* the filter is cuttlefish-internal (lambda hoisting is framework-agnostic).
|
|
38
|
+
* Whether the workspace's gdb debug artifacts need rewriting: missing, still
|
|
39
|
+
* in an older (self-managed-server) shape, written before a build resolved
|
|
40
|
+
* the gdb path (the create-time starter omits gdbPath), or referencing an app
|
|
41
|
+
* root other than the current one (an outDir rename). Only OUR entries count
|
|
42
|
+
* (`TypeCAD Debug (Zephyr, …)`); user-authored ones are never judged.
|
|
95
43
|
*/
|
|
96
|
-
export declare function
|
|
97
|
-
export declare function writeDebugConfig(o: DebugConfigOptions): void;
|
|
44
|
+
export declare function debugArtifactsNeedRewrite(workspaceRoot: string, appRel: string, currentGdb?: string): boolean;
|
|
98
45
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* 'gdb'); the gdb frame-filter script is skipped (no source map exists yet).
|
|
46
|
+
* Write the debug artifacts: the cortex-debug launch entry (merged by name)
|
|
47
|
+
* and the three tasks (merged by label). Returns the workspace-relative
|
|
48
|
+
* paths written, for CLI reporting.
|
|
49
|
+
*/
|
|
50
|
+
export declare function writeDebugConfig(o: DebugConfigOptions): string[];
|
|
51
|
+
/**
|
|
52
|
+
* Create-time starter debug artifacts: the same west-driven launch entry and
|
|
53
|
+
* tasks, minus gdbPath (no build exists yet — runners.yaml is absent). The
|
|
54
|
+
* first build upgrades the entry (debugArtifactsNeedRewrite fires on the
|
|
55
|
+
* missing gdbPath), so F5 after a compile is fully resolved.
|
|
110
56
|
*
|
|
111
|
-
*
|
|
57
|
+
* No-ops (returns []) for targets without gdb debug facts (no debug-capable
|
|
58
|
+
* probe method in the board's table — printf instrumentation territory).
|
|
112
59
|
*/
|
|
113
60
|
export declare function writeProjectDebugArtifacts(o: {
|
|
114
|
-
/** Absolute path to the
|
|
61
|
+
/** Absolute path to the typecad-hal project root (contains typecad-hal.config.ts). */
|
|
115
62
|
workspaceRoot: string;
|
|
116
63
|
/** The Zephyr board id from the project config (frameworkData.buildTarget). */
|
|
117
64
|
buildTarget?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The scaffolded app dir, workspace-relative with forward slashes.
|
|
67
|
+
* Defaults to the standard layout ('src/out'); typecad-hal create passes
|
|
68
|
+
* its config's actual entry + outDir resolution so a non-standard scaffold
|
|
69
|
+
* still gets correct starter paths.
|
|
70
|
+
*/
|
|
71
|
+
appRel?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Create-time best-effort gdb from typecad-hal create (SDK + silicon) —
|
|
74
|
+
* see DebugConfigOptions.starterGdbPath. Plain JSON string.
|
|
75
|
+
*/
|
|
76
|
+
gdbPath?: string;
|
|
118
77
|
}): string[];
|
|
78
|
+
export declare function generateGdbScript(sourceMapPath?: string): string | null;
|