How to use STM32 Library Examples

Home Page
STM32 home page
STM32 Tutorials

Suggested reading:

  • The PC operating system is Windows XP SP3.
  • In the PC is installed the free Atollic software (TrueSTUSIO STM32 Lite 1.4.0).
  • For test the example below is used the STM32 Discovery.
  • We use the STM32 Library 3.3.0 that are in the directory:
  • We have created a directory named:
  • We want to use the Library example:
    GPIO --> IOToggle
  • What does the example:
    The program will flash the two LEDs (green and blue) present on STM32 Discovery. 
Click here to get this SW Example ready to use (Example How to use STM32 examples in ATOLLIC)

STEP n.1

Go to library directory:


and copy all, files and directory, into the directory:


See the fig.1


STEP n.2

Select the directory:


And press on it with the right mouse key and select Properties (fig.2)


Next deselect the Read-only and click Apply (fig.3)


A new windows will appear, press OK (fig.4)


And then you are back to fig.3, press OK again.

STEP n.3

Go to directory:


And copy all files into the directory:


See fig.5


STEP n.4

Run the ATOLLIC TrueSTUDIO Lite.
From the window that appear press on BROWSE button and select:

Next press OK (fig.6)


From the new window that appear press: Start using TrueSTUDIO (fig.7)


STEP n.5
Be sure to be in:
If you are not sure, do this:
Click on File-->Switch Workspace-->Other (fig.8)


and browse to:


It is TrueSTUDIO workspace directory (fig.9)


STEP n.6

Now Click on File-->Import, select General-->Existing Projects into Workspace and then click Next. (fig.10)


Now Browse to the TrueSTUDIO workspace directory, select the STM32100B-EVAL project and click OK. (fig.11)


Next press Finish (fig.12)

STEP n.7

Now open the: stm32f10x.h, see fig.13


Remove comment from line 52 and insert comment in the line 54, see fig.14


Now open the file: stm32f10x_conf.h and remove the comment from the line 45, see fig.15.


Now press the icon  for compile the project.

If all is OK, you must see in the Console window: Build complete for project STM32100B-EVAL, see Fig.16.


STEP n.8

Now it is a time for debugging our program.
Select STM32100V-EVAL and click on the Debug toolbar button (the insect icon  ) or the F11 key to start the debug session.
A new window appear, press OK.
See fig.17.


The first time debugging is started for a project, Atollic TrueSTUDIO display a dialog box that enable developers to confirm the debug configuration before launching the debug session.
The fig.18 appear and you must per OK and next Cancel.


Next, will appear the fig.19, verify that the Debug menu is setted like below and click on the OK button to start the debug session.


Atollic TrueSTUDIO launches the debugger, and switches to the Debug Perspective, which provides a number of docking views and windows suitable for debugging (fig.20) .


A number of execution control functions are now available from the Run menu.

Alternatively, use the corresponding execution control commands in the Run control toolbar.

The Global Variables are automatically displayed in the Variable Window, fig.9, see on top and right.
For add a Global Variable to the Window Variable do this:
click inside it with the right button of mouse and from the popup windows select:
Add Global Variables
Another way to add a Global Variable is clik on the icon:

For insert Breakpoint click twice near the number of the line, see fig.20 red circle.
For remove Breakpoint click twice on it.

For see the ASM code click on the icon

Stop Debug
When the debug session is completed, the running application must be stopped by clicking on the icon: 
Atollic TrueSTUDIO now automatically switch to the C/C++ editing perspective.

Go Up

Home Page
STM32 home page