Niklas SchoeningandClaude Opus 5.5 26fe4cc0cf Move console and spindle setup into separate modules
Extract the terminal/console logic and the spindle initialisation out of
main.c into dedicated modules so main only wires the components together.

- Add consoleLogic.c/.h: init_console_custom() creates the console
  instance, registers the "capability" command and returns the handle.
  CapabilityFunc moved here from main.c.
- Add spindleLogic.c/.h: init_spindle_custom(console, maxRPM, minRPM,
  absMinRPM) creates the spindle controller with the given RPM limits.
  Includes stub platform callbacks (SPINDLE_SetDutyCycle,
  SPINDLE_EnaPWM) that still need the PWM/H-bridge implementation.
- main.c: keep console and spindle handles as static variables, pass the
  console handle to the spindle module, remove the second playground
  task.
- .cproject: add Core/Inc/Console and Core/Inc/Spindle to the include
  paths of the CM7 project.
- Include IDE-generated settings changes and the root Eclipse .project.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 20:19:13 +02:00
2026-10-16 18:25:42 +02:00
2026-10-16 18:25:42 +02:00
2026-10-16 18:25:42 +02:00
2026-10-16 18:25:42 +02:00
2026-10-16 18:25:42 +02:00
2026-10-16 18:25:42 +02:00

Frässpindel – HNP

Firmware für die Ansteuerung einer Frässpindel und eines Schrittmotors (L6474) auf einem STM32H755ZI (Dual-Core: Cortex-M7 + Cortex-M4). Projekt im Rahmen von Hardwarenahes Programmieren von Echtzeitsystemen.

Die eigentliche Anwendung läuft auf dem Cortex-M7 unter FreeRTOS. Der Cortex-M4 wird nur gestartet und über OpenAMP/HSEM synchronisiert.

Projektstruktur

.
├── stepper_h7/          STM32CubeIDE-/Makefile-Projekt
│   ├── CM7/             Anwendung (Cortex-M7, FreeRTOS)
│   ├── CM4/             Cortex-M4
│   ├── Common/          gemeinsamer Startcode
│   ├── Drivers/         STM32 HAL / CMSIS
│   ├── Middlewares/     OpenAMP
│   └── stepper_h7.ioc   CubeMX-Konfiguration
├── libs/                externe Bibliotheken (über relative Pfade eingebunden)
│   ├── FreeRTOS-LTS/
│   ├── LibL6474/        Schrittmotortreiber
│   ├── LibRTOSConsole/  Konsole über UART
│   ├── LibSpindle/      Spindelansteuerung
│   └── LibHALMockup/, LibCMocka/   Unit-Tests
├── spec/                Pflichtenheft, Interfacespezifikation, Laborbericht
└── doc/                 Schaltpläne, Registerbeschreibungen

stepper_h7 referenziert ../libs relativ. Die Ordnerstruktur muss deshalb erhalten bleiben.

Hardware

Funktion Pin Makro (CM7/Core/Inc/main.h)
LED grün PB0 LED_GREEN_GPIO_Port, LED_GREEN_Pin
LED gelb PE1 LED_YELLOW_GPIO_Port, LED_YELLOW_Pin
LED rot PB14 LED_RED_GPIO_Port, LED_RED_Pin
User-Taste PC13 USR_BUTTON_GPIO_Port, USR_BUTTON_Pin
Debug-UART PD8/PD9 (USART3, 115200 Baud)

Bauen und Flashen

Variante A: STM32CubeIDE (Windows / macOS / Linux)

  1. File → Import → Existing Projects into Workspace und stepper_h7 auswählen (stepper_h7_CM7 und stepper_h7_CM4 werden mit importiert).
  2. stepper_h7_CM7 (und stepper_h7_CM4) bauen.
  3. Eine Debug-Konfiguration anlegen. Die .launch-Dateien sind bewusst nicht im Repo, weil sie rechnerspezifische Pfade enthalten.

Variante B: VS Code + Makefile

Voraussetzungen:

  • STM32CubeCLT (enthält arm-none-eabi-gcc, ST-LINK-GDB-Server, CubeProgrammer)
  • Umgebungsvariable STM32CLT_PATH auf das CubeCLT-Installationsverzeichnis setzen
  • make (macOS: xcode-select --install)
  • VS-Code-Extensions: Cortex-Debug, RTOS Views, C/C++, Serial Monitor
cd stepper_h7
make cm7 -j      # nur Cortex-M7
make all -j      # M7 + M4
make clean

Debuggen über stepper_h7.code-workspace und die Konfiguration Debug CM7 ST-Link V3.

Nicht im Repository

  • Build-Ausgaben (Debug/, build/)
  • Hersteller-Datenblätter (doc/Datasheets/), z. B. das STM32H7 Reference Manual (RM0399)
  • Windows-spezifische Dateien (MSVC-Projekte, DLLs/EXEs von CMocka)
S
Description
Projekt Hardwarenahes Programmieren
Readme
16 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 89.2%
HTML 3.8%
CMake 1.7%
Ruby 1.5%
JavaScript 1.1%
Other 2.6%