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 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:
- Double-click on the picture of the board or press the Start Project button.
- By default, the checkbox Generate demonstration code is not checked.
- It must be checked to generate the code allowing the user to interact with the board via the User button located on the board.
- Check the Generate demonstration code checkbox.
- Each of the checkboxes 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 is about to generate the code using the corresponding BSP drivers.
- Press the OK button.
3. Pinout & Configuration view
- Expand the Bsp tree on the left hand side of the Pinout & Configuration view 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.
Note that:
- Pins reserved for the BSP are colored in magenta and are not available for any other configuration (users cannot configure those pins).
- Any IP configured with "Start From Board" is grayed out in the GUI display. When the user moves the mouse over it, a tooltip will appear to indicate this status.
- You can adjust the settings in the Mode and Configuration panels.
- You cannot enable or disable the Generate demonstration code option.
Limitation:
If you press the Reset Configuration button on the screen, you will not be able to interact with the Generate demonstration code option any longer; The option is set to do not generate.
3.1. Generating the project
Go to the Project Manager tab:
- Give a name to your project.
- Select your preferred toolchain / IDE.
- Press the GENERATE CODE button.
3.2. Moving the code to the board
You can now locate the generated code in your file system. Compile it using the appropriate toolchain and transfer the firmware 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 the ST-LINK.
4. Limitations
- The functionality is not compatible with the software packs implementing BSP drivers.
- Since the demonstration code is in user section, it should be removed manually once the BSP is disabled.
5. Supported boards
Board name |
---|
NUCLEO-C031C6 |
NUCLEO-C051C8 |
NUCLEO-C071RB |
NUCLEO-C092RC |
NUCLEO-G431KB |
NUCLEO-G431RB |
NUCLEO-G474RE |
NUCLEO-G491RE |
NUCLEO-H503RB |
NUCLEO-H533RE |
NUCLEO-H563ZI |
NUCLEO-H723ZG |
NUCLEO-H743ZI |
NUCLEO-H743ZI2 |
NUCLEO-H745ZI-Q |
NUCLEO-H753ZI |
NUCLEO-H755ZI-Q |
NUCLEO-H7A3ZI-Q |
NUCLEO-H7S3L8 |
NUCLEO-L552ZE-Q |
NUCLEO-N657X0-Q |
NUCLEO-U031R8 |
NUCLEO-U083RC |
NUCLEO-U385RG-Q |
NUCLEO-U545RE-Q |
NUCLEO-U575ZI-Q |
NUCLEO-U5A5ZJ-Q |
NUCLEO-WB05KZ |
NUCLEO-WB07CC |
NUCLEO-WB09KE |
NUCLEO-WB15CC |
NUCLEO-WB55RG |
NUCLEO-WBA52CG |
NUCLEO-WBA55CG |
NUCLEO-WL33CC1 |
NUCLEO-WL33CC2 |
NUCLEO-WL55JC1 |
NUCLEO-WL55JC2 |
P-NUCLEO-WB55-NUCLEO |
P-NUCLEO-WB55-USBDONGLE |
STM32H573I-DK |
B-WBA5M-WPAN |