cancel
Showing results for 
Search instead for 
Did you mean: 

Your Input Matters: How Do You Use STM32Cube Examples?

Dear STM32 Community,

 

We believe that the example projects provided for the STM32Cube embedded software are a valuable resource when developing projects.

 

We would like to better understand how developers use these examples in their workflow and explore ways to improve them. Therefore, we have a few questions we would like to ask:

 

From where do you obtain the examples, and why?

  • Are you working with the examples through the STM32Cube MCU packages, the STM32CubeMX Example Selector, or through GitHub?
  • Is there a particular reason you prefer one channel over the others?

How do you use the examples in your work with STM32 embedded software?

  • Do you use the examples to learn how to use a driver or a feature, as reference code for implementation, and/or for debugging?

What is working well, and what can we do to improve the examples and/or your experience working with them?

 

You can either reply directly in this thread or feel free to send me a private message.

 

Best regards,
Emil

24 REPLIES 24
matt-crc
Senior III

Hello,

It would be nice if we can get the source code for the demos that come with the board.  For example, where can i find the source code project for stm32n6570-dk board/development system?

thanks, Matt

frogrammer
Associate III

For many STM32 Families, you have provided example codes with same topic. If i have one HID mouse example with USBX, i do not need another one. Again, if i have USBX  MSC SRAM example for one chip, i do not need the same example for another chip. I would prefer USBX MSC SD Card example, in my experience, i faced numerous issues with SD card implementation.

mikesmith100
Associate II

It would be great to have a feature in the GENERATE CODE button for the CubeMX ioc file that allows users to freely reconfigure the USER CODE BEGIN and USER CODE END areas of their projects, as well as control the file names being operated on (such as main.c or linked_list.c).


I will use the CubeMX Example for sample source code. It is very convenient to deploy an Example project specialized for a certain function and update it with a single click of the GENERATE CODE button. However, I often find myself wanting to merge two or more Example ioc files. Unfortunately, there is no way to adjust the USER CODE BEGIN and USER CODE END areas, so I end up backing up the project as Project A and Project B, updating Project A using the GENERATE CODE button from the ioc file, and then checking the diff between Project A and Project B to manually transfer the differences back to the original project. This process is quite tedious.

 

When I update the driver version in CubeMX, I also back up the project as Project A and Project B, updating Project A with the old version of CubeMX and Project B with the new version, using the GENERATE CODE button. I then check the diff between Project A and Project B and manually transfer the differences back to the original project. However, the initialization order of GPIOs may change, resulting in a large number of diff differences, even though there are effectively no real differences. Manually transferring these differences back to the original project is quite a challenge.


Well, compared to the bare-metal sample code from the past, this environment feels like heaven, so I guess this is a luxurious complaint.

PJD
Associate II

Hi Emil, I generally use examples provided by STM via STM32CubeIDE or other STM resources e.g., STM32Cube_FW_MP2_V1.2.0 for board STM32MP257F-DK... One thing that would be very helpful is for examples to included .ico files...

As far as I can tell, BSP packages and drivers do not use CubeMX .ico files and that .ico file does not exist.  BSP packages, I think, were never intended to use CubeMX configuration and were never intended to be portable.  They were intended to be "load this, run this, see how wonderful, buy product."

I do not use them at all, although you have to take the code, generate the ICO files yourself, use CubeMX to initialize the board the right way, then just use a fraction of the demo code.  It can be done........