How to import the examples present in STM CUBE Library for AC6 into the ATOLLIC TrueSTUDIO for STM32

If you like it, share it

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:
…\STM32Cube_FW_F0_V1.9.0\Projects\STM32F030R8-Nucleo\Examples
you see a loot of example but none for Atollic.
See for example the GPIO toggle:
…\STM32Cube_FW_F0_V1.9.0\Projects\STM32F030R8-Nucleo\Examples\GPIO\GPIO_IOToggle
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:
E:\0_F0lib_v190

Now go in the directory:
E:\0_F0lib_v190\Projects\STM32F030R8-Nucleo\Examples\GPIO\GPIO_IOToggle\SW4STM32\STM32F030R8-Nucleo
and you muste see the files below.

It’s very important associate the files:
.cproject
.project
to ATOLLIC.
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:
.cproject
.project
to ATOLLIC click by the right mouse button on the file:
.project
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:
    E:\0_F0lib_v190\Projects\STM32F030R8-Nucleo\Examples\GPIO\GPIO_IOToggle\SW4STM32\STM32F030R8-Nucleo\Debug
  • 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.


NOTE
Suppose that you whant to test another example, suppose: UART_TwoBoards_ComIT
for use the same working directory, that in our case is:
E:\0_F0lib_v190
semply delete the file named:
.metadata
and repeat the steps above explaned.