Skip to main content
davbergar
Associate
January 20, 2023
Solved

How can I avoid to open main.c file after code generation ?

Hi!

In stm32cubeIde, when I press code generation, automatically after the main.c file is opened. I would like to know how deactivate this option if it is possible.

I have many main.c files in other projects folders that are excluded from compilation but all are opened after code generation and it is a bit annoying 

Thanks!!

This topic has been closed for replies.
Cartu38 OpenDev
Cartu38 OpenDevBest answer
Graduate II
January 20, 2023

0693W00000Y8n1ZQAR.png

4 replies

Cartu38 OpenDev
Cartu38 OpenDevBest answer
Graduate II
January 20, 2023

0693W00000Y8n1ZQAR.png

Brian H
Senior
July 11, 2024

Clearing the "Do switch to C/C++ perspective" options indeed seems to stop the unwanted behavior.  However, it also stops wanted behavior.  I do want to automatically switch back to C/C++ perspective after IOC generates code.  I don't want it to recurse the entire project folder and open every single "main.c" it finds (there are 30+ in my project, thanks to tinyusb's examples folder).  

Suggested new options:

[ ] Do switch to C/C++ perspective on code generation - this ONLY switches back to C/C++ perspective and DOES NOT open any files (ideally moving focus back to the last file I was editing)

[ ] Open modified source files - This opens any modified .c source files ONLY under "Core/Src" (for typical project layout).

It's senseless in all cases to open files the code generator didn't touch.

BUG: After modifying these settings, the default behavior of asking if I want to generate code when saving the .ioc went away, and I can't seem to get it back.

davbergar
davbergarAuthor
Associate
January 20, 2023

Thanks!!!

unsigned_char_array
Lead III
January 20, 2023

Another way is to install STM32CubeMX. I personally find it easier to use a separate tool instead of the build-in one. But that's my preference.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."