This repository contains firmware for the HTMDv2.2c and HTMDv2.2s boards.
HTMDv2.2c supports two MCUs: STM32F303K8T6 and STM32G431K8T6. HTMDv2.2s supports STM32G431CEU6.
| Feature | Detail |
|---|---|
| Motor driver IC | A3921 gate driver |
| Encoder | Incremental encoder (4096 counts/rev) |
| Board ID | 4-bit DIP switch (0– 15) |
| Limit switch | LIM1 |
| Control cycle | 1 ms (1 kHz) |
| Communication | CAN bus (gn10_can) |
| Feature | Detail |
|---|---|
| CAN | Standard CAN 2.0B |
| Sensors | — |
| LED | Color | Behavior |
|---|---|---|
| LED1 | Red | Toggles every 100 ms — confirms control loop is running |
| LED2 | Red | Lit during reverse rotation (target < 0) |
| LED3 | Blue | Lit while rotating (target ≠ 0) |
| LED4 | Green | Lit after initialization |
| Feature | Detail |
|---|---|
| CAN | FDCAN |
| Sensors | — |
| LED | Color | Behavior |
|---|---|---|
| LED1 | Red | Toggles every 100 ms — confirms control loop is running |
| LED2 | Red | Lit during reverse rotation (target < 0) |
| LED3 | Blue | Lit while rotating (target ≠ 0) |
| LED4 | Green | Lit after initialization |
| Feature | Detail |
|---|---|
| CAN | FDCAN |
| Temperature sensor | TMP275 (I2C, ±0.5°C accuracy) |
| Current sensor | MCP3421 (I2C, 16-bit ADC, PGA ×1) |
| LED | Behavior |
|---|---|
| LED_LGC_PWR | Toggles every 100 ms — confirms control loop is running |
| LED_CAN | Lit after initialization |
| Document | Description |
|---|---|
| CONTRIBUTING.md | Development flow, commit conventions, coding rules |
| docs/coding-rules.md | Detailed coding rules |
Install CMake Tools extension for VSCode.
sudo apt update
sudo apt install -y build-essential cmake ninja-build gcc-arm-none-eabi gdb-multiarchInstall STM32CubeCLT.
for STM32F303K8T6 (HTMDv2.2c-f303):
cmake --preset HTMDv2.2c-f303-debug
cmake --build --preset HTMDv2.2c-f303-debugfor STM32G431K8T6 (HTMDv2.2c-g431):
cmake --preset HTMDv2.2c-g431-debug
cmake --build --preset HTMDv2.2c-g431-debugfor HTMDv2.2s:
cmake --preset HTMDv2.2s-debug
cmake --build --preset HTMDv2.2s-debugSee CONTRIBUTING.md for details.
This project is licensed under the Apache-2.0 - see the LICENSE file for details.
