1. Download and install STM32 Cube IDE, as discussed in session
https://www.st.com/en/development-tools/stm32cubeide.html
(or)
You may download normal eclipse if not wishing for CubeIDE Features
https://www.eclipse.org/downloads/packages/ [ Eclipse IDE for C/C++ Developers ]
2. Download cross toolchain from
https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases (or)
https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads
3. Download xPack Windows Build Tools (ignore for Linux)
https://github.com/xpack-dev-tools/windows-build-tools-xpack/releases/
———————————————————————————-
4. Download xPack openocd
https://github.com/xpack-dev-tools/openocd-xpack/releases/
(or)
sudo apt install opencd # alternative in case of Linux
5. Download xPack qemu
https://github.com/xpack-dev-tools/qemu-arm-xpack/releases/
6. Launch STM32 Cube IDE, Go to Help -> Eclipse Marketplace, Look for “Eclipse Embedded CDT 5.x” and install
Restart eclipse when prompted
(or)
Download Eclipse with pre installed Embedded CDT plugins (Alternative to Cube IDE)
https://projects.eclipse.org/projects/iot.embed-cdt/downloads
7. Window -> Preferences -> MCU -> Global ARM Toolchain Path
provide path of toolchain here, location of bin
8. Window -> Preferences -> MCU -> Global Build Tools Path
provide path of xPack windows build tools here
9. Window -> Preferences -> MCU -> Global OpenOCD Path
provide path of xPack openocd here
10. Window -> Preferences -> MCU -> Global Qemu Path
provide path of xPack openocd here
11. File -> New -> C/C++ project -> C Managed Build
Select STM32F4xx C/C++ project here, give some name say “f4-blinky”
Just go with default settings in next dialog
In last dialog, Toolchain path could have reflected due to global settings
12. Right click on project -> build, observe generated elf file
13. Right click on project -> Debug As -> Debug Configurations -> GDB Qemu Debugging -> Debugger Tab
Provide “STM32F4-Discovery” as board name, “STM32F407VG” as Device name
Launch Debug
Same debug configuration works for Run also (Run As -> Run Configurations -> GDB QEMU Debugging)
14. If you want to go for Cube IDE features, File -> New -> STM32 Project [ Qemu support is not yet verified for this ]
STM32F405xx