julian | Posted: 4 Jul 2025, 02:02 PM |
---|---|
![]() Member Posts: 3 Joined: 3-July 25 |
Hi, I'm trying to document the way on how to import the source code for the clock4 in STM32CubeIDE, as it was not that straight forward. This was all on done on a Fedora machine and might work differently on other systems. # Get the code git clone https://github.com/mitxela/clock4 # Get and install STM32CubeIDE, I choose the -RPM variant (I used latest, as of now: 1.18.1) https://www.st.com/en/development-tools/stm32cubeide.html # Create and login for STM32Cube updates, you need to setup a "myST" account for this Help -> STM32Cube updates -> Connection to myST # Import the project with this: File -> Import -> General -> Existing Projects into Workspace ![]() Now comes the interesting part as at least I could not build the project yet. (The next steps are just for the mk4-time project) What I found out works is: Double-click on the .ioc file, the following dialog should pop-up: ![]() I choosed continue to stay with the same version Then: Project -> Generate Code It will download additional software packages (therefore the need for the myST account) Now you should finally be able to see two build configurations: Project -> Build Configurations -> Set Active (should show Debug and Release) But not so fast, back to the cmdline and check any changes with git status mk4-time:
Some changes are expected: .mxproject has changed path separators and changed paths to header files, that seems ok. But there are also modifications to the application code, a new file (STM32L476RGTX_RAM.ld) etc. so I decided to revert these changes like this:
and delete the new file: rm mk4-time/STM32L476RGTX_RAM.ld You should only see these three files as modified:
With that I hit "Build Project":
I added the missing include path with right-click and Add/remove include path... I also needed to add MSC_CDC/Inc. ![]() With that I was left with this:
Fixed with https://community.st.com/t5/stm32cubeide-mcus/core-src-sysmem-c-38-1-error-unknown-type-name-caddr-t/td-p/56309 Which I solved by adding that include:
And with that, finally:
Is there a better way of doing it, first time using STM32CubeIDE. Hope it helps if someone else wants to experiment with it. ------------- |
[top] | |
mit | Posted: 4 Jul 2025, 03:59 PM |
![]() yeah whatever Admin Posts: 625 Joined: 4-May 16 |
Wow, I am sorry about that - it is definitely not supposed to be that difficult. The whole reason for sticking with their stupid IDE was to make it easier for people to set up the toolchain. There are a few things here, mostly my fault, let's break it down. I have stubbornly refused to get a "myST" account, they only started enforcing that recently and it's awful. You can still manually acquire the files and add them via Help > Manage embedded software packages > from local. However all of the driver files are committed to the repo, so there is no reason to acquire any further files. Similarly, you definitely don't want to "Generate Code", the code is already there. I made a vague effort to have the .ioc match the project, but as you saw if it's generating new code especially with a different version of the firmware it's going to change a lot of files. The intended way to compile is to go File > Open projects from filesystem, select the project and then click build. ![]() That should have been enough. I notice now that the build configuration is missing. That is my fault for adding them to the gitignore with this commit. If you check out just before that commit, the .cproject files are present and it will compile. I'll fix that shortly. The second problem you encountered is apparently to do with compiling with a different toolchain. It's possible to select a specific toolchain under project > properties > C/C++ build > settings > MCU/MPU Toolchain. I didn't realise that this was saved to the "workspace" by default instead of to the project. ![]() The Toolchain Manager doesn't require a log-in, but it also is so glitchy that I couldn't get it to properly install different versions, so it's probably not worth bothering with. The fix you posted of that extra include is probably best. I'll commit these changes momentarily. Again, sorry you had to go through that! I have a strong impulse to just abandon STM32CubeIDE and go back to makefiles... ------------- |
[top] | |
julian | Posted: 4 Jul 2025, 05:27 PM |
![]() Member Posts: 3 Joined: 3-July 25 |
Thank you for your reply, as I suspected sth. was missing, but hey, in the end it worked out for me. I also don't get it why so many vendor IDEs are...suboptimal. If I find some time I'll have a look at some other options. The documentation of every other aspect of this project is just outstanding, I can't imagine how much effort went into it. Building the kit was almost too easy. ------------- |
[top] | |
julian | Posted: 5 Jul 2025, 07:54 AM |
![]() Member Posts: 3 Joined: 3-July 25 |
I just tried latest commit, all looking good, none of my extra steps needed. Thanks so much! ------------- |
[top] | |
Sign in to post a reply.