Firmware for STM32H723VGT6 used in the custom vehicle control unit (VCU) for TR27 handling data acquisition from sensors and logic
- VSCode
- A STM32H7 dev board (can be any H7 but if it is not the same as the one listed make your own project and add in your code)
- GCC
-
Download STM32CubeMX
-
Click help on the top
a. Click Manage Embedded Software Packages
b. Scroll down and find STM32H7 and install the package
-
Click on File at the top
a. Load Project
b. Open "STM32-config.ioc"
-
Go to Project Manager and check for these things
- Toolchain/IDE is CMake
- Default Compiler/Linker is GCC
- MCU Reference is STM32H723VGTx
-
Click GENERATE CODE on the top right
-
Open VSCode and go to extensions
-
Install "STM32CubeIDE for Visual Studio Code" bundle
-
Open the repository once the extension has been installed
-
Select Debug for the build
-
Build the project by going to the bottom left clicking on the gear that says Build to ensure that everything is working
The 2 main ways we will be flashing firmware will be with a ST-Link through SWD or J-Link through JTAG or SWD. Each way has their own software ST-Link STM32CubeProgrammer and J-Flash for J-Link
ST-Link
Connections
ST-Link -> STM32
SWCLK -> SWCLK (or clk)
SWDIO -> SWDIO (or DIO)
3.3V/VCC -> 3.3V
GND -> GND
Open ST32CubeProgrammer
- Click Connect
- Click Open File and find the .elf file
- Click Start Programming J-Link
Connections (if using SWD you do not have to include TDI, TDO, and RESET)
J-Link -> STM32
VTref -> VCC
GND -> GND
TMS -> JTMS/SWCLK
TDI -> JTDI
TDO -> JTDO
TCK -> JTCK/SWCLK
RESET -> NRST
Open J-Flash (any version)
- Create New project if first time opening
- Click find target device and find STM32H723VG
- Select protocol that you are using
- Click File and then Open Data File and select the .elf
- Click Target and Click Connect
- Flash