Skip to main content
Senior
February 16, 2026
Solved

STM32CubeMX keeps file handles open after code generation

  • February 16, 2026
  • 2 replies
  • 187 views

Hi,

this is a small but annoying little bug: Sometimes after running code generation, apparently the STM32CubeMX application keeps some files open in the "cmake" subdirectory. This then prevents me from modifying or deleting (to force re-generation on the next code generation run) the files. It also interferes with my Post Generation user script which modifies those files.

This can be seen e.g. via ProcessExplorer:

Screenshot 2026-02-16 110112.png

It would be helpful if STM32CubeMX would close all file handles after code generation, ideally before calling the post generation user scripts.

Thanks! 

 

 

Best answer by Ghofrane GSOURI

Hello @Erlkoenig 

Your change request has been forwarded to dev team under internal ticket ID 227258 for further investigation  and feasibility check .

I will keep you posted with updates.

THX

Ghofrane

2 replies

Ghofrane GSOURI
Technical Moderator
February 16, 2026

Hello @Erlkoenig 

I'm currently investigating this behaviour.I will get back to you ASAP.

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.
Ghofrane GSOURI
Ghofrane GSOURIBest answer
Technical Moderator
February 16, 2026

Hello @Erlkoenig 

Your change request has been forwarded to dev team under internal ticket ID 227258 for further investigation  and feasibility check .

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.
ErlkoenigAuthor
Senior
February 16, 2026

Thank you very much!