2024-09-25 08:31 PM - last edited on 2024-09-25 11:21 PM by SofLit
Hello,
I am a beginner with STM32IDECube.
I have just installed Version: 1.16.1 Build: 22882_20240916_0822 (UTC) which seems to work.
I am developing a program with the STM32F107 processor as a target.
Everything works so far except that now I want to integrate my little test program (just for blinking e LED) written in C into the project with a view, of course, to compiling it and then downloading it into the component alongside FeeRTOS and the configurations that I have made with STM32Cube for which I have generated the code.
My problem is:
1) I do not see anywhere, neither in STM32Cube nor in my directories on my disk, a file in which this basic code could have been generated ?
2) I don't see anywhere, neither in STM32Cube nor in my directories on my disk, a "\Core" directory where this could be ?
3) I don't see anywhere, neither in STM32Cube nor in my directories on my disk, a "main.c" file in which I could, possibly and if that's what needs to be done, integrate my code ?
See attached a screen capture of the only thing I see on STM32Cube.
- What's going on ?
- How could I move forward ?
Thanks,
--
MDe / Belgium
Solved! Go to Solution.
2024-09-26 06:22 AM
Hello SofLit,
Ok now it works :) I installed STM32CubeMX as you recommended, loaded the project, press the "GENERATE CODE" button and I got all .c files etc… is the directory I showed you.
But I have one question :
Can you explain to me why we have to go through this other STM32CubeMX application, to install, in addition to the STM32CubeIDE IDE for this code to appear ?
To be complete, please find attached a .7z file with all files after this code generation, also include the file .Project that was missing.
I did not have .7z compressor installer on my computer, I did this compression online and may be it missed the file, sorry. Now I have .7z compressor 24.08 installed and it should work better.
Thanks for your help.
For the rest, along the way, I receive much indication on what to with "Copilot", the AI search engine of Microsoft :)
Looking forward to read from you with that question : why STM32CubeMX in addition to STM32CubeIDE ?
Kind regards,
--
Mde / Belgium
2024-09-26 07:03 AM
I don't know how you did start the project, I invite you to either read UM2609 / section 2.1.2 Creating a new STM32 project or simply watch one of the videos on youtube how to create a project from scratch starting from the CubeIDE. For example: https://www.youtube.com/watch?v=oJ0D5Xye6Hg.
To answer you question, and if you start your project from CubeIDE you need to click on this button to generate your code
Hope I answered your questions
2024-09-26 07:53 AM
I don't know if there is any difference between clicking on this "Device Configuration Tool Code Generation" or going through "Project - Generate Code" having indeed the icon.
So far this is all disturbing.
I did created my very initial project you have seen, simply at first opening of STM32CubeIDE, by going through "File New STM32 Project"
This cannot be more intuitive and logical !
Later the IDE proposed me to select my Arm microcontroller which was very logical too.
You still do not explain me why, at some point, we need to install a second application, STM32CubeMX and generate code through it, for it to work ?
Thanks,
Regards,
--
MDe / Belgium
2024-09-26 08:02 AM
@MDe wrote:
You still do not explain me why, at some point, we need to install a second application, STM32CubeMX and generate code through it, for it to work ?
I didn't tell you at any time you "should" install STM32CubeMX.
There are two possibilities:
1- You start from CubeMx (the standalone) tool and configure your peripherals and generate your code from there. In this case you need to generate the code with this button:
2- Start from CubeIDE tool (as stated in UM2609 / section 2.1.2 Creating a new STM32 project) and use the integrated CubeMx in CubeIDE. In this case you need to generate the code with this button:
Hope it's clear now.
2024-09-26 10:47 AM
Ok, thanks.
I suggest we leave it like this. As I move forward in the project I will mainly test, using this button, if my code recompiles well and, above all, delivered in the ad'hoc .c files.
Thanks for your help :)
--
MDe / Belgium
2024-09-27 02:27 AM
Hello,
Thanks for your last message, it telsl me how to do it, it works.
But are you aware that the IDE, which seems to integrate MX to generate code. In fact, the IDE does NOT generate the "main.c" file for example. And without saying anything, it makesyou believe that the generation was done perfectly.
Are you aware of that?
Are you aware that the IDE does not do everything that MX does?
2024-09-27 02:38 AM
@MDe wrote:But are you aware that the IDE, which seems to integrate MX to generate code. In fact, the IDE does NOT generate the "main.c" file
Please describe the exact steps you take to end up in such a situation.
IME, STM32CubeIDE certainly does generate the required code - including main.c.
2024-09-27 03:33 AM
Not difficult at all :
- I installed IDE fresh on my computer
- Created a new project in the IDE
- I didn't changed anything. All remaining default.
- I only initiated FreeRTOS and adding a task;
- I also changed a bit the clocks but nothing special.
- And I defined one of the Pin as digital output for blinking a LED
- Then I generated the code, menu : "Project - Generate Code"
At this point I started wondering where the .c files were generated. And they were nowhere to be found.
That's were SofLit told me to generate the code with MX.
Then, the main.c file etc.. appeared, also in the IDE and without doing anything.
That's all.
Probably, if you like, you could start with a fresh computer, without anything from STMicroelectronics on it, and you will come across the problem ?
2024-09-27 03:36 AM - edited 2024-09-27 03:37 AM
Hello @MDe
There is no issue in the two cases I described before. Attached a project that I started from scratch starting the project with STM32CubeIDE. If you didn't follow the steps described in UM2609 / section 2.1.2 Creating a new STM32 project you need to check that again.
2024-09-27 03:39 AM - edited 2024-09-27 03:40 AM
@MDe wrote:
- Created a new project in the IDE
- I didn't changed anything. All remaining default.
How?
Again, did you follow the steps described in UM2609 / section 2.1.2 Creating a new STM32 project ??