@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,18 @@
|
|
|
1
|
+
/** The descriptor subset this helper needs (see ZephyrChipDescriptor.usb.touchReset). */
|
|
2
|
+
export interface TouchResetInfo {
|
|
3
|
+
readonly flagAddress: number;
|
|
4
|
+
readonly magic: number;
|
|
5
|
+
readonly bootloaderVid?: string;
|
|
6
|
+
readonly bootloaderPid?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TouchResetResult {
|
|
9
|
+
/** Bootloader port to flash (undefined = touch failed / timed out). */
|
|
10
|
+
readonly port?: string;
|
|
11
|
+
/** Human-readable outcome for the build log. */
|
|
12
|
+
readonly note: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Touch the app port at 1200 baud and wait for the bootloader to appear.
|
|
16
|
+
* Never throws — a failed touch degrades to "double-tap reset" guidance.
|
|
17
|
+
*/
|
|
18
|
+
export declare function bossacTouchReset(appPort: string, info: TouchResetInfo, timeoutMs?: number): TouchResetResult;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// 1200-baud touch-to-reset for BOSSA-bootloader boards (host side)
|
|
3
|
+
//
|
|
4
|
+
// The device side lives in the emitted USB shim (lowering/usb.ts): when the
|
|
5
|
+
// host sets the CDC baud rate to 1200, the firmware writes the bootloader's
|
|
6
|
+
// stay-resident magic to RAM and reboots — the board lands in the BOSSA
|
|
7
|
+
// bootloader without a button press. This module is the other half: open the
|
|
8
|
+
// app's console port at 1200 baud to trigger that reboot, then wait for the
|
|
9
|
+
// bootloader's own USB identity to appear and report its port so bossac can
|
|
10
|
+
// be pointed at it.
|
|
11
|
+
//
|
|
12
|
+
// Runs as a spawned `node -e` helper (upload() is synchronous; serialport's
|
|
13
|
+
// open/poll loop is async) with require() resolution rooted at THIS package,
|
|
14
|
+
// so `serialport` resolves from the monorepo's hoisted node_modules. In a
|
|
15
|
+
// published install without serialport available, the touch is skipped with
|
|
16
|
+
// a note telling the user to double-tap reset — never a hard failure.
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
import { spawnSync } from 'node:child_process';
|
|
19
|
+
import path from 'node:path';
|
|
20
|
+
import { fileURLToPath } from 'node:url';
|
|
21
|
+
// CommonJS so `node -e` can require() it without a package "type" lookup.
|
|
22
|
+
// Keep the logic compact: open at 1200, close, poll for the bootloader
|
|
23
|
+
// identity, print the port (or nothing) on stdout.
|
|
24
|
+
const TOUCH_SCRIPT = `
|
|
25
|
+
const SerialPort = require('serialport');
|
|
26
|
+
const [appPort, wantVid, wantPid, timeoutMsStr] = process.argv.slice(1);
|
|
27
|
+
const norm = (v) => (v || '').toLowerCase().replace(/^0x/, '');
|
|
28
|
+
const timeoutMs = parseInt(timeoutMsStr, 10) || 15000;
|
|
29
|
+
function die(msg) { console.log(JSON.stringify({ error: msg })); process.exit(0); }
|
|
30
|
+
// The open call itself delivers the touch: serialport applies the 1200-baud
|
|
31
|
+
// line coding as part of opening, and the firmware resets to the bootloader
|
|
32
|
+
// MID-OPEN — so the open erroring ("File not found" on Windows as the device
|
|
33
|
+
// vanishes) is the EXPECTED symptom of success, not a failure. Whatever the
|
|
34
|
+
// open result, proceed to watching for the bootloader identity; only a
|
|
35
|
+
// missing bootloader after the timeout is a real failure.
|
|
36
|
+
async function watchForBootloader() {
|
|
37
|
+
const deadline = Date.now() + timeoutMs;
|
|
38
|
+
while (Date.now() < deadline) {
|
|
39
|
+
await new Promise((r) => setTimeout(r, 300));
|
|
40
|
+
try {
|
|
41
|
+
const list = await SerialPort.SerialPort.list();
|
|
42
|
+
const hit = list.find((p) =>
|
|
43
|
+
norm(p.vendorId) === norm(wantVid) && norm(p.productId) === norm(wantPid));
|
|
44
|
+
if (hit) { console.log(JSON.stringify({ port: hit.path })); process.exit(0); }
|
|
45
|
+
} catch { /* transient enumeration races while ports bounce */ }
|
|
46
|
+
}
|
|
47
|
+
die('timeout');
|
|
48
|
+
}
|
|
49
|
+
const port = new SerialPort.SerialPort({ path: appPort, baudRate: 1200, autoOpen: false });
|
|
50
|
+
port.open((err) => {
|
|
51
|
+
if (err) { watchForBootloader(); return; }
|
|
52
|
+
// The 1200-baud line coding was applied BY the open; close immediately —
|
|
53
|
+
// the firmware's 250 ms pre-reboot delay covers the ordering, and holding
|
|
54
|
+
// the handle open across the device reset is what wedges usbser.
|
|
55
|
+
port.close(() => watchForBootloader());
|
|
56
|
+
});
|
|
57
|
+
`;
|
|
58
|
+
/**
|
|
59
|
+
* Touch the app port at 1200 baud and wait for the bootloader to appear.
|
|
60
|
+
* Never throws — a failed touch degrades to "double-tap reset" guidance.
|
|
61
|
+
*/
|
|
62
|
+
export function bossacTouchReset(appPort, info, timeoutMs = 30_000) {
|
|
63
|
+
if (!info.bootloaderVid || !info.bootloaderPid) {
|
|
64
|
+
return { note: 'touch-reset: board declares no bootloader USB identity — skipping (double-tap reset to enter the bootloader)' };
|
|
65
|
+
}
|
|
66
|
+
const pkgDir = path.dirname(path.dirname(fileURLToPath(import.meta.url))); // .../src -> package root
|
|
67
|
+
let result;
|
|
68
|
+
try {
|
|
69
|
+
result = spawnSync(process.execPath, ['-e', TOUCH_SCRIPT, '--', appPort, info.bootloaderVid, info.bootloaderPid, String(timeoutMs)], { encoding: 'utf8', timeout: timeoutMs + 10_000, cwd: pkgDir });
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return { note: 'touch-reset: helper failed to launch — double-tap reset to enter the bootloader' };
|
|
73
|
+
}
|
|
74
|
+
const stdout = (typeof result.stdout === 'string' ? result.stdout : '').trim();
|
|
75
|
+
const lastLine = stdout.split('\n').filter(Boolean).pop() ?? '';
|
|
76
|
+
try {
|
|
77
|
+
const parsed = JSON.parse(lastLine);
|
|
78
|
+
if (parsed.port) {
|
|
79
|
+
return { port: parsed.port, note: `touch-reset: bootloader on ${parsed.port}` };
|
|
80
|
+
}
|
|
81
|
+
return { note: 'touch-reset: bootloader did not re-appear in time — double-tap reset and retry' };
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// serialport not resolvable (published install without it) or the helper
|
|
85
|
+
// crashed — degrade gracefully.
|
|
86
|
+
return { note: 'touch-reset: unavailable (serialport not installed?) — double-tap reset to enter the bootloader' };
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -32,7 +32,7 @@ export declare function checkZephyrCompat(version: string | undefined): CompatRe
|
|
|
32
32
|
/**
|
|
33
33
|
* Normalize a board target for the installed Zephyr version. Rewrites a stale
|
|
34
34
|
* bare id (esp32s3_devkitc) to the qualified form on Zephyr >=4.3; idempotent
|
|
35
|
-
* if the target is already qualified. Older Zephyr
|
|
36
|
-
*
|
|
35
|
+
* if the target is already qualified. Older Zephyr and unknown boards pass
|
|
36
|
+
* through unchanged.
|
|
37
37
|
*/
|
|
38
38
|
export declare function resolveBoardTarget(boardTarget: string, version: string | undefined): string;
|
package/dist/toolchain/compat.js
CHANGED
|
@@ -74,7 +74,7 @@ export function detectZephyrVersion() {
|
|
|
74
74
|
let base = process.env.ZEPHYR_BASE;
|
|
75
75
|
if (!base) {
|
|
76
76
|
// Fall back to the discovered west install's zephyrBase — covers the
|
|
77
|
-
// micromamba env from
|
|
77
|
+
// micromamba env from the bundled Zephyr installer WITHOUT activation.
|
|
78
78
|
// (micromamba run sets ZEPHYR_BASE only inside the west subprocess; this
|
|
79
79
|
// makes the compat check work in the parent cuttlefish process too.)
|
|
80
80
|
const install = discoverWest();
|
|
@@ -120,16 +120,21 @@ export function checkZephyrCompat(version) {
|
|
|
120
120
|
* found". Map each known multi-core board id to its procpu (main app core)
|
|
121
121
|
* qualified form. procpu is the core that runs application firmware; appcpu is
|
|
122
122
|
* the secondary core (selected explicitly only when offloading to it).
|
|
123
|
+
* Single-SoC boards (xiao_ble, rpi_pico) still normalize their bare ids on
|
|
124
|
+
* 4.4, but Zephyr has signaled that bare-name normalization is going away —
|
|
125
|
+
* map them too so builds do not depend on it.
|
|
123
126
|
*/
|
|
124
127
|
const QUALIFIED_TARGETS_GE_4_3 = {
|
|
125
128
|
esp32_devkitc: 'esp32_devkitc/esp32/procpu',
|
|
126
129
|
esp32s3_devkitc: 'esp32s3_devkitc/esp32s3/procpu',
|
|
130
|
+
xiao_ble: 'xiao_ble/nrf52840',
|
|
131
|
+
rpi_pico: 'rpi_pico/rp2040',
|
|
127
132
|
};
|
|
128
133
|
/**
|
|
129
134
|
* Normalize a board target for the installed Zephyr version. Rewrites a stale
|
|
130
135
|
* bare id (esp32s3_devkitc) to the qualified form on Zephyr >=4.3; idempotent
|
|
131
|
-
* if the target is already qualified. Older Zephyr
|
|
132
|
-
*
|
|
136
|
+
* if the target is already qualified. Older Zephyr and unknown boards pass
|
|
137
|
+
* through unchanged.
|
|
133
138
|
*/
|
|
134
139
|
export function resolveBoardTarget(boardTarget, version) {
|
|
135
140
|
const boardId = boardTarget.split('/')[0];
|
|
@@ -4,7 +4,7 @@ export interface DebugConfigOptions {
|
|
|
4
4
|
/** Absolute path to the workspace root (the cuttlefish config dir — the folder VS Code has open). */
|
|
5
5
|
workspaceRoot: string;
|
|
6
6
|
/** The Zephyr app dir relative to the workspace root (e.g. 'src/out'). */
|
|
7
|
-
|
|
7
|
+
appRel: string;
|
|
8
8
|
/** The Zephyr board id (e.g. 'esp32s3_devkitc'). */
|
|
9
9
|
target: string;
|
|
10
10
|
/** Absolute path to the Zephyr build dir (<projectRoot>/build) — read for the SDK/GDB path. */
|
|
@@ -24,14 +24,16 @@ export interface DebugConfigOptions {
|
|
|
24
24
|
* omits gdbPath and relies on Cortex-Debug's default resolution).
|
|
25
25
|
*/
|
|
26
26
|
export declare function resolveGdbPath(buildDir: string, target: string): string | undefined;
|
|
27
|
-
/** The
|
|
28
|
-
*
|
|
29
|
-
|
|
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;
|
|
30
32
|
/**
|
|
31
33
|
* Probe the well-known Zephyr SDK install locations, newest version first:
|
|
32
34
|
* 1. $ZEPHYR_SDK_INSTALL_DIR (the var board.cmake reads)
|
|
33
35
|
* 2. <MAMBA_ROOT_PREFIX | ~/micromamba>/zephyr-sdk/zephyr-sdk-<ver> — the
|
|
34
|
-
*
|
|
36
|
+
* the bundled Zephyr installer layout
|
|
35
37
|
* 3. ~/zephyr-sdk-<ver> — the standalone download layout
|
|
36
38
|
*
|
|
37
39
|
* Only roots that actually contain the esp32s3 GDB are useful to callers;
|
|
@@ -43,21 +45,24 @@ export declare function discoverZephyrSdkRoots(opts?: {
|
|
|
43
45
|
env?: Record<string, string | undefined>;
|
|
44
46
|
}): string[];
|
|
45
47
|
/**
|
|
46
|
-
* Resolve the
|
|
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
|
|
48
50
|
* generic/GDB-stub build — because only it carries the Xtensa + esp_usb_jtag
|
|
49
|
-
* support.
|
|
50
|
-
*
|
|
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.
|
|
51
54
|
*
|
|
52
55
|
* Discovery order:
|
|
53
|
-
* 1. ESPRESSIF_TOOLCHAIN_PATH env (the var board.cmake reads) —
|
|
54
|
-
* openocd-esp32/bin/openocd.exe.
|
|
56
|
+
* 1. ESPRESSIF_TOOLCHAIN_PATH env (the var board.cmake reads) — esp32
|
|
57
|
+
* targets; its openocd-esp32/bin/openocd.exe.
|
|
55
58
|
* 2. The standard ESP-IDF install layout: ~/.espressif/tools/openocd-esp32/
|
|
56
|
-
* <version>/openocd-esp32/bin/openocd.exe
|
|
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.
|
|
57
62
|
* Returns undefined if not found (the launch.json then omits openOCDPath and
|
|
58
63
|
* Cortex-Debug falls back to PATH / its openocdPath setting).
|
|
59
64
|
*/
|
|
60
|
-
export declare function resolveOpenOcdPath(): string | undefined;
|
|
65
|
+
export declare function resolveOpenOcdPath(target?: string): string | undefined;
|
|
61
66
|
/**
|
|
62
67
|
* Resolve where to write the VS Code debug artifacts and how to express paths
|
|
63
68
|
* in them.
|
|
@@ -71,13 +76,13 @@ export declare function resolveOpenOcdPath(): string | undefined;
|
|
|
71
76
|
* THAT as the workspace root. This makes F5 work when a user opens the project
|
|
72
77
|
* folder directly, and keeps launch.json paths relative to it.
|
|
73
78
|
*
|
|
74
|
-
* Returns { workspaceRoot,
|
|
75
|
-
* project root (the `.vscode/` target) and
|
|
79
|
+
* Returns { workspaceRoot, appRel } where workspaceRoot is the cuttlefish
|
|
80
|
+
* project root (the `.vscode/` target) and appRel is the Zephyr app dir
|
|
76
81
|
* (`projectRoot`) relative to it (e.g. 'src/out').
|
|
77
82
|
*/
|
|
78
83
|
export declare function resolveDebugLocations(projectRoot: string): {
|
|
79
84
|
workspaceRoot: string;
|
|
80
|
-
|
|
85
|
+
appRel: string;
|
|
81
86
|
};
|
|
82
87
|
/**
|
|
83
88
|
* Generate the GDB Python frame-filter that rewrites cuttlefish's hoisted
|
|
@@ -89,16 +94,6 @@ export declare function resolveDebugLocations(projectRoot: string): {
|
|
|
89
94
|
* the filter is cuttlefish-internal (lambda hoisting is framework-agnostic).
|
|
90
95
|
*/
|
|
91
96
|
export declare function generateGdbScript(sourceMapPath?: string): string | null;
|
|
92
|
-
/**
|
|
93
|
-
* Write all gdb-mode debug artifacts for the given target. Called from the
|
|
94
|
-
* toolchain compile() after a successful build when debugMode === 'gdb'.
|
|
95
|
-
*
|
|
96
|
-
* Writes (all idempotent):
|
|
97
|
-
* <workspaceRoot>/.vscode/launch.json (cortex-debug config)
|
|
98
|
-
* <workspaceRoot>/.vscode/tasks.json (build + flash preLaunch task)
|
|
99
|
-
* <projectRoot>/.cuttlefish/openocd.cfg (OpenOCD cfg, adapter speed override)
|
|
100
|
-
* <projectRoot>/.cuttlefish/.cuttlefish-gdb.py (lambda frame filter, conditional)
|
|
101
|
-
*/
|
|
102
97
|
export declare function writeDebugConfig(o: DebugConfigOptions): void;
|
|
103
98
|
/**
|
|
104
99
|
* Create-time starter debug artifacts. Called by the cuttlefish `create` flow
|