Hello, I am trying to compile the example project provided by ST for the X-CUBE-SPN7 motor control kit. The kit includes a Nucleo-F302R8, X-NUCLEO-IHM07M1, a brushless motor and an ACDC power supply. I proceeded to download the example code from ST website:
To import the project in SW4STM32 in Windows (I will call it Eclipse from now on)
1. Extract the contents of en.X-CUBE-SPN7.zip into a destination folder with a short path to avoid Windows long path issues. All files of the package are located under this directory:
2. In Eclipse, go to: File -> Switch Workspace -> Other and paste C:\Workspaces\MotorControl_WP\. Click OK and Eclipse will restart.
3. In Eclipse, go to: File -> Import -> Existing projects into workspace -> Select Root Directory: C:\Workspaces\MotorControl_WP\. Press Enter.
4. From the four projects eclipse will found, select only the one for STM32F302R8 and click Finish.
The project seems to be imported correctly, but it fails immediatly when I hit compile, because it cannot find the files referenced in the project. After digging around in .project file, I found that all the files are referenced using an absolute path, apparently from the computer where the project was created. For example:
C:/Users/giuseppe scuderi-sl/Desktop/MOTOR CONTROL/Peppe/trunk/Firmware/X-CUBE-SPN7-MC-6STEP/Projects/Multi/Examples/MotorControl/Src/main_F302.c
I solved the problem opening .project file with a text editor, replacing all occurrences of "C:/Users/giuseppe scuderi-sl/Desktop/MOTOR CONTROL/Peppe/trunk/Firmware/X-CUBE-SPN7-MC-6STEP" to "C:\Workspaces\MotorControl_WP\STM32CubeExpansion_SPN7_V1.0.0". It's still an absolute path, but now it works on my computer and at least I can compile the project. Still, it is not the ideal solution, because the project will fail when I copy it into another location. In my opinion, it should use relative paths.
Few questions to ST on my side:
a. Is my procedure to import the example project correct? I could not find any explicit documentation on how to import this project in SW4STM32, so I followed this procedure based on my experience with other projects.
b. Is it possible that ST updates ALL the example projects from the official website to use relative paths? It is not the first time I face this issue.
c. Is SW4STM32 supported by ST at all?
d. In my job I am promoting ST evaluation boards to the maker and DIY community. I think ST puts a lot of effort to help introduce their line of STM32 microcontrollers to the non-expert users, and I think they did a good job with the STM32 Cube MX. However, I think that SW4STM32, and in general any IDE based on Eclipse is tremendously complicated to understand, its working internals are obscure and, in general, never does what you want it to do. People want an IDE that "Just Works". Compare it to Arduino for example. Is there any plan to do a "Simple" IDE for STM32 Nucleo platform?