cancel
Showing results for 
Search instead for 
Did you mean: 

Extending example projects in the IDE

SBade.1
Associate II

I'm new to IDE's (i'm old school, all my dev has been done with unix command line, shells, manually created make files), so my apologies up front for what is probably a pretty basic question. I'm starting with the example SBSFU KMS for the B-L475E-IOT board and want to extend the user app to bring in the application capabilities from the AZURE example for the same board. This entails bring in some drivers (for the networking, sensors, etc) and sme additional middlewares. If i just copy the middleware/driver folder content from the file system i'm bringing in alot more than the example project, so i'm trying to understand how to bring in the required files. It looks like the IDE has some level of a "link" that it maintains pointing to the actual source folders, as the directories within the example app for the Drivers and Middlewares are completely empty (place holders??)

3 REPLIES 3

I loathe the eclipsoids so I don't know for this one, but usually there are configuration files for the projects, which are xml thus readable and contain the list of sources from which then eclipse works out. I used to hack out these from the atollic version of the cube examples.

Also, eclipsoids used to have a way to generate a normal makefile, and then you can proceed in the usual adult way.

JW

Pavel A.
Evangelist III

> eclipsoids used to have a way to generate a normal makefile, and then you can proceed in the usual adult way.

+1

The examples in SBSFU for SW4STM IDE actively use "linked files", which are the Eclipse way to have portable symbolic links.

(Even though Windows has symbolic links, they are still pain to use...)

"Linked files" is a common feature of Eclipse so it is present in Atollic and CubeIDE as well. It is very powerful but takes some time to get comfortable with.

It's worth to invest effort in learning Eclipse. Agree, it is not pretty, but lot of companies offer Eclipse based IDEs - ARM themselves, TI, Silicon Labs to name some.

Like with riding a bicycle, learn it once and that's it.

Back to the SBSFU examples - the linked files in these are relative to the project directory so all this works because the examples are located in the same source tree with the Cube library. If you move an example outside, this obviously breaks the links.

Linked resources are specified in the .project file; to fix them you can edit .project manually (of course, with caution))

Fix the paths in <link> elements, for example, as below:

<link><name>Drivers/STM32H7xx_HAL_Driver/stm32h7xx_hal_rtc.c</name>
<type>1</type>
<location>PARENT-7-PROJECT_LOC/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rtc.c</location>
</link>
<!-- change this to: -->
<link><name>Drivers/STM32H7xx_HAL_Driver/stm32h7xx_hal_rtc.c</name>
<type>1</type>  <location>file:/your/CubeRepositoryPath/STM32Cube_FW_H7_V1.5.0/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rtc.c</location>
</link>

Note that "Drivers/STM32H7xx_HAL_Driver" is a "virtual" directory which maps to the matching directory in the Cube library installation.

Eclipse will create these vitual directories under the project bulid root. But they will be empty because the files are somewhere else. TL;DR.

PARENT-7-PROJECT_LOC means 7 levels up from PROJECT_LOC, which is a predefined Eclipse variable that contains the project path. Always use forward slashes / - even on Windows. Eclpise will convert the slashes in the paths properly.

There is a better way to manage these paths, using macros - this is closer to how you would do this in a makefile.

-- pa

SBade.1
Associate II

Thanks for all the answers.