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, choose TrueSTUDIO (instead of EWARM or MDK-ARM) as toolchain / IDE.

  • On Code Generator tab, select Copy all used libraries into the project folder option. Then generate codes.

Launch TrueSTUDIO,

  • open menu File -> Import, select General folder -> Existing Projects into Workspace, click next.

  • click Browse, choose project file folder, named as TrueSTUDIO, (Path: [code generation folder]/Projects/TrueSTUDIO), click 确定, DON'T check any other options in dialog, click finish.

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:

  1. Copy and paste the content in stm32f4_flash.ld to STM32F4VE_FLASH.ld file, or

  2. Select the project in project explorer pane, choose menu Project -> Properties, expand C/C++ build in left, choose Settings, click Tool Settings tab, Choose C Linker -> General, You can see on the right side, there is a field holding the linker script file path, and a Browse 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:

  1. Click Target Settings tab alongside Tool Settings.

  2. Click drop-down menu 代码位置, choose FLASH or RAM, you can toggle it several times. Each time you change this setting and click apply, TrueSTUDIO will ask you if you want to generate a new ld file. If you choose yes, 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.