Skip to content

chouswei/HVDC-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HVDC Output Module

Firmware for the HVDC (High-Voltage DC) Output Module of the RF Coil Box.
Target: STM32 Nucleo-32 (ndhu.DrPeng.mastek.EI-LIT).

Overview

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.

Hardware

  • Board: STM32 Nucleo-32 (e.g. NUCLEO-L432KC or similar)
  • Role: HVDC output control and monitoring

Software

  • Target MCU: STM32 (ARM Cortex-M)
  • Toolchain: STM32CubeIDE / ARM GCC recommended

Repository structure

  • Core/ — application source (Src/, Inc/): main, pinmap, rs485, protocol, dac_driver, adc_driver, app_state, system_clock, HAL MSP; optional Startup/ when ST resources not present
  • scripts/setup-stm32.ps1 — fetches STM32CubeL4 (CMSIS + HAL) into lib/STM32CubeL4 for build
  • Makefile, build.ps1 — CLI build (use ST resources + HAL from lib/ when present)
  • STM32L432KCUx_FLASH.ld — linker script for NUCLEO-L432KC
  • docs/ENVIRONMENT_SETUP.md — environment setup plan
  • docs/SOFTWARE_DEVELOPMENT_PLAN.md — development phases and checklist

Development environment

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.

Building and flashing

  • STM32CubeIDE: Build (Ctrl+B), then Run/Debug to flash.
  • CLI: Run .\build.ps1 or make. Output: build/hvdc.elf, build/hvdc.bin. Flash with make flash (OpenOCD) or STM32CubeProgrammer.

RS‑485 and protocol (stub)

  • 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.

License / project

ndhu.DrPeng.mastek.EI-LIT — RF Coil Box, HVDC Output Module.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors