cancel
Showing results for 
Search instead for 
Did you mean: 

How to install and import an X-CUBE Expansion Package with STM32CubeMX?

ST AME Support NF
ST Employee

How to install and import an X-CUBE Expansion Package with STM32CubeMX?

At ST we offer a lot of Expansion Packages also known as X-CUBE for our STM32.
You can download and import these software packages using STM32CubeMX.
Let me show you how.

1. Import drivers


In STM32CubeMX I have created a project for a STM32G071RBTx
Let's say we want to import the drivers of a ST MEMS in our project.
First we need to download and install the X-CUBE-MEMS1 package where the drivers of the ST MEMS is.
To do that click on Help -> Manage Embedded software packages as shown below:
1833.png
A window will pop-up and you want to select STMicroelectronics menu as shown here:
1834.png


2. Install X-CUBE expansion package


Now we want to download and install the X-CUBE we want to import in our project.
In our case scroll down to X-CUBE-MEMS1 and expand it as shown below:
1835.png
Now select the latest version of the X-CUBE by checking the blue box on the left side and then Click on Install Now:
1836.png
Once downloaded acknowledge the agreement and press Finish:
1837.png
A green dot like this will show you when the package has been installed properly, then click Close
1839.png
Now to import the driver in your project, expand Software Packs and then clock on Select Components:
1840.png


3. Import driver using I2C interface


Now let's say we would like to import a driver for a LSM6DSL using a I2C interface, please expand X-CUBE-MEMS1 as shown here, select LSM6DSL and then I2C interface, then you can close by clicking OK:
1841.png
First in the pinout and configuration tab we will enable an I2C peripheral that will be used to interface to MEMS, in my case I choose I2C1:
1842.png
Now scroll down the list on the left and expand and sect the Software Packs for the MEMS that we imported, then for the Mode click on Board Part AccGyr, then in the  platform settings select I2C1 for the solution found :
1843.png
Now you can generate your project and as you can see the drivers for the MEMS has been properly added to your project:
1844.png
Comments
SDomi.2
Associate

X-CUBE-CELLULAR doesn't show up on the Embedded software packages Manager.

JSanc.7
Associate II

Sorry, I've tried to follow your post and when I generated the code, in the 2 generated files "app_ble.c" and "p2p_client.c" there are a lot of errors, most of which are due to undeclared variables.

Is there anything I miss? 

I'm going to post photos to show these errors.

Could you help me?

Thank you.

Screenshot_5.pngScreenshot_6.png

Lex
Associate III

In addition to missing X-CUBE-CELLULAR, X-CUBE-NFC6 is also missing... It looks strange that no one from ST staff could explain how extension packages from ST could be imported into STM32CubeMX or CubeIDE...

Peter BENSCH
ST Employee

@SDomi.2 @Lex OK, but unfortunately, you are confusing the terms a bit here and you will probably only understand this if you delve a little into the history: CUBE packages were made available long before the introduction of the free GUI STM32CubeIDE and could not be installed in STM32CubeMX at that time. However, it was already quite easy to integrate the file structure of the CUBE package into one's own project, even those provided by external developers are often integrated in this way. Information on this can be found in UM2312, UM2385 and UM2388.

Newer CUBE packages from ST are then gradually made installable in CubeMX/IDE.

Hope I could help a little?

Regards
/Peter

Version history
Last update:
‎2021-09-14 03:05 AM
Updated by: