Sunteți pe pagina 1din 42

 

   

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   
   

AN-IDE-001 1 Ver 1.0


Telink IDE Quick Guide
Revision History 
Version  Major Changes  Date  Author 
0.1.0  Preliminary alpha release  2011‐9‐4  R&D 
0.2.0  Revision  2012‐4‐12  R&D 
0.3.0  Added flash programming  2012‐7‐9  R&D 
 
   

AN-IDE-001 2 Ver 1.0


Telink IDE Quick Guide
Table of Content 
1  The C Compiler and Assembler .............................................................................. 4 
1.1  Installation ....................................................................................................... 4 
1.2  The OS and environment ................................................................................. 4 
1.3  The Toolchain file folders and hierarchy ......................................................... 5 
2  The Eclipse IDE ........................................................................................................ 6 
2.1  Start the Project from SVN .............................................................................. 6 
2.2  Start from an Existing File System and Create Project .................................. 10 
2.3  Building the Project ........................................................................................ 21 
2.4  Building the Project Release Mode ................................................................ 23 
2.5  Working With SDK Sample Code .................................................................... 26 
2.5.1  Importing the SDK project into your work space ................................... 26 
2.5.2  Uploading firmware ................................................................................ 32 
2.5.3  Loading the Image using wtcdb debug / programming tool .................. 33 
2.6  Automatic Updates from Telink Update Site ................................................. 40 
 
   

AN-IDE-001 3 Ver 1.0


Telink IDE Quick Guide

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.     
   

AN-IDE-001 4 Ver 1.0


Telink IDE Quick Guide
 

1.3 The Toolchain file folders and hierarchy   
The default Telink SDK and IDE will be installed into 
 
C:\TelinkSDK     
 

   

AN-IDE-001 5 Ver 1.0


Telink IDE Quick Guide

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) 
 

 
 

AN-IDE-001 6 Ver 1.0


Telink IDE Quick Guide

 
 
Now create and add a new SVN URL repository location inside of the SVN explorer 
view. 
 

 
 

AN-IDE-001 7 Ver 1.0


Telink IDE Quick Guide

 
 

AN-IDE-001 8 Ver 1.0


Telink IDE Quick Guide

 
 
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 

bar    build icon.    The default mode is Debug mode but we suggest you start 


with the Release build since we will use Release mode only for almost the whole 
development process. 

AN-IDE-001 9 Ver 1.0


Telink IDE Quick Guide

 
 
 
 

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 10 Ver 1.0


Telink IDE Quick Guide

 
 

 
 
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.   
 

AN-IDE-001 12 Ver 1.0


Telink IDE Quick Guide

 
 
You will then see the new project showing on your project explorer panel. 
 
 

AN-IDE-001 13 Ver 1.0


Telink IDE Quick Guide

 
 
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. 
 

AN-IDE-001 14 Ver 1.0


Telink IDE Quick Guide

 
 
Select  File  System.  Navigate  the  folder selection  to  your  toolchain  sample  directory 
and import “coremark_ic”.   
 

AN-IDE-001 15 Ver 1.0


Telink IDE Quick Guide

  

AN-IDE-001 16 Ver 1.0


Telink IDE Quick Guide

 
 
 

AN-IDE-001 17 Ver 1.0


Telink IDE Quick Guide

 
 
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. 
 
 

AN-IDE-001 18 Ver 1.0


Telink IDE Quick Guide

AN-IDE-001 19 Ver 1.0


Telink IDE Quick Guide

 
 
You should see the sample codes are imported into your workspace folder.   
 

AN-IDE-001 20 Ver 1.0


Telink IDE Quick Guide

 
 
 

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.   
 

AN-IDE-001 21 Ver 1.0


Telink IDE Quick Guide

 
 
 
The  IDE  will  create  and  start  building  a  Debug  mode  image  for  you  (as  the  default 
mode).     
 

AN-IDE-001 22 Ver 1.0


Telink IDE Quick Guide

 
 
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.   
 

AN-IDE-001 23 Ver 1.0


Telink IDE Quick Guide

 
 
You can turn off the automatic build feature from the project menu by uncheck it.   
 

AN-IDE-001 24 Ver 1.0


Telink IDE Quick Guide

 
 
 
   

AN-IDE-001 25 Ver 1.0


Telink IDE Quick Guide

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. 

AN-IDE-001 26 Ver 1.0


Telink IDE Quick Guide

 
 
  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. 
 

AN-IDE-001 28 Ver 1.0


Telink IDE Quick Guide

 
 
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. 
 

AN-IDE-001 29 Ver 1.0


Telink IDE Quick Guide

 
 
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. 

AN-IDE-001 30 Ver 1.0


Telink IDE Quick Guide

 
   

AN-IDE-001 31 Ver 1.0


Telink IDE Quick Guide
 
2.5.2 Uploading firmware 
Now  we  finished  the  build  and  identified  the  flash  image  file.    It's  time  for  us  to 
upload. 
 
For this, you will need the Telink EVK OTP/Flash Programmer board (as shown) and 
your target sample board.    Your target board is a full function 2.4G RF board and it 
also comes with a RF dongle for 2.4G PC applications.   
 
 

  
 
   

AN-IDE-001 32 Ver 1.0


Telink IDE Quick Guide
 
First  we  need  to  tell  IDE  which  flash  image  we  are  using.  Our  SDK  project,  we  use 
boot.bin as the default flash image file name. There are cases that you dont need to 
fix this to load the software if your default flash image is not boot.bin. 
 

 
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. 
 

AN-IDE-001 33 Ver 1.0


Telink IDE Quick Guide

 
 
Let's upload the firmware for the RX target device first (the audio board).   
 

AN-IDE-001 34 Ver 1.0


Telink IDE Quick Guide

 
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) 
   

AN-IDE-001 35 Ver 1.0


Telink IDE Quick Guide
 
Now,  make  sure  your  target  board  is  connected  to  the  Programmer  board  and  the 
programmer is also connected to the PC using the mini USB cables included in your 
SDK kit. 
 
 First make sure the target board is powered on by continue holding the soft 
button while doing the programming 
 

 
   

AN-IDE-001 36 Ver 1.0


Telink IDE Quick Guide
 
Verify the SWS is connected ok, still holding the soft button. 
 

 
 
Now upload the firmware to the board using SWS interface. 
 

AN-IDE-001 37 Ver 1.0


Telink IDE Quick Guide

 
   

AN-IDE-001 38 Ver 1.0


Telink IDE Quick Guide
 
We should repeat this for the dongle. 
 
 Build the dongle firmware by using CONF_Dongle_AUDIO from IDE 
 
 Upload  the  dongle  firmware  using  the  same  method  you  did  for  the  audio 
target device.    (Note, you don't need to use another cable for the dongle) 
 

 
 
Make sure you burn the dongle using SWS again.   

AN-IDE-001 39 Ver 1.0


Telink IDE Quick Guide
 

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 
 

AN-IDE-001 40 Ver 1.0


Telink IDE Quick Guide

 
 
 
That’s it.    It will then update your IDE to the most recent version of the Telink IDE.   

AN-IDE-001 41 Ver 1.0

S-ar putea să vă placă și