cancel
Showing results for 
Search instead for 
Did you mean: 

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

davbergar
Associate II

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!!

1 ACCEPTED SOLUTION

Accepted Solutions
Cartu38 OpenDev
Lead II
4 REPLIES 4
Cartu38 OpenDev
Lead II

0693W00000Y8n1ZQAR.png

davbergar
Associate II

Thanks!!!

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.

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.