0% found this document useful (0 votes)
25 views17 pages

MicroSTM32F4 - Software User Manual

The MicroSTM32F4 Software User Manual provides detailed instructions for setting up and using the MicroSTM32F4 development board, including system requirements and software installation steps for STM32CubeIDE. It covers project creation, configuration, and debugging processes within the IDE, along with guidance on using the firmware library for program development. The manual is designed to assist users in effectively programming and debugging applications on the STM32F407 microcontroller.

Uploaded by

siddhesh955sable
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views17 pages

MicroSTM32F4 - Software User Manual

The MicroSTM32F4 Software User Manual provides detailed instructions for setting up and using the MicroSTM32F4 development board, including system requirements and software installation steps for STM32CubeIDE. It covers project creation, configuration, and debugging processes within the IDE, along with guidance on using the firmware library for program development. The manual is designed to assist users in effectively programming and debugging applications on the STM32F407 microcontroller.

Uploaded by

siddhesh955sable
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

MicroSTM32F4 Software User Manual

MicroSTM32F4
ARM Cortex-M4

Development Board
Software User Manual

www.microembedded.in

MicroEmbedded Technologies. ©2022 Page 1


MicroSTM32F4 Software User Manual

1. System Requirements. ...................................................................................... 3

2. Softwares to be Installed. ................................................................................ 3


2.1. Installing the STM32CubeIDE: ....................................................................................................... 3
2.2. Installing the Firmware Library Package in STM32CubeIDE. ............................................ 5

3. Using the STM32CubeIDE. ............................................................................... 7


3.1. Creating/Choosing a Workspace. ................................................................................................. 7
3.2. Creating a New Project. ..................................................................................................................... 7
3.3. Setting the Clock Configuration. ................................................................................................. 11
3.4. Pinout & Configuration. .................................................................................................................. 12
3.5. Importing an existing project in to the workspace. ............................................................ 15
3.6. Building / Compiling the project. ............................................................................................... 16
3.7. Downloading into the Microcontroller. ................................................................................... 16
3.8. Debug the code. ................................................................................................................................. 17

MicroEmbedded Technologies. ©2022 Page 2


MicroSTM32F4 Software User Manual

1. System Requirements.
 Windows 7 and Above (preferably Windows 10) (64bit executable).
 Min 4 GB RAM.
 10 GB space on Hard Drive.

2. Softwares to be Installed.
In the DVD provided by MicroEmbedded all software needed for the development of
programs for the MicroSTM32F407 board are provided in the Softwares folder.

2.1. Installing the STM32CubeIDE:


SM32CubeIDE is the preferred IDE for developing programs for the STM32 based
microcontrollers. The IDE is available freely from st.com which is the official website of ST
Microelectronics.

To Install STM32CubeIDE  go to the Softwares folder and Extract the


en.st-stm32cubeide_1.6.0_9614_20210223_1703_x86_64.exe.zip file.
The file will get extracted to st-stm32cubeide_1.6.0_9614_20210223_1703_x86_64.exe.
RIGHT click on this extracted file and click on Run as administrator.

Click on Next.

Accept the License Agreement by clicking I Agree

MicroEmbedded Technologies. ©2022 Page 3


MicroSTM32F4 Software User Manual

Choose the install Location and click Next.

In the Choose Component dialog box select the SEGGER J-Link Drivers and ST-Link Drivers
and Click on Install.

The selected drivers and STM32CubeIDE will get installed.

Click Next and Finish the installation.

MicroEmbedded Technologies. ©2022 Page 4


MicroSTM32F4 Software User Manual

2.2. Installing the Firmware Library Package in STM32CubeIDE.


Open the STM32CubeIDE.

Go to Help and click on Manage Embedded Software Packages.

In the STM32Cube MCU Packages section scroll and search STM32F4


Click on STM32Cube MCU Package for STM32F4 series 1.26.0

MicroEmbedded Technologies. ©2022 Page 5


MicroSTM32F4 Software User Manual

Now Click on From Local

Now browse and select the stm32cube_fw_f4_v1260.zip file located in the


MicroSTM4 Softwares folder and click Open.

This will install the firmware library in the IDE. Be patient and wait for the process to
finish.

After the library is installed click on Close.

With the installation of the firmware library (version 1.26.0) the setup for STM32F407
program development is complete.
The project created can use this library for quick and easy program development with
Hardware Abstraction Layer (HAL). The Drivers for all the peripherals are available for
the user to use in the program.

Note: Installing the STM32CubeIDE and managing the firmware library is to be done only
one time.

MicroEmbedded Technologies. ©2022 Page 6


MicroSTM32F4 Software User Manual

3. Using the STM32CubeIDE.

3.1. Creating/Choosing a Workspace.


When you open the STM32CubeIDE for the first time, you will be directed to create a
workspace for your projects. You can choose the default location for the project provided
by the IDE (which will generally be located in the users folder in C: drive) or you can assign
a different folder for the workspace. All your projects will be stored and referenced from
this workspace folder. STM32CubeIDE is a eclipse based IDE and so you can have multiple
projects in your projects window. Only one project can be active at one time. The Active
project will get compiled or debugged or downloaded when you use the shortcut keys for
the Compile, Debug or RUN actions.

3.2. Creating a New Project.


