Um At32ide en
Um At32ide en
UM0009
Introduction
This user manual gives an overview of Artery AT32 IDE. AT32 IDE is a software development
environment for cross-platform ARM embedded system. It contains a series of Eclipse plug-ins and
tools. Eclipse plug-ins allow users to create, build and debug AT32 MCU in AT32 IDE. AT32 IDE has
the following features.
Create projects using Artery project wizard: The New Project Wizard provides project template
for different target Artery MCUs.
Build projects using GNU ARM toolchain: The toolchain contains ARM GCC compiler. Users can
easily use it to build projects.
Debug projects using GDB: Users can pause, single-step debug, run and monitor the target chip.
SRAM and Flash access is allowed. Hardware breakpoints and detection points can be set. In
addition, users can erase the target chip and program user configuration.
Contents
1 Introduction ................................................................................................................ 7
Environmental requirements......................................................................................... 7
Glossary ........................................................................................................................ 7
2 Installation .................................................................................................................. 8
J-Link debug................................................................................................................ 21
4.2.1 Main tab ......................................................................................................................21
4.2.2 Debug tab ...................................................................................................................21
Start debugging........................................................................................................... 22
Download & Erase ...................................................................................................... 25
4.4.1 Download....................................................................................................................25
4.4.2 Erase ..........................................................................................................................25
5 ld linker ...................................................................................................................... 26
Basic concept.............................................................................................................. 26
5.1.1 Memory.......................................................................................................................26
5.1.2 Section ........................................................................................................................27
7 FAQs .......................................................................................................................... 40
Configuration ............................................................................................................... 40
Debugging ................................................................................................................... 40
Compilation ................................................................................................................. 40
List of tables
Table 1. Document revision history .................................................................................................... 42
List of figures
Figure 1. Select setup language .......................................................................................................... 8
Figure 2. Select destination location .................................................................................................... 8
Figure 3. Select additional tasks .......................................................................................................... 9
Figure 4. Installing AT32 IDE ............................................................................................................... 9
Figure 5. Installation complete ........................................................................................................... 10
Figure 6. Unzip files ........................................................................................................................... 10
Figure 7. GCC installation command ................................................................................................. 11
Figure 8. Configure udev access permission .................................................................................... 11
Figure 9. Set up HIDAPI library ......................................................................................................... 12
Figure 10. arm-gone-eabi-gdb execution fails ................................................................................... 12
Figure 11. Set up ncurses library ....................................................................................................... 12
Figure 12. Run AT32 IDE ................................................................................................................... 12
Figure 13. Select workspace ............................................................................................................. 13
Figure 14. Change file associations................................................................................................... 13
Figure 15. New project wizard ........................................................................................................... 14
Figure 16. Target chip configurations................................................................................................. 15
Figure 17. Debug configurations........................................................................................................ 16
Figure 18. GNU toolchain configurations ........................................................................................... 16
Figure 19. Complete project creation ................................................................................................ 17
Figure 20. Click toolbar to build a project .......................................................................................... 17
Figure 21. Build a project ................................................................................................................... 18
Figure 22. Project build result ............................................................................................................ 19
Figure 23. Project build configurations .............................................................................................. 19
Figure 24. AT-Link Main tab ............................................................................................................... 20
Figure 25. AT-Link Debugger tab ....................................................................................................... 21
Figure 26. J-Link Debugger tab ......................................................................................................... 22
Figure 27. J-Link SVD Path tab ......................................................................................................... 22
Figure 28. Start debugging ................................................................................................................ 23
Figure 29. Perspective switch ............................................................................................................ 23
Figure 30. Debug perspective............................................................................................................ 24
Figure 31. Install plug-ins online ........................................................................................................ 31
Figure 32. Installation progress ......................................................................................................... 32
Figure 33. Restart .............................................................................................................................. 32
1 Introduction
Environmental requirements
Software requirements
Windows 7 and above is required.
Linux distributions, including Ubuntu 18.4 and above, Fedora 34 and above, Centos 7 and above
are supported.
There is no need to install a driver when using the AT-Link simulator.
A driver is required when using the J-Link simulator. J-Link v6.20c and above is used. The version
below J-Link v6.20c will not work with this software.
Hardware requirements
AT-Link simulator
J-Link simulator
PC/AT compatible, Pentium or higher CPU
XVGA (1024*768) color display
At least 512M RAM
At least 20G disk space
Glossary
AT-Link simulator
AT-Link is a simulator developed by Artery to support the simulation of the kernel chip.
J-Link simulator
J-Link is a simulator developed by SEGGER to support the simulation of the kernel chip.
2 Installation
AT32 IDE provides an installer. The installer can be run directly and should be set up as prompted.
The installer consists of JRE runtime environment, ARM toolchain and GCC Make that do not need
to be installed separately.
Set up AT32 IDE on Windows
2.1.1 Run installer and select setup language
Run AT32IDE_V1.0.0_Setup.exe and select setup language as needed. Simplified Chinese and
English are available. Select the setup language and then click “OK”.
Installation commands:
Ubuntu:
$ sudo apt install libncurses5
Fedora:
$ sudo dnf install ncurses-compat-libs
Centos:
$ sudo yum install ncurses-devel
After AT32 IDE setup, select “AT32 IDE” as the default file association for .project and .cproject
files. The file association is added in the Windows Registry during installation but does not take
effect immediately; therefore, it is recommended to restart the computer to apply the file association
or right click to select AT32IDE.exe.
Run the AT32 IDE, the project where the .project file is located will be automatically imported.
Note:
1. The Project Name can only use uppercase letters, lowercase letters, digits and underscores. It
cannot contain Spaces.
Debug configurations
Select the default debug configuration. Click “Next” to continue.
Build project
Right click on the target project and select “Build Project” in the pop-up menu, or select the target
project and click “Build Project” in the menu bar, to generate an elf file, as shown below.
4 Debug project
Before debugging, please complete debug configurations that contain all the information required
for debugging.
AT-Link debug
Select [Run] > [Debug Configurations…] to open the debug configurations dialog box. Double-click
GDB AT-Link Debugging, the AT-Link debug configurations will be created automatically and
displayed on the right. All debug configurations are generated automatically and generally do not
need to be changed.
4.1.1 Main tab
In the Main tab, the project should have same name as the created project, and the name is
generated automatically. The C/C++ programs generally automatically search for elf files built in the
project. In this example, the Debug\xxxxx.elf is automatically filled in. If the project is not built in
advance and the elf file is not found, the Debug\${project_name}.elf will be automatically filled in.
The configurations also work when an elf file named after the project name is produced.
J-Link debug
The following configurations are needed for J-Link debug.
J-Link configuration
GDB configuration
SVD peripheral register configuration
You need to install the J-Link driver before using J-Link Debugging, and use the
“Segger_AT32MCU_AddOn” tool to import the AT32 MCU configuration , so that Segger tools can
identify the AT32 MCU.(You can download the “Segger_AT32MCU_AddOn” from the official
website.)
Select [Run] > [Debug Configurations…] to open the debug configurations dialog box. Double-click
GDB SEGGER J-Link Debugging, the J-Link debug configurations will be created automatically and
displayed on the right. All debug configurations are generated automatically and generally do not
need to be changed.
3. Select SVD Path for debug register description. You can use the svd file in keil. When AT32 keil
Packet is installed, the svd file can be automatically copied to keil directory.
Start debugging
Select the “AT32F403AVGT7 Debug” created in the previous step and click “Launch in ‘Debug’
mode” in the toolbar to start project debugging, as shown below.
The “Confirm Perspective Switch” dialog box pops up. Click “Switch” to switch to the Debugger
perspective, as shown below.
Start project debugging and switch to Debug perspective. In Debug perspective, users can perform
debugging functions, such as viewing variable values, expression values, peripheral registers, etc.,
as shown below.
click the download button ( ) in the toolbar to download the generated program to the device.
4.4.2 Erase
Select the item to be downloaded and click the erase button ( ) to perform erase operation to the
MCU Flash automatically.
5 ld linker
Every link is controlled by a linker script. The main purpose of the linker script is to describe how
the sections in the input files should be mapped into the output file, and to control the memory
layout of the output file. This section mainly introduces the use of GCC “*ld.” Linker (it is located in
the “ldscripts” file of the current project in AT32 IDE).
Basic concept
The “*.ld” linker combines objects and archive files, and relocate their data and bind symbolic
references. Generally, the last step in compiling a program is to run the “*.ld” linker. The linker
describes sections in the input files and how these sections are mapped into the output file, and the
memory layout of the output file.
5.1.1 Memory
Syntax:
MEMORY
{
Name [(attr)] : ORIGIN = origin, LENGTH = len
…
}
Note: The “attr” defines the attributes of a particular memory region. The valid attribute should be
made up of the following options.
R Read-only section
W Read/write section
X Executable section
A Allocatable section
I Initialized section
L Same as‘I’
! Invert the sense of any of the attributes that follow
Example:
/* Memories definition */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
SPIM (rx) : ORIGIN = 0x08400000, LENGTH = 16384K
}
Note:
“rx”: “FLASH” area can be read and executed, and the FLASH start address is “0x08000000”, size:
1024 KB.
“xrw”: “RAM” area can be read, written and executed, and the RAM start address is “0x20000000”,
size: 96 KB.
“rx”: “SPIM” area can be read and executed, and the SPIM s tart address is “0x08400000”, size:
16384 KB.
SECTIONS
{
Section [address] [(type)]:
{
[AT(Ima)]
[ALIGN(section_align) | ALIGN_WITH_INPUT]
[SUBALIGN(subsection_align)]
[constraint]
{
output-section-command
output-section-command
…
}
…
} [>region] [AT>Ima_region] [:phdr:phdr…] [=fillexp] [,]
…
}
/* Sections */
SECTIONS
{
/* The startup code goes first into FLASH */
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. =ALIGN(4)
} >FLASH
/* Initialized data sections goes into RAM, load LMA copy after code */
.data :
{
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start */
*(.data) /* .data sections */
*(.data*) /* .data* sections */
. = ALIGN(4);
_edata = .; /* define a global symbol at data end */
} >RAM AT> FLASH
}
Note: The LMA and VMA of “.isr_vector” are the same. For the “.data” with “>RAM AT> FLASH”, the
“RAM” address (“.data” section) is the VMA, and the FLASH address is the LMA. In this case, the
content of “.data” section is stored in the FLASH, and then loaded to the RAM when the program
runs.
Linker script
A linker script contains a series of commands. Each command is either a keyword (possibly
followed by arguments) or an assignment to a symbol. Commands are separated by semicolons “;”.
A complete “*.ld” linker generally contains an entry point, memory and sections.
5.2.1 Example of linker script
Here is an example of a simple linker script.
SECTIONS
{
. = 0x10000;
.text : {*(.text)}
. = 0x8000000;
.data : {*(.data)}
.bss : {*(.bss)}
}
/* Entry Point */
ENTRY(Reset_Handler)
Note: In AT32 projects, the default entry point is the “Reset_Handler” function.
Note: An error message displays when the “_estack” is greater than the “_Min_Stack_Size +
_Min_Heap_Size”.
PROVIDE
Syntax: PROVIDE(symbol = expression)
In some cases, it is desirable for a linker script to define a symbol only if it is referenced and is not
defined by any object included in the link.
HIDDEN
Syntax: HIDDEN(symbol = expression)
Usage: For the ELF target port, the symbol is hidden and not exported.
Example:
PROVIDE_HIDDEN
Syntax: PROVIDE _HIDDEN(symbol = expression)
Usage: It is used in the same way of PROVIDE, and it is the combination of PROVIDE and
HIDDEN.
Example:
KEEP
Usage: When link-time garbage collection is in use (‘—gc-sections’), the KEEP() is often used to
mark sections that should not be eliminated.
Example:
6 Common functions
Install and upgrade AT32 IDE plug-ins
Artery continues developing new functions and MCUs supporting AT32 IDE to improve user
experience. This section introduces how to install and upgrade AT32 IDE plug-ins online and offline.
AT32 IDE plug-ins repository address: https://www.arterytek.com/download/at32ide_repository
6.1.1 Online installation and upgrade
Search for the desired plug-ins in the AT32 IDE plug-ins repository. Click [Help]>[Install New
Software…] to open the Install Dialog. Copy the plug-ins repository address to the “Work with:”, and
then AT32 IDE automatically starts to analyze all plug-ins in the plugin repository and then list all
plug-ins. Tick the plug-ins to be installed or upgraded, and untick “Contact all update sites during
install to find required software”; then click “Next” and “Finish to install the selected plug-ins.
Click “Finish” to complete installation. Back to the AT32 IDE, there is an installation progress bar in
the lower right corner. Click “Progress” to view the installation progress. After the installation is
complete, the “Trust” dialog box will pop up. Click “Select All” and check “Always trust all content”.
Then, the “Always Trust Everything Configuration” dialog box pops up, and please click “Yes, I
Accept the Risk”. Go back to the “Trust” dialog box and click “Trust selected”, then the plug-in
upgrade is complete. The “Software Updates” dialog box pops up, and please click “Restart Now” to
restart AT32 IDE, as shown below.
If the plug-in has been installed, When the AT32 IDE starts, it will automatically detect whether the
plug-ins needs to be updated, or click [Help] > [Check for Updates] to perform the plug-ins update
detection. If a new version of the plug-in is detected, the “Available Updates” dialog box pops up,
listing all plug-ins that need to be updated.
Continue clicking “Next” and “Finish” to install the plug-ins.
The AT32 IDE will automatically analyze all the plug-ins in the project template zip package and
display them in the information list. Tick all items in the list and untick “Contact all update sites
during install to find required software”; then click “Next”, as shown below.
This list shows all the plug-ins that need to be installed. Click “Finish” to complete installation.
Language setting
Select [Help] > [Change Language] to open the “Language” dialog box. Select the desired language
and click “OK”. Then, the “Restart” dialog box pops up, and please click “Yes” to restart AT32 IDE.
Finally, the language is set successfully, as shown below.
Resources update
Click “Resources update ” button in the toolbar, and the following interface pops up, as shown
below.
The list in the dialog box displays the status of AT32 MCU BSP, where “Latest” represents the
current latest version, “Not Latest” indicates the current version is not the latest, and “Failed”
indicates updating failed.
For the “Not Latest”, tick the select box of this MCU, and then the “Update packages…” is available.
Click this button to automatically update BSP of the selected MCU. After successful updating, the
status becomes “Latest”. To delete the BSP, tick the MCU and then click the “Delete packages…”
button, and the BSP of this MCU is deleted.
To import local BSP package, select the MCU series and click “Import” in the toolbar, and then click
“Browse” in the pop-up “Import resource pack” (as shown in Figure 40) to select the BSP package;
Note: The OpenOCD upgade will overwrite all existing files. If you have made modifications to the
configuration files, please back them up before upgrading your OpenOCD version.
This section demos how to import a BSP mdk_v5 project into AT32 IDE.
MDK project directory:
AT32F423_Firmware_Library_V2.0.2\utilities\at32f423_boot_memory_ap_demo\read_write_boot_
memory\mdk_v5.
Right click (or click the [File]) in AT32 IDE project explorer window, click [Import] in the drop-down
menu and select “General->MDK5 Project into the Workspace” in the [Import] dialog, as shown
below.
Click [Browse…] to select the MCK projects (.uvprojx) to be imported, and the MDK project name is
filled in automatically in the “Project Name” (it can be modified by users as needed). Then, click
[Finish], and the MDK project is imported to AT32 IDE automatically and opened in the project
explorer, as shown below.
After the MDK project is imported successfully, a project directory named “at32_ide_proj” is created
in the sibling directory of the MDK project, as shown below.
The project explorer displays the project directory structure, as shown below.
After being imported, the MDK project can be compiled and debugged according to Section 3 and
Section 4.
7 FAQs
This section summarizes solutions to some common problems in use, which can be used as a
reference.
Configuration
1. Prompt information appears during compiling:
“Cannot run program “make”: Launching failed. Error: Program “make” not found in PATH”
Cause and solution: This is usually the case when the GCC Make is not configured properly. ARM
toolchain and GCC Make configuration paths are configured by default in AT32 IDE. If this prompt
information appears, it may be that the default configuration of GCC Make does not take effect.
In Windows system, the user needs to click on [Windows] -> [Preferences], and configure the
path as“${eclipse_home}/platform/tools/Build Tools/bin” in “Global Build Tools Path” of MCU
configuration. In addition, the Global Arm Toolchains Path is configured as
“${eclipse_home}/platform/tools/gcc-arm-none-eabi-10.3-2021.10/bin” by default.
In Linux system, it may be the case when GCC is not installed. In this case, the user needs to
set up GCC properly according to Section 2.2.2.
2. If you run the AT32 IDE after installing it for the first time, you need to download the BSP
firmware before creating the project. See 4.5.4 to download the BSP firmware and then create
the new project.
Debugging
1. Prompt information appears during debugging:
“Error: please select the matching algorithm
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for
GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected”
Cause and solution: Check if there are multiple AT-Link connections. If there are multiple AT-Link
connections, the MCU that needs to be debugged may not be found. If there is only one AT-Link
connection, check if the MCU is latched or if it is in a protected status.
Compilation
1. Error during compilation
Use GCC compiler to compile codes containing mathematical functions such as “sqrt()”, an error is
reported as below:
8 Revision history
Table 1. Document revision history
Date Version Revision note
1. Added OpenOCD online updating function;
2. Added the function of double click .project and .cproject file to run AT32 IDE
2024.10.30 V1.0.9
and automati import of the current project;
3. Added the function of auto filling in the device name while setting up J-Link.
2024.02.05 V1.0.8 1. Added description of ld linker.
2023.11.17 V1.0.7 1. Added importing MDK_V5 projects for compiling and debugging.
2023.10.23 V1.0.6 1. The AT32 MCU project template creation plug-in supports automatic updates.
2023.09.05 V1.0.5 1. Support for AT32A403A/AT32F402/AT32F405.
2023.05.26 V1.0.4 1. Added the description of J-Link debugger configuration.
1. Added BSP online and offline updating functions;
2. Added download and erase functions;
2022.11.07 V1.0.3 3. Customize the folder name when creating the project;
4. Added automatic configurations of MCU (1024KB/4096KB Flash) profiles in AT-
Link debugger.
2022.09.26 V1.0.2 1. Added available Linux system.
2022.08.10 V1.0.1 1. Added Section 5 FAQs.
2022.05.26 V1.0.0 1. Initial release.
Purchasers are solely responsible for the selection and use of ARTERY’s products and services; ARTERY assumes no liability for
purchasers’ selection or use of the products and the relevant services.
No license, express or implied, to any intellectual property right is granted by ARTERY herein regardless of the existence of any previous
representation in any forms. If any part of this document involves third party’s products or services, it does NOT imply that ARTERY
authorizes the use of the third party’s products or services, or permits any of the intellectual property, or guarantees any uses of the third
party’s products or services or intellectual property in any way.
Except as provided in ARTERY’s terms and conditions of sale for such products, ARTERY disclaims any express or implied warranty,
relating to use and/or sale of the products, including but not restricted to liability or warranties relating to merchantability, fitness for a
particular purpose (based on the corresponding legal situation in any unjudicial districts), or infringement of any patent, copyright, or other
intellectual property right.
ARTERY’s products are not designed for the following purposes, and thus not intended for the following uses: (A) Applications that h ave
specific requirements on safety, for example: life-support applications, active implant devices, or systems that have specific requirements
on product function safety; (B) Aviation applications; (C) Aerospace applications or environment; (D) Weapons, and/or (E) Oth er
applications that may cause injuries, deaths or property damages. Since ARTERY products are not intended for the above-mentioned
purposes, if purchasers apply ARTERY products to these purposes, purchasers are solely responsible for any consequences or ri sks
caused, even if any written notice is sent to ARTERY by purchasers; in addition, purchasers are solely responsible for the compliance with
all statutory and regulatory requirements regarding these uses.
Any inconsistency of the sold ARTERY products with the statement and/or technical features specification desc ribed in this document will
immediately cause the invalidity of any warranty granted by ARTERY products or services stated in this document by ARTERY, an d
ARTERY disclaims any responsibility in any form.