SystemWorkbench for STM32 Project creation wizard |
The first step consists to create a new project for the application.
This could be performed by any of the following action available from the C/C++ perspective:
In this tutorial, the new project is created using the File menu. From the C/C++ perspective menu bar, select File > New > Project....
This opens the New Project wizard. From here, select the type of project to create. For this tutorial, expand the C/C++ folder, select the C Project branch and click Next.
This opens the C Project wizard. In the Project name field, enter the name of the new project. Do not use spaces or punctuation characters. Underscores are permitted, so a name like Simple_Project is acceptable.
In the Project types list, expand the Executable branch and select Ac6 STM32 MCU Project.
Select the toolchain that is appropriate to the project from the Toolchain list. A toolchain is the set of tools (such as compiler, linker, and assembler) that will be used to build the project. Additional tools, such as a debugger, may be associated with a toolchain. Different toolchains may be available, depending on the different compilers installed on the system. To compile an application specifically for the STM32 MCUs, select Ac6 STM32 MCU GCC and then click Next. This opens the Select configurations. There is nothing to change here, in the Select Configurations window, click Next. This opens the MCU configuration. In the MCU Configuration window, select the board to use. More details about MCUs are available here: (STM32 32-bit ARM Cortex MCUs). To help the choice:
For the tutorial, choose the NUCLEO-F446RE and click Next. In the Project Firmware configuration window, click Finish. More details about Project Firmware configuration are available corresponding chapter (Firmwares). This creates the project:
At this point, the project is ready but there is nothing to compile. So a main.c must be added under the src folder. Select the src folder, click-right and select the menu New > File, name it main.c and click Finish. The file is opened directly by SystemWorkbench.
Copy this piece of code:
int main(void)
{
for(;;){}
}
Save, and build the project by selecting the project in the Project Explorer view, click-right and select the menu Build Project. This actions generates the binary file:
For more information about C/C++ development tools in Eclipse, please see C/C++ Development User Guide.