Firmware for the HVDC (High-Voltage DC) Output Module of the RF Coil Box.
Target: STM32 Nucleo-32 (ndhu.DrPeng.mastek.EI-LIT).
This repository contains the embedded software for the HVDC output stage, running on an STM32 Nucleo-32 board. It is part of the larger RF Coil Box project.
- Board: STM32 Nucleo-32 (e.g. NUCLEO-L432KC or similar)
- Role: HVDC output control and monitoring
- Target MCU: STM32 (ARM Cortex-M)
- Toolchain: STM32CubeIDE / ARM GCC recommended
Core/— application source (Src/,Inc/): main, pinmap, rs485, protocol, dac_driver, adc_driver, app_state, system_clock, HAL MSP; optionalStartup/when ST resources not presentscripts/setup-stm32.ps1— fetches STM32CubeL4 (CMSIS + HAL) intolib/STM32CubeL4for buildMakefile,build.ps1— CLI build (use ST resources + HAL fromlib/when present)STM32L432KCUx_FLASH.ld— linker script for NUCLEO-L432KCdocs/ENVIRONMENT_SETUP.md— environment setup plandocs/SOFTWARE_DEVELOPMENT_PLAN.md— development phases and checklist
See Environment setup plan for hardware, toolchain, and flash steps.
Using STM32 resources (recommended): From repo root run .\scripts\setup-stm32.ps1 once. This clones STM32CubeL4 and initializes CMSIS Device and HAL submodules. The build then uses ST's startup, system_stm32l4xx.c, and includes.
- STM32CubeIDE: Build (Ctrl+B), then Run/Debug to flash.
- CLI: Run
.\build.ps1ormake. Output:build/hvdc.elf,build/hvdc.bin. Flash withmake flash(OpenOCD) or STM32CubeProgrammer.
- Baud: 9600 (configurable in
Core/Inc/app_config.h). - Module ID: 1 (configurable; broadcast addr 0 also accepted).
- Frame (minimal):
[addr, cmd_id]or[addr, cmd_id, payload...]. No CRC in stub; replace with full frame format from HVDC Output Module RS485 Protocol Reference Manual. - Commands (placeholder): Ping (0x01), Get setpoint (0x02), Set setpoint (0x03, 2-byte payload), Read HV (0x04). Safe state: DAC zero, relay off; IWDG enabled.
ndhu.DrPeng.mastek.EI-LIT — RF Coil Box, HVDC Output Module.