Skip to main content

Firmware Development Toolkit - Build, generate, and manage embedded projects

Project description

fwkit

Firmware Development Toolkit - Automate embedded firmware builds, code generation, and project management.

Tests PyPI Python License

๐ŸŽฏ What is fwkit?

fwkit is a command-line toolkit that automates repetitive tasks in embedded firmware development. Instead of manually managing build configurations, generating boilerplate code, or maintaining multiple hardware variants, fwkit handles it for you.

Current focus: Texas Instruments microcontrollers (CC13xx, CC26xx series)
Architecture: Designed to support multiple vendors (STM32, ESP32, Nordic, etc.) in the future

๐Ÿš€ What Can It Do?

โœ… Available Now

1. Generate Version Headers from Git

# Automatically create version.h from your Git tags and commits
fwkit codegen version --output src/version.h

# Creates:
#define VERSION "1.2.3"
#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define GIT_COMMIT "a1b2c3d"
#define BUILD_DATE "2026-02-15"

Use in your firmware to display version info, track releases, and debug builds.

2. Generate TI Code Composer Studio Projects

# Generate .projectspec files from YAML configuration
fwkit ti ccs generate --platforms platforms.yaml --output projects/

# Supports:
# - Multiple hardware variants (CC2652R1, CC2652R7, CC2651R3, etc.)
# - Different build configurations (Debug/Release)
# - Custom compiler/linker flags per platform
# - Batch generation for CI/CD

Perfect for projects targeting multiple hardware revisions or product variants.

3. Import Projects into CCS Workspace

# Import .projectspec into Code Composer Studio workspace
fwkit ti ccs import --projectspec my_project.projectspec \
  --workspace ~/ccs-workspace

# CCS CLI path auto-detected from CCS_SERVER_CLI env var
# or common installation paths

Automate project setup without manual IDE clicks.

4. Build TI CCS Projects

# Headless builds without opening CCS IDE
fwkit ti ccs build --project my_project --workspace ~/ccs-workspace

# Build specific configuration
fwkit ti ccs build --project my_project -w ~/ccs-workspace --config Release

# Clean build
fwkit ti ccs build --project my_project -w ~/ccs-workspace --type clean

Enable CI/CD builds and automated testing.

๐Ÿšง Coming Soon

5. Flash & Debug (Planned)

# Flash firmware to device
fwkit ti ccs flash --platform cc26x2r1 --file firmware.hex

# Launch debugger
fwkit ti ccs debug --platform cc26x2r1

5. Project Initialization (Planned)

# Bootstrap new projects from templates
fwkit project init my-ble-sensor \
  --vendor ti \
  --platform cc26x2r1 \
  --template ble-peripheral

๐Ÿ“ฆ Installation

pip install fwkit

๐Ÿ’ก Real-World Example

Imagine you have a product line with 6 different hardware variants (different MCUs, different peripherals). Instead of maintaining 6 separate CCS projects by hand:

# platforms.yaml
defaults:
  compiler_version: "4.0.4.LTS"
  compiler_build_options:
    - "-O2"
    - "-gdwarf-3"

cc26x2r1_basic:
  platform: "cc26x2r1_basic"
  device: "Cortex M.CC2652R1F"
  project_name: "sensor_cc26x2r1"

cc26x2r7_advanced:
  platform: "cc26x2r7_advanced"
  device: "Cortex M.CC2652R7"
  project_name: "sensor_cc26x2r7"
  compiler_build_options:
    - "-DHAS_EXTRA_MEMORY"

Then generate all projects:

fwkit ti ccs generate --platforms platforms.yaml --subdirs

Result: 6 ready-to-import .projectspec files, automatically configured, in seconds.

๐ŸŽฏ Why fwkit?

Problem: Managing embedded projects involves:

  • Manually configuring IDEs for each hardware variant
  • Copy-pasting build settings between projects
  • Keeping version numbers in sync across files
  • Maintaining separate projects for Debug/Release builds

Solution: Define your configuration once in YAML, generate everything automatically.

Benefits:

  • โœ… Reproducible builds - Configuration in version control
  • โœ… Faster onboarding - New developers run one command
  • โœ… CI/CD ready - Automated project generation and builds
  • โœ… Less errors - No manual copy-paste mistakes
  • โœ… Multi-platform - Manage 10 hardware variants as easily as 1

๐Ÿ“– Quick Start Guides

Generate Version Headers

# In your firmware repository with Git tags
git tag -a v1.0.0 -m "Release 1.0.0"

# Generate version.h
fwkit codegen version --output src/version.h

# Use in your code
#include "version.h"
printf("Firmware version: %s\n", VERSION);

Generate TI CCS Projects

  1. Create platforms.yaml:
defaults:
  compiler_version: "4.0.4.LTS"
  
my_platform:
  platform: "my_platform"
  project_title: "My Project"
  project_name: "my_project"
  device: "Cortex M.CC2652R1F"
  link_file_path: "cc13x2_cc26x2_tirtos7.cmd"
  1. Generate projects:
fwkit ti ccs generate --platforms platforms.yaml
  1. Import into CCS:
    • Project โ†’ Import โ†’ CCS Projects
    • Select generated .projectspec file

See examples/ for complete configuration examples.

๐Ÿ› ๏ธ Development

Prerequisites

  • Python 3.9 or higher
  • uv (recommended) or pip
  • Git

