2020-03-29 10:59 AM
Being able to create a new project from an existing .ioc file is very useful. But when I've tried to do this (by selecting File->New->STM32 Project from STM32CubeMX .ioc file) the project seems broken. I can build it fine, but when I try to add new (existing) source files to the project (either by dragging and dropping or importing), they appear in the IDE but are never actually built. If you inspect the properties for newly added source files, the Tools Settings section is empty. If I create a new, blank, project, I'm able to add source files fine. Is this feature broken, or am I doing something wrong?
2020-03-29 01:14 PM
Eclipse CDT has some quirks (not specific to CubeIDE) so perhaps you're doing something wrong.
Try to add a file by placing it in a source directory and refresh the project.
If the folder where you want to add a file is virtual (aka "linked"), this should be done in a different way:
right click on the folder -> New-> FIle or File from template or Advanced-> Link to file in the filesystem.
-- pa
2020-03-29 01:57 PM
And btw: I don´t know, why... But sometimes (too often in my opinion...) it helps to clean the project and refresh it completely (via right click on project) :) There are many strange behaviours in cubeIDE :(
/Charly
2020-03-29 02:45 PM
I tried every method of adding files I know (drag and drop, import, and putting them in the folder), none of them worked. In the end I worked around it by creating a new project, and then copying the .ioc from the original project, renaming it, and adding it to the new project. This worked, and I was able to add files fine. It seems there is a bug with the 'create new project from .ioc' feature. This is version 1.3.0 of the IDE.
2020-03-29 02:46 PM
Yeah, it's a shame. When it works it's great, but there are so many small bugs that make it infuriating. 1.3.0 fixed some of the issues I was having (1.2.0 really didn't like C++, and you had to keep converting the project back to C++ after an ioc export).
2020-03-29 11:10 PM
Therefore, they added some new (major) ones... Try to add a new include path via Properties -> C/C++ General -> Paths and Symbols ... Click add, choose the folder from workspace and check "Add to all languages" ... Up to cubeIDE 1.2 it worked and it showed up in both (GNU C and GNU C++) of them... Since cubeIDE, this checkbox is just senseless... If you need the paths in both languages, you have to add them twice. Just annoying and shouldn´t happen in a "professional" environment :(
edit: And the integrated cubeMX isn´t much better: For example: if you have a timer set up there ... Open the .ioc file, go to timers, click the one, you want to change... then for example just change the prescaler (without something else ! Just a new value...) and close it... It´s magicaly, but cubeMX thinks: Hey, this was just a mistake, it worked until now and so let´s forget that change. If you close the file, you will recognize at once, because code doesn´t get updated... But if you change something else in another category (gpio for example...) , you will wonder, why your settings won´t work, like expected :(