In the Cube Libraries there are a lot examples ready to use for IAR, KEIL, AC6 and sometime for ATOLLIC (TrueSTUDIO).
We think that in the next release of the Libraries, the examples for Atollic will be a standard presence because STM acquired Atollic.
Up to now (Feb.2018) sometimes the Atollic examples are missing.
Don’t worry, follow this tutorial and by yourself you import every AC6 examples (present in the Cube Library) in ATOLLIC.
For explain to you the way to import an example from AC6 to ATOLLIC, we use the CUBE Library of the STM32L0 where is not presente the ATOLLIC version.
We choose to use the examples for NUCLEO-F030R8.
Download and unzip the STM32L0 library.
If you see in the directory:
you see a loot of example but none for Atollic.
See for example the GPIO toggle:
There are the example for IAR, KEIL and AC6 (SW4STM32)
Our goal is to import the AC6 example, GPIO_IO Toggle, in ATOLLIC
We copy all F0 library in another directory for preserve the original files.
We use the directory:
Now go in the directory:
and you muste see the files below.
It’s very important associate the files:
In our example (image above) we have already done the association, in fact near the name of the files there is the Atollic Icon.
For associate the files:
to ATOLLIC click by the right mouse button on the file:
from the window that appear choose: Open With
and associate the .project to: TrueSTUDIO.exe
that, in Window 7, is in the directory:
C:\Program Files (x86)\Atollic\TrueSTUDIO for STM32 9.0.0\ide
Look the image below
Do the same for file: .cproject
Now double click on .project and from the ATOLLIC window that appear choose your working directory (the directory where you unzipped the library), in our case is: E:\0_F0lib_v190
and press OK
A new window appear that explain us that a conversion of format is necessary, answer OK. (See below).
At the end of the conversion a new window appear that remember us that are necessary some manual settings, see below.
Now is necessary inform the compiler that we use the STM32F030R8, for do this do the steps shown below.
Project -> Properties -> C/C++ Build -> Settings -> Target Settings -> STM32F0 -> STM32F030R8
Now compile and you must see something like below.
At this point is necessary choose the emulator ST-LINK-v2, see the steps below.
- Click on icon: Configure Debug
- From the window that appear press the mouse button twice in quick succession, on the option: Embedded C/C++ Application
- Select the ELF file (step n.4 in the immage below) that in our case is in directory:
- Next click on Debugger option (step n.5 in the immage below) and choose the: ST-LINK
That is all, now you are ready to debug the GPIO_IO Toggle imported from AC6.
Suppose that you whant to test another example, suppose: UART_TwoBoards_ComIT
for use the same working directory, that in our case is:
semply delete the file named:
and repeat the steps above explaned.