How to build a firmware using Makefile?
dev.toΒ·6dΒ·
Discuss: DEV
πŸŒ‘darktable
Preview
Report Post

In embedded programming, we trust IDEs like STM32CubeIDE, Keil or so on. These IDEs give us just some buttons and UIs to build, flash, and debug the source code that we’ve written for a MCU. But, I think that every engineer that works on this field have to know that how these steps are made by hand.

In this article, I will show building a firmware written for STM32F446RE MCU with just using a single Makefile.

Below is the project directory:

$ tree
.
β”œβ”€β”€ bin/
β”œβ”€β”€ drivers/
β”‚Β Β  β”œβ”€β”€ CMSIS/
β”‚Β Β  β”œβ”€β”€ STM32F446RETX_FLASH.ld
β”‚Β Β  └── STM32F4xx_HAL_Driver/
β”œβ”€β”€ lib/
β”œβ”€β”€ Makefile
└── src/
β”œβ”€β”€ it.c
β”œβ”€β”€ main.c
β”œβ”€β”€ main.h
└── peripheral.c

Firstly, which libraries do we need to have?

HAL library

CMSIS library

Linker script

Startup/system code

arm-none-eabi-* tools

I’ve p…

Similar Posts

Loading similar posts...