STM32F3DISCOVERY Get Started Manual Datasheet by STMicroelectronics

View All Related Products | Download PDF Datasheet
September 2012 Doc ID 023558 Rev 1 1/48
UM1562
User manual
Getting started with software and firmware environments for the
STM32F3DISCOVERY Kit
Introduction
This document describes the software, firmware environment and development
recommendations required to build an application around the STM32F3DISCOVERY board.
It presents the firmware applications package provided within this board with details on its
architecture and contents. It provides guidelines to novice users on how to build and run a
sample application and allows them to create and build their own application.
This document is structured as follows:
System requirements to use this board and how to run the built-in demonstration are
provided in Section 1: Getting started.
Section 2 describes the firmware application package.
Section 4 presents development toolchain installation and overview of ST-LINK/V2
interface.
Section 5, Section 6, Section 7, and Section 8 introduce how to use the following
software development toolchains:
IAR Embedded Workbench® for ARM (EWARM) by IAR Systems
Microcontroller Development Kit for ARM (MDK-ARM) by Keil™
TASKING VX-toolset for ARM Cortex by Altium
TrueSTUDIO® by Atollic
Although this user manual cannot cover all the topics relevant to software development
environments, it demonstrates the first basic steps necessary to get started with the
compilers/debuggers.
Reference documents
STM32F3DISCOVERY high-performance discovery board data brief
STM32F3DISCOVERY peripheral firmware examples (AN4062)
STM32F30x reference manual (RM0313)
STM32F30xx datasheet
The above documents are available at www.st.com/stm32f3-discovery.
Table 1. Applicable tools
Type Part number
Evaluation tools STM32F3DISCOVERY
www.st.com
Contents UM1562
2/48 Doc ID 023558 Rev 1
Contents
1 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1 System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Running the built-in demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 Description of the firmware package . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1 Libraries folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.1 CMSIS subfolder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.2 STM32F30x_StdPeriph_Driver subfolder . . . . . . . . . . . . . . . . . . . . . . . 10
2.1.3 STM32_USB-FS-Device_Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2 Project folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.1 Demonstration subfolder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.2 Master_Workspace subfolder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.3 Peripheral_Examples subfolder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 Utilities folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3 Binary images for reprogramming firmware applications . . . . . . . . . 12
4 ST-LINK/V2 installation and development . . . . . . . . . . . . . . . . . . . . . . . 13
5 Using IAR Embedded Workbench® for ARM . . . . . . . . . . . . . . . . . . . . 14
5.1 Building an existing EWARM project . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.2 Debugging and running your EWARM project . . . . . . . . . . . . . . . . . . . . . 15
5.3 Creating your first application using the EWARM toolchain . . . . . . . . . . . 17
5.3.1 Managing source files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.3.2 Configuring project options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
6 Using MDK-ARM Microcontroller Development Kit by Keil™ . . . . . . . 23
6.1 Building an existing MDK-ARM project . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.2 Debugging and running your MDK-ARM project . . . . . . . . . . . . . . . . . . . 24
6.3 Creating your first application using the MDK-ARM toolchain . . . . . . . . . 26
6.3.1 Managing source files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
6.3.2 Configuring project options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7 Using TASKING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
UM1562 Contents
Doc ID 023558 Rev 1 3/48
7.1 Building an existing TASKING project . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7.2 Debugging and running your TASKING project . . . . . . . . . . . . . . . . . . . . 34
7.3 Creating your first application using TASKING toolchain . . . . . . . . . . . . . 35
8 Using Atollic TrueSTUDIO® . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
8.1 Building an existing TrueSTUDIO project . . . . . . . . . . . . . . . . . . . . . . . . . 39
8.2 Debugging and running your TrueSTUDIO project . . . . . . . . . . . . . . . . . . 42
8.3 Creating your first application using TrueSTUDIO toolchain . . . . . . . . . . 43
9 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
List of tables UM1562
4/48 Doc ID 023558 Rev 1
List of tables
Table 1. Applicable tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Table 2. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
UM1562 List of figures
Doc ID 023558 Rev 1 5/48
List of figures
Figure 1. Hardware environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Figure 2. Firmware applications subfolders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 3. IAR Embedded Workbench IDE (Integrated Design Environment) . . . . . . . . . . . . . . . . . . 14
Figure 4. EWARM project successfully compiled. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Figure 5. Download and Debug button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Figure 6. IAR Embedded Workbench debugger screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Figure 7. Go button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Figure 8. Create New Project dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 9. IDE interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 10. IAR main.c example file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 11. Adding files to a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 12. New project file tree structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 13. Configuring project options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 14. General options > Target tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 15. Linker > Config tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Figure 16. Linker configuration file editor dialog box > Vector Table tab . . . . . . . . . . . . . . . . . . . . . . . 20
Figure 17. Linker configuration file editor dialog box > Memory Regions tab . . . . . . . . . . . . . . . . . . . 20
Figure 18. C/C++ Compiler > Preprocessor tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 19. Debugger > Setup tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 20. Select Flash loaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 21. ST-Link communication protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Figure 22. MDK-ARM µVision4 IDE environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Figure 23. Build Output - MDK-ARM µVision4 project successfully compiled . . . . . . . . . . . . . . . . . . . 24
Figure 24. Starting an MDK-ARM µVision4 debugging session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Figure 25. MDK-ARM IDE workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Figure 26. Creating a new project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Figure 27. Device selection dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Figure 28. Copy the STM32 Startup Code dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Figure 29. MDK-ARM main.c example file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 30. Adding source files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 31. New project file tree structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 32. Target Options dialog box - Target tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Figure 33. Target Options dialog box - Debug tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Figure 34. Target Options dialog box - Utilities tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Figure 35. MDK-ARM µVision4 project successfully built . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 36. TASKING workspace launcher dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Figure 37. TASKING VX-Toolset for ARM Cortex welcome screen. . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Figure 38. TASKING import source select dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 39. TASKING import projects dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 40. TASKING project successfully compiled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 41. TASKING debug window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Figure 42. TASKING Workspace Launcher dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Figure 43. TASKING New C/C++ Project dialog box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Figure 44. Processor selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Figure 45. Debug configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Figure 46. TASKING Import dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Figure 47. Adding a new source file window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Figure 48. Tasking project successfully built . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
List of figures UM1562
6/48 Doc ID 023558 Rev 1
Figure 49. TrueSTUDIO workspace launcher dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Figure 50. Atollic TrueSTUDIO®/STM32 Lite welcome screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Figure 51. Atollic TrueSTUDIO®/STM32 Lite import source select dialog box . . . . . . . . . . . . . . . . . . 40
Figure 52. Atollic TrueSTUDIO®/STM32 Lite import projects dialog box . . . . . . . . . . . . . . . . . . . . . . 41
Figure 53. TrueSTUDIO® project successfully compiled. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Figure 54. TrueSTUDIO Debug Configuration dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Figure 55. TrueSTUDIO Debug window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Figure 56. TrueSTUDIO workspace launcher dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Figure 57. TrueSTUDIO® C Project dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Figure 58. TrueSTUDIO® Build Settings dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Figure 59. TrueSTUDIO® Misc Settings dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Figure 60. TrueSTUDIO® project successfully built . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
UM1562 Getting started
Doc ID 023558 Rev 1 7/48
1 Getting started
1.1 System requirements
Before running your application, you should establish the connection with the
STM32F3DISCOVERY board as follows.
Figure 1. Hardware environment
To run and develop any firmware applications on your STM32F3DISCOVERY board, the
minimum requirements are as follows:
Windows PC (2000, XP, Vista, 7)
'USB type A to Mini-B' cable, used to power the board (through USB connector CN1)
from host PC and connect to the embedded ST-LINK/V2 for debugging and
programming.
'USB type A to Mini-B' cable, used to power the board (through USB connector CN2)
from host PC and connect USB to host PC.
Getting started UM1562
8/48 Doc ID 023558 Rev 1
1.2 Running the built-in demonstration
The board comes with the demonstration firmware preloaded in the Flash memory. Follow
the steps below to run it:
Check jumper position on the board, JP4 on, CN4 on (Discovery selected).
Connect the STM32F3-DISCOVERY board to a PC with a 'USB type A to Mini-B' cable
through USB connector CN2 or CN1 to power the board. Then red LED LD1 (PWR)
and LD2 (COM) light up.
All 8 LEDs between B1 and B2 are blinking in a chase sequence.
Press User Button B1 (Botton left corner of the board) then gyroscope MEMS sensor is
enabled, move the board and observe the four LEDs blinking according to the motion
direction.
Press User Button B1 (Botton left corner of the board) then Compass MEMS sensor is
enabled, move the board horizontaly and observe the north direction. If you take the
board and lean it then all LEDs are blinking.
fi _htmvesc L3 E Libraries E E CMSIS E E STM32_USB-FS-Devi:e_DrIver E E STM32F3le_SthevIph_Drlver E inc a src a E Project E E Demonstration m a Mastev_Workspace E PeripheraLExamples a E Utilities E STM32F3_Discovevy
UM1562 Description of the firmware package
Doc ID 023558 Rev 1 9/48
2 Description of the firmware package
The STM32F3DISCOVERY firmware applications are provided in one single package and
supplied in one single zip file. The extraction of the zip file generates one folder,
STM32F3-Discovery_FW_VX.Y.Z, which contains the following subfolders:
Figure 2. Firmware applications subfolders
1. VX.Y.Z refer to the package version, ex. V1.0.0
2.1 Libraries folder
This folder contains the Hardware Abstraction Layer (HAL) for STM32F30x devices.
2.1.1 CMSIS subfolder
This subfolder contains the STM32F30x and Cortex-M4 CMSIS files.
Cortex-M4 CMSIS files consist of:
Core Peripheral Access Layer: contains name definitions, address definitions and
helper functions to access Cortex-M4F core registers and peripherals. It defines also a
device independent interface for RTOS Kernels that includes debug channel definitions.
CMSIS DSP Software Library: features a suite of common signal processing functions
for use on Cortex-M processor based devices. The library is completely written in C
and is fully CMSIS compliant. High performance is achieved through maximum use of
Cortex-M4F intrinsics.
STM32F30x CMSIS files consist of:
stm32f30x.h: contains the definitions of all peripheral registers, bits, and memory
mapping for STM32F30x devices. The file is the unique include file used in the
application programmer C source code, usually in main.c.
system_stm32f30x.c/.h: contains the system clock configuration for STM32F30x
devices. It exports SystemInit() function which sets up the system clock source,
Description of the firmware package UM1562
10/48 Doc ID 023558 Rev 1
PLL multiplier and divider factors, AHB/APBx prescalers and Flash settings. This
function is called at startup just after reset and before connecting to the main program.
The call is made inside the startup_stm32f30x.s file.
startup_stm32f30x.s: provides the Cortex-M4 startup code and interrupt vectors for all
STM32F30x device interrupt handlers.
2.1.2 STM32F30x_StdPeriph_Driver subfolder
This subfolder contains sources of STM32F30x peripheral drivers.
Each driver consists of a set of routines and data structures covering all peripheral
functionalities. The development of each driver is driven by a common API (application
programming interface) which standardizes the driver structure, the functions and the
parameter names.
Each peripheral has a source code file, stm32f30x_ppp.c, and a header file,
stm32f30x_ppp.h. The stm32f30xx_ppp.c file contains all the firmware functions required to
use the PPP peripheral.
2.1.3 STM32_USB-FS-Device_Driver
This subfolder contains USB Full Speed Library Core and the class drivers. The Core folder
contains the USB library machines as defined by the revision 2.0 Universal Serial Bus
Specification.
The Class folder contains all the files relative to the Host class implementation. It is
compliant with the specification of the protocol built in these classes.
2.2 Project folder
This folder contains the source files of the STM32F3DISCOVERY firmware applications.
2.2.1 Demonstration subfolder
This subfolder contains the demonstration source files with preconfigured project for
EWARM, MDK-ARM, TASKING and TrueSTUDIO toolchains.
A binary image (*.hex) of this demonstration is provided under Binary subfolder. You can use
any in-system programming tool to reprogram the demonstration using this binary image.
2.2.2 Master_Workspace subfolder
This subfolder contains, for some toolchains, a multi-project workspace allowing you to
manage all the available projects (provided under the subfolders listed below) from a single
workspace window.
2.2.3 Peripheral_Examples subfolder
This subfolder contains a set of examples for some peripherals with preconfigured projects
for EWARM, MDK-ARM, TASKING and TrueSTUDIO toolchains. See Section 4 and
STM32F3DISCOVERY peripheral firmware examples, AN4062, for further details.
UM1562 Description of the firmware package
Doc ID 023558 Rev 1 11/48
2.3 Utilities folder
This folder contains the abstraction layer for the STM32F3DISCOVERY hardware. It
provides the following drivers:
stm32f3_discovery.c: provides functions to manage the user push-button and 8 LEDs
(from LD3 to LD10).
stm32f3_discovery_lsm303dlhc.c/.h: provides functions to manage the MEMS
(LSM303DLHC).
stm32f3_discovery_l3gd20.c/.h: provides functions to manage the MEMS (L3GD20).
Binary images for reprogramming firmware applications UM1562
12/48 Doc ID 023558 Rev 1
3 Binary images for reprogramming firmware
applications
This section describes how to use the provided binary images to reprogram the firmware
applications. The STM32F3DISCOVERY firmware package contains binary images (*.hex)
of the provided applications under Binary subfolder. You can use any in-system
programming tool to reprogram the demonstration using this binary image.
To reprogram the firmware applications, use the “in-system programming tool” and:
1. Connect the STM32F3DISCOVERY board to a PC with a 'USB type A to Mini-B' cable
through USB connector CN1 to power the board.
2. Make sure that the embedded ST-LINK/V2 is configured for in-system programming
(both CN4 jumpers ON).
3. Use *.hex binary (for example,
\Project\Demonstration\Binary\STM32F3-Discovery_Demonstration_V1.0.0.hex) with
your preferred in-system programming tool to reprogram the demonstration firmware
(ex. STM32 ST-LINK Utility, available for download from www.st.com).
UM1562 ST-LINK/V2 installation and development
Doc ID 023558 Rev 1 13/48
4 ST-LINK/V2 installation and development
STM32F3DISCOVERY board includes an ST-LINK/V2 embedded debug tool interface that
is supported by the following software toolchains:
IAR™ Embedded Workbench for ARM (EWARM) available from www.iar.com
The toolchain is installed by default in the C:\Program Files\IAR Systems\Embedded
Workbench 6.30 directory on the PC’s local hard disk.
After installing EWARM, install the ST-LINK/V2 driver by running the
ST-Link_V2_USB.exe from [IAR_INSTALL_DIRECTORY]\Embedded Workbench
6.30\arm\drivers\ST-Link \ST-Link_V2_USBdriver.exe
RealView Microcontroller Development Kit (MDK-ARM) toolchain available from
www.keil.com
The toolchain is installed by default in the C:\Keil directory on the PC’s local hard disk;
the installer creates a start menu µVision4 shortcut.
When connecting the ST-LINK/V2 tool, the PC detects new hardware and asks to install
the ST-LINK_V2_USB driver. The “Found New Hardware wizard” appears and guides
you through the steps needed to install the driver from the recommended location.
Altium™ TASKING VX-toolset for ARM® Cortex-M available from www.tasking.com
The toolchain is installed by default in the “C:\Program Files\TASKING directory on the
PC’s local hard disk. The ST-Link_V2_USB.exe is installed automatically when
installing the software toolchain.
Atollic TrueSTUDIO® STM32 available from www.atollic.com
The toolchain is installed by default in the C:\Program Files\Atollic directory on the PC’s
local hard disk.
The ST-Link_V2_USB.exe is installed automatically when installing the software
toolchain.
Note: The embedded ST-LINK/V2 supports only SWD interface for STM32 devices.
Refer to the firmware package release notes for the version of the supporting development
toolchains.
run v5.1a, )1 um Embedded Wurkhenrh \m HCVX Fl: a: View an)»: des thnw Heb jnsufidé‘am a and W-fln—e Wind" llIfll Wind-w \ Messages
Using IAR Embedded Workbench® for ARM UM1562
14/48 Doc ID 023558 Rev 1
5 Using IAR Embedded Workbench® for ARM
5.1 Building an existing EWARM project
The following is the procedure for building an existing EWARM project.
1. Open the IAR Embedded Workbench® for ARM (EWARM).
Figure 3 shows the basic names of the windows referred to in this document.
Figure 3. IAR Embedded Workbench IDE (Integrated Design Environment)
2. In the File menu, select Open and click Workspace to display the Open Workspace
dialog box. Browse to select the demonstration workspace file and click Open to launch
it in the Project window.
3. In the Project menu, select Rebuild All to compile your project.
Messages Errors nune Warnings nuns Lmktvme u as (CPU) 0 us (a‘apsad) Tom numbevmenms u Tow numbev ofiwamlngs U
UM1562 Using IAR Embedded Workbench® for ARM
Doc ID 023558 Rev 1 15/48
4. If your project is successfully compiled, the following window in Figure 4 is displayed.
Figure 4. EWARM project successfully compiled
5.2 Debugging and running your EWARM project
In the IAR Embedded Workbench IDE, from the Project menu, select Download and
Debug or, alternatively, click the Download and Debug button in the toolbar, to program the
Flash memory and begin debugging.
Figure 5. Download and Debug button
The debugger in the IAR Embedded Workbench can be used to debug source code at C
and assembly levels, set breakpoints, monitor individual variables and watch events during
the code execution.
l‘ Dem: um Embed-ltd wmgm In: F Diflfié A Efl I; I EDA/£29212} m.‘ EflDzmn'De « m m imam mu; Dasmv sum runs mm m: n ~IV¥ Eififi3fiiwbfié§9 m . mm mm ”Max. . mm. Nana mmnamm Msxmxzn nsrw umnzxmmnsm. flqrflnh‘slmam my hmmamz‘wzmaszw‘v Manama“ nmm , , w Z : WWW, .f‘ t , “ Hiiswaau . n W W asmm 5: i * 1 Ewan mfimmm mum, mm \ La game v “m m a, W m m a H1 i smmu “gunmummmgmm: b—aiusay Synxcxrcmwrflcrnums “Mum-um / mm? x H3 a m m \ Ha an“ /, 1mm,” mu m U551 1mm mm. m mmrmmm mm 3/ x a «m STAMJWWW ‘ t3 Wm 51““,me ‘ Hi am .1! SEJWWWW \ a “Sign STIJVALLEanuLEDsJ ‘ 3 “Dim mpwmmm. ‘ 3 “am mpwmmm \ La mum m’mmnxixilméy, Lm i saw 7 7 mmrmmwurm, murmrm, lu_ p mm m m V "m m a g w my Wad ma, am ‘2 27 n: Lnadad dehqua mpwnznmwsmazugaj“Mm/mwwwzmmummm"\zwmmoemmmmmaam Wed ma, zmz 12 27 n1 Smare vaaelws: pemvmed WedJA/HKEH‘ZVZNHJ rarqeueset mum mm mm, mam M, can Ci ti
Using IAR Embedded Workbench® for ARM UM1562
16/48 Doc ID 023558 Rev 1
Figure 6. IAR Embedded Workbench debugger screen
To run your application, from the Debug menu, select Go. Alternatively, click the Go button
in the toolbar to run your application.
Figure 7. Go button
mm NemejerI team ARM Prom mumx Emwnwiea a m IE E.. II: c DUE ExlanaHy mu axe-unable Descv’uwm Dull: m mow muse: Massages Cunnguvunun \s up-m-dme
UM1562 Using IAR Embedded Workbench® for ARM
Doc ID 023558 Rev 1 17/48
5.3 Creating your first application using the EWARM toolchain
5.3.1 Managing source files
Follow these steps to manage source files.
1. In the Project menu, select Create New Project and click OK to save your settings.
Figure 8. Create New Project dialog box
2. Name the project (for example, NewProject.ewp) and click Save to display the IDE
interface.
Figure 9. IDE interface
To create a new source file, in the File menu, open New and select File to open an empty
editor window where you can enter your source code.
m maxntvnld) < let-hi="" [="" d="" )="" j="">| < \="" ’4:="" iar="" embedded="" workbenrh="" idf="" fhe="" edk="" view="" mleu="" smlaw="" yen‘s="" wlndaw="" heb="" dias="" 1="" int="" mam="" (ma)="" 4="" mun-(n)="" oulnns‘="" .‘="" mm=""> Rebulfl AH dean — mm- “9”" Add Gmuv‘ 7 '— V "W9" SW; mam. ' IMO ‘ ‘ » Add me 5| Fde vaemesm
Using IAR Embedded Workbench® for ARM UM1562
18/48 Doc ID 023558 Rev 1
The IAR Embedded Workbench enables C color syntax highlighting when you save your file
using the dialog File > Save As… under a filename with the *.c extension. In Figure 10: IAR
main.c example file, the file is saved as main.c.
Figure 10. IAR main.c example file
Once you have created your source file, you can add this file to your project by opening the
Project menu, selecting Add and adding the selected file as in Figure 11.
Figure 11. Adding files to a project
If the file is added successfully, Figure 12 is displayed.
Figure 12. New project file tree structure
Maka : ‘ u nebula nu dean Ophuns (on nude "Damn“ clc++ cmuev assemble! mpm (nmevtu Cnstnm Emld mm ans um 0mm” mum Angel ma sum m ROM-murmur J-unkIJ-rvxs 11 Ellen; Macvaqm v: mm m1 mam 5mm Ihwd-Pavty Dwev n xrysmo chessm variant 0 Cove m , Guam ST smazrauaxc Ends" mode FPLI (a We mm 0 my E Tags! mum Lmv-ytmnguannn mavyflmmm} mam-Emu <> NW: and Anathzwtes Atmd cums inugymm Epsm Faraday Fveescate mm Hflsmev Hunk xnfmun mm mm anas Natflhmn Nuvntnn W on oNsemconduam samsuno Suck Yaxasxnmmmts > rust-ha v swim srmzwsu sTszlun svmznm smsznm svmznm smazms srmznm smzzms 5043sz smazms smazszn srmzms srmzrm srmzms srmznn smazusx smazusz smszuaz smzwma 5mm smau smsn 5mm
UM1562 Using IAR Embedded Workbench® for ARM
Doc ID 023558 Rev 1 19/48
5.3.2 Configuring project options
Follow these steps to configure project options.
1. In the Project Editor, right-click on the project name and select Options... to display the
Options dialog box as in Figure 13.
Figure 13. Configuring project options
2. In the Options dialog box, select the General Options category, open the Target tab
and select Device - ST -STM32F303.
Figure 14. General options > Target tab
Assemb‘ev Ouwulcumenev -wavaw Imun Umpm L»: Meme Damask»: Cusmm Eufld Md Linker canhgmalmn Ms D [Name delau‘l D: was S‘mu‘atnl ‘ H J ‘ 1‘ ‘ J ‘ " Linker configurauon file “may eckw Yab‘e W m mm slat flxflfiflwflflu 1mm wu‘lgumllmx hlr Nlrlm m1»; Mumrvkeams smumosw s-v am
Using IAR Embedded Workbench® for ARM UM1562
20/48 Doc ID 023558 Rev 1
3. Select the Linker category and open the Config tab; in the Linker configuration file
pane, select Override default and click Edit to display the Linker configuration file
editor.
Figure 15. Linker > Config tab
4. In the Linker configuration file editor dialog box, open the Vector Table tab and set
the .intvec.start variable to 0x08000000.
Figure 16. Linker configuration file editor dialog box > Vector Table tab
5. Open the Memory Regions tab, and enter the variables as shown in Figure 17.
Figure 17. Linker configuration file editor dialog box > Memory Regions tab
6. Click Save to save the linker settings automatically in the Project directory.
u ,"L‘ m,‘ ssamMav Outvutcmvevlav ‘Languagercwe ‘Dwmlzalmsrflulvut‘ stl in 4 I custam sum M, km“ D \nge star-1am Include anemones gummy mmwn mm Debuggev Addmnnal with: immune: [m pal my mum Ange‘ spa Sevvev m nommommv Assemb‘ev ,— Output Cmyeyka SEND annlned Images Exits Elphnm‘ P‘ugmx Cuswm Bu‘d BLIM Athens Dnvev film he W" v man 5‘,“th Se|up macros Ange‘ El Use macm Nels] aw Sewer Output Canvartgy \ sew \ Down‘m Wages Exha Dvhunx‘ Hum (ustnm Budd Mach m , yam mu mans D F N \j Venry duwn‘nad El Supuvesx duwn‘nad Anal :3 Hath m a! GDB Sevvev D Dvemde deramx board He
UM1562 Using IAR Embedded Workbench® for ARM
Doc ID 023558 Rev 1 21/48
7. If your source files include header files, select the C/C++ Compiler category, open the
Preprocessor tab, and specify their paths as shown in Figure 18. The path of the
include directory is a relative path, and always starts with the project directory location
referenced by $PROJ_DIR$.
Figure 18. C/C++ Compiler > Preprocessor tab
8. To set up the ST-Link embedded debug tool interface, select the Debugger category,
open the Setup tab and, from the drop-down Driver menu, select ST-Link as shown in
Figure 19.
Figure 19. Debugger > Setup tab
9. Open the Debugger tab and select Use flash loader(s) as shown in Figure 20.
Figure 20. Select Flash loaders
Assembler Output Converter Custom Bwld Buwld Amuns unkev Debugger Swmubtnv Angel GDB Sewev m Rommmm J-lwnli-Tvsai LMI FTDI Manama! nk lmevlace OJTAIS ®
Using IAR Embedded Workbench® for ARM UM1562
22/48 Doc ID 023558 Rev 1
10. Select the ST-Link category, open the ST-Link tab and select SWD as the connection
protocol as shown in Figure 21.
Figure 21. ST-Link communication protocol
11. Click OK to save the project settings.
12. To build your project, follow the instructions given in Section 5.1: Building an existing
EWARM project.
13. Before running your application, establish the connection with the
STM32F3DISCOVERY board as described in Section 1: Getting started.
14. To program the Flash memory and begin debugging, follow the instructions given in
Section 5.2: Debugging and running your EWARM project.
rues Wlndow 0— Frnject Window 0— E“ IN uni :m mm mm ram mbug vegan.“ Ind: 2‘45 wndaw m :Fm n was
UM1562 Using MDK-ARM Microcontroller Development Kit by Keil™
Doc ID 023558 Rev 1 23/48
6 Using MDK-ARM Microcontroller Development Kit by
Keil™
6.1 Building an existing MDK-ARM project
Follow these steps to build an existing MDK-ARM project.
1. Open the MDK-ARM µVision4 IDE, debugger, and simulation environment.
Figure 22 shows the basic names of the windows referred to in this section.
Figure 22. MDK-ARM µVision4 IDE environment
2. In the Project menu, select Open Project... to display the Select Project File dialog
box. Browse to select the STM32F3-Discovery.uvproj project file and click Open to
launch it in the Project window.
3. In the Project menu, select Rebuild all target files to compile your project.
$23232: ZEZEEEEEEZZY T. $223232: $323532: E. . EEESEZZZ::§§§ a???“ 32222:: 23:32:33; :. - m , , 5‘33;mfg,ffffgfifffi’ffifgéifDiil‘iiiiiigifi‘ii‘l'{Tum m, a "mum Q Start/Slap mung 525mm (Elrlfis) I may a! have a debug sassmn
Using MDK-ARM Microcontroller Development Kit by Keil™ UM1562
24/48 Doc ID 023558 Rev 1
4. If your project is successfully compiled, the following Build Output window (Figure 23)
is displayed.
Figure 23. Build Output - MDK-ARM µVision4 project successfully compiled
6.2 Debugging and running your MDK-ARM project
In the MDK-ARM µVision4 IDE, click the magnifying glass to program the Flash memory
and begin debugging as shown below in Figure 24.
Figure 24. Starting an MDK-ARM µVision4 debugging session
wmswvm pVIsmM E“: a! yaw Erased Hash gem; mums mmhnn mamas 1on1; :vcs /- Kimble mm mm GPIOX Clock: '1 5 - Rcc_wswenpnc1ucxcmlmcc_umpenpn_wn, Imam: nxnsunmaA 2101 move: UJDXDJ uxuauumac uvoa LSLS rummza uxuauuudsl rlrrrzn aw RCC_APBlPe:thCluchmd (uxuaouu so: RCC_APBJP2:1PhClu:kCn-i(RCC_AP82Perxph_GPI0C, 2mm: nvnnnnruua am‘ "My: ” mm as m Re ml [ v-x “3 - Desczlinon .~ mun non-1. :1 mn . 1 nput None H“ n output : None “‘2 ~ Rezum None —‘ mars?! .m.m.m.mm.m...m.m.m.m.«g«M........«....m«...« m m n55 1m mum-m 4: m .575. was n55 /t Enable m and 5?on clocks ~/ RCC_APEipetlphc10ckcmfllRCC_APBlPeriph_PllR, mum; v » Adrien: umnwunn DXZDDDDDD uuuunuun unuuuuuu ouuouunu nuuuuuuu nunuunuu uxsnsun unuuuuuu uuuouunu uxzuuuuuzu: uquaozm ugueuvus Auumauu quunuuu quunuuu uuuuDuuU uuuuuuuu uuunuuuu uxzunuum ununuunu uuuuuuuu Dnuunuuu Unummnu uuuuuuuu ununuunu uuuuuuuu unuunuuu nxznunnus unnunnun unnunuun onunnunn nuunuunu nunnunnu nunnnnun unnunuun unannoun- uxzuuuuua uuuuDuuD uuuauuuu Duuouuuu uuuuuuuu uuuuuuua uuuuouun uuuuuuuu uuuDuuDu uxzuuuuuw uuuuuuuu uuuuuuuu DDUUDUUU Duuuuuuu uuuuuuuu uuuuuuuu uuuuuuuu uuuuuuuu szflflnflflcfl: unnunnun unuunuun mmmmnn nuunuunu nunnunuu unnummn unaunuun nnummnn uxzuunuuz uuuunuun uuuuuuuu uuuouunu uuuuuuuu uuouuuuu uuuuuuun unuuuuuu uuuouuou ' A Emmy; sunk mm” ‘
UM1562 Using MDK-ARM Microcontroller Development Kit by Keil™
Doc ID 023558 Rev 1 25/48
The debugger in the MDK-ARM IDE can be used to debug source code at C and assembly
levels, set breakpoints, monitor individual variables and watch events during the code
execution as shown below in Figure 25.
Figure 25. MDK-ARM IDE workspace
2mm my. gating Mamas New Mum-puma flukpam. ‘. QDsn mm“. gnu w Ewart Manse: dem STMiwudwllonict Devi: STMBZF‘JIIWC Tanker ARM STMlcmalecllmc: a i STMmmeleoumic: Cole :Carlux Ml 9 ; Envy smaz Startuu cmm Pmiatl Fddsv and Addfia mama 7 -L'
Using MDK-ARM Microcontroller Development Kit by Keil™ UM1562
26/48 Doc ID 023558 Rev 1
6.3 Creating your first application using the MDK-ARM toolchain
6.3.1 Managing source files
Follow these steps to manage source files.
1. In the Project menu, select New µVision Project... to display the Create Project File
dialog box. Name the new project and click Save.
Figure 26. Creating a new project
2. When a new project is saved, the IDE displays the Device selection dialog box. Select
the device used for testing. In this example, we use the STMicroelectronics device
mounted on the STM32F3DISCOVERY board: double-click on STMicroelectronics,
select the STM32F303VCT6 device and click OK to save your settings.
Figure 27. Device selection dialog box
3. Click Yes to copy the STM32 Startup Code to the project folder and add the file to the
project as shown in Figure 28.
Figure 28. Copy the STM32 Startup Code dialog box
Note: The default STM32 startup file includes the SystemInit function. You can either comment out
this file not to use it, or add the system_stm32f30x.c file from the STM32f30x firmware
library.
3 mt mam (void) 5 mum my ; ung m 04“ LL 1 an r u: m, amid an target mas Budd lanai F7 , , v m- 7‘ r w M J Agd Gmup . Ran-m Gnu» ‘Swvce em» 1‘ and ms fi‘as Manafie gumnanents . shw Indude We Dependemes m Tigetl E fi Sowce Group1 ‘ mahc slam_stm32l30x.s
UM1562 Using MDK-ARM Microcontroller Development Kit by Keil™
Doc ID 023558 Rev 1 27/48
To create a new source file, in the File menu, select New to open an empty editor window
where you can enter your source code.
The MDK-ARM toolchain enables C color syntax highlighting when you save your file using
the File > Save As… dialog under a filename with the *.c extension. In this example
(Figure 29), the file is saved as main.c.
Figure 29. MDK-ARM main.c example file
MDK-ARM offers several ways to add source files to a project. For example, you can select
the file group in the Project Window > Files page and right-click to open a contextual
menu. Select the Add Files... option, and browse to select the main.c file previously
created.
Figure 30. Adding source files
If the file is added successfully, the following window is displayed.
Figure 31. New project file tree structure
'1' Uplivns (or TarEgv 'Nngmpm' Device Tawlumuux] Lung] User | clcwl Am | Liked Debuvl Ulilies] Smicmhmm s‘rMaszE >aal [MHz] 8 0 Opening mm: None v symviwu file [5"! 7 Code Eenuafiun F u“ cluanda Human r7 ”:2 MicmLIB F Eh Endm F—J Fleeing Fo'ul Heldwe: m HeadmnhMamyArea:— *fiaadN/maMlmtyAlea: dale-4| not-chip sum Sir: sum: «and: nil—dip sun Sin Nolnl F HDMI' r‘ F HAMI: F F HDMZ r F HAMZ r 1’ REM} r F HAM: l' and-‘9 own» 17 mum-‘— r? I? "RAMP-W F r IRDMZ r‘ r IRAM2 l‘ BK I Cant Dal-uh I Hub
Using MDK-ARM Microcontroller Development Kit by Keil™ UM1562
28/48 Doc ID 023558 Rev 1
6.3.2 Configuring project options
1. In the Project menu, select Options for Target 1 to display the Target Options dialog
box.
2. Open the Target tab and enter IROM1 and IARM1 Start and Size settings as shown in
Figure 32.
Figure 32. Target Options dialog box - Target tab
3. Open the Debug tab, click Use and select the ST-Link Debugger. Then, click Settings
and select the SWD protocol. Click OK to save the ST-Link setup settings.
4. Select Run to main().
\errku .|urir-| L'nkm Debw|urimer| 6 Us: Hm menace om v Settings | r? Use: STLinkDehumer v saunas] I LILINK Carla Deb-19' Hm lnlevlace Dnva I7 Ln“ Alma Slaw Cam Debugger srauanr \cDI Comm Targm Driver Setup um] unbvg | I.” | Hesthmbadl DebugAdamer WDwiva Urir [:1 r Hum d IDBUDE WDID -|128ADI477 SelialNunhel NI’A ‘ HWVr-rmfiz FlwaaVsnim 241550 r: a” ‘4‘ H Put m v c- ‘ ,rrmrmm-m Dvlinns {In Talgpl 'Talgpt 1' Daviual Tagal Dubukl Limngl u“. | ac»| Ann | Links] Debug Ewan: Flash Menu camm'and @u» Tam Dviverlanlosh Frogramm'nn ULINK Cumeabggs v San'mt I @ded-Tami behmDabum I“ as LILINK EuszDehmggs —— RDI Ivlswfacs Dr'mr Sleflavis ICDI J1! Dam Heb
UM1562 Using MDK-ARM Microcontroller Development Kit by Keil™
Doc ID 023558 Rev 1 29/48
Figure 33. Target Options dialog box - Debug tab
5. Open the Utilities tab, select Use Target Driver for Flash Programming and select
the ST-Link Debugger from the drop-down menu.
6. Verify that the Update Target before Debugging option is selected.
7. Click OK to save your settings.
Figure 34. Target Options dialog box - Utilities tab
8. In the Project menu, select Build Target.
9. If your project is successfully built, the following window is displayed.
Build target 'Tarwec 1‘ linking... Prugral'n Size' Cud '344 R0 0 act. aXf eta—405 R as: —u ZI—data=1632 u Errorls), u Warn
Using MDK-ARM Microcontroller Development Kit by Keil™ UM1562
30/48 Doc ID 023558 Rev 1
Figure 35. MDK-ARM µVision4 project successfully built
10. Before running your application, establish the connection with the
STM32F3DISCOVERY board as described in Section 1: Getting started.
11. To program the Flash memory and begin debugging, follow the instructions given in
Section 5.2: Debugging and running your EWARM project.
Tm; Imam. I— mamm ”9(me in: MM (mu won suns mum-ct: “Mind-d - um. chm: a mm: W m use For a: mum, woman: C:\STM32F3 Discovevmnfimwarebemonstafiomusme : Dmuumauummtunm 1:1— mums-«mum». H.) wambench , 1, m “mm TASKIIIE
UM1562 Using TASKING
Doc ID 023558 Rev 1 31/48
7 Using TASKING
7.1 Building an existing TASKING project
Follow these steps to build an existing TASKING project.
1. Open the TASKING VX-toolset for ARM Cortex IDE. The program launches and asks
for the Workspace location.
Figure 36. TASKING workspace launcher dialog box
2. Browse to select the STM32F3DISCOVERY Demonstration TASKING workspace and
click OK to save your settings and to display the Welcome screen. To start using
TASKING, click Go to the workbench.
Figure 37. TASKING VX-Toolset for ARM Cortex welcome screen
lm purl Salad (mag haw mm; from an mm; m. m dummy sum an lnpnvl snuvu‘ 9 Geneva m7, Avmwemg 9‘ F“: System 3 Pvefeventes I2» uc++ B (vs 9 Run/Debug D manna (/(++ 9 team 56 EMF 0
Using TASKING UM1562
32/48 Doc ID 023558 Rev 1
3. The TASKING Discovery workspace contains a demo project for the
STM32F3DISCOVERY kit. To load this project, select Import... in the File menu to
display the Import dialog box.
4. In the Import window, open General, select Existing Projects into Workspace and
click Next.
Figure 38. TASKING import source select dialog box
Impnrl vmyem Sam . fienury n: m by emu; Edospmmu. (-3 salt: I“ mm: C: \STM32F3 DiscovervKitL‘ivmwave O sax: mm- "a: _\ Will-(B: E STM32F3_Dischery_Kit(C: \STM32F3_Discuvevy M 5% in ( ) Dcwyua-mmm \vukrguu Dwmmwmm (m ‘ cm it qublaggg $3 ,3 Cal-sale] El Properties" 13 items Des btion Resource Path completed successfully
UM1562 Using TASKING
Doc ID 023558 Rev 1 33/48
5. Click Select root directory, browse to the TASKING workspace folder and select the
STM32F3-Discovery project.
Figure 39. TASKING import projects dialog box
6. In the Projects window, select the STM32F3_Discovery_Kit and click Finish.
7. In the Project Explorer, select the STM32F3-Discovery project. Open the Project
menu, and click Build Project.
8. If your project is compiled successfully, the following window is displayed.
Figure 40. TASKING project successfully compiled
Avur u”. wuuw H gn- aw mun—u :- "an. In up nun-v olewlu mum-nu «I 1_ mm
Using TASKING UM1562
34/48 Doc ID 023558 Rev 1
7.2 Debugging and running your TASKING project
Figure 41 shows the first step for debugging and running your TASKING project. From the
project toolbar menu, select Debug > Debug STM32F3-Discovery_Demo.
Figure 41. TASKING debug window
The debugger in TASKING can be used to debug source code at C and assembly levels, set
breakpoints, monitor individual variables and watch events during the code execution.
To run your application, from the Run menu, select Resume, or alternatively click the
Resume button in the toolbar.
v Wnlkspace Launcher Select a wurkspaca msxme \lX-lanlsel rm ARM Cavtex v3.2" slaves ynuv armed; m a may (awed a wmksnaze change a woflspane folder m use for m; sess‘an Wm“: cumwmm . DUse this as the dew: and do not yawn " New (,Ic ,, pmm c/c ‘ ‘ Pmlm! — <> (nah: arm EK~+ arm fa km IASUNG V'X-(odslk for Am ‘ mm was: TASGNIG ARM W’ = - o Mela Wmld c Puma o Helm Wurld c-u- mum . :5 usms ARM Library - \: usxmc ARM m1 may um > in». (mud
UM1562 Using TASKING
Doc ID 023558 Rev 1 35/48
7.3 Creating your first application using TASKING toolchain
The debug session is launched as follows:
1. Open TASKING VX-Toolset for ARM Cortex. The program launches and asks for the
Workspace location. Browse to select an existing workspace, or enter a new
workspace location and click OK to confirm.
Figure 42. TASKING Workspace Launcher dialog box
2. When TASKING displays its Welcome window, click Go to workbench to open the
main window. In the File menu, select New > TASKING VX-toolset for ARM C/C++
Project.
3. In the New C/C++ Project dialog box, enter the new Project name; then, in the
Project type box, select TASKING ARM Application and click Next.
Figure 43. TASKING New C/C++ Project dialog box
v L mum x L ruins: ; 1" mm ,Emyw » L 31mm; A r‘ =mvv~lv . - r4 . mm): unvnmcn E‘Pmm
Using TASKING UM1562
36/48 Doc ID 023558 Rev 1
4. From the list of supported devices, select STMicroelectronics > STM32F303>
STM32F303VCT6 as shown below in Figure 44.
Figure 44. Processor selection
5. To configure the project for STM32F3 DISCOVERY board, select Debug > Debug
configurations and choose STMicroelectronics STM32F3 Discovery Kit. Choosing
STMicroelectronics STM32F3 Discovery Kit as the evaluation board, will add
automatically the needed linker file and will configure the project as follows:
Microcontroller: STM32F303VCT6
Debug probe: ST-LINK
Connection: Serial Wire Debugging (SWD)
Figure 45. Debug configuration
c'auemmhmuudmmuagm. sunk-am“. C. m: as fiExisliug ijlcks into warkipace m: L". Mm m I. ac» i O as 5: D RAND-bun m 0 name (kw mi D we.» ‘IS-Iwi ® ,r'm "-
UM1562 Using TASKING
Doc ID 023558 Rev 1 37/48
6. To add a source file to your project, right-click on the project from the C/C++ project
window and select Import.
7. From the Import dialog box, select General and the desired file as shown in Figure 46.
Figure 46. TASKING Import dialog box
From dreamy: i c:\ 3 Eli? C:\ Fllte! Type Select All Deselect All vi Browse... ‘1 into folder: 1 PmJect Options D0verwrite existing resouces without waming El Create toplevel folder Creat In works ICreate link locations relative to: ipnoJecuoc v @ i LBvowse. ., Cancel W Console‘ E7 Properties 33 tems Description Resource c c++ bu mmpleted successfully “e"Pxoj eer— Path
Using TASKING UM1562
38/48 Doc ID 023558 Rev 1
8. Click Next. Fill the displayed window as follows and then browse to your source file.
Figure 47. Adding a new source file window
9. Select main.c file and click Finish.
10. To build your project, click on Project > Build Project from the toolbar menu.
11. Your project is compiled successfully.
Figure 48. Tasking project successfully built
12. Before running your application, establish the connection with the
STM32F3DISCOVERY board as described in Section 1: Getting started.
a kaspam Launcher Eden! 3 wnrkspaca Atom TrueSYLDIO® Fm STMlcmebctmrlzs® SW62" Lite 101a ymv prolecls in a folder (sled a workspace, amass a wwkspacz folder to use m m sassm flul‘sw C:\SIM3ZF3_Di5cav2vy\F[RMWARE\Pmje(tWEmnnslvatmnflvuaSYLDIO J b cum Settinus Mmmuw m ‘n-amu mm
UM1562 Using Atollic TrueSTUDIO®
Doc ID 023558 Rev 1 39/48
8 Using Atollic TrueSTUDIO®
8.1 Building an existing TrueSTUDIO project
1. Open the TrueSTUDIO®/STM32 product folder and select the Atollic TrueSTUDIO®
STM32 product name. The program launches and asks for the Workspace location.
Figure 49. TrueSTUDIO workspace launcher dialog box
2. Browse to select the STM32F3DISCOVERY Demonstration TrueSTUDIO workspace
and click OK to save your settings and to display the Welcome screen. To start using
Atollic TrueSTUDIO®, click Start using TrueSTUDIO.
Figure 50. Atollic TrueSTUDIO®/STM32 Lite welcome screen
a Impnn select Cveat: new amen; fvm an avd’uv: Fla nv dwadnvv. 5am an mam some: 9 Geneva‘ U; mm: lee a, F Esme." .Pvefevances w E Clc++ \v E Rm/Dabua & B Yeam
Using Atollic TrueSTUDIO® UM1562
40/48 Doc ID 023558 Rev 1
3. The TrueSTUDIO Discovery workspace contains a demo project for the
STM32F3DISCOVERY kit. To load this project, select Import... in the File menu to
display the Import dialog box.
4. In the Import window, open General, select Existing Projects into Workspace and
click Next.
Figure 51. Atollic TrueSTUDIO®/STM32 Lite import source select dialog box
a Qmpun lmpnrt pruiects seed a dmmy to seem rm estllhg muse mums, @iktmugdrenury: LgL51M353_D\§cfvevyflgmw5[qevaecz\D 0 Select gems fie: \ emeds‘ SMEZFS'Dwsme/(C YMGZFCLDrs:wew\FIRMWARE\PW|e
UM1562 Using Atollic TrueSTUDIO®
Doc ID 023558 Rev 1 41/48
5. Click Select root directory, browse to the TrueSTUDIO workspace folder and select
the STM32F3-Discovery project.
Figure 52. Atollic TrueSTUDIO®/STM32 Lite import projects dialog box
6. In the Projects pane, select the STM32F3_Discovery_Kit and click Finish.
7. In the Project Explorer, select the STM32F3-Discovery project. Open the Project
menu, and click Build Project.
8. If your project is successfully compiled, the following window is displayed.
Figure 53. TrueSTUDIO® project successfully compiled
a [ ‘ oungumnun Edit launch canfigur r' Mane ETMSZFflrbwscnvevyae‘f \ DE" #042ng p Stamp Dahug 2 Stamp Andyz: ‘ ”a ‘ clc++Apuimtim \Demgj§mzpfulscavax.er HSEVfllpmfitlmll flame”. ] EMBCt: \smazraoiscmvy [ gawsem ] sum: or tequwed) before Iaunchmg Bu'H mriiguman: Use Active v [IS-Jack mnfiguvatinn ufl‘ng 'c/(w Awkah‘nn' OEnable m buid Ousable m mu (an: walkspam settings Cnnfigue Wmace 59mm; ,. ® @-
Using Atollic TrueSTUDIO® UM1562
42/48 Doc ID 023558 Rev 1
8.2 Debugging and running your TrueSTUDIO project
In the Project Explorer, select the STM32F3-Discovery project and press F11 to display
the Debug Configuration dialog box.
Figure 54. TrueSTUDIO Debug Configuration dialog box
BDuhug 91mm y; verylsvdmimr Mu||vz as gm m Bun mm Saw ; omvnvxfiv 3‘ a; pm Wm mm diam; M a szr I'> 1%”‘5‘9aB-SM mam”; =5: n a 5mm Dsmwew 2f [Embeddde/(H Anwcatnn] a i! smazmosmvew e» a .0! mm In (men) (swam LES Request! , MEN) 3 man : az nxxmnsrs >11 qflh Ji- Ioh :«ffifiv 7mm“;- ~ E gioulhne LA \\ w u 77 m /: ~ a) ., a» m mnwnm 1 m < ‘="" a:="" -‘="" «amateur,="" m="" m="" gpioilchypedei="" m="" as="" ,-="" mm="" m="" m:="" applicacxzn="" cm="" w="" svstlckicanfleedm:="" ,7="" n="" ‘="" w;="1m:" 67="" as="" systemmumupme="" n:="" a;="" n="Systemcurecluck:" 5::="" n="" z="" u;="" \="" :="" apxogmsuuu="" n="" nus="" xs="" 3="" v="" .="" li;="" r="" \5="" i="" 3:="" v="" i:="" swam="" u="" :thszvflxxchh="" :zmazmxmn="" n="" xzbjom="" m)!="" m="" myom="" kev="" nmev="" um;="" hmstlaq="" amt!)="" svsfidqiand‘evlvmd)="" m="" mammay="" m="" e="" ./="" a="" «="" mm;="" mam“,="" w="" w="" v="" x="" w="" s="" x="" a="" o="" c="" m="" [a="" xead="" (he="" svs:em="" me="" \=""> ‘5 (arms a swmrmsmvew 2v [mmmmcym nw‘raunn] sv um comm“ 2min”, mu“ m. , 1m v e We m; if, E‘E'ELQ'U‘, W Y mum memm mm,“ m: 3H,“. mm» @Elflnfimflfiwm = El Eiwvnazemz mgswvmm LI mm \ 0 EE = E ‘ > ” ov.ynm.zm§ u
UM1562 Using Atollic TrueSTUDIO®
Doc ID 023558 Rev 1 43/48
9. In the Main tab, configure the project as shown in Figure 54 and click OK to save your
settings and to program the Flash memory and begin debugging.
Figure 55. TrueSTUDIO Debug window
The debugger in the Atollic TrueSTUDIO can be used to debug source code at C and
assembly levels, set breakpoints, monitor individual variables and watch events during the
code execution.
To run your application, from the Run menu, select Resume, or alternatively click the
Resume button in the toolbar.
8.3 Creating your first application using TrueSTUDIO toolchain
TrueSTUDIO includes a dedicated connection to the STM32F3DISCOVERY board. When
choosing this connection, all required files (startup file, firmware library, etc.) are added to
the workspace and sample files are generated in the project folder to simplify the
development. The debug settings are automatically configured by selecting
STM32F3DISCOVERY as the evaluation board.
Follow these steps to create your first application using TrueSTUDIO toolchain.
1. Open the TrueSTUDIO®/STM32 product folder and select the Atollic TrueSTUDIO®
STM32 product name. The program launches and asks for the Workspace location.
Browse to select an existing workspace, or enter a new workspace location and click
OK to confirm.
a Wnrkxpace Launcher Select a wurkspaca mm: rmsrmlowsmaz m: 5mm; Yam wands n a was mum a mkaDace Chaos: 3 wovksnate Folder m use rm ms sessmn mkspaw ::\Newwmksgatel , Envy serum; (3 a c Frojec' C Pmiecl Geek: c waved uF 93km we meet name Nevanyed Use dam! mam Puma type: “Ankh-m: t 9 Executdfle 1, Am‘k ARM Yank 6 EN ‘2 {a Maszflevmied Shaw mm types and mum-n; nnlv i any are mwmm m the v‘alfnvm
Using Atollic TrueSTUDIO® UM1562
44/48 Doc ID 023558 Rev 1
Figure 56. TrueSTUDIO workspace launcher dialog box
2. When the Atollic TrueSTUDIO® displays its Welcome window, click Start using
TrueSTUDIO to open the main window. In the File menu, select New and click C
Project.
3. Name the new project, select STM32 C Project in the Project type pane, then click
Next.
Figure 57. TrueSTUDIO® C Project dialog box
@El 1rLIeSTUDlIJ® Build Settings Select hardware and build configuvation Tavget Vendor: sm reelectmmcs—v Evaluation board: ETM32F3_Discm/efy v Miuocuntmllev family: All Miuocuntmllen Floating point: Software implementation v Code location: FLASH v instruction set ARM Ttiumti © Endianess an endian ®Little endian Optimization El Remove unused :ude (dead code removal) Remove unused data (dead data removal) Disabli C++ mmimi— hum:— Infiiimi iF‘YTI'I o
UM1562 Using Atollic TrueSTUDIO®
Doc ID 023558 Rev 1 45/48
4. In the TrueSTUDIO® Build Settings dialog box, select STM32F3_Discovery as the
Evaluation board, configure the other settings as shown in Figure 58 and click Next.
Figure 58. TrueSTUDIO® Build Settings dialog box
Note: Choosing STM32F3DISCOVERY as the evaluation board will configure the project as
follows:
Microcontroller: STM32F303VCT6
Debug probe: ST-LINK
Connection: Serial Wire Debug (SWD)
a c Home! @E IrueSILDIU® Misc Settings Se‘ecl mscelanews waned semnqs mm 51-me w: Imusvuolo m m‘y slums ml km or m6 Dvnba‘ Mm: purchases ths thisnni‘ vumon tn 9st mum m a lava: numb. at arm was a Jmfi Wabas‘ [L Prublms}21ask¥ Ecansula Ed Dfiapemes Q § ‘3; * CrBuIld [NelNPmlatl] Program F)les\k:nll)c\TrueSTUDIO for STfllcrneleccrunlcs s'maz Lice 2.3.U\Too1s\am-acu111c-repons.as: anemia NewPrDJect.elf Report and converter :nols only avaxlable 1n TrueSTUDIO Professional mum complece f0: prnjEDL NeuProjetL Tme consumed: 10125 ms.
Using Atollic TrueSTUDIO® UM1562
46/48 Doc ID 023558 Rev 1
5. Verify that the JTAG Probe is ST-LINK and click Finish to confirm your settings.
Figure 59. TrueSTUDIO® Misc Settings dialog box
6. Your project has been created successfully. Atollic TrueSTUDIO® generates target
specific sample files (main.c, stm32f30x_it.c...) in the Project folder to simplify the
development. You can tailor this project to your needs by modifying these sample files.
7. To build your project, click Build Project in the Project menu.
8. Your project is compiled successfully.
Figure 60. TrueSTUDIO® project successfully built
9. Before running your application, establish the connection with the
STM32F3DISCOVERY board as described in Section 1: Getting started. To program
the Flash memory and begin debugging, follow the instructions given in Section 8.2:
Debugging and running your TrueSTUDIO project.
UM1562 Revision history
Doc ID 023558 Rev 1 47/48
9 Revision history
Table 2. Document revision history
Date Revision Changes
04-Sep-2012 1 Initial release.
UM1562
48/48 Doc ID 023558 Rev 1
Please Read Carefully:
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the
right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any
time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no
liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this
document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products
or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such
third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED
WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS
OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
UNLESS EXPRESSLY APPROVED IN WRITING BY TWO AUTHORIZED ST REPRESENTATIVES, ST PRODUCTS ARE NOT
RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING
APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY,
DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE
GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void
any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any
liability of ST.
ST and the ST logo are trademarks or registered trademarks of ST in various countries.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.
© 2012 STMicroelectronics - All rights reserved
STMicroelectronics group of companies
Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan -
Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America
www.st.com

Products related to this Datasheet

DISCOVERY STM32F303VCT6 EVAL BRD