Skip to main content
Zack
Associate II
March 10, 2023
Solved

Cubemx v6.8 deletes the "Middlewares" folder, even if there are other non-cubemx generated files in it.

  • March 10, 2023
  • 6 replies
  • 3404 views

Created a new project with v6.8 and reproduced the issue

Steps:

1.cubeMX create new STM32F334 project and generate code.

(Project-application structure-advanced

Project-IDE-MDK-v5.32

Code Generator- copy only the necessary library files

Code Generator- Delete previously gernerated files)

2.Create a Middlewares folder (/project folder/Middlewares), copy some folders in this folder (/project folder/Middlewares/mymiddleware).

3.Generate code again, Middlewares folder is deleted.

os:Win10

jre:IBM Semeru jre 11.0.18.10

Best answer by Ghofrane GSOURI

Hello @Zack​ 

Thank you for your contributions and for your detailed explanations,

I confirm the issue on my side, it has been reported to STM32CubeMX development team .

Internal ticket number: 147368(This is an internal tracking number and is not accessible or usable by customers).

I will keep you posted with updates.

Thanks,

Ghofrane

6 replies

Ghofrane GSOURI
Ghofrane GSOURIBest answer
Technical Moderator
March 10, 2023

Hello @Zack​ 

Thank you for your contributions and for your detailed explanations,

I confirm the issue on my side, it has been reported to STM32CubeMX development team .

Internal ticket number: 147368(This is an internal tracking number and is not accessible or usable by customers).

I will keep you posted with updates.

Thanks,

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.
MPast.1
Senior
March 10, 2023

I discover the same thing on STM32CubeIDE 1.12.0 (windows version) with Touchgfx 4.21:

Everytime I generate code by configurator on STMCubeIDE, thisone delete the "Middlewares" folder from my project.

In my case, I must re-generate one more time the Code by Touchgfx.

MChan.10
Associate
April 3, 2023

What is the workaround to get the Middlewares back that I need to compile my project in STMCubeIDE?

Associate II
May 3, 2023

The Bug also exists in STM32CubeMX 6.8.1 and STM32CubeIDE 1.12.1.

I found this clumsy workarround for me:

If I have to change the configuration in the *.ioc-file I rename the "Middlewares"-folder without updating the references to "Middleware" for example. Then I change the configuration and save it. After everything was updated I change the folder name back to "Middlewares".

Ghofrane GSOURI
Technical Moderator
May 3, 2023

Hello @JensH​ 

Thank you for having reported.

I assume this is the exact same issue already reported to the development team and tracked by the Ticket 151040 and that will be fixed as soon as possible.

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.
jacobq
Associate II
September 5, 2024

@Ghofrane GSOURI Can you please provide a status update for these internal tickets (147368 & 151040)? We are still experiencing this problem with the latest version:

STM32CubeIDE v1.16.0 (Build: 21983_20240628_1741 (UTC))
STM32CubeMX v6.12.0-RC9 (Build: 20240628-1431 (UTC))

ALong.4
Associate II
May 26, 2025

Any news? still have the issue in latest cubemx  release (6.14.1)

Associate
December 21, 2025

@Ghofrane GSOURI 

Hate to reopen an old thread - but still happening in 6.16.1!!!

 

This is even with the "Delete Previously Generated Files" UNCHECKED in the Project Manager.

Ghofrane GSOURI
Technical Moderator
December 22, 2025

Hello @ryedwards 

If you named your added files as Middlewares or Utilities, please rename them. These are considered reserved folder names for STM32CubeMX.

Also, if you have added a subgroup in the MDK-ARM project, go to File → Save All.
This way, your added user files will not be deleted.

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.