Open the STM32CubeIDE (preferably Run as administrator)

Step 1: To create a new project click on FileNewSTM32 Project.

Step 2: Select the MCU part number.

MicroEmbedded Technologies. ©2022 Page 7


MicroSTM32F4 Software User Manual

In the Target Selection window, enter the part number STM32F407VG (this part is
populated on the board), in the Part Number window.
MCU/MPU Selector  Part Number.
Now select the part (click near the star ) and click Next.

Step 3:

In the Project Name window, give a unique name to the project. (you cannot have two
projects with the same name ). Click Next.

Step 4:

Make sure that the Firmware Package Name and Version is V1.26.0.
Click Finish to complete the process of creating the new project.

MicroEmbedded Technologies. ©2022 Page 8


MicroSTM32F4 Software User Manual

After the process is complete the project Template will get created.

The Project Structure is as follows:


All the source code (.c) and header (.h) files for the HAL (library function for peripherals)
are located in
C files :Project_name DriversSTM32F4xx_HAL_DriverSrc
.h files :Project_name DriversSTM32F4xx_HAL_DriverInc

All the source code (.c) and header (.h) files for the user program are located in
C files :Project_name CoreSrc
.h files :Project_name CoreInc

The user can write the program in main.c file.

MicroEmbedded Technologies. ©2022 Page 9


MicroSTM32F4 Software User Manual

The code for clock initialization and HAL initialization are already done and available in
main.c file.

MicroEmbedded Technologies. ©2022 Page 10


MicroSTM32F4 Software User Manual

3.3. Setting the Clock Configuration.

Users can use the default clock settings for 16Mhz if they do not wish to make changes.
Here we are using the (HSI) internal High Frequency RC clock to generate the clock signals
for all the peripherals like AHB bus, APB bus etc.

MicroEmbedded Technologies. ©2022 Page 11


MicroSTM32F4 Software User Manual

If the user wants the maximum clock frequency of 168 MHz, the PLL should be set as
follows;

In the PLL section make N = 336


In System Clock Mux select PLLCLK
In APB1 Prescalar use /4
In APB2 Prescalar use /2

This will set all the clocks to the core and peripherals for maximum allowed frequency.

3.4. Pinout & Configuration.

MicroEmbedded Technologies. ©2022 Page 12


MicroSTM32F4 Software User Manual

We can use the GUI tool in the IDE to set the pin configuration.

Select the pin (let’s take pin PC0 which is connected to LED1).
Locate the pin on the MCU pin map. Left Click on the pin PC0.

Select the GPIO_Output option.

To label the selected pin now Right Click on the pin

Select Enter User Label option and give the name of your choice in the window

Now when you press enter, the pin name will be set to LED1. This name will be used by the
library and automatic code generation tool throughout the code.

MicroEmbedded Technologies. ©2022 Page 13


MicroSTM32F4 Software User Manual

You can also set the pin parameters from the tool.
Expand the System Core and select GPIO. The selected GPIO will be shown and below you
can set the parameters for the selected Pin.

The same procedure applies to multiple pins and peripherals. To set the parameters for the
peripherals, set the pins, select the peripherals from the Pinout &Configuration settings
block and make appropriate changes.

After you have set the parameters, save the project. You will be prompted to generate code.
When you click yes, the IDE will generate the initialization code and template in the main.c
file.

Alternatively you can also click on the Device Configuration Tool Code Generation to
generate the code. Or go to Project Generate Code.

MicroEmbedded Technologies. ©2022 Page 14


MicroSTM32F4 Software User Manual

3.5. Importing an existing project in to the workspace.


When you want to import an existing project in to the workspace, click on File  Import.

Select – Existing Projects into Workspace. Click Next.

MicroEmbedded Technologies. ©2022 Page 15


MicroSTM32F4 Software User Manual

In select root directory, browse to the folder which contains the project to be imported.
Also make sure that the Copy projects into workspace field is selected in the options menu.
Click Finish.
The project will be imported into the workspace.

3.6. Building / Compiling the project.


After writing the code in the main.c file compile the project by Right clicking on the project
name and click Build Project.

Also you can select the project name. click on Project Build Project.

Else you can select the project and click on icon to build the project.

After successful build the bin file and elf file will be created. This file can be flashed into the
microcontroller using the ST emulator.

3.7. Downloading into the Microcontroller.


To download the hex file into the microcontroller connect the Emulator to PC using the USB
cable and the FRC cable to connector CN22 (JTAG Header).
Power on the board.
Make sure that Boot0 and Boot1 switches are towards GND (2-3).
And switch SW13 is towards 2-3.

Now select the project, right click and select Run As STM32 cortex m C/C++
Application

Also you can select the project RunRun.

Else click on icon to download the file.

Press RESET switch SW38 and observe the output.

MicroEmbedded Technologies. ©2022 Page 16


MicroSTM32F4 Software User Manual

3.8. Debug the code.


To debug the code; select the project Right click Debug As STM32 Cortex-M C/C++
Application.

Also select the project Run Debug.

Or select the project click on debug icon.

The hex fie will get loaded and the program will halt at main function. The IDE will enter
the debug perspective and you can use the step into to step out to debug the code line by
line.

MicroEmbedded Technologies. ©2022 Page 17

You might also like