on
2021-09-14
03:05 AM
- edited on
2024-09-03
08:32 AM
by
Laurids_PETERSE
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.
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:
A window will pop-up and you want to select STMicroelectronics menu as shown here:
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:
Now select the latest version of the X-CUBE by checking the blue box on the left side and then Click on Install Now:
Once downloaded acknowledge the agreement and press Finish:
A green dot like this will show you when the package has been installed properly, then click Close
Now to import the driver in your project, expand Software Packs and then clock on Select Components:
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:
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:
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 :
Now you can generate your project and as you can see the drivers for the MEMS has been properly added to your project:
X-CUBE-CELLULAR doesn't show up on the Embedded software packages Manager.
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.
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...
@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