How fadi-eid/vcp-display works
Project Type & Purpose
• A multi-component firmware and host-side toolchain.
• “Embedded” folder: Dual-core STM32H7 firmware split into CM4 and CM7 targets, with common dual-core boot code, CMSIS, HAL drivers, DSP and NN libraries, RTOS2 support, and Makefile or .ioc project for code generation.
File Structure Analysis
Top-level directories:
• Desktop/.devcontainer, .vscode – containerized dev environment for host code.
• Desktop/Comm – C++ CLI “Comm” tool (CMake).
• Desktop/Display – C++ “Display” app that consumes Comm data.
• Desktop/Test – host-side unit/integration tests plus PyListen scripts for automated verification.
• Embedded/.devcontainer, .vscode – containerized firmware build environment.
• Embedded/CM4 & Embedded/CM7 – core-specific startup and application code.
• Embedded/Common – dual-core boot and inter-core synchronization.
• Embedded/Drivers – CMSIS, CMSIS-DSP, CMSIS-NN, RTOS2, and STM32H7xx HAL drivers.
• Embedded/Makefile – scripts and linker scripts for flashing each core.
• Embedded/PyListen – Python utilities to parse UART logs from firmware.
Key README Insight
• No textual architecture; relies on image to show host apps ↔ MCU data exchange.
Main Components
A. Developer Workstation
– VS Code IDE
– Docker DevContainer(s) for Desktop and Embedded
– Build System: CMake (Desktop), Makefile / CubeMX (Embedded)
B. Host-Side Applications
– Comm App (C++, CMake)
– Display App (C++, CMake)
– Test Suite (C++, Python)
C. Communication Channel
– USB Virtual COM Port (UART over USB)
– Data protocol between host apps and firmware
D. Embedded Device (STM32H7 Board)
• Bootloader (Common dual-core startup)
• CM7 Core – high-level application tasks
• CM4 Core – real-time DSP/ML processing tasks
• HAL & Middleware – STM32H7xx HAL, CMSIS, CMSIS-DSP, CMSIS-NN, RTOS2
• Peripherals – USART (UART), DMA, GPIO, etc.
Relationships & Interactions
• Developer → DevContainer → Build → Host Apps / Firmware
• Host Apps ↔ USB‐VCP ↔ Firmware (UART)
• Firmware layers:
– Startup (CMSIS & HAL init)
– RTOS2 scheduler & tasks
– DSP/NN libraries invoked by CM4 tasks
– Inter-core messaging between CM7 ↔ CM4 via shared memory or hardware semaphores
• Test scripts invoke Comm or directly parse logs for CI.
Architectural Patterns & Principles
• Layered architecture: Hardware abstraction → Middleware → Application.
• Dual-core partitioning: CM7 for coordination & communication; CM4 for signal processing.
• Containerized, reproducible build environments (DevContainers).
• Separation of concerns: Host apps vs firmware vs test harness.