TrueSTUDIO - matianfu/arabesque GitHub Wiki
Overview
TrueSTUDIO is an Eclipsed-based IDE. It has support for ARM cortex-M MCU (including STM32) and provides a free and 32K size limited version. STM32CubeMX generates TrueSTUDIO project files (The other two choices are IAR and Keil respectively).
We just install TrueSTUDIO for manipulating with linkder scripts (ld files) and compiler options, providing a reference for composing Makefile.
Download
The download page is:
http://www.atollic.com/index.php/download/truestudio-for-arm
Installation
Installation needs registration. Fill information form and get register code emailed with registration email address.
Collaboration with CubeMX
Code Generation with "Copy all" strategy
This is the easiest way. No risk for broken path when imported into TrueSTUDIO.
Launch CubeMX, make necessary settings via GUI interface, choose Menu Project
-> Settings
-
On
Project
tab, chooseTrueSTUDIO
(instead ofEWARM
orMDK-ARM
) as toolchain / IDE. -
On
Code Generator
tab, selectCopy all used libraries into the project folder
option. Then generate codes.
Launch TrueSTUDIO,
-
open menu
File
->Import
, selectGeneral
folder ->Existing Projects into Workspace
, clicknext
. -
click
Browse
, choose project file folder, named as TrueSTUDIO, (Path: [code generation folder]/Projects/TrueSTUDIO), click确定
, DON'T check any other options in dialog, clickfinish
.
Fix Linker Script
For unknown reason, CubeMX does not generate correct linker script. You can see a file named STM32F407VE_FLASH.ld
in project explorer pane. The file is located at project configuration folder, which is inside the project file folder (TrueSTUDIO). But it is empty. If you start building the project right after import, you will get linker complaints.
TrueSTUDIO provides linker script file for all its supported MCU, including STM32F4. You can find the built-in linker script file in this folder:
C:\Program Files\Atollic\TrueSTUDIO for ARM Lite 5.0.0\ide\plugins\com.atollic.truestudio.tsp.stm32_1.0.0.201404221459\tsp\ld
There are two files for STM32F4, stm32f4_flash.ld
and stm32f4_ram.ld
. The former is generally used and the later, if you wish, will load programs (.text) into SRAM rather than flash. This may be faster for downloading, or may extend flash lifespan for your dev board, due to reduced erase time. But this mode can not be used for production.
You have two working but not recommended way to fix ld file:
-
Copy and paste the content in stm32f4_flash.ld to STM32F4VE_FLASH.ld file, or
-
Select the project in project explorer pane, choose menu
Project
->Properties
, expandC/C++ build
in left, chooseSettings
, clickTool Settings
tab, ChooseC Linker
->General
, You can see on the right side, there is a field holding the linker script file path, and aBrowse
button. You can click this button to choose the TrueSTUDIO built-in linker script file, i.e.,stm32f4_flash.ld
.
Both ways are high unrecommended, they are list here for you to demonstrate where is the built-in linker script file located and where you can set the ld file for the project.
The recommended way is:
-
Click
Target Settings
tab alongsideTool Settings
. -
Click drop-down menu
代码位置
, choose FLASH or RAM, you can toggle it several times. Each time you change this setting and clickapply
, TrueSTUDIO will ask you if you want to generate a new ld file. If you chooseyes
, then a copy of built-in ld file will be copied to your project folder. If there is an old file with the same name, it will prompt you to name the new file differently.
There are some glitches for TrueSTUDIO to decide whether ld settings are changed, you may see a dialog pop up then disappear instantly. Try it several times and you will understand how it works. I prefer to delete existing ld file first before I generate new ld file using this way.