A simple blinky project using FreeRTOS and QPC — a framework for running state machine code generated by QM (a model-based design tool). Learn more at state-machine.com.
- About the Project
- Features
- Technologies
- Prerequisites
- Installation
- Usage
- Folder Structure
- Tests
- Contributing
- License
- Contact
This code serves as a base for model-driven projects on the LAUNCHXL-F28379D, a standard launchpad widely used in control applications, particularly in HIL (Hardware-in-the-Loop) setups.
A common limitation in HIL workflows is that control code tends to be monolithic — it handles only a single control strategy and lacks failure handling or distinct operational states. This template is designed to bridge the gap between a simple control implementation and a production-grade system.
The intended workflow is:
(HIL Native Generated Code) → (HIL State Machine code using this template) → (Field Code using the same control logic and QM file)
- FreeRTOS integration
- QS over SCI (see more at state-machine.com)
- CPU1 support
- CLA working properly
- Auto-generated dictionaries for signals and states
- QS over CAN
- CPU2 support
- (Submodule) Auto-generated dictionaries for signals and states
- QUTest support (pronounced "cutest")
| Technology | Version | Purpose |
|---|---|---|
| QPC | 7.4.0-rc.3 + custom changes (see submodule) | State Machine Framework |
| QM | 6.2.3 | State Machine Modeling |
| QSPY | 7.4.0 | Software Trace |
| SysConfig | 1.24.0 | Register configuration interface |
| C2000Ware | 26.0.0.00 | SDK used by SysConfig and for register manipulation |
| Python | Latest | Used to generate the auto dictionary |
| CCS | 12.8.1 | Code compiler and editor |
Before getting started, make sure you have the following installed:
- SysConfig >= 1.24.0
- C2000Ware = 26.0.0.00
- Git
- Python
- Qtools = 7.4.0 — do not use versions above this, as QSPY is no longer open source in later releases
Access the project on GitHub and use it as a template to create your own repository.
🔗 Project link: https://github.com/mon-martins/qpc_f28379d_model
git clone https://github.com/your-username/your-project-name.git
cd your-project-namegit submodule update --initOpen the model file by double-clicking model.qm, then click Generate Code inside QM.
Alternatively, from the command line:
Linux:
path/to/qm/qmc.sh model.qmWindows:
path/to/qm/qmc.exe model.qmAvoid using paths that are too long or that contain special characters — while it may work, it's better to be safe.
- Open CCS and enter your workspace.
- Import the project: Getting Started → Import Project.
- Verify that your products are recognized:
- Open project properties: right-click the project → Properties (or press
ALT+ENTER). - Navigate to General → Products and confirm that C2000Ware [26.0.0.00] and SysConfig [1.24.0] are listed.
- If they are missing: click Add → Preferences, check that the resources are in the Product Discovery Path, then click Refresh. The products should now appear under Discovered Products.
- Click Apply and Close.
- Open project properties: right-click the project → Properties (or press
- Connect the USB cable to the Launchpad.
- Build and deploy the code by clicking the Debug button (bug icon).
- The debugger will automatically halt at the first line of
main. At this point, you can optionally connect QSPY before resuming execution. - Check which COM port is being used for debugging (Device Manager → XDS100v2 under COM Ports).
- Open a terminal and start QSPY:
qspy -c COM?? -b 115200Or, if qspy is not in your PATH:
path/to/qspy/bin/qspy -c COM?? -b 115200- Resume execution in CCS.
📁 QPC_Blinky_F28379D/
├── 📁 cores/
│ ├── 📁 cpu1/
│ │ ├── 📁 application/ # Your application code
│ │ │ ├── 📁 include/ # Header files
│ │ │ ├── 📁 qs_auto_dict/ # QS auto dictionary (will become a submodule in the future)
│ │ │ └── 📁 source/ # Source files
│ │ │ └── 📁 event_triggers/ # Functions called by the BSP when events occur
│ │ ├── 📁 bsp/ # Board Support Package
│ │ │ ├── 📁 bsp_f28379d_cpu1/ # MCU BSP
│ │ │ ├── 📁 bsp_f28379d_xl_launchpad_cpu1/ # Board BSP
│ │ │ ├── 📁 bsp_interrupts/ # Interrupt handlers
│ │ │ └── 📁 cla_user_code/ # CLA user code
│ │ ├── 📁 debug/
│ │ ├── 📁 middleware/ # Third-party or compatibility support code
│ │ ├── 📁 safety/ # Custom library based on QPC ASSERTs
│ │ └── 📁 targetConfigs/ # CCS files for MCU connection configuration
│ └── 📁 cpu2/ # CPU2 folder (reserved for future use)
├── 📁 submodules/ # External repositories
│ └── 📁 qpc/
└── 📁 system_project/ # System project (reserved for future use)
Note on CLA: The CLA does not support multiple levels of function nesting. As a result, CLA code is kept in the BSP layer, using direct driverlib calls or register access. CLA source files use the
.claextension.
Tests will be added in the future.
Contributions are welcome! Follow the steps below:
- Fork the repository.
- Create a branch for your feature:
git checkout -b feature/my-feature - Commit your changes:
git commit -m 'feat: add my feature' - Push to the branch:
git push origin feature/my-feature - Open a Pull Request.
A
CONTRIBUTING.mdfile will be added in the future.
This project follows the Conventional Commits standard:
| Prefix | Usage |
|---|---|
feat: |
New feature |
fix: |
Bug fix |
docs: |
Documentation update |
refactor: |
Code refactoring |
test: |
Adding or fixing tests |
This project does not have a license yet. Note that the QPC framework is licensed under the GPL.
Ramon — ramonbp01@gmail.com
🔗 Project link: https://github.com/mon-martins/qpc_f28379d_model