Setup

# Clone repository
git clone https://github.com/AcenoTecnologia/fwkit.git
cd fwkit

# Install dependencies with uv (recommended)
uv sync --all-extras

# Or with pip
pip install -e ".[dev]"

# Run tests
uv run pytest

# Run linting
uv run ruff format .
uv run ruff check .
uv run mypy fwkit/

Validating Changes Locally

To avoid CI failures, run the same checks locally before committing:

# Quick validation (runs all CI checks)
./scripts/validate.sh

# Or run checks individually:
uv run ruff format .          # Auto-fix formatting
uv run ruff check --fix .     # Auto-fix linting issues
uv run mypy fwkit/            # Type checking
uv run pytest tests/          # Run test suite

Optional: Pre-commit hooks (runs checks automatically before each commit)

pip install pre-commit
pre-commit install

# Now checks run automatically on git commit
# Or run manually:
pre-commit run --all-files

Project Structure

fwkit/
โ”œโ”€โ”€ fwkit/
โ”‚   โ”œโ”€โ”€ codegen/           # Code generation (version headers, etc.)
โ”‚   โ”œโ”€โ”€ vendors/           # Vendor-specific implementations
โ”‚   โ”‚   โ””โ”€โ”€ ti/           # Texas Instruments (CCS, toolchains)
โ”‚   โ”œโ”€โ”€ common/           # Shared utilities
โ”‚   โ””โ”€โ”€ cli.py            # Main CLI entry point
โ”œโ”€โ”€ tests/                # Test suite (71 tests, 77% coverage)
โ”œโ”€โ”€ examples/             # Configuration examples
โ””โ”€โ”€ docs/                 # Complete documentation with MkDocs

๐Ÿ—บ๏ธ Roadmap

Phase 1: TI Foundation โœ… (Completed)

  • Version header generation
  • TI CCS .projectspec generation
  • Multi-platform configuration
  • YAML-based config
  • CLI with rich output
  • Project import to workspace
  • Headless builds via ccs-server-cli

Phase 2: TI Complete ๐Ÿšง (In Progress)

  • Flash support (Uniflash integration)
  • Debug launch configurations
  • Build matrix (multiple configs in parallel)
  • Project templates
  • Binary post-processing

Phase 3: Expansion ๐Ÿ”ฎ (Planned)

  • STM32CubeIDE support (.project/.cproject generation)
  • ESP-IDF support (CMakeLists.txt, sdkconfig)
  • Nordic nRF support (SES/Keil projects)
  • PlatformIO integration
  • Generic Makefile/CMake templates

Phase 4: Advanced ๐ŸŽฏ (Future)

  • Docker build environments
  • Cloud build integration
  • Firmware OTA packaging
  • Binary analysis tools
  • Plugin system for custom vendors

๐Ÿ—๏ธ Architecture

While fwkit currently focuses on Texas Instruments tools, it's designed with a vendor-agnostic architecture:

fwkit/
  vendors/
    ti/          # Texas Instruments (active development)
    stm32/       # STMicroelectronics (planned)
    esp/         # Espressif (planned)
    nordic/      # Nordic Semi (planned)

Each vendor module is independent and follows the same patterns:

  • Schemas: Pydantic models for type-safe configuration
  • Generators: Code/project generation from Jinja2 templates
  • CLI: Commands under fwkit <vendor> namespace
  • Tests: Isolated test suites with >90% coverage target

This makes it easy to add new vendors without affecting existing ones.

๐Ÿ“š Documentation

๐Ÿ“– Read the Full Documentation (or run mkdocs serve locally)

Quick Links

Configuration Examples

๐Ÿค Contributing

Contributions are welcome! Areas where you can help:

  • New vendor support: Implement STM32, ESP32, Nordic, etc.
  • Features: Build automation, debugging, OTA packaging
  • Documentation: Tutorials, examples, API docs
  • Testing: Expand test coverage, add integration tests
  • Bug fixes: Check Issues

Please read CONTRIBUTING.md for details (coming soon).

๐Ÿ“„ License

MIT License - see LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ“ฎ Support


Status: Alpha - In active development. APIs may change. Production use at your own risk.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fwkit-0.1.0.tar.gz (149.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fwkit-0.1.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file fwkit-0.1.0.tar.gz.

File metadata

  • Download URL: fwkit-0.1.0.tar.gz
  • Upload date:
  • Size: 149.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fwkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0fd0393b2beee94bd165c199e44a39db35cd1d60fdd8bea0d8dd8bbaa1842372
MD5 adf20428d8ea4f3a013d61f60d864e9c
BLAKE2b-256 a756b4e8661bb9203411d5e3d0559200905182dda3adcafa9f7418b28551b6d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for fwkit-0.1.0.tar.gz:

Publisher: publish.yml on AcenoTecnologia/fwkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fwkit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fwkit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fwkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0fcf2a8593941d939cbe31b2b06578441184f2761e2b061e465cec79fd592c9f
MD5 8c70bd2dd4ef251f97d98fb367dce44c
BLAKE2b-256 a1cbaf5c74dea6052a03b0c6c38b326d10ef7b10d1600a6f8d7dc0f37bfcf80b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fwkit-0.1.0-py3-none-any.whl:

Publisher: publish.yml on AcenoTecnologia/fwkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page