/docs: project docs for phase 1 report /old: stmide project for config. reference /Main: the current working project
Make sure you have the following installed on your system (Linux/Ubuntu):
- ARM GNU Toolchain:
gcc-arm-none-eabi - Build Tools:
cmakeandninja-build - Flashing/Debugging:
openocd
(Ubuntu/Debian install command: sudo apt install gcc-arm-none-eabi cmake ninja-build openocd)
- Navigate to the working project directory:
cd Main/STM32_Motor_Control - Configure the CMake project (first time only):
cmake -S . -B build - Compile the code:
cmake --build build
We use ARM Semihosting to print messages (like the 3 Ultrasonic distances) directly to the terminal without needing an extra TTL/UART adapter.
- Connect your ST-Link v2 to the STM32 and plug it into your PC.
- Run the flashing script (from within the
Main/STM32_Motor_Controlfolder):sudo ./flash_and_view.sh
- The script will automatically flash the MCU, soft reset it, and display the live output prints directly in your terminal!