cancel
Showing results for 
Search instead for 
Did you mean: 

Developing on example (i.e. X-CUBE-AWS) with STM32CubeIDE

DDori.1
Associate III

Hello,

I am on my first steps in the STM32 world, using STM32CubeIDE on Linux. I have a 32F413HDISCOVERY board to play with.

I have no problems developing simple applications from scratch in the IDE. My problems start when I want to integrate external code provided as examples by ST.

In particular, I want to develop a AWS IoT application. I have downloaded the X-CUBE-AWS example and managed to import it, build it and make it work on the board. Now I would like to modify the example to add more functionalities (for example, control a motor).

I cannot understand how to integrate the code generated during the micro configuration step and the example. Main questions:

  1. the structure of the files and folders in the example project and a new generated project is quite different. For example, the main in the example is completely different, with no "safe" sections for user code. Do I miss something or it is because STM32CubeIDE is different from Workbench for STM32? Would it be easier if I change software?
  2. in the examples the pins configuration is mixed up in different files (wifi, LEDs, serial and so on). This is quite different from what I get from the configurator. Should I work with a new project with no assigned pins and simply import the header files of the example to get the right pin assignment? What about when I need to add other pins/functionalities?
  3. Not sure if I am importing the driver/middleware/header files of the example correctly. I have included the respective folders in the Project-Properties-C/C++ Build-Settings-MCU GCC Linker-Libraries-Library search path and selected the folders in the filesystem. However, I don't see the files in the project explorer and I am worried that some files are duplicate of the one coming from the configurator.

In general, as you see, I am quite confused. Any help, even from another example, would be most welcomed.

Thanks in advance

Davide

3 REPLIES 3
Cartu38 OpenDev
Lead II

See my answers here: Converting Examples from SW4STM32 to CubeIDE and HELP - CMWX1ZZABZ-078 project on STM32CubeIDE

I guess you're facing mix of both.

DDori.1
Associate III

Thanks Cartu38, it helps a bit but not much (I did find your first link before posting).

From what I understand, the best (and long) way is to generate a new project and then importing the single files and bits of code that I will need. But what about pin assignment? Some of them are already defined somewhere in random header files. Should I use the latter's and not assign anything via CubeMX or I should painstakingly "back engineer" the used pins, configure them on CubeMX and remove them from the header files? I hope my concern is clear.

Davide

I'm fully sharing your pain but yes if expecting to rely on STM32CubeMX automation I guess no choice only suitable path is reverse engineering.

Or rely on STM32CubeMX on a side project then extract from it valuable material to reinject it within AWS example.