Skip to main content
Moose
Associate
August 29, 2025
Solved

STM32Cube post code generation script

  • August 29, 2025
  • 1 reply
  • 280 views

Hey all.

As per tradition, my first post in this community will be a question.

In the same way that I can run pre- and post-build commands that is run when I build a project in STM32cube, is it possible to run a post code generation command when I generate code from the .ioc file?

- Moose

Best answer by Ghofrane GSOURI

Hello @Moose 

Welcome to ST Community

In STM32CubeMX and STM32CubeIDE, you will find fields labeled:

"User action, Before code generation"

"User action, After code generation"

These fields allow you to specify commands or scripts that will be executed:

Before code generation:
The command in the "Before code generation" field runs just before the code is generated from the .ioc file.
After code generation:
The command in the "After code generation" field runs immediately after the code is generated.

GhofraneGSOURI_0-1756454078752.png

THX

Ghofrane

 

1 reply

Ghofrane GSOURI
Ghofrane GSOURIBest answer
Technical Moderator
August 29, 2025

Hello @Moose 

Welcome to ST Community

In STM32CubeMX and STM32CubeIDE, you will find fields labeled:

"User action, Before code generation"

"User action, After code generation"

These fields allow you to specify commands or scripts that will be executed:

Before code generation:
The command in the "Before code generation" field runs just before the code is generated from the .ioc file.
After code generation:
The command in the "After code generation" field runs immediately after the code is generated.

GhofraneGSOURI_0-1756454078752.png

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.
Moose
MooseAuthor
Associate
August 29, 2025

Glorious!

Exactly what I was looking for. Had missed the tabs in that view.

Many thanks! :)

- Moose