Getting started with Start from board

Revision as of 12:39, 12 March 2024 by Registered User

This article explains what is the Start From Board feature and how to use it through a detailed example.

1. What is Start From Board?


Start From Board is a functionality of STM32CubeMX that simplifies the creation of a project on a board.
A project can quickly be generated and uploaded to a board.
The working generated skeleton allows a faster understanding of the ins and outs of the board workings.

Main features:

  • A fully functional application can be generated in a few clicks.
  • All the required board support packages (BSPs) of drivers and configuration settings, which allow a kernel image to boot up the board, are included in a few clicks.

This article uses the STM32C031C6Tx-based NUCLEO-C031C6 device as an example.
See the list of supported boards below.

1.1. Objectives

  • Learning how to generate easily a project to execute on a board.
  • Creating a simple project illustrating the Start From Board functionality.

2. Creating the project in STM32CubeMX

The example below uses the NUCLEO-C031C6 board

[https://www.st.com/en/evaluation-tools/nucleo-c031c6.html |NUCLEO-C031C6 board]


We are going to create a project with the following functionalities:

  • A green LED goes on and off when the user presses the user button on the board.
  • A message is sent to the UART associated to the ST-LINK.

Select the NUCLEO-C031C6 board using the Board Selector, as shown in the figure below:
Start from board boardselector.png

  • Double-click on the board or press the start project button.
  • By default the "Generate demonstration code" is not set.
  • We need it to be checked in in order to generate code allowing the user to interact with the board via the "User Button" located on the card.

Start from board options.png

  • Check the "Generate demonstration code" box.
  • Each of the check box under the "Human Machine Interface" allows the inclusion of the corresponding BSP drivers.
  • The list of the available BSPs is presented and some are checked.
  • This indicates that STM32CubeMX will generate the code using the corresponding BSP drivers.
  • Press the OK button.

3. On the Pinout & Configuration view

Locate the "Bsp" section on the left hand side of the '"Pinout & Configuration" view.
Click on the Bsp chevron to show the list of boards being configured.
Click on the NUCLEO-C031C6 board.
The mode and configuration panels are opened with the data previously configured in the wizard.

Start from board pinout and configuration.png

Note that:

  • You can adjust the settings in the "Mode and Configuration" panels.
  • You cannot enable or disable the "demonstration code" generation.

Limitation:
If you press the "Reset button" you will not be able to interact with the "Generate demonstration code" option, it will be set to "do not generate".

3.1. Generating the project

Go to the Project Manager tab.

  • Give a name to your project.
  • Select your prefered toolchain / IDE
  • Press the "GENERATE CODE" button.

Start from board generate code.png

3.2. Moving the code to the board

You can now locate the generated code on your file system. Compile using the appropriate toolchain. Transfer the code to the board. Using the "user button" on the board, you can start and stop the led blinking process. Using a debugger, you can see the data being sent to the UART associated to ST link.

Start from board6.png

4. Limitations

The functionality is not compatible with software packs implementing BSP drivers.

5. Supported boards

Boar name:
NUCLEO-C031C6
NUCLEO-U031R8
NUCLEO-U083RC
NUCLEO-U5A5ZJ-Q
NUCLEO-H563ZI
NUCLEO-H533RE
NUCLEO-H7S3L8


No categories assignedEdit