STM32F4 Timer Blinky

This repository contains a basic STM32F4xx project that blinks an LED on the Nucleo-64 STM32F401RE board by polling a timer. The main prupose of the project is to demonstrate how to compile all of the required sources using a Makefile, this includes the STM32F4 HAL.

The contents of this repository are derived from the HAL generated by the STMCubeMX IDE. I did the following:

  1. Generated a working CubeMX project to blink the LED using TIM2 on the Nucleo board.
  2. Examined the build output produced by CubeMX.
  3. Copied all source files (less some project configuration files) into this directory.
  4. Re-arranged the directory structure to be a bit more sensible.
  5. Wrote a Makefile to mimick the build procedure determined from (2).

See my earlier project for details on installing the required toolchain: STM32F4-Basic. There is also a related blink project that uses the HAL_Delay function to blink the LED, this requires fewer source files since it does not need an additional timer.

Usage

To build this code run: make

To clean the project run: make clean

To upload/flash the resulting executable to the microcontroller run: make flash

Its easy to combine them all into one command: make clean all flash