MicroSTM32F4 - Software User Manual
MicroSTM32F4 - Software User Manual
MicroSTM32F4
ARM Cortex-M4
Development Board
Software User Manual
www.microembedded.in
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.
Click on Next.
In the Choose Component dialog box select the SEGGER J-Link Drivers and ST-Link Drivers
and Click on Install.
This will install the firmware library in the IDE. Be patient and wait for the process to
finish.
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.
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.
After the process is complete the project Template will get created.
All the source code (.c) and header (.h) files for the user program are located in
C files :Project_name CoreSrc
.h files :Project_name CoreInc
The code for clock initialization and HAL initialization are already done and available in
main.c file.
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.
If the user wants the maximum clock frequency of 168 MHz, the PLL should be set as
follows;
This will set all the clocks to the core and peripherals for maximum allowed frequency.
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 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.
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.
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.
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.
Now select the project, right click and select Run As STM32 cortex m C/C++
Application
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.