Repository navigation
S1: the core opens a board, reads its model, validates and generates - #9
Merged
Merged
Conversation
The core's first workspace is a board of an EmbLinkRTOS checkout, until the project manifest exists (spec section 8: S1 to S3 work on the boards in the RTOS tree and their generated model). - project.open, close, status: a board directory, boards/<vendor>/<board>/, inside a checkout. Opening reads files and runs nothing. A checkout whose emb-hwgen or hw.json is outside the formats the core reads (emb-hwgen 0.x, hw.json schema 0) is refused with unsupported_rtos. - board.list, describe, pins, clocks, memory: the generator's resolved model, read from hw.json; nothing is computed, in the core or the GUI. - project.validate, generate.run, generate.diff: run the checkout's own emb-hwgen, with the core's Python, and turn its lines (HW-002) into diagnostics with the file, the line and the path in the YAML. diff writes nothing. - project.trust: running the generator runs the checkout's code, so it waits until the checkout is trusted (spec section 9). Trust is kept per path in the person's own settings, never in a checkout. - Every method has a command too: emblink-studio-core board list RTOS, project validate BOARD, generate diff BOARD, and the rest. - PyYAML becomes the core's dependency: the generator reads YAML with it. Schemas for every new method are in protocol/. Tests: a fake emb-hwgen with the real interface and output, the protocol end to end, and S1's acceptance against the real nucleo_f446re and pico2_w, with errors made in a copy of the NUCLEO's description found at their lines; CI checks out the RTOS at a pinned commit for it. Signed-off-by: teo1747 <148846371+teo1747@users.noreply.github.com>
Signed-off-by: teo1747 <148846371+teo1747@users.noreply.github.com>
Signed-off-by: teo1747 <148846371+teo1747@users.noreply.github.com>
…'s generator is fixed Signed-off-by: teo1747 <148846371+teo1747@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The core side of S1 Core foundation (spec §8). Until the project manifest exists, the workspace is a board of an EmbLinkRTOS checkout, as the spec says S1 to S3 should work.
Methods (schemas in
protocol/, a CLI form for each):project.open,close,statusboards/<vendor>/<board>/inside a checkout. Opening reads files and runs nothing. Anemb-hwgenorhw.jsonoutside the formats the core reads (emb-hwgen 0.x, hw.json schema 0) is refused withunsupported_rtosboard.list,describe,pins,clocks,memoryhw.json. Nothing is computedproject.validateemb-hwgenand turns its lines (rule HW-002) into diagnostics with the file, line and YAML pathgenerate.run,diffdiffwrites to a temporary directory and reports each file as unchanged, changed (with its diff), added or removedproject.trustS1's acceptance, tested in CI against the RTOS at pinned commit
a2cb045:nucleo_f446reandpico2_wopen and show their model: STM32F446RE at 180 MHz with PA2 onusart2_tx, and RP2350A at 150 MHz with GPIO0 onuart0_tx. Every view equals the board'shw.json.board.yaml:25: pins.usart2.tx: PA2 af9 is not usart2_tx (PA2 offers af7 usart2_tx).Other changes
third_party/components.json.hw.jsonalready has its version and schema. JSON diagnostics from the generator are still to come; until then the core reads the documented line format.Tests: 53 pass locally with the real RTOS (48, with the acceptance tests skipped, without it). Ruff is clean.
Next for S1: the desktop side, opening a board from the app and showing its model and diagnostics. S2 then builds the real views on these methods.
Found by the acceptance tests: a generator bug in EmbLinkRTOS. On Python 3.11,
emb-hwgencrashes while reporting a clock error.emb_hwgen/clock.py's_mhzformats aFractionwith:g, which Python only accepts from 3.12, yet the RTOS supports 3.10+. The core reports the crash correctly astool_failedwith the traceback. The acceptance test checks the clock error on 3.12+ only until the RTOS is fixed and the pin is raised. The fix is one line:f"{float(Fraction(hz) / 10**6):g} MHz".