@turingcode/cli 0.3.4 → 0.3.5
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/dist/cli/create-cli.js +5 -3
- package/dist/cli/index.js +1 -1
- package/dist/core/exact/fraction.js +2 -0
- package/dist/core/files.js +2 -2
- package/dist/core/json-shape.js +1 -0
- package/dist/core/query.js +2 -2
- package/dist/core/tables/csv.d.ts +13 -2
- package/dist/core/tables/csv.js +54 -25
- package/dist/core/tables/markdown.js +8 -2
- package/dist/features/contract/diagnostics.d.ts +3 -0
- package/dist/features/contract/diagnostics.js +7 -4
- package/dist/features/contract/load.js +4 -4
- package/dist/features/contract/rules.d.ts +12 -0
- package/dist/features/contract/rules.js +31 -4
- package/dist/features/debug/clear_breakpoint.d.ts +1 -0
- package/dist/features/debug/clear_breakpoint.js +1 -1
- package/dist/features/debug/command.js +1 -1
- package/dist/features/debug/continue.d.ts +1 -0
- package/dist/features/debug/continue.js +2 -2
- package/dist/features/debug/debug_start.d.ts +1 -0
- package/dist/features/debug/debug_start.js +1 -1
- package/dist/features/debug/debug_stop.d.ts +1 -0
- package/dist/features/debug/debug_stop.js +1 -1
- package/dist/features/debug/evaluate.d.ts +1 -0
- package/dist/features/debug/evaluate.js +5 -5
- package/dist/features/debug/get_stack.d.ts +1 -0
- package/dist/features/debug/get_stack.js +1 -1
- package/dist/features/debug/get_variables.d.ts +1 -0
- package/dist/features/debug/get_variables.js +2 -2
- package/dist/features/debug/halt.d.ts +1 -0
- package/dist/features/debug/halt.js +1 -1
- package/dist/features/debug/set_breakpoint.d.ts +1 -0
- package/dist/features/debug/set_breakpoint.js +1 -1
- package/dist/features/debug/step.d.ts +1 -0
- package/dist/features/debug/step.js +2 -2
- package/dist/features/install-mods/install.js +4 -3
- package/dist/features/install-skills/install.d.ts +1 -0
- package/dist/features/install-skills/install.js +1 -1
- package/dist/features/probe/command.d.ts +1 -1
- package/dist/features/probe/command.js +103 -35
- package/dist/features/probe/kill_all_debuggers.d.ts +1 -0
- package/dist/features/probe/kill_all_debuggers.js +5 -5
- package/dist/features/probe/list_probes.d.ts +1 -0
- package/dist/features/probe/list_probes.js +1 -1
- package/dist/features/probe/program_project.d.ts +1 -0
- package/dist/features/probe/program_project.js +1 -1
- package/dist/features/probe/read_fault_status.d.ts +1 -0
- package/dist/features/probe/read_fault_status.js +1 -1
- package/dist/features/probe/read_memory.d.ts +1 -0
- package/dist/features/probe/read_memory.js +2 -2
- package/dist/features/probe/read_peripheral.d.ts +1 -0
- package/dist/features/probe/read_peripheral.js +7 -5
- package/dist/features/probe/reset_probe_usb.d.ts +1 -0
- package/dist/features/probe/reset_probe_usb.js +1 -1
- package/dist/features/probe/reset_target.d.ts +1 -0
- package/dist/features/probe/reset_target.js +1 -1
- package/dist/features/probe/target_info.d.ts +1 -0
- package/dist/features/probe/target_info.js +1 -1
- package/dist/features/project/analysis_static.d.ts +1 -0
- package/dist/features/project/analysis_static.js +1 -1
- package/dist/features/project/analysis_syntax_check.d.ts +1 -0
- package/dist/features/project/analysis_syntax_check.js +1 -1
- package/dist/features/project/project_build.d.ts +1 -0
- package/dist/features/project/project_build.js +1 -1
- package/dist/features/project/project_download_template.d.ts +1 -0
- package/dist/features/project/project_download_template.js +4 -4
- package/dist/features/project/project_sync_to_server.js +1 -1
- package/dist/features/project/stm32_cubetools_download_drivers.d.ts +1 -0
- package/dist/features/project/stm32_cubetools_download_drivers.js +2 -2
- package/dist/features/status/get_status.d.ts +1 -0
- package/dist/features/status/get_status.js +1 -1
- package/dist/features/table/check.js +5 -5
- package/dist/features/table/read.js +9 -9
- package/dist/features/tool/command.d.ts +2 -2
- package/dist/features/tool/command.js +95 -66
- package/dist/lib.d.ts +4 -0
- package/dist/lib.js +4 -2
- package/dist/stm32/actions/DebugAction.d.ts +4 -2
- package/dist/stm32/actions/DebugAction.js +6 -5
- package/dist/stm32/actions/DebugActionInfo.d.ts +4 -0
- package/dist/stm32/actions/DebugActionInfo.js +4 -2
- package/dist/stm32/actions/DebugActionListProbes.d.ts +1 -0
- package/dist/stm32/actions/DebugActionListProbes.js +1 -1
- package/dist/stm32/actions/DebugActionProgram.d.ts +8 -2
- package/dist/stm32/actions/DebugActionProgram.js +9 -7
- package/dist/stm32/actions/DebugActionRead.d.ts +8 -7
- package/dist/stm32/actions/DebugActionRead.js +5 -3
- package/dist/stm32/actions/DebugActionReset.d.ts +2 -1
- package/dist/stm32/actions/DebugActionReset.js +1 -1
- package/dist/stm32/actions/DebugActionServer.d.ts +4 -0
- package/dist/stm32/actions/DebugActionServer.js +4 -2
- package/dist/stm32/analysis.d.ts +1 -0
- package/dist/stm32/build.d.ts +4 -4
- package/dist/stm32/build.js +1 -1
- package/dist/stm32/context.js +2 -2
- package/dist/stm32/daemon.d.ts +8 -6
- package/dist/stm32/daemon.js +25 -18
- package/dist/stm32/regen.js +14 -8
- package/dist/stm32/session.d.ts +9 -6
- package/dist/stm32/session.js +11 -10
- package/dist/stm32/sync.d.ts +1 -0
- package/dist/stm32/sync.js +5 -3
- package/dist/stm32/tool.d.ts +5 -3
- package/dist/stm32/toolCommand.d.ts +4 -4
- package/dist/stm32/toolCommand.js +1 -3
- package/dist/stm32/utils/discover_tools.d.ts +2 -1
- package/dist/stm32/utils/discover_tools.js +1 -1
- package/dist/stm32/utils/downloadzip_utils.js +4 -4
- package/dist/stm32/utils/faultUtils.d.ts +2 -1
- package/dist/stm32/utils/faultUtils.js +2 -2
- package/dist/stm32/utils/listSyncFiles.js +12 -10
- package/dist/stm32/utils/mcu_utils.d.ts +5 -6
- package/dist/stm32/utils/mcu_utils.js +10 -9
- package/dist/stm32/utils/project_utils.d.ts +1 -1
- package/dist/stm32/utils/project_utils.js +5 -3
- package/dist/stm32/utils/usb_utils.js +2 -2
- package/dist/stm32/utils/user_code.d.ts +4 -1
- package/dist/stm32/utils/user_code.js +5 -3
- package/dist/stm32/utils/utils_mutex.js +34 -14
- package/dist/stm32/validate.d.ts +1 -0
- package/dist/stm32/validate.js +1 -1
- package/mods/claude/turingcode-skills/skills/turingcode-cli/SKILL.md +17 -23
- package/mods/claude/turingcode-skills/skills/turingcode-firmware-code/SKILL.md +4 -0
- package/mods/claude/turingcode-skills/skills/turingcode-firmware-code/references/input-and-bounds.md +0 -13
- package/package.json +1 -1
- package/mods/claude/turingcode-skills/skills/turingcode-cli/references/board-and-debug.md +0 -22
- package/mods/claude/turingcode-skills/skills/turingcode-cli/references/build-and-check.md +0 -19
- package/mods/claude/turingcode-skills/skills/turingcode-cli/references/new-project.md +0 -9
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* CubeMX keeps only the code between the USER CODE BEGIN and USER CODE END markers when it regenerates a file.
|
|
3
|
+
*/
|
|
2
4
|
const MARKER = /\/\*\s*USER CODE (BEGIN|END)\s+(.+?)\s*\*\//g;
|
|
3
5
|
/**
|
|
4
6
|
* Scans a source file for CubeMX user code sections, collecting every marker mismatch instead of stopping at the first.
|
|
@@ -19,7 +21,7 @@ export function scanUserSections(text) {
|
|
|
19
21
|
errors.push(`line ${open.line}: USER CODE BEGIN ${open.name} has no matching END`);
|
|
20
22
|
if (sections.some((s) => s.name === name))
|
|
21
23
|
errors.push(`line ${line}: USER CODE section "${name}" appears twice`);
|
|
22
|
-
|
|
24
|
+
/** Body starts on the line after the marker when nothing else follows it on its line. */
|
|
23
25
|
const after = at + marker.length;
|
|
24
26
|
const eol = /^[ \t]*\r?\n/.exec(text.slice(after));
|
|
25
27
|
open = { name, start: after + (eol ? eol[0].length : 0), line };
|
|
@@ -28,7 +30,7 @@ export function scanUserSections(text) {
|
|
|
28
30
|
errors.push(`line ${line}: USER CODE END ${name} has no matching BEGIN`);
|
|
29
31
|
}
|
|
30
32
|
else {
|
|
31
|
-
|
|
33
|
+
/** Body ends before the END marker's indentation when the marker starts its line. */
|
|
32
34
|
const lineStart = text.lastIndexOf('\n', at - 1) + 1;
|
|
33
35
|
const end = lineStart >= open.start && /^[ \t]*$/.test(text.slice(lineStart, at))
|
|
34
36
|
? lineStart
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Probe lock for the debug actions and the debug session: one probe operation at a time, in this process and,
|
|
3
|
+
* once setProbeLockFile was called, across processes through a lock file that holds the owner's pid.
|
|
4
|
+
*/
|
|
5
|
+
import { mkdirSync, readFileSync, renameSync, rmdirSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
4
6
|
import { dirname } from 'node:path';
|
|
5
|
-
let owner;
|
|
6
|
-
let lockFile;
|
|
7
|
+
let owner; /** name of the run in this process holding the probe */
|
|
8
|
+
let lockFile; /** set by the CLI to <project>/.turingcode/probe.lock */
|
|
7
9
|
/**
|
|
8
10
|
* Makes claimProbe also take a lock file, so other processes see the probe as busy.
|
|
9
11
|
* @param file lock file path, e.g. <project>/.turingcode/probe.lock; undefined turns the lock file off
|
|
@@ -42,17 +44,33 @@ function claimLockFile(name) {
|
|
|
42
44
|
if (e?.code !== 'EEXIST')
|
|
43
45
|
throw e;
|
|
44
46
|
}
|
|
47
|
+
let text = '';
|
|
45
48
|
let held = {};
|
|
46
49
|
try {
|
|
47
|
-
|
|
50
|
+
text = readFileSync(file, 'utf8');
|
|
51
|
+
held = JSON.parse(text);
|
|
48
52
|
}
|
|
49
53
|
catch {
|
|
50
|
-
|
|
54
|
+
/** unreadable or half written: treated as stale */
|
|
51
55
|
}
|
|
52
|
-
|
|
56
|
+
/** shortcut: a reused pid of a dead owner looks alive, so its lock waits for that process; add a start time if that bites */
|
|
53
57
|
if (held.pid && held.pid !== process.pid && isAlive(held.pid))
|
|
54
58
|
throw new Error(`The probe is busy with another turingcode run (pid ${held.pid}): ${held.name ?? 'unknown'}`);
|
|
55
|
-
|
|
59
|
+
/** stale: its process is gone. Moved away first (atomic), so two processes never both delete it and one a fresh lock. */
|
|
60
|
+
const moved = `${file}.${process.pid}`;
|
|
61
|
+
try {
|
|
62
|
+
renameSync(file, moved);
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
if (e?.code === 'ENOENT')
|
|
66
|
+
continue; /** another process took it over first */
|
|
67
|
+
throw e;
|
|
68
|
+
}
|
|
69
|
+
/** shortcut: if a third process created a lock while a fresh one was moved, putting it back replaces that one; add a takeover lock if that bites */
|
|
70
|
+
if (readFileSync(moved, 'utf8') === text)
|
|
71
|
+
unlinkSync(moved);
|
|
72
|
+
else
|
|
73
|
+
renameSync(moved, file); /** a fresh lock had replaced the stale one: put it back, the next loop reports it busy */
|
|
56
74
|
}
|
|
57
75
|
}
|
|
58
76
|
/**
|
|
@@ -79,15 +97,17 @@ export function releaseProbe() {
|
|
|
79
97
|
unlinkSync(lockFile);
|
|
80
98
|
}
|
|
81
99
|
catch {
|
|
82
|
-
|
|
100
|
+
/** no lock file, or not ours */
|
|
83
101
|
}
|
|
84
102
|
try {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
103
|
+
/**
|
|
104
|
+
* an empty .turingcode/ left outside a project would mark that folder as one.
|
|
105
|
+
* Keep this non-recursive: rmdir removes only an empty folder in one atomic step, so it can never delete
|
|
106
|
+
* project files or another process's lock; a readdir check first would race with that process.
|
|
107
|
+
*/
|
|
88
108
|
rmdirSync(dirname(lockFile));
|
|
89
109
|
}
|
|
90
110
|
catch {
|
|
91
|
-
|
|
111
|
+
/** not empty (other project files, or another process's lock) or already gone */
|
|
92
112
|
}
|
|
93
113
|
}
|
package/dist/stm32/validate.d.ts
CHANGED
package/dist/stm32/validate.js
CHANGED
|
@@ -13,7 +13,7 @@ export function validateArgs(def, args) {
|
|
|
13
13
|
if (!Object.hasOwn(args, key))
|
|
14
14
|
return `Missing argument: ${key}`;
|
|
15
15
|
for (const [key, v] of Object.entries(args)) {
|
|
16
|
-
|
|
16
|
+
/** own keys only: properties.__proto__ or .constructor would otherwise be found on Object.prototype */
|
|
17
17
|
const p = Object.hasOwn(properties, key) ? properties[key] : undefined;
|
|
18
18
|
if (!p)
|
|
19
19
|
return `Unknown argument: ${key}`;
|
|
@@ -5,35 +5,32 @@ description: Use when running the turingcode CLI on an STM32 project - creating
|
|
|
5
5
|
|
|
6
6
|
# turingcode for STM32
|
|
7
7
|
|
|
8
|
-
`turingcode`
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
the installed probe tools. Server commands need `TURINGCODE_TOKEN`: set it in the environment, or
|
|
12
|
-
put `TURINGCODE_TOKEN=<token>` in a git-ignored `.env` in the folder you run `turingcode` from (a set
|
|
13
|
-
variable wins). Never print the token or commit the `.env`.
|
|
8
|
+
- `turingcode` is a set of tools for working with stm32 projects.
|
|
9
|
+
- Start with `turingcode status`: it shows the project, token, last build, debug session and the installed probe tools.
|
|
10
|
+
- Server commands need `TURINGCODE_TOKEN`: set it in the environment, or put `TURINGCODE_TOKEN=<token>` in `.env` in the project folder.
|
|
14
11
|
|
|
15
|
-
##
|
|
12
|
+
## Commands
|
|
16
13
|
|
|
17
|
-
Read the
|
|
14
|
+
Read the help before you run commands in an area; every subcommand has its own `--help` with flags and examples.
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| `references/build-and-check.md` | syncing, building, pulling, regenerating from the `.ioc`, restoring drivers, syntax checks, static analysis |
|
|
23
|
-
| `references/board-and-debug.md` | flashing, resetting, reading registers or memory, decoding faults, recovering a probe, breakpoints and stepping |
|
|
16
|
+
- `turingcode project --help`: sync, build, pull, regen, drivers, syntax check, static analysis.
|
|
17
|
+
- `turingcode probe --help`: flash, reset, read memory or registers, decode faults, recover a stuck probe.
|
|
18
|
+
- `turingcode debug --help`: breakpoints, stepping, stack, variables.
|
|
24
19
|
|
|
25
|
-
##
|
|
20
|
+
## New project
|
|
21
|
+
|
|
22
|
+
Only when the user asks for one.
|
|
23
|
+
|
|
24
|
+
1. `turingcode probe info` identifies the connected chip and lists the matching CubeMX names. Don't call probe-rs or STM32_Programmer_CLI yourself.
|
|
25
|
+
2. Pick one name. The package (pin count) can't be read over SWD: ask the user, or pick one that has the pins they need. Names differing only in package build the same code for pins they share.
|
|
26
|
+
3. `turingcode project template --mcu <name>` downloads it into `./<name>/`; `cd` into it, every project command runs from the project folder (copy the `.env` there too if you use one).
|
|
26
27
|
|
|
27
|
-
In generated files (main.c, stm32*_it.c, ...) write code only between `/* USER CODE BEGIN <name> */` and
|
|
28
|
-
`/* USER CODE END <name> */`; CubeMX deletes everything else on `project regen`. Never change, move or delete
|
|
29
|
-
the markers, and keep code the section already holds.
|
|
30
|
-
`project sync` stops on unmatched markers and warns about code outside the sections.
|
|
31
28
|
|
|
32
29
|
## Server tools
|
|
33
30
|
|
|
34
31
|
Pins, clocks, .ioc edits, the knowledge base and register lookup are server tools:
|
|
35
32
|
|
|
36
|
-
- `turingcode tool list` to
|
|
33
|
+
- `turingcode tool list` to get a list of available tools.
|
|
37
34
|
- `turingcode tool call <name> --args '<json>' > result.md` to run it.
|
|
38
35
|
|
|
39
36
|
After a tool changes the server copy of the project, run `project pull` (or `project regen`).
|
|
@@ -43,8 +40,5 @@ After a tool changes the server copy of the project, run `project pull` (or `pro
|
|
|
43
40
|
1. Edit the code, then `turingcode project sync -b` and fix the reported errors;
|
|
44
41
|
`turingcode project sync -b -a` before finishing a change.
|
|
45
42
|
2. `turingcode probe program` to flash.
|
|
46
|
-
3. Confirm it runs without looking at the board: read the register the program changes a few times
|
|
47
|
-
with `probe read` and check it changes as expected. E.g. a blinking LED on PB6 of an STM32F3:
|
|
48
|
-
GPIOB ODR is `0x48000414`, and `probe read --address 0x48000414 --length 4` should alternate
|
|
49
|
-
between `00000040` and `00000000` (look up the base address and ODR offset for your chip).
|
|
43
|
+
3. Confirm it runs without looking at the board: read the register the program changes a few times with `probe read` and check it changes as expected.
|
|
50
44
|
4. On a crash, `probe faults`, or `debug start` with breakpoints to find the cause.
|
|
@@ -18,6 +18,10 @@ Read the file before you write code in that area, not after.
|
|
|
18
18
|
| `references/init-and-timing.md` | boot order, flash-backed config, driver (re)init, timer callbacks, µs time, `extern "C"` interfaces |
|
|
19
19
|
| `references/registers-and-units.md` | sensor drivers, datasheet registers, bit fields, units, signedness, macros |
|
|
20
20
|
|
|
21
|
+
## General code editing rules
|
|
22
|
+
|
|
23
|
+
- In generated files (main.c, stm32*_it.c, ...) write code only between `/* USER CODE BEGIN <name> */` and `/* USER CODE END <name> */`; CubeMX deletes everything else on project regeneration. Never change, move or delete the markers, and keep code the section already holds.
|
|
24
|
+
|
|
21
25
|
## House style
|
|
22
26
|
|
|
23
27
|
Match this; don't "modernize" it.
|
package/mods/claude/turingcode-skills/skills/turingcode-firmware-code/references/input-and-bounds.md
CHANGED
|
@@ -15,20 +15,7 @@ Before using a received value as a length, index or offset:
|
|
|
15
15
|
- Bound every write into a table (registers, config) against its count, for every element (`start + i < count`), not only the first.
|
|
16
16
|
- Keep these checks compiled in. Don't put them behind a debug-only macro.
|
|
17
17
|
|
|
18
|
-
## Bounds are `>=`, not `>`
|
|
19
|
-
|
|
20
|
-
For a count N, valid indices are `0..N-1`:
|
|
21
|
-
```cpp
|
|
22
|
-
if (page >= PAGE_COUNT) return Status::OUT_OF_RANGE;
|
|
23
|
-
```
|
|
24
|
-
Don't rely on hardware masking (a value silently truncated by a register field) to make a wrong value work. Compute the value the hardware actually expects.
|
|
25
|
-
|
|
26
|
-
## Frames that never complete
|
|
27
|
-
|
|
28
|
-
If a protocol buffer fills up with a start marker but no end marker, drop it and resync. A buffer that stays full stops RX for good.
|
|
29
18
|
|
|
30
19
|
## Checklist
|
|
31
20
|
- [ ] Every external length, index and offset is checked against the real size
|
|
32
21
|
- [ ] No unsigned subtraction without a guard
|
|
33
|
-
- [ ] Index checks use `>=`
|
|
34
|
-
- [ ] A full buffer without a valid frame is dropped
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Flash, inspect and debug the board
|
|
2
|
-
|
|
3
|
-
| Command | Use it to |
|
|
4
|
-
| --- | --- |
|
|
5
|
-
| `turingcode probe list` | See the connected probes (ST-LINK, J-Link, CMSIS-DAP). |
|
|
6
|
-
| `turingcode probe info` | Identify the connected chip and its matching CubeMX names; works outside a project. |
|
|
7
|
-
| `turingcode probe program` | Flash the newest .elf in `build/`, verify and reset. |
|
|
8
|
-
| `turingcode probe reset` | Hardware-reset the target. |
|
|
9
|
-
| `turingcode probe peripheral --name GPIOA` | Read and decode a peripheral's registers without halting. The register layout is downloaded once per peripheral (needs the token), then works offline. |
|
|
10
|
-
| `turingcode probe read --address 0x20000000 --length 64` | Read raw memory (max 4096 bytes). |
|
|
11
|
-
| `turingcode probe faults` | Decode the Cortex-M fault registers after a HardFault. |
|
|
12
|
-
| `turingcode probe reset-usb`, `turingcode probe kill-debuggers` | Recover a stuck probe or one held by another debugger. |
|
|
13
|
-
|
|
14
|
-
## Debug
|
|
15
|
-
|
|
16
|
-
`turingcode debug start` opens a probe-rs session that lasts across commands until `debug stop`;
|
|
17
|
-
probe commands that need the probe are refused while it runs.
|
|
18
|
-
|
|
19
|
-
- `debug break --file Core/Src/main.c --line 120 [--condition 'count > 3']`, `debug clear ...`
|
|
20
|
-
- `debug continue`, `debug halt`, `debug step [--kind over|into|out]`
|
|
21
|
-
- `debug stack`, `debug vars`, `debug eval` on the halted target
|
|
22
|
-
- `debug stop` to release the probe
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Sync, build and check
|
|
2
|
-
|
|
3
|
-
| Command | Use it to |
|
|
4
|
-
| --- | --- |
|
|
5
|
-
| `turingcode project sync [-b [preset]] [-a [profile]]` | Sync local changes to the server; `-b`/`--build` then builds (default Debug), `-a`/`--analyse` then runs static analysis (default quick). Run before every build. |
|
|
6
|
-
| `turingcode project build [--preset Debug]` | Build on the server and download the .elf into `build/<preset>/`. Prints a short result (own-code warnings, sizes, clock audit summary); a failed build prints everything, `--verbose` always does. |
|
|
7
|
-
| `turingcode project pull` | Bring server-side changes (e.g. after a server tool edited the .ioc) back to the local files. |
|
|
8
|
-
| `turingcode project regen` | Regenerate the code from the .ioc with CubeMX after pin, clock or peripheral changes, then pull. |
|
|
9
|
-
| `turingcode project drivers` | Restore missing `Drivers/` files (CMSIS, HAL). |
|
|
10
|
-
| `turingcode project template` | Download a new barebone project for an MCU. Only when the user asks for a new project. |
|
|
11
|
-
|
|
12
|
-
## Check
|
|
13
|
-
|
|
14
|
-
Both check the synced server copy, so run `project sync` first. They print `file:line:col: severity: message` lines.
|
|
15
|
-
|
|
16
|
-
| Command | Use it to |
|
|
17
|
-
| --- | --- |
|
|
18
|
-
| `turingcode project check [--files Core/Src/main.c,App]` | Syntax-check files or folders (default: `Core`, `App`). Fast check after an edit. |
|
|
19
|
-
| `turingcode project analyze [--profile quick\|full\|misra] [--paths Core/Src]` | Static analysis of the project's own code (never `Drivers/`): `quick` cppcheck, `full` + clang-tidy, `misra` MISRA C:2012. |
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# New project
|
|
2
|
-
|
|
3
|
-
1. `turingcode probe info` identifies the connected chip (device ID, name, flash size, core) and lists the
|
|
4
|
-
CubeMX names that match it, e.g. `STM32F303CCTx, STM32F303RCTx, ...`. Don't call probe-rs or
|
|
5
|
-
STM32_Programmer_CLI yourself.
|
|
6
|
-
2. Pick one name. The package (pin count) can't be read over SWD: ask the user, or pick one that has the
|
|
7
|
-
pins they need. Names differing only in package build the same code for pins they share.
|
|
8
|
-
3. `turingcode project template --mcu <name>` downloads the project into `./<name>/`; `cd` into it,
|
|
9
|
-
every project command runs from the project folder (copy the `.env` there too if you use one).
|