Documente Academic
Documente Profesional
Documente Cultură
Quick Manual:
Telink 32‐bit MCU
Toolchains and SDK
AN‐TC32‐IDE‐001
TELINK SEMICONDUCTOR
Ver 0.3.0
2012/7/9
Keyword:
Toolchains, Compilers, Assembler, Linker, IDE, Eclipse
Brief:
The purpose of this quick guide is to describe the
general toolchains for Telink 32bit RISC MCU. This
includes the Eclipse based IDE and hardware
debugger. The tools are all Telink 32bit embedded
CPUs, this includes the touch panel controller and RF
and general purpose CPUs.
Telink IDE Quick Guide
Published by
Telink Semiconductor
3002 Dow Ave, Suite 220
Tustin, CA 92780, USA
© Telink Semiconductor
All Right Reserved
Legal Disclaimer
Telink Semiconductor reserves the right to make changes without further notice to
any products herein to improve reliability, function or design. Telink Semiconductor
disclaims any and all liability for any errors, inaccuracies or incompleteness contained
herein or in any other disclosure relating to any product.
Telink Semiconductor does not assume any liability arising out of the application or
use of any product or circuit described herein; neither does it convey any license
under its patent rights, nor the rights of others
The products shown herein are not designed for use in medical, life‐saving, or
life‐sustaining applications. Customers using or selling Telink Semiconductor products
not expressly indicated for use in such applications do so entirely at their own risk
and agree to fully indemnify Telink Semiconductor for any damages arising or
resulting from such use or sale.
Information:
For further information on the technology, product and business term, please
contact Telink Semiconductor Company (www.telink‐semi.com).
For sales or technical support, please send email to the address of:
sales@telink‐semi.com
support@telink‐semi.com
1 The C Compiler and Assembler
Telink TC32 32bit RISC compiler and tools are based on GNU C compiler and binutils
tools. It’s built on GCC‐4.5.1 and binutils‐2.20.
1.1 Installation
The installer comes with a self‐extracting EXE program. Telink toolchains and Eclipse
based IDE are installed under one folder, It’s recommended that you leave it to the
default setting under C:\TelinkSDK.
1.2 The OS and environment
Currently only Windows are supported at this point. We will continue to provide
toolchains for other platforms in the coming releases.
1.3 The Toolchain file folders and hierarchy
The default Telink SDK and IDE will be installed into
C:\TelinkSDK
2 The Eclipse IDE
The toolchains installation comes with Eclipse and plugins for TC32 based firmware
development. Java environment is included in the installation. It won’t affect any of
your existing java environments if any. It’s suggested that you go through one or
more of the sample files from within the IDE to familiar with the development
environment for Telink 32bit RISC.
You have two ways to start your TC32 projects.
Start your project from an existing TC32 project from SVN
Start your project from an existing C project or new project
2.1 Start the Project from SVN
To get things started, you will need to know your project SVN URL and the account in
hand.
First start up your TC32 IDE and select the SVN and open the SVN Perspective (on the
right hand side corner)
Now create and add a new SVN URL repository location inside of the SVN explorer
view.
Enter your URL, SVN account then you will see your SVN repository listed in your SVN
Repositories View. Now check out the whole project by right click on the URL.
Switch back to the C/C++ Perspective View then you will see the checked out source
code.
Now build the project by selecting the Project/Build Project menu or from the tool
2.2 Start from an Existing File System and Create Project
First select and open eclipse.exe from C:\tc32ide‐32\Eclipse\eclipse.exe or any other
folder where your TC32 toolchains are installed, you will see the startup IDE similar
to this example. Eclipse will ask you for a default workspace folder. Pick one that
you would remember where will you source code will end up with.
Now from within Project Explorer, right click to bring up the context menu so you can
create a new project. You can also do this from the menu bar File menu to create
your first project.
AN-IDE-001 11 Ver 1.0
Telink IDE Quick Guide
Now select the C project and type in a new project name. Select the TC32 Cross
Target Project since we want to create a project to build firmware for the Telink 32bit
RISC embedded MCU.
Click Next or Finish to create the project. In our case, we name the project to be
coremark since we want to show you how to create a sample benchmark project for
the TC32 MCU.
You will then see the new project showing on your project explorer panel.
Now that we have a project skeleton with some default settings and include folders
provided by the toolchains. Your next step will be importing the actual code from
the sample directory. This is normally under C:\tc32ide‐32\home\dev\samples
folder.
Select File System. Navigate the folder selection to your toolchain sample directory
and import “coremark_ic”.
Check Copy Projects into the workspace so you get a copy of the code. Select
coremark_ic project on your dialog left panel and import everything into your project
workspace.
You should see the sample codes are imported into your workspace folder.
2.3 Building the Project
Now that you successfully created and imported the sample project files into your
workspace, let’s build it.
Note that the sample project comes with a Makefile that you can build the project
from command lines, TC32 Eclipse IDE does not use the sample Makefile. Instead,
it will create project makefiles automatically in both Debug and Release mode for
you. We recommend that you used IDE to build your projects as the IDE takes care of
many things for you underneath.
Now let’s build it.
The IDE will create and start building a Debug mode image for you (as the default
mode).
Congratulation! You just created and built your first project for Telink 32bit RISC
program. Get ready for next step.
2.4 Building the Project Release Mode
Let’s play with the IDE to see what we can do about it. From the IDE tool bar, click on
the tool (the hammer icon) and switch it to Release mode. As you would notice,
once you select it, the IDE will automatically create and build the Release mode for
you. This is because we have the automatic build as the default.
You can turn off the automatic build feature from the project menu by uncheck it.
2.5 Working With SDK Sample Code
These SDK sample code are actually production ready code that you are allowed to
modify and customize them to fit into your actual final products.
2.5.1 Importing the SDK project into your work space
First thing you will do is to import the SDK code to start with. You need to create a
new work space.
Then you import your SDK project into the newly created workspace.
Importing the SDK project into the workspace.
AN-IDE-001 27 Ver 1.0
Telink IDE Quick Guide
Build the library first. There is only one mode for the library, the Release mode. Telink
compiler and debugging tools do not require the code to be compiled into Debugging
mode which makes the actual runtime performance identical to the development
code.
Next step will be try to modify and build your own projects.
High light the tl_[MCU]prj folder, where MCU can be 5320, 3520, and look the C/C++
Setting property.
Now you can clone, rename, delete the project configurations.
At this stage, we will use the existing projects. Now you can look at what does the
configuration does by looking at the Symbols (C Macros). This is where we define
how the project will be built.
Now go back to the IDE and then select an project configuration and build it.
If the build completed with no errors, you will see under folder named after the
project configuration name, there is one boot.bin file. Which is the flash binary that
you would need to upload it to the EVK kit that you received.
2.5.3 Loading the Image using wtcdb debug / programming tool
You can bring up the programmer with from the desktop short cut, if you have it
installed. Or simply click on the toolbar Telink Debugger icon from the IDE.
Let's upload the firmware for the RX target device first (the audio board).
Click on the [BIN...] button and navigate to the project binary output directory
(C:\TelinkSDK\SDK\cayenne\tl_5320prj\CONF_Ring_A350).
Also set the hardware debugging definition file (for later VCD timing debugging)
(C:\TelinkSDK\SDK\cayenne\tl_5320prj\proj\2in1_rx\rx_def.h)
Now upload the firmware to the board using SWS interface.
Make sure you burn the dongle using SWS again.
2.6 Automatic Updates from Telink Update Site
One of the nice things about Eclipse is the automatic update feature. You will be
able to get the most recent toolchain and Eclipse TC32 updates from our support
site.
‐ First select the Install New Software from the Help menu
‐ Enter the URL
http://www.telink‐us.com:8821/updatesite
That’s it. It will then update your IDE to the most recent version of the Telink IDE.