Skip to main content
Associate
July 16, 2026
Question

Codegeneration with STM32CubeMX deletes Keil µVision User Command

  • July 16, 2026
  • 1 reply
  • 30 views

I discovered some strange behavior in the STM32CubeMX code generation for Keil µVision.

I created a project with STM32CubeMX that I compile using Keil µVision. In Keil µVision, I configured two user commands in the "Options for Target" dialog under "User" in the "After Build/Rebuild" section. These commands must be executed after the software has been compiled.

Whenever I regenerate the project in CubeMX due to configuration changes, the "After Build/Rebuild Run #2" command is always removed.

I then tested all commands and was able to narrow the issue down exclusively to "After Build/Rebuild Run #2".

Is this a bug in CubeMX, or do I need to change a setting somewhere to ensure that these commands are preserved?

Please also refer to the attached screenshots.

Best regards,

Kai Riek

Before running CubeMX:

After running CubeMX:

 

1 reply

Ghofrane GSOURI
ST Technical Moderator
July 16, 2026

Hello ​@KaiRiek 

Your detailed explanation is much appreciated.

This issue has been escalated to the development team and is being tracked under ticket ID #0064477

I will keep you posted with updates.

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.