Skip to content

Generate CC2340 SysConfig from existing circuit pin attributes - #255

Merged
AnasSarkiz merged 5 commits into
mainfrom
feat/sysconfig-from-source-pins
Oct 6, 2026
Merged

AnasSarkiz merged 5 commits into
mainfrom
feat/sysconfig-from-source-pins

Conversation

@AnasSarkiz

@AnasSarkiz AnasSarkiz commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

ti generate-sysconfig currently fails after a successful circuit build unless a separate request JSON exists. For supported CC2340 circuits, derive GPIO/I2C settings from existing Circuit JSON pin attributes instead.

Before:

ti generate-sysconfig ./index.circuit.tsx
Failed: firmware request file is missing

After:

ti generate-sysconfig ./index.circuit.tsx
Generated index.syscfg.
Pin configuration: Circuit JSON. Other settings use TI SDK defaults.

Use the converter's resolved declarations for native validation, including recognized LF crystal ownership. Reject absent MCU pin records and traces referencing missing source ports rather than producing partial SysConfig. Missing-function errors identify the MCU, physical pins and existing TSX attributes to supply. Do not force NoRTOS or invent startup, interrupt or bitrate requirements. Continue validating physical GPIO/I2C pins, direction, selected pulls, declared clock and explicit choices against TI output. Existing explicit CC2340/AM2434 requests remain available via --config; implicit sidecar files are no longer loaded. Add --component for multiple MCUs.

Pin the converter to cc3e6f3fa7fbfab99bf60db1c19ca1858995bdd0 from tscircuit/circuit-json-to-sysconfig#8. Update tscircuit/core/props development dependencies and npm peer minimums: the old runtime reproducibly drops required TSX pin flags, and props 0.0.685 lacks an export required by current core. No new Props/Circuit JSON fields or board firmware preset is added.

Discover standalone SysConfig, CCS-bundled SysConfig and SDK installations in standard TI folders automatically. ti check-sysconfig ./index.circuit.tsx requires no exported TI variables when one compatible installation is found. Select SDKs by product metadata and tools by their actual --version; print the selected versions and paths. Keep the three existing environment variables as optional overrides for custom locations or ambiguity. Invalid or incompatible explicit paths are never replaced. Deduplicate symlinks and fail with candidate details when multiple compatible installations exist. Search only the TI roots and known CCS utils folders.

Reject malformed project tscircuit installations, missing entrypoints and missing cli.mjs files instead of silently using another runtime. Retain the CLI-installed peer only when the project has no tscircuit copy. Report broken discovered TI installations when another compatible installation is selected. Remove an unused NoRTOS profile value and stale converter revision constant.

Make TI setup failures actionable: explain missing tools and searched folders, report invalid configured paths, explain the separate SDK installation, and show corrective steps for unsupported versions or a CLI launch failure. check-sysconfig --help links to official downloads and lists the supported tool/SDK versions. Standalone SysConfig is sufficient; full CCS is optional. Generation remains available without TI tools.

Validation:

  • Root typecheck and formatting: passed after a clean canonical install.
  • CLI suite: 59 Node tests and one schematic snapshot passed. Missing pin records and required attributes fail with chip/pin details before writing output. Existing explicit-request rejection checks remain intact. Discovery tests cover macOS/Linux/Windows folder layouts, standalone and CCS Node pairing, both targets, partial/full overrides, wrong versions, missing tools, malformed metadata, duplicate installations and symlink deduplication; the CLI also checks captured TI output without any TI environment variables.
  • npm build and isolated local/global installs: passed; request-free JSON and TSX conversion, missing connected-port rejection with no output, ESM/CJS exports, declarations and source builds checked with tscircuit 0.0.2745. Setup errors and help output are checked in both local and global installs.
  • Required system-block UI checks: 80 tests, typecheck and production build passed.
  • Locally enriched pedometer TSX and its source Circuit JSON: request-free generation and real TI checking passed with SysConfig 1.28.1+4785 / SimpleLink F3 SDK 9.21.00.36. Six GPIOs, I2C0, crystal pins reserved, external LF crystal startup and no LaunchPad flash routines verified. The source JSON also passes schema validation. The packaged CLI also passes native checking of the published fork's index.circuit.tsx on macOS using automatic CCS SysConfig/Node discovery and only a TI_SDK_ROOT override for the SDK's custom workspace location (7 generated files). The audit changes were retested with clean local/global npm installs, all 59 CLI tests and the real packaged check of that published fork (7 generated files). Both fixed profiles' 12 GPIO package-pin mappings were independently compared with TI SysConfig's CC2340R5RGE device database and match. Converter PR8's 215 tests, typecheck and formatting also passed. Native installations on Windows/Linux were not tested.

The pedometer proof uses documented local pin declarations, not the untouched registry package. Omitted SDK defaults do not establish correct application behavior. Firmware build/hardware testing were not performed.

The fixed target metadata describes verified chip identities, package pins and tool versions; it is not a firmware preset. Request-free I2C support remains limited to the validated CC2340 SDA pin 3 / SCL pin 19 route. Broader TI target/mux support is not implemented.

Keep this PR in draft and unmerged while the converter dependency is reviewed.

@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ti-system-block-ui Ready Ready Preview Oct 6, 2026 1:28pm UTC

Request Review

@AnasSarkiz
AnasSarkiz marked this pull request as ready for review October 6, 2026 14:19
@AnasSarkiz
AnasSarkiz merged commit b065896 into main Oct 6, 2026
5 of 6 checks passed
@AnasSarkiz
AnasSarkiz deleted the feat/sysconfig-from-source-pins branch October 6, 2026 14:19
@tscircuitbot

Copy link
Copy Markdown
Contributor

Thank you for your contribution! 🎉

PR Rating: ⭐
Impact: Tiny

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


1 similar comment
@tscircuitbot

Copy link
Copy Markdown
Contributor

Thank you for your contribution! 🎉

PR Rating: ⭐
Impact: Tiny

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


This branch had an error being deployed

1 failed deployment
Preview — 919671bf Deployed Oct 6, 2026 by tscircuit[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants