cancel
Showing results for 
Search instead for 
Did you mean: 

Makefile creation

arun27
Associate II

Can you give me a step-by-step guide to create a makefile for stm32 project?

2 REPLIES 2
Ghofrane GSOURI
ST Employee

Hello @arun27 

To generate a Makefile for an STM32 project using CubeMX, follow these steps:

Step 1: Open CubeMX and Configure Your Project

  1. Launch STM32CubeMX 6.13.0 (Link for download  STM32CubeMX - STM32Cube initialization code generator - STMicroelectronics )
  2. Configure your STM32 microcontroller settings, including clock configuration, peripherals, and middleware.

Step 2: Generate the Project

  1. Click on the "Project" tab.
  2. Set the "Toolchain / IDE" to "Makefile".
  3. Specify the project name and location.
  4. Click "Generate Code".

GhofraneGSOURI_1-1736336561681.png

 

   

 

Step 3: Review the Generated Makefile

CubeMX will generate a Makefile in the project directory. This Makefile will include all necessary build rules, compiler flags, and linker scripts based on your CubeMX configuration.

THX

Ghofrane

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Is this a continuation of https://community.st.com/t5/stm32cubeide-mcus/compilation-using-batch-file/td-p/759173 ?

If so, perhaps mark the solution there, and give a link to here?

Are you familiar with makefiles in general?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.