CoIDE User Guide

CoIDE User Guide

CoIDE User Guide

2013-01-21 V1.0 Completed

Website: http://www.coocox.org

Forum: http://forum.coocox.org

Technical: [email protected]

Market: [email protected]

1

Catalog

1 CoIDE Quick Start............................................................................................................... 5

2 General Introduction ....................................................................................................... 15

2.1

New Concepts ................................................................................................... 15

2.1.1

Terminology Note ............................................................................................. 15

2.1.2

CoIDE Features ................................................................................................. 15

2.2

Support list........................................................................................................ 17

2.2.1

Support Devices ................................................................................................ 17

2.2.2

Supported Adapters ......................................................................................... 19

2.3

Requirement for CoIDE ..................................................................................... 20

3 Preparation ...................................................................................................................... 21

3.1

Set GCC Compiler .............................................................................................. 21

3.1.1

ARM GCC Introduction ..................................................................................... 21

3.1.2

Set GCC in CoIDE ............................................................................................... 22

4 User Interface .................................................................................................................. 24

4.1

Menus and Actions ........................................................................................... 24

4.1.1

File Menu Actions ............................................................................................. 24

4.1.2

Edit Menu Actions ............................................................................................ 24

4.1.3

View Menu Actions ........................................................................................... 24

4.1.4

Project Menu Actions ....................................................................................... 25

4.1.5

Flash Menu Actions .......................................................................................... 25

4.1.6

Debug Menu Actions ........................................................................................ 25

4.1.7

Search Menu Actions ........................................................................................ 26

4.1.8

Help Menu Actions ........................................................................................... 26

4.2

Toolbar .............................................................................................................. 27

4.2.1

Editor Toolbar Actions ...................................................................................... 27

4.2.2

Debug Toolbar Actions ..................................................................................... 28

4.3

Editor View ....................................................................................................... 29

4.3.1

Welcome ........................................................................................................... 29

4.3.2

Breakpoint ........................................................................................................ 30

4.3.3

Components ..................................................................................................... 31

4.3.4

Console ............................................................................................................. 31

2

4.3.5

Configuration .................................................................................................... 33

4.3.6

Editor ................................................................................................................ 37

4.3.7

Help ................................................................................................................... 37

4.3.8

Help Contents ................................................................................................... 38

4.3.9

Outline .............................................................................................................. 39

4.3.10

Peripheral ......................................................................................................... 40

4.3.11

Project Explorer ................................................................................................ 41

4.3.12

Repository ......................................................................................................... 42

4.3.13

Search ............................................................................................................... 42

4.4

Debug View ....................................................................................................... 44

4.4.1

Breakpoints ....................................................................................................... 44

4.4.2

Debug ................................................................................................................ 45

4.4.3

Disassembly ...................................................................................................... 47

4.4.4

Expressions ....................................................................................................... 49

4.4.5

Memory ............................................................................................................ 51

4.4.6

Peripherals view (CoAssistant) ......................................................................... 52

4.4.7

Registers ........................................................................................................... 54

4.4.8

Semihosting view .............................................................................................. 55

4.4.9

Variables ........................................................................................................... 56

5 Project Management ....................................................................................................... 59

5.1

Create Project ................................................................................................... 59

5.1.1

Create Project by Chip Model ........................................................................... 59

5.1.2

Create Project by Board Model ........................................................................ 64

5.2

Manage Target/Groups/Files and Switch Chip ................................................. 69

5.2.1

Target List Management in the Multi-configuration ........................................ 69

5.3

Project configuration ........................................................................................ 73

5.3.1

Change device ................................................................................................... 73

5.3.2

Compile configuration ...................................................................................... 75

5.3.3

Link configuration ............................................................................................. 76

5.3.4

Output configuration ........................................................................................ 78

5.3.5

User configuration ............................................................................................ 79

5.3.6

Debugger configuration .................................................................................... 80

3

5.3.7

Download configuration ................................................................................... 81

5.4

Build project ..................................................................................................... 82

5.5

Open project ..................................................................................................... 83

6 Debug .............................................................................................................................. 85

6.1

Introduction ...................................................................................................... 85

6.1.1

Enter debug mode ............................................................................................ 85

6.1.2

Debug control ................................................................................................... 85

6.1.3

Set breakpoints ................................................................................................. 85

6.1.4

Step mode ......................................................................................................... 85

6.1.5

Debug Example ................................................................................................. 86

6.2

How to use debug views ................................................................................... 89

6.2.1

Disassembly view .............................................................................................. 89

6.2.2

Memory view .................................................................................................... 90

6.2.3

Variables view ................................................................................................... 91

7 Components, Examples and Boards ................................................................................ 93

7.1

Components ..................................................................................................... 93

7.1.1

Add Components .............................................................................................. 93

7.1.2

Refresh and Update Components .................................................................... 97

7.1.3

Upload Components ....................................................................................... 100

7.1.4

Modify or Delete Components ....................................................................... 116

7.2

Examples ......................................................................................................... 119

7.2.1

View examples ............................................................................................... 119

7.2.2

Adding code snippet ....................................................................................... 123

7.2.3

Upload Examples ............................................................................................ 125

7.2.4

Modify an Example ......................................................................................... 131

7.3

Board .............................................................................................................. 133

7.3.1

Refresh Board List ........................................................................................... 135

7.3.2

Update a Board ............................................................................................... 135

7.3.3

Upload a Board ............................................................................................... 136

7.3.4

Modify a Board ............................................................................................... 142

4

1 CoIDE Quick Start

1. Launch CoIDE, select “Browse in Repository”

2. Select the manufacturer, e.g. Freescale.

5

3. Select your target chip, e.g. MKL05Z32VFM4. The Help view on the right side of CoIDE will show corresponding information of the chip.

4. Check/Select the components which you want to use, e.g. xGPIO component. You will be prompted to create a new project.

6

5. After clicking "Yes", CoIDE will pop up a wizard window. Input project name. You can also modify the Project Path.

6. After clicking "Finish", CoIDE will create a project for you, containing manually-selected component code in step 4 and associated components will be automatically selected and included (e.g. the startup component), as well as a main.c file.

7

7. In the Repository view, click xGPIO component and the detailed description of xGPIO component will be displayed in the Help view.

8. The Components view shows all selected components and the number of examples for each component. Click a component and its Example window will popup.

8

9. Click "view" to view the example (e.g. Blinky) and “add” to add it to your project.

10. Click "Yes" to confirm adding the example to the default path.

9

11. CoIDE will add the Blinky.c file to the project, and the Blinky function to the main function.

12. Click the “Build” button to compile and link the program.

10

13. Click the “Configuration” button to open the configuration view.

14. In the “Debugger” tab, select “CMSIS-DAP” as the hardware adapter.

11

15. Click the “Download” button to download code to flash.

16. To start debugging, click on the “Debug” icon or press “Ctrl+F5”.

12

17. If debugging is launched successfully, CoIDE will enter the debug mode.

18. Other debug windows can be added by simply selecting them from the View menu.

13

19. Set breakpoints in the C code window or the Disassembly window.

20. Use the debug functions like single stepping via the tool bar or debug menu.

14

2 General Introduction

CoIDE is a new, free and highly integrated software development environment for ARM

Cortex MCU based microcontrollers, which includes all the tools necessary to develop highquality software solutions in a timely and cost effective manner.

2.1 New Concepts

CoIDE consists of a component-based network platform and an Eclipse-based development environment. The component-based network platform can quickly obtain resources to build applications, share your resources and exchange ideas. The Eclipse-based development environment provides many features for code editing, code browsing, compiling, linking, debugging, project management, etc.

Features:

Free to use

Full functional IDE

Component-oriented development platform

Internet-based, efficient integration of network resources

Integrates CoOS (Real-Time Operating System)

Peripheral registers

2.1.1 Terminology Note

2.1.1.1 Component

In CoIDE, any reusable code can be called as a component, including OS, drivers, examples, middle layer software etc. Each component has its corresponding code snippets, usage, documentation and comments.

2.1.1.2 Dependence

When a component is selected, CoIDE automatically selects the required dependent components required for compiling or executing the program.

2.1.1.3 Code Snippet

Code Snippet (or example code) is an extension of a component. If the component is objectoriented, the code snippet will be application-oriented. For example, a PIO driver can be known as a component, a function using PIO driver to achieve LED flashing can be known as a code snippet. The code snippet is generally very short, but the features are not restricted.

It can be automatically inserted into the code.

2.1.2 CoIDE Features

CoIDE can be used for code editing, code browsing, compiling, linking, debugging and project management; it also can be used to obtain components, share components and to exchange ideas.

2.1.2.1 Component Network

Component Network contains a large amount of free components. The components are provided by CooCox and CooCox users. CooCox tools include a RTOS, flash manager,

15

embedded database, protocol stack and other components, which are all free. Everyone can use these components and upload their own components.

2.1.2.2 Component Oriented Programming

In embedded application development, if there is no suitable libraries, development work will become very complicated. Once you have the suitable libraries, anything will be manipulated in your hands. CooCox CoIDE Component Network contains a large amount of free components, users can choose suitable components according to your own needs, and use the component code snippets to build application will become more quickly. With a large number of components and detailed component documentation, programming will be as simple as building block.

2.1.2.3 Component Documentation

Detailed documentation (displayed in the Help View) is available for each component making it extremely easy for users with their development. This includes component description, component dependency relationship, component source files, usage of the component, comments etc. CoIDE automatically generates documentation for source files.

Tip: having the code comments according to Doxygen standard will help generate detailed documentation.

2.1.2.4 Interaction

CooCox CoIDE, provides powerful interaction between the various elements such as the chip, component, peripheral, register, code snippet and more. Users can even ask questions directly from within the environment, making it easy to address any problems encountered in the development process.

2.1.2.5 Development Environment

CoIDE is based on the Eclipse development platform, and has the following features:

Integrated CDT editor: A full-featured editor to edit and browse the code

Integrated GCC ARM Embedded: Using gcc tool chain, which is efficient and stable.

A clear interface: Menus and toolbar are simple, clear and easy to use.

GUI Setting: Dialogs for all settings.

16

2.2 Support list

2.2.1 Support Devices

The CooCox CoIDE mainly supports ARM Cortex-M based devices. Until now, CooCox has supported Cortex-M4, Cortex-M3, Cortex-M0 and Cortex-M0+ chips from Atmel, Energy

Micro, Freescale, Holtek, NXP, Nuvoton, ST and TI. For the latest support list, please visit: http://www.coocox.org/CooCox_CoIDE.htm

 Atmel:

AT91SAM3U4E AT91SAM3U4C

AT91SAM3U2E AT91SAM3U2C

AT91SAM3U1E AT91SAM3U1C

 Energy Micro:

EFM32G200F16 EFM32G200F32 EFM32G200F64

EFM32G210F128

EFM32G230F128 EFM32G230F32 EFM32G230F64

EFM32G280F128 EFM32G280F32 EFM32G280F64

EFM32G290F128 EFM32G290F32 EFM32G290F64

EFM32G840F128 EFM32G840F64 EFM32G840F32

EFM32G880F128 EFM32G880F64 EFM32G880F32

EFM32G890F128 EFM32G890F64 EFM32G890F32

 Freescale :

MKL04Z16VFK4, MKL04Z16VFM4, MKL04Z16VLC4, MKL04Z16VLF4, MKL04Z32VFK4,

MKL04Z32VFM4, MKL04Z32VLC4, MKL04Z32VLF4, MKL04Z8VFK4, MKL04Z8VFM4,

MKL04Z8VLC4

MKL05Z16VFK4, MKL05Z16VFM4, MKL05Z16VLC4, MKL05Z16VLF4, MKL05Z32VFK4,

MKL05Z32VFM4, MKL05Z32VLC4, MKL05Z32VLF4, MKL05Z8VFK4, MKL05Z8VFM4,

MKL05Z8VLC4

MKL14Z32VFM4, MKL14Z32VFT4, MKL14Z32VLH4, MKL14Z32VLK4,

MKL14Z64VFM4, MKL14Z64VFT4, MKL14Z64VLH4, MKL14Z64VLK4

MKL15Z128VFM4, MKL15Z128VFT4, MKL15Z128VLH4, MKL15Z128VLK4,

MKL15Z32VFM4, MKL15Z32VFT4, MKL15Z32VLH4, MKL15Z32VLK4,

MKL15Z64VFM4, MKL15Z64VFT4, MKL15Z64VLH4, MKL15Z64VLK4

MKL24Z32VFM4, MKL24Z32VFT4, MKL24Z32VLH4, MKL24Z32VLK4,

MKL24Z64VFM4, MKL24Z64VFT4, MKL24Z64VLH4, MKL24Z64VLK4

MKL25Z128VFM4, MKL25Z128VFT4, MKL25Z128VLH4, MKL25Z128VLK4,

MKL25Z32VFM4, MKL25Z32VFT4, MKL25Z32VLH4, MKL25Z32VLK4,

MKL25Z64VFM4, MKL25Z64VFT4, MKL25Z64VLH4, MKL25Z64VLK4

Holtek:

HT32F1251, HT32F1251B, HT32F1252, HT32F1253

HT32F1755, HT32F1765, HT32F2755

NXP:

LPC1111x101 LPC1111x201 LPC1112x101 LPC1112x201

LPC1113x201 LPC1113x301 LPC1114x201 LPC1114x301

LPC11C14x301 LPC11C12x301

17

LPC1224x101 LPC1224x121 LPC1225x301 LPC1225x321 LPC1226x301 LPC122

7x301

LPC1311 LPC1313 LPC1342 LPC1343

LPC1751 LPC1752 LPC1754 LPC1756 LPC1758 LPC1759

LPC1763 LPC1764 LPC1765 LPC1766 LPC1767 LPC1768 LPC1769

Nuvoton:

NUC100LC1BN, NUC100LD1BN, NUC100LD2BN, NUC100RC1BN, NUC100RD1BN,

NUC100RD2BN

NUC100LD3AN, NUC100LE3AN, NUC100RD3AN, NUC100RE3AN, NUC100VD2AN,

NUC100VD3AN, NUC100VE3AN

NUC120LC1BN, NUC120LD1BN, NUC120LD2BN, NUC120RC1BN, NUC120RD1BN,

NUC120RD2BN

NUC120LD3AN, NUC120LE3AN, NUC120RD3AN, NUC120RE3AN, NUC120VD2AN,

NUC120VD3AN, NUC120VE3AN

NUC122LC1AN, NUC122LD2AN, NUC122SC1AN, NUC122SD2AN, NUC122ZC1AN,

NUC122ZD2AN

NUC130LC1CN, NUC130LD2CN, NUC130LE3CN, NUC130RC1CN, NUC130RD2CN,

NUC130RE3CN, NUC130VE3CN

NUC140LC1CN, NUC140LD2CN, NUC140LE3CN, NUC140RC1CN, NUC140RD2CN,

NUC140RE3CN, NUC140VE3CN

M0516LBN, M0516ZBN, M052LBN, M052ZBN, M054LBN, M054ZBN, M058LBN,

M058ZBN

Mini51LAN, Mini51ZAN, Mini52LAN, Mini52ZAN, Mini54LAN, Mini54ZAN

NANO100KC2BN, NANO100KD2BN, NANO100KD3BN, NANO100KE3BN,

NANO100LC2BN, NANO100LD2BN, NANO100LD3BN, NANO100LE3BN,

NANO100SC2BN, NANO100SD2BN, ANO100SD3BN, NANO100SE3BN

NANO110KC2BN, NANO110KD2BN, NANO110KD3BN, NANO110KE3BN,

NANO110SC2BN, NANO110SD2BN, NANO110SD3BN, NANO110SE3BN

NANO120KC2BN, NANO120KD2BN, NANO120KD3BN, NANO120KE3BN,

NANO120LC2BN, NANO120LD2BN, NANO120LD3BN, NANO120LE3BN,

NANO120SC2BN, NANO120SD2BN, NANO120SD3BN, NANO120SE3BN

NANO130KC2BN, NANO130KD2BN, NANO130KD3BN, NANO130KE3BN,

NANO130SC2BN, NANO130SD2BN, NANO130SD3BN, NANO130SE3BN

ST

STM32F050C4, STM32F050C6, STM32F051C4, STM32F051C6, STM32F051C8,

STM32F051K4, STM32F051K6, STM32F051K8, STM32F051R4, STM32F051R6

STM32F051R8,

STM32F100C4, STM32F100C6, STM32F100C8, STM32F100CB,

STM32F100R4, STM32F100R6, STM32F100R8, STM32F100RB, STM32F100RC,

STM32F100RD, STM32F100RE,

STM32F100V8, STM32F100VB, STM32F100VC, STM32F100VD, STM32F100VE,

STM32F100ZC, STM32F100ZD, STM32F100ZE,

STM32F101C4, STM32F101C6, STM32F101C8, STM32F101CB,

STM32F101R4, STM32F101R6, STM32F101R8, STM32F101RB, STM32F101RC,

STM32F101RD, STM32F101RE, STM32F101RF,

18

STM32F101T4, STM32F101T6, STM32F101T8, STM32F101TB,

STM32F101V8, STM32F101VB, STM32F101VC, STM32F101VD, STM32F101VE,

STM32F101VF, STM32F101VG,

STM32F101ZC, STM32F101ZD, STM32F101ZE,

STM32F102C4, STM32F102C6, STM32F102C8, STM32F102CB,

STM32F102R4, STM32F102R6, STM32F102R8, STM32F102RB,

STM32F103C4, STM32F103C6, STM32F103C8, STM32F103CB,

STM32F103R4, STM32F103R6, STM32F103R8, STM32F103RB, STM32F103RC,

STM32F103RD, STM32F103RE, STM32F103RF, STM32F103RG,

STM32F103T4, STM32F103T6, STM32F103T8, STM32F103TB,

STM32F103V8, STM32F103VB, STM32F103VC, STM32F103VD, STM32F103VE,

STM32F103VF, STM32F103VG,

STM32F103ZC, STM32F103ZD, STM32F103ZE, STM32F103ZF, STM32F103ZG,

STM32F105R8, STM32F105RB, STM32F105RC, STM32F105V8, STM32F105VB,

STM32F105VC,

STM32F107RB, STM32F107RC, STM32F107VB, STM32F107VC

STM32F405RG, STM32F407IG, STM32F407VG, STM32F407ZG, STM32F415RG,

STM32F417VE

TI

LM3S102 LM3S316 LM3S601 LM3S617 LM3S811 LM3S818

LM3S1958 LM3S1968

LM3S2110 LM3S2276 LM3S2776 LM3S2793 LM3S2965 LM3S2B93

LM3S3748 LM3S3W26

LM3S5749 LM3S5B91

LM3S6432 LM3S6537 LM3S6610 LM3S6911 LM3S6918 LM3S6965

LM3S8962 LM3S8971

LM3S9792 LM3S9B90 LM3S9B92 LM3S9B96 LM3S9L97

2.2.2 Supported Adapters

List of debug adapters, supported by CoIDE

Debugging Adapter

Colink

CoLinkEx

Available Devices

Atmel, TI, NXP, ST

Atmel, Energy Micro, Freescale , TI, NXP,

Nuvoton, ST, Holtek

PC USB Driver

Colink Driver

CoLinkEx Driver

Nu-Link, Nu-Link-Me or

Nu-Link-pro

FTDI devices

J-Link( How to use )

ST-Link or ST-Link/V2

e-link32

Open-SDA

Nuvoton

Atmel, TI, NXP, ST

Atmel, Energy Micro, TI, NXP, ST

ST

Holtek

Freescale

Nu-Link Driver

FTDI Driver

J-Link Driver

ST-Link/V2

Driver e-link32 Driver

19

2.3 Requirement for CoIDE

System requirements:

Windows XP SP3/Windows Vista/Windows 7

Hardware requirements:

Debug adapter such as CoLinkEx, Open-SDA, etc.

Software requirements:

GCC ARM Embedded ( see: Set GCC Compiler )

Install the related driver for the adapter you used

20

3 Preparation

3.1 Set GCC Compiler

Before you use CoIDE to start your project, you need to configure the GCC compiler and debugger.

It is recommended to use the ARM GCC compiler. For more details about ARM GCC, please click here . In addition, you can also choose other GCC compilers such as CodeSourcery GCC.

3.1.1 ARM GCC Introduction

Features:

All GCC 4.7 features, plus latest mainline features

Cortex-M0/M0+/M1/M3/M4 support

Cortex-M4 with hard float multilib support

Fixed point fraction support

Nano C Library support

Download link:

https://launchpad.net/gcc-arm-embedded/+download

Note:

As CoIDE supports different GCC compilers, you need to pay attention to the following points when you switch between the compilers:

The different compilers have different C libraries, for example: ARM GCC has a base C

Library, Nano C library Semihosting Library and a Retarget Library. However,

CodeSourcery GCC only has the base C Library. See: Project Configuration

ARM GCC and CodeSourcery GCC use different link.ld when they compile the same project. CoIDE will generate different link.ld when you create the project, so it is

strongly recommended of you to set the GCC compiler before you start.

If you want to use ARM GCC to compiler the project you created under CodeSourcery

GCC, you need to delete the Build.xml, link.ld, memory.ld. Then check a component

and reconfigure the project after setting the GCC.

In CoIDE 1.7.0 or higher, we support the ARM GCC 4.7 version, which provide a Nano C library for Cortex M series.

21

3.1.2 Set GCC in CoIDE

1. After launching the CooCox CoIDE, click "Select Toolchain Path" under the Project menu.

2. Click the Browse button, select the folder that contains the arm-none-eabi-gcc.exe and the other GCC execute files.

22

3. For example, select the bin folder and click OK to save the setting.

23

4 User Interface

4.1 Menus and Actions

4.1.1 File Menu Actions

Name Description Shortcut

New File Create a new file. Ctrl + Shift + N

Open File… Open a file from the file system in the Editor view.

Save

Save the content of the current editor. Disabled if the editor does not contain unsaved changes.

Ctrl + S

Save As... Save the content of the current editor under a new name.

Save All

Save the content of all editors with unsaved changes.

Disabled if no editor contains unsaved changes.

Ctrl + Shift + S

Exit Exit CoIDE.

4.1.2 Edit Menu Actions

Name

Undo Undo your operations.

Description

Cut

Copy

Cut a code snippet or a file.

Copy a code snippet or a file.

Paste Paste the code snippet or a file to a place.

4.1.3 View Menu Actions

Shortcut

Ctrl + Z

Ctrl + X

Ctrl + C

Ctrl + V

Name

Repository

Configuration

Description

Open Repository View.

Open the current project configuration page (Open builder.xml of the current project in Editor).

Open Project View Project

Components Open component platform

Help Open Help View.

Outline

Peripherals

Breakpoints

Open Outline View.

Open Peripherals View.

Open Breakpoints View.

Shortcut

24

Default layout Resume to the default layout.

4.1.4 Project Menu Actions

Name Description

New Project Create a new Project and close the current project.

Open Project... Show a dialog that can be used to select an existing project.

Shortcut

Close Project Close the current project.

Select

Toolchain path

Select the GCC Toolchain you want to use.

Build

Build the currently selected project. This is an incremental build, meaning that the builder analyzes the changes since the last time of build and minimizes the number of changed files.

F7

Rebuild Rebuild all files of the current project. Ctrl + R

Clean Clean the intermediate files that generated by building.

Upload

Component

Upload Board

Open the Login dialog box, you can upload Component after login with CooCox account.

You can upload development board after login with CooCox account.

Upload

Example

You can upload component examples after login with CooCox account.

4.1.5 Flash Menu Actions

Name Description

Program Download Download program to Flash.

Flash Erase Erase Flash.

4.1.6 Debug Menu Actions

Shortcut

Name

Debug

Toggle Breakpoint

Description

To debug the current project.

To set a breakpoint at the current line.

Toggle Line Breakpoint To set a breakpoint at one line in the function.

Toggle Method Breakpoint To set a breakpoint at the entry of current function.

Toggle Watch Breakpoint To set a Watch Breakpoint.

Skip All Breakpoints Skip all the Breakpoints when debugging.

Shortcut

Ctrl+F5

Ctrl +Shift+ B

25

Remove All Breakpoints Delete all the Breakpoints.

Breakpoint Type Breakpoint Type

4.1.7 Search Menu Actions

Name

Search...

Description

Execute a C/C++ or file search.

File... Execute a file search.

C/C++ … Execute a C/C++ search.

4.1.8 Help Menu Actions

Shortcut

Ctrl + H

Name

Welcome

Description

Open the Welcome view.

Help Contents CoIDE Users' Guide.

About CoIDE Display CoIDE version number and license information.

Shortcut

26

4.2 Toolbar

4.2.1 Editor Toolbar Actions

Icons Name

New Project

Description

Create a new Project and close the current project.

Create New File Create a new file.

Save

Build

Rebuild

Start Debug.

Save the content of the current editor. Disabled if the there is no changed.

Build the currently selected project. This is an incremental build, meaning that the builder analyzes the changes since the last time of build and minimizes the number of changed files.

Rebuild all files of the current project.

Debug the current project.

Download Code to Flash

Flash Erase

Download program to flash.

Erase the full chip.

Configuration Configure the project.

Target Manage Manage the Targets in the project

Repository

Welcome

Open Repository View.

Open Welcome View

Open Element Open the Search dialog box.

Shortcut

Ctrl + S

F7

Ctrl + R

Ctrl + F5

Ctrl +Shift +T

Search Open the Search dialog box. Ctrl + H

Toggle Mark

Occurrences

Turns mark occurrences on and off in the C/C++ editor.

Next Annotation Go to the next annotation.

Previous

Annotation

Go to the previous annotation.

Last Edit

Location

Back to...

Go to the location where you have modified last time.

Go back to the previous position.

Alt+Shift+0

Ctrl +.

Ctrl + ,

Ctrl + Q

Alt + Left

Forward to... Forward to next position. Alt + Right

27

4.2.2 Debug Toolbar Actions

Icons Name Description

Instruction Stepping

Mode

Select the instruction stepping mode command to step the instruction.

Shortcut

Reset CPU

Run

Suspend

Terminate

Step Into

Step Over

Step Out

Select the Reset command to reset the debugging.

Select the Run command to resume execution of the currently suspended debug target.

Select the Suspend command to halt execution of the currently selected thread in a debug target.

Ends the selected debug session and/or process.

Select to execute the current line, including any routines, and proceed to the next statement.

Select to execute the current line, following execution inside a routine.

Select to continue execution to the end of the current routine, then follow execution to the routine's caller.

F5

F9

Ctrl + F5

F11

F10

Ctrl + F11

Run To Line Select to continue execution to current line. Ctrl + R

Open Element

Search

Open the Search dialog box.

Open the Search dialog box.

Ctrl +Shift +T

Ctrl + H

Toggle Mark

Occurrences

Last Edit Location

Turns mark occurrences on and off in the

C/C++ editor.

Next Annotation Go to the next annotation.

Previous Annotation Go to the previous annotation.

Go to the location where you have modified last time.

Back to...

Forward to...

Go back to the previous position.

Forward to next position.

Alt+Shift+0

Ctrl +.

Ctrl + ,

Ctrl + Q

Alt + Left

Alt + Right

28

4.3 Editor View

4.3.1 Welcome

29

When you launch CoIDE for the first time, you could see the welcome page.

The welcome page is a convenient entry for “Browse in Repository”, “Create a New Project”,

“Open a Project”, refer to “User Guide” and go to “Forum”.

4.3.2 Breakpoint

This view shows the information of breakpoints set by user in the code.

30

4.3.3 Components

This view displays all the components of the current project selection. Clicking on a component in this view will have:

The Help view display the properties of the clicked component, such as the component source files, source files documents, dependent components, usage and comments.

The Code Snippet View displays all code snippets of the component.

The Project View highlights the component source files.

4.3.4 Console

This view shows the output of the execution of your program and enables you to enter input for the program.

Console View Toolbar:

Icon Command

Pin Console

Display Selected Console

Description

Force the Console view to remain on top of other views in the window area.

If multiple consoles are open, you can select the one to display from a list.

Open Console Open new console view.

Clear the console. Clear Console

Scroll Lock

Show Console When

Standard Out Changes

Toggle the Scroll Lock.

Show console when standard out changes.

31

Show Console When

Standard Error Changes

Show console when standard error changes.

32

4.3.5 Configuration

Click the Configuration button to enter the configuration view.

The Configuration view is split into seven tabs that contain the configuration for the project.

They are Device, Compile, Link, Output, User, Debugger and Download.

4.3.5.1 Device configuration

33

4.3.5.2 Compile configuration

4.3.5.3 Link configuration

34

4.3.5.4 Output configuration

4.3.5.5 User configuration

35

4.3.5.6 Debug configuration

4.3.5.7 Download configuration

36

4.3.6 Editor

The C/C++ editor provides specialized features for editing C/C++ related files.

The most common way to invoke the C/C++ editor is to open a file from the Project Explorer by clicking the file (single or double-click depending on the user preferences).

The C/C++ editor only provides context menu (right click your mouse in the editor view, the context menu will appear) and key binding actions.

4.3.7 Help

This view displays all information about the selected component including:

1. Component name, overview and other information

37

2. API Reference, the reference of the APIs, which link to the Doxygen Documents generated by CoIDE.

3. Source files: Source files of the component.

4. Dependency: Other components depended by the component.

4.3.8 Help Contents

The Help Menu provides contents for help with the features and functionality of the CoIDE.

Toolbar

Icon Name

Go Back

Description

Go back to the previous position.

Availability

Toolbar

Go Forward to Forward to the next position. Toolbar

Home Go to the home page of the Help content. Toolbar

Show in table of content

Show the page position in the table of content view.

Bookmark Document Add a bookmark.

Toolbar

Toolbar

Print Page

Print Topics

Print the current page.

Print the topics.

Toolbar

Context menu

Search Topics

Collapse All

Search the topics.

Collapse all the topics.

Context menu

Context menu

Link with contents Link with the contents. Context menu

38

Show Result

Categories

Show Result

Description

Delete Selected

Bookmark

Show the categories of the search results.

Show the description of the search results.

Delete the selected bookmark.

Delete All Bookmark Delete the entire bookmark.

4.3.9 Outline

Search Results

View

Search Results

View

Bookmark View

Bookmark View

The Outline view will show the outline when you open a source file in the edit view. It can show all the includes, definitions, macros, functions in the source file you opened.

You can click the icons or the characters behind to go to the related values in the edit view.

Outline view toolbar icons:

The table below lists the icons displayed in the Outline view toolbar.

Icon Description

Sort items alphabetically

Icon

Filters…

Description

Hide Fields Link With Editor

Hide Static Members Group Includes

Hide Non-Public Members Group Macros

Hide Inactive Elements Group Methods

Outline view menu

Outline view icons:

The table below lists the icons displayed in the Outline view.

Group Namespaces

Icon Description Icon Description

Class Include

Namespace Method private

39

Macro Definition

Enum

Enumerator

Variable

Field private

Field protected

Field public

4.3.10 Peripheral

Method protected

Method public

Struct

Type definition

Union

Function

This view shows the information of peripheral register.

Click on the corresponding register to get the register detailed information view:

40

4.3.11 Project Explorer

This view displays all files of the file system under your project directory, including C source files (*.c, *.h), assembly source files

(*.s), project configuration files (build.xml), linker script files

(*.ld), library files (*.a), etc. In this view you could do the following operations:

Open files in the editor view

Open project configuration interface

Close the current project

Create new projects, files, or folders

Manage existing files (copy, paste, delete, move or rename)

41

4.3.12 Repository

This view displays all available components in the project. The “√” before the component shows this component has been added to the project. By checking or unchecking the “√” before components to add or delete the components.

4.3.13 Search

The Search view only appears after you have searched something in the project.

The type of the selected C/C++ element defines which search context menus are available.

Search view Toolbar:

Icon Command Description

Next Navigate to the next search result.

Previous

Remove the Selected

Matches

Remove All Matches

Navigate to the previous search result.

Removes user selected matches from the search console.

Clear the search console.

42

Run the Current Search

Again

Terminate

Run the current search again.

Terminate the current search.

Show Previous Searches

Pin the Search View

Menu

Show the list of previously runs searching, which can be re-selected.

Force the search view to remain on top of other views in the window area.

List two selectable view layouts for search results: Flat and Hierarchical.

Minimize Console Minimize the Console view.

Maximize Console Maximize the Console view.

43

4.4 Debug View

4.4.1 Breakpoints

The Breakpoints View lists all the breakpoints you have set in your workspace. Up to six breakpoints can be toggled if you are debugging in flash with Cortex-M3 series' chips, for

Cortex-M0, the number is four. Otherwise, warnings will be presented at runtime.

You can double-click a breakpoint to find its location in the editor (if applicable). You can also enable or disable breakpoints, delete them, add new ones.

The commands available in the Breakpoints View are listed below.

Command Name

Remove Selected

Breakpoints

Remove All

Breakpoints

Description

Only remove the selected breakpoint(s).

Remove all breakpoints.

Availability

Context menu and view action

Context menu and view action

Show Breakpoints

Supported by

Selected Target

Display the breakpoints supported by the selected target board.

View action

Go to File

Skip All

Expand All

Collapse All

Link with View

Go to the corresponding location of the breakpoint in the java editor.

Context menu and view action

Set all breakpoints to be skipped. View action

Expand all the sub items in the view. View action

Collapse all the sub items in the view. View action

Change if the breakpoints should be linked to the Debug View.

View action

Add Event

Breakpoint(C/C++)...

Add event breakpoint. View action

44

Add Watchpoints

(C/C++)...

Add watchpoints (Not supported by the current version. It will be supported in the future versions.)

View action

Show full paths Show the full paths of the breakpoints. View action

Group By...

Select default

Working Sets...

Deselect Default

Working Set

Allow you to select an alternate grouping for your breakpoints or create your own.

View action

Select the default working set so that the new breakpoints will be added into this working set.

View action

Deselect the default working set so that the new breakpoints will not be added into any working set.

View action

Working Sets... Open the working sets dialog. View action

Enable

Disable

Select All

Copy

Paste

Import Breakpoints... Open the import breakpoints wizard.

Export Breakpoints...

Change the selected breakpoint(s) to be enabled.

Change the selected breakpoint(s) to be disabled.

Open the export breakpoints wizard.

Context menu

Context menu

Select all the breakpoints in the view.

Copy the selected breakpoints to the system clipboard.

Context menu

Context menu

Paste copied breakpoints into the view.

Context menu

Context menu

Context menu

Breakpoint

Properties...

4.4.2 Debug

Open the breakpoints properties dialog.

Context menu

1. The Debug view shows the target debugging information in a tree hierarchy.

2. The number beside the thread label is a reference counter, not a thread identification number.

3. The CDT displays stack frames as child elements. It displays the reason for the suspension beside the thread, (such as end of stepping range, breakpoint hit, and signal received). When a program exits, the exit code is displayed.

45

Debug view context menu commands command Name

Remove All

Terminated

Description

Clear all terminated processes in Debug view.

Use Step Filters

Copy Stack

Toggle step filters on/off. When on, all step functions apply step filters.

Copy the selected stack of suspended threads as well as the state of the running threads to the clipboard.

Find...

Step Into

Step Over

Step Return

Instruction Stepping

Mode

Resume

Suspend

Terminate

Terminate and

Relaunch

Restart

Disconnect

Open the debug view element-searching dialog.

Select to execute the current line, including any routines, and proceed to the next statement.

Select to execute the current line, following execution inside a routine.

Select to continue execution to the end of the current routine, then follow execution to the routine’s caller.

Activate to enable instruction stepping mode to examine a program as it steps into disassembled code.

Select the Resume command to resume execution of the currently suspended debug target.

Select the Suspend command to halt execution of the currently selected thread in a debug target.

End the selected debug session and/or process. The impact of this action depends on the type of the item selected in the Debug view.

Select the Terminate and Relaunch command to terminate the selected debug target and then relaunch it.

Select the Restart command to restart the remote debug target.

Select the Disconnect command to disconnect the connection to the debug target.

46

Relaunch This command relaunches the selected debug target.

Edit...

Edit Source Lookup...

Open the launch configuration dialog, allowing you to make changes.

Open the source lookup dialog, allowing you to make changes.

Lookup Source Select to force a source lookup to take place.

Terminate and

Remove

Terminate the selected debug target and removes it from the view.

Terminate/Disconnect

All

Terminate all active launches in the view.

Properties

Open the Properties for window showing the process properties.

4.4.3 Disassembly

The Disassembly View shows the loaded program as assembler instructions mixed with source code for comparison. The currently executing line is marked by a yellow arrow and highlighted with green background in this view. You can do the following tasks in the

Disassembly view.

Set breakpoints at the start of any assembler instruction

Enable and disable breakpoints and set their properties

Step through the disassembly instructions of your program

Jump to specific instructions in the program

47

Disassembly view context menu commands

Command

Copy

Name Description Availability

Copy the selected content into the clipboard. Context menu

Select All

Show Source

Select all the content.

Show the assembly and its corresponding source code

Context menu

Context menu and View action

Context menu Show Symbols Show function label and symbols

Preferences Parameter selection.

Resume At Line Resume program execution from the line

Context menu

Run To Line

Resume program execution until the specific line is reached. This is a convenient way to suspend execution at a line without setting a breakpoint.

Context menu

Move to Line

Jump to the line selected in the Disassembly view.

Context menu

Context menu

48

selected in the Disassembly view.

Refresh View Refresh Disassembly view. View action

Go to Current

Program

Counter(Home)

Jump to the current program execution.

Link with

Active Debug

Context

Display the current operating position of the code

View action

View action

Open New

View

Open a new Disassembly view. View action

Pin to Debug

Context

View action

4.4.4 Expressions

An expression is a snippet of code that can be evaluated to produce a result. The context for an expression depends on the particular debug model. Some expressions may need to be evaluated at a specific location in the program so that the variables can be referenced. You can view information about expressions in the Expressions view.

You can inspect expressions from a scrapbook page, a stack frame of a suspended thread, or other places. The Expressions View opens automatically when an item is added to the view.

When debugging a C/C++ program, data that contains variables can be expanded to show the variables and the fields of the variables.

There are many commands available in the Expressions View:

Command Name Description

Show Type

Name

Availability

Configure columns to display type names. View action

Show logic Show logic structure of the Expressions. View action

49

structure

Collapse All

Add Watch

Expression

Remove

Remove All

Open New

View

Pin to Debug

Context

Refresh

Select All

Copy

Expressions

Find...

Disable

Enable

Edit Watch

Expression

Reevaluate

Expression

Format

Collapse all the Expressions.

Allow you to add a watch expression.

Remove the currently selected expression(s) from the view.

Remove all of the expressions from the view.

Open a new Expressions view.

View action

Context menu and view action

Context menu and view action

Context menu and view action

View action

View action

Refresh. View action

Select all the variables in the view.

Copy the selected expressions and variables to the system clipboard.

Open the search dialog to find elements in the variables view.

Context menu

Context menu

Context menu

Disable a currently enabled expression. Context menu

Context menu Enable a currently disabled expression.

Allow you to edit existing watch expression.

Reevaluate the currently selected expression.

Select a format type. Choices include:

Binary, Decimal, Natural, and

Hexadecimal.

Context menu

Context menu

Context menu

50

4.4.5 Memory

The Memory view of the Debug perspective lets you monitor and modify your process memory. Memory can be displayed in different predefined data formats -- memory renderings. The CoIDE supports five rendering types -- hexadecimal (default), ASCII, signed

integer and unsigned integer.

The Memory view can display and modify the value of selected memory address. The

Rendering pane can be configured to display more than two renderings at the same time.

Memory view toolbar icons:

The table below lists the icons displayed in the Memory view toolbar.

Command Name Description

New Tab

Go

Import

Export

Open New View

Pin to Debug Context

Click to create a new memory view..

Shows the Memory value of the selected address.

Import memory view from different kinds of files.

Export memory to different kinds of files.

Open a new Memory view.

Default Rendering Select default rendering.

Find/Replace Find or replace value from the Rendering pane.

Find next Find next one after the command: Find/Replace.

Clear Expressions Clear the contents of the address input box.

Memory view context menu:

The context menu inside the Memory view includes:

Name Description

Panes Enable or disable the showing of the Address, Binary, and Text portions of

51

the rendering view.

Endian Toggle between the Little (default) and Big Endian display of memory.

Text

Choose the character encoding used to convert memory values into text for display. Choices include: ISO-8859-1 (default), US-ASCII, or UTF-8.

Cell Size

Specify the cell size used to display values in the Binary column. Choices include 1, 2, 4 (default), and 8 bytes.

Radix

Specify the radix used to display the values in the Binary column. Choices include Hex, Decimal Signed, Decimal Unsigned (default), Octal, and Binary.

Columns Specify the number of columns in the Binary column.

Update Mode

Select the update mode of the Rendering pane: Always, On Breakpoints, or

Manual.

Copy

Copies the selected portion (address, content or binary number) of the

Rendering pane to the clipboard.

Reset To Base

Reset the Rendering pane to the original base address.

Address

Refresh Refresh the Rendering pane.

4.4.6 Peripherals view (CoAssistant)

The Peripherals View can be used to view and modify the value of Peripherals' registers.

Values that have been changed are highlighted in the Peripherals view when your program stops.

52

It displays the register list and views the value of these registers. Register that have been changed are highlighted in the Peripherals view.

Click the Register name to open the detail information view. In this view, you can get the description, RW access, address offset and the reset value of the register. You can also modify the value of register when you debug a project.

53

4.4.7 Registers

The Registers view of the Debug perspective lists information about the registers in a selected stack frame.

You can view information about the registers in a selected stack frame. Values that have been changed are highlighted in the Registers view when your program stops.

Registers view toolbar icons:

The table below lists the icons displayed in the Registers view toolbar.

Command Name

Show Type

Name

Show logic structure

Description

Configure columns to show type names(unavailable when columns are displayed).

Show logic structure of the registers.

Collapse All Collapse all the registers.

Open New View Open a new Registers view.

Pin to Debug

Context

Refresh Refresh

Layout Provides multiple layout options for the Registers view.

Registers view context menu commands:

The Registers view context menu commands include:

Command Name Description

Select All Select all the editor content.

Copy Registers Copy the register names and contents to the clipboard.

54

Enable Enable the selected register.

Disable Disable the selected register.

Format

Find...

Restore Default

Register Groups

Add Watchpoints

(C/C++)...

Select a format type. Choices include Binary, Decimal,

Natural, and hexadecimal.

Open the Find dialog, which allows you to find specific elements within the view.

Change Value...

Open the Set Value dialog to change the selected registers value.

Add Register Group

Open the Register Group dialog, which allows you to define a register group that is shown in the Registers view.

Restore the original register groups.

Add watchpoints (Not supported by the current version.

It will be supported in the future versions.)

Watch

4.4.8 Semihosting view

Convert the selected register into a watch expression.

Semihosting view is used to show the information of the host computer and the ARM input and output communication

when debugging.

Semihosting view toolbar icons:

The Semihosting view toolbar commands

include:

Command Name

Clear Console

Description

Clear Console view content.

55

Scroll Lock Toggle the Scroll Lock.

Show semihosting info

Semihosting view context menu commands:

Show semihosting information.

The Semihosting view context menu commands include:

Command Name Description

Cut Cut the selected content.

Copy Copy the selected content to the system clipboard.

Paste

Select All

Paste the content in the clipboard.

Select all the content.

Find/Replace Find or replace specific element from the Rendering pane.

Open Link It always is in an invalid state.

Clear Clear all the content.

Scroll Lock

4.4.9 Variables

Toggles the Scroll Lock.

The Variables View displays information about the variables associated with the stack frame selected in the Debug View. When debugging a C/C++ program, data that contains variables can be expanded to show the variables and the fields the variables contain.

You can view information about the variables in a selected stack frame in the Variables view.

When execution stops, the changed values are by default highlighted. Like the other debugrelated views, the Variables view will not be refreshed when you run your executable code.

The refresh occurs when the execution stops.

56

Variables view

There are many commands available in the Variables View:

Command Name Description Availability

Show Type Name Configure columns to show type names. View action

View action Show logic structure Show logic structure of the Variables.

Collapse All Collapse all the Variables. View action

Add Global Variables Add Global Variables.

Context menu and view action

Remove Global

Variables

Remove Global Variables.

Remove All Global

Variables

Remove All Global Variables.

Context menu and view action

Context menu and view action

Open New View

Pin to Debug Context

Select All

Open a new Variables view.

Select all the variables in the view.

View action

View action

Context menu

Copy Variables

Enable

Disable

Cast To Type…

Copy the selected variables to the system clipboard.

Context menu

Enable a currently disabled variable. Context menu

Disable a currently enabled variable.

Cast To Type…

Context menu

Context menu

57

View Memory

Format

Find...

Change Value...

Allow you to create a memory monitor for the selected variable.

Context menu

Select a format type. Choices include

Binary, Decimal, Natural, and hexadecimal.

Context menu

Open the search dialog to find elements in the variables view.

Context menu

Allow you to change the value for the underlying selected variable.

Context menu

Add

Watchpoints(C/C++)

Add Watchpoints(C/C++).

Watch

Context menu

Allows you to create a watch expression for the selected variable.

Context menu

58

5 Project Management

5.1 Create Project

CoIDE provides two models for creating projects:

 Create a new project based on your target chip.

 Create a new project based on your target board.

You can select a MCU or a board to create a project and start your embedded development.

A board is a set of components including basic components, driver components and app examples. If CooCox supports your target board, it is recommended to create a new project based on your target board. When you select the board, CooCox will show you all the components and examples that suitable for your board. You don’t need to do any modification on the examples and components.

5.1.1 Create Project by Chip Model

To create an embedded project using CoIDE by chip model, you only need to perform the following steps:

1. Select “Project > New Project” from the menu or select “Create a New Project” from the welcome page.

59

2. A wizard window will pop up, enter a name for the project (for example: GPIO_Test),

You can also modify the Project Path.

60

3. Choose a model. For example, select ''Chip Model', then click “Next”.

4. Select a chip. For example, select ''MKL05Z32VFM4''.

61

5. Click "Finish". CoIDE automatically generates GPIO_Test.coproj file and one configuration: "GPIO_Test".

6. Check a component; for example, select 'GPIO'. CoIDE will automatically check the components, which are depended by the checked component.

62

7. You can view the result in Component View.

8. You can also click Drivers to view the Driver pages and add the driver components to your project.

63

5.1.2 Create Project by Board Model

To create an embedded project using CoIDE by board model, you only need to perform the following steps:

9. Select “Project > New Project” from the menu or select “Create a New Project” from the welcome page.

64

1. A wizard window will pop up, enter a name for the project (for example: Cookie_Test)

65

2. Choose a model. For example, select ''Board Model''. Then click “Next”.

3. Select a board. For example, select '' Cookie NuMicro'' which produced by CooCox.

66

4. Click "Finish". CoIDE automatically generates Cookie_Test.coproj file and one configuration: "Cookie_Test".

5. Click "Document". CoIDE will show document about cookie board in “Help” View.

67

6. Check a driver component; for example, select 'LCDShield'. CoIDE will automatically check the components, which are depended by the checked component.

7. You can review the result in “Peripherals” Page.

68

8. You can also click Drivers to view the Driver pages and add the other driver components to your project.

5.2 Manage Target/Groups/Files and Switch Chip

5.2.1 Target List Management in the Multi-configuration

There is a default configuration target after creating project: Flash configuration target.

Click Target Manage button to manage configuration list. You can modify the configuration name, increase configuration, delete configuration, and change the sort order of configuration, set as current target and so on. Click OK to confirm.

69

In the project view, select the parent directory in which you want to create the Group (If you do not select the parent directory, the default is the root directory of the project), select Add

Group in context menu:

Group edit box pops up, and you can add the Group.

70

Click Add Files menu item to add a link file to the project view:

Click the “New File” menu item to create a new file. As it is shown in the following figure, after clicking ''Open'' you can create a file and add the file to the project view as a link file.

71

Double click the file name in Project view to open and edit it.

72

5.3 Project configuration

Click Configuration button to open project configuration view.

Configuration area is divided into seven different configuration items: Device, Compile, Link,

Output, User, Debugger and Download. The first five configurations are building and linking configurations, the last two are debugging/programming configurations.

5.3.1 Change device

Device can be changed in the latest version of CoIDE.

However, the new chip might not be compatible with component files or other configuration you checked in the old chip, so errors or warnings could occur. User needs to consider carefully and modify appropriately.

1. Click ''Device'' in context menu in project view to change project chip.

73

2. Select the target file you need to change, and then click “Change Device”.

3. CoIDE will prompt you to confirm the change.

74

4. Click OK, then CoIDE will show you the following view. Peripherals view and all the other views will be associated to the new chip.

5.3.2 Compile configuration

1) Option area:

75

a) FPU: Select MCU type, it includes Not use FPU, FPU soft and FPU hard (Note: If you

select the FPU hard, you need to enable FPU module in the code) b) Optimization: Select the level of optimization, it includes (None(-O0), Optimize(-

O1), Optimize More(-O2), Optimize Most(-O3), Optimize Size(-Os))

2) Include paths area:

Add / Remove header files’ paths

The added paths will be associated to the current path of the project file to be processed.

3) Defined Symbols area:

Add / Remove pretreatment (macro definition) Symbol

4) Misc Controls area:

User can edit (add) user-defined compile commands.

5) Compile Control String area:

Show compile commands (do not edit)

5.3.3 Link configuration

1) Options area:

a) Use Memory Layout from Memory Window (Checked by default)

Check: Memory Areas will be available; Scatter File will be unavailable.

Mean to use memory Areas memory data, and use IDE default link file (such as link.ld).

Uncheck: Memory Areas will be unavailable; Scatter File will be available.

76

The system will add default link.ld/arm-gcc-link.ld and the memory.ld file in the directory of the project file, at the same time, the link file path is filled into the Scatter File area, and user can select a custom link file in the Scatter File area.

b) Discard unused sections

Allow recovery of unused input section. Segments that contain the entrance symbol and all the segments of undefined symbols in the command line will be retained. Segments that contain a dynamic object reference symbol will also be retained. Check this option to reduce code size.

c) Don’t use standard system startup files

Do not use the standard system startup files when linking. The standard system libraries are used in default unless ‘-nostdlib’ or ‘-nodefaultlibs’ is used.

d) Library select list

Select link library: Not use C Library, Use base C Library, Use nano C Library*, Semihosting,

Retarget

Options: Printf float, Scanf float

Note: “Use nano C Library” only work if you are using gcc-arm-none-eabi-4_7-2012q4 or higher version. If you choose “Use nano C Library”, it will provide two more options “Printf float” and “Scanf float”. Just like the following picture.

2) Linked Libraries area:

Add/remove library file.

Library is collection of a series of procedures, external function and variables. It is integrated into an application program by the compiler and linker during compilation, and made into a target file and an executable file that can run independently. The CoIDE library is the GCC library.

3) Memory Areas area

The memory area is only available when “Use Memory Layout from Memory Window”) is checked. a) Select: Debug in Flash (default), Debug in RAM b) In “Memory Areas” area, start address and size for IROM and IRAM can be customized:

77

IROM and IRAM start address and size is automatically changed according to your choice, or you can manually modify these values. c) In Start line, IROM and IRAM start address can be customized; in Size line, IROM and

IRAM size can be customized.

4) Scatter File area

Scatter File area (available when uncheck “Use Memory Layout from Memory Window”, at the same time system in project file directory provides a default link file)

In the area user can specify a custom link file path.

5) Misc Controls area

Edit link command area, users can add custom link command.

6) Linker Control String area

Cannot be edited, display the link commands information.

5.3.4 Output configuration

The configuration area of output files after building project.

The files generated after building a project will be saved under a directory named with the formation of Executable+”/”+ Name of Executable.

1) Name of Executable: Specify the folder of the output files, the default is the configuration name of the current project configuration;

2) Path of Executable: Specify the output file path

78

3) Create Executable(.elf) :: Generate. elf executable files, by check / uncheck decide whether to generate the HEX or BIN file

4) Create Library(.a): Generate. a library file

5.3.5 User configuration

Customize IDE implementation program Before Build, After Build and Before Debug.

In Before Build/Rebuild area implementation program before Build/Rebuild can be customized; in After Build/Rebuild area implementation program after Build/Rebuild can be customized.

You can directly enter commands, or import. bat or. exe files. After configuration, you need build or rebuild the project.

In Before Debug, if “Auto Compile Before Debugging” is checked, CoIDE will automatically execute incremental compile before debugging launched.

79

5.3.6 Debugger configuration

1) Hardware area

a) Adapter: CoIDE supports Colink, CoLinkEx, Nu-Link, ST-Link, J-Link and Stellaris-ICDI debug adapter. b) Port: CoIDE supports SWD and JTAG debug modes. c) Max Clock (Hz): You can select the clock frequency from 2M, 1M, 500K, 300K and 100K.

2) Startup area

Need to check or uncheck Run to main.

3) Advance area

a) Reset Mode: There are three reset modes: HW RESET, VECTRESET and SYSRESETREQ. b) Semihosting Enable: Check to enable Semihosting function. c) CacheRom Enable: Check to enable ROM cache.

4) TargetInfo area

Target Info area displays the host name and port number.

80

5) J-link Info area

In Adapter configuration items of the

Hardware

area, some special link such as J-Link

Adapter has the particular configuration items, as shown below. It displays J-link debugger configuration information.

5.3.7 Download configuration

81

1) Auto Download Before Debugging: automatically download programs before debugging.

2) Verify After Download: verify programs after download.

3) Erase Full Chip: erase the full chip before download.

4) Erase Effected: erasing the affected sectors before download.

5) Do not Erase: do not erase the chip before download.

6) Programming Algorithm Will display Programming Algorithm file.

7) Add..., Remove and Default are used to configure Flash algorithm file.

5.4 Build project

To build a project using CoIDE, you only need to perform the following steps:

1. Select Project > Build. If necessary, you can select Rebuild to recompile your project or select Clean to clean-up the project that has been compiled.

82

2. View compile information in the Console window.

5.5 Open project

To open an existing project using CoIDE, you only need to perform the following steps:

1. Select Project > Open Project...or click Open a Project in the welcome page.

83

2. Find the project files with extension name as ''.coproj'' or ''.cob''.

3. View the opened project.

84

6 Debug

6.1 Introduction

6.1.1 Enter debug mode

You can click the Debug button” ” to enter into debugging mode.

The debug mode has a quiet different interface comparing with edit mode. To learn more,

you can go to Chapter 4.4 Debug View

6.1.2 Debug control

The debug execution controls are realized by breakpoints. For example, if you attempt to step over a function and the program hits a breakpoint, it pauses, regardless of whether the function is completed. You can control your debug execution in various ways, but they all rely on a core set of debug controls.

To control the debug session, you can use the buttons in the toolbar of debug mode.

Reference: Chapter 4.2.2 Debug Toolbar Actions

6.1.3 Set breakpoints

A breakpoint can be set on an executable line of the program. If a breakpoint is enabled when you are debugging, the execution will be suspended before the code of that line is executed.

To add a breakpoint point, you could double-click the marker bar located in the left margin of the C/C++ Editor beside the line of code where you want to add a breakpoint. A dot will display in the marker bar and in the Breakpoints View, along with the name of the associated file.

6.1.4 Step mode

CoIDE support two kinds of step modes: C code step and instruction step. C code step is the default option.

C code step means executing the lines in c code area one by one, while the instruction step means executing a single assembler instruction at a time.

To activate the instruction step mode, you just need to click the Instruction Stepping Mode option ( ) on the Debug view toolbar. Then when you click the step button ( ), the

Debugger switches to the instruction stepping mode, the Disassembly view will be opened automatically. If you want to switch back to c code step mode, click the Stepping Mode option ( ) again.

85

6.1.5 Debug Example

1. Click Debug button to start debugging.

2. After debugging is stared successfully, CoIDE will enter into debugging mode.

86

3. Set a breakpoint by double clicking the marker bar.

4. Step in C code mode.

87

5. Step in instruction step mode.

6. Stop debugging.

88

6.2 How to use debug views

The initial debug UI only shows a few debug views, you can open the other debug views through view menu.

6.2.1 Disassembly view

The Disassembly view allows you examine your program as it is running disassembled code under stepping mode. This is useful when the instruction pointer enters a function for which it does not have the source. To open the Disassembly view, select View > Disassembly menu.

89

6.2.2 Memory view

To open the Memory view, select View > Memory menu. Input the memory address you want to view, for example 0x20000000, then press Enter or click the Go button.

Then you can view the memory space.

90

6.2.3 Variables view

1. To open the Variables view select View > Variables menu. Click Add Global Variables to add a global variable.

2. Check the global variables you want to add, then click OK button.

91

3. Right click on the variable and select the Change Value item to change the value of the variable.

4. Input the new value of the variable and click the OK button.

92

7 Components, Examples and Boards

7.1 Components

In CooCox CoIDE, the reusable code is called component. A component can be a library, or a collection of source files, etc. It must provide useful functions, be easy to understand and use, and most importantly, it can work correctly. Each component has its corresponding code snippets, usage, documentation and comments.

7.1.1 Add Components

1. When you have created a project and selected a chip, CoIDE will show you a Repository

View, which lists all the components that fit for the chip.

93

2. Check the Component you want to add to your project.

3. CoIDE will add the component and the dependent components to your project automatically.

94

4. You can also click the Driver page to view and add driver components.

5. Click the components’ names to view the help documents.

95

6. You can view the Doxygen documents for the component by clicking the related links in help view.

7. For the driver component, we have more documents that guide you to use.

96

7.1.2 Refresh and Update Components

Refresh operation will synchronize the component list with remote server. Update operation will update the content of one component to latest. They are different.

1. If you want to refresh basic component list, click "Refresh Component List" button in the “Peripherals” page of “Repository View”.

97

2. If you want to refresh driver component list, click “Refresh Component List” button in the “Driver” page of “Repository View”.

3. CoIDE will show you a dialog to remind you which components can be downloaded or updated.

98

4. The right side of repository view shows the components which can be updated (or downloaded) with the state “Update” (or Download).

5. Click “Update” to update the component, and then it turns into “Available”.

99

7.1.3 Upload Components

If you have a good component, you can upload it through CoIDE. Then, the other engineers over the world could see it after refresh component and benefit from it. Sharing make the world better.

7.1.3.1 Upload Basic Components

What is a basic component? When we introduce COX interface , we used a picture. We will use it again to interpret basic component conception.

Beyond that, Basic components also include components of following categories:

Algorithm

Board Support

System Boot

Startup Code

Common Files

File System

RTOS

To upload a basic component, you need to perform the following steps:

100

1. There are two entries for uploading basic component, click the Upload Component button in the Repository View or in the Project menu.

2. Select “Basic Component”, and then click “Finish”.

101

3. Input the necessary information: “Component Name”, “Component Description”, and

“Keywords”.

4. If your component has used CoX interfaces, select “Yes” and set the CoX interfaces you have used. Otherwise, just keep the default setting.

102

5. If you click “Advance”, you can define the Micro Definition for your component. If you define a micro definition, for example “My Comp Micro Definition”, when this component is checked, CoIDE will add “My Comp Micro Definition” to the compile setting: “Define Symbols” automatically.

103

6. Step 2-“Classification”.

1)

Choose the manufacturer, for which your component is suitable. Put your cursor into the textbox, a pop up window will show you all options. If your component is suitable

2)

3) for all manufacturers, you should choose “All”.

Choose the chips for which your component is suitable. Put your cursor into the textbox, after a while, a pop up window will show you all chips according to the manufacturer you selected.

Choose the category, to which your component belongs. CoIDE will show your component in “Repository” View at a certain location according to the category you defined here.

104

105

7. Step 3-“Component Dependency”.

“Component Dependency” is a conception that defines the relation of dependency between your component and other components existing in CoIDE. For instance, when you implemented the component “COX.Peripheral.KLx.xGPIO”, it referenced the interfaces provided by “xStartup”,”xLowLayer”,”xSysCtl” and “xCore” . Therefore, you have to specify the list of these four components required for the operation of “COX.Peripheral.KLx.xGPIO”.

When other users check “COX.Peripheral.KLx.xGPIO”, CoIDE will check the other four components automatically according to the “Component Dependency” you defined before.

106

8. Step 4 - “Source Files”. Select your component source files from project or choose files from your file system.

107

9. Step 5-“Document Files” and you can edit your component document in “HTML Editor”. a) The Create APIs Document button: (the second button on the toolbar) can help you to create the APIs of your component code. If your code comments are Doxygen style, it will also create the API description for you.

108

b) If your document has already been prepared, you should choose “File System”. After all component document files have been added, you need to set the index of the document. The index of the document is just like the index page of a website.

109

c) After finish your document, you can click “Preview” button to preview the effect of your documents.

110

10. Step 6 - Publish.

Congratulations! You can set your component version and then click “Publish” to share your component.

7.1.3.2 Upload Driver Components

What is a driver component? When we introduce COX interface , we used a picture. We will use it again to interpret driver component conception.

In CoIDE, we define the code for the peripherals outside the chip as a Driver component. The

Driver component is suitable for a Driver device such as LCD, Sensor, EEPROM, SD card, etc.

They are classified by the device type, not the MCUs.

111

1. There are three entries for uploading driver components. Click the Upload Component button in the Repository View or in the Project menu. You can also click Upload Driver in Project View’s Context Menu.

2. Select “Driver Component” and then click “Finish”.

112

3. Input the necessary information: “Driver Name”, “Driver Description”, “Communication

Interface” and “Keywords”. If your driver does not use CoX interfaces, just keep the default setting. Otherwise, choose “Yes”, and Choose the CoX interfaces you have used.

113

4. Step 2 - “Supported Device”. First, you can click “Add” to search the devices that already existed in CoIDE. If you can’t find the device, click “New” to create one.

114

5. The other options for uploading the driver component is the same as uploading the

basic component. You can refer to 7.1.3.1 Upload Basic Component .

115

7.1.4 Modify or Delete Components

1. If you want to modify your components, you must login in first. Click the sign in to

CooCox…

116

2. After you login in, find your basic component in “Repository” view and right click on the component, then choose “Modify” or “Delete”.

3. Then you can modify the content gradually. The modification UI is the same as uploading component. If you forget what the meaning of the content is, refer to the

7.1.3.1 Upload Basic Component .

117

4. After you finish the modification, go to step 6 and click “Save” button.

118

7.2 Examples

CoIDE integrates many infrastructure components. In order to allow users to use these components more easily, each component can be associated to multiple sample code fragments. You can view them and add them to your project. You also could upload your own examples to the Internet.

7.2.1 View examples

1. Click the component which shows "with x example(s)" in the Component View of CoIDE.

119

2. The example view will appear and display all the code snippets of the selected component.

3. Click “view “ to view the examples you are interested in.

120

4. The code snippet will display in the code editor viewer.

5. You can click "More Example for xxx" to view more examples for the selected chip.

121

6. Other examples will be show in “More Examples” view based on the component classifications.

7. Click the example name to open the example in the edit view.

122

7.2.2 Adding code snippet

1. Click “add ” to add the example you are interested in.

2. A dialog will show you where the example will be located. Click "yes".

123

3. The code snippet will be automatically added to the project.

124

7.2.3 Upload Examples

If you want to upload an example, make sure you have logined in first. You can upload an example for a basic component or a driver component or a board.

7.2.3.1 Entries for Uploading Examples

1. The first entry: “Upload Example” in the Project Menu.

2. The second entry: Click the component which you want to upload an example for in

“Components” view, then the “Examples” view will show all examples existed which belong to the component. Click “Have a better example snippet? Share with others?” to upload an example.

3. The third one, “Upload Example” in Project View’s Context Menu.

7.2.3.2 Upload an Example

1. Click “Have a better example snippet? Share with others?”

125

2. Input the necessary information: “Example Name”, “Example Description”.

3. Specify the example source files.

126

4. Set “Add to Main()”. If you check “Add to Main ()”, when users add the example code to his project, CoIDE will automatically add the function of “Blinky.c” to “main.c”.

127

5. Step 2 -“Dependency”: Select the Example type, for a basic component or a driver component. If your example used interfaces which provided by other components when you implement, you should specify those components in “Example Dependency”.

Then when users add your example to project, CoIDE will automatically add the components that your example depends to project too.

128

6. Step 3 -“Document Files”. Edit your document in “HTML Editor”. If your document had been prepared already, choose “File System”. After all component document files have been added, you have to set the index of the document. After finish your document, you can click “Preview” button to preview the effect of your documents.

129

7. Then you can click “Publish” to share your example.

130

7.2.4 Modify an Example

1. After you login in, you can modify or delete an example of your own. You need to find your example in “Examples” view, and click “modify”.

131

2. Then you can modify the content step by step. The modification UI is the same as

uploading example. Refer to the chapter 7.2.3.2 Upload An Example .

3. After you finish modification. Go to step 4 and click “Save” button.

132

7.3 Board

Board is actually a set of components including basic components, driver components, app examples that are suit for the board. Therefore, if you have a board, which is already existed in CoIDE, it is very convenient to start your development against the board. CoIDE has offered a board model in “New Project” wizard; you can create a new project of “Board

Model”. Refer to Chapter 5.1.2

133

1. The first entry for viewing board list is in “New Project” wizard.

2. The second entry for viewing board list: after you create a new project by “Board

Model”, you can view board list in “Board List” page of “Repository” view.

134

7.3.1 Refresh Board List

In “Board List” page of “Repository” view, click “Refresh Board List” to refresh board list.

7.3.2 Update a Board

In “Board” page of “Repository” view, click “Refresh” to update your current board to latest.

135

7.3.3 Upload a Board

There are two entries for uploading a board, in “Project” menu, “Board” page of

“Repository” view. You need to do the following operations.

136

1. Input necessary information: “Board Name”, “Board Description”. If you want users know more about your board, you should input more information.

2. Input the necessary information: “Board Name”, “Board Description”.

137

3. Step 2-“Classification”. “Chip Manufacturer” means the manufacturer of the chip that your board based on. “Chip” means the chip that the board uses. “Board Manufacturer” means the manufacturer that makes the board. For instance, the cookie board which make by CooCox (more info: http://www.coocox.org/Cookie.html

). The cookie board uses the chip M0516LBN that make by Nuvoton. So i set “Nuvoton” for “Chip

Manufacturer” and set “M0516LBN” for “Chip”.

138

4. Step 3-“Associate Components”. Specify driver components that are suitable for your board. When other users choose your board, they could see the driver components that you specified at this step in “Board” page of “Repository” view.

139

5. Step 4-“Associate Examples”. If you have app examples for the board, you should

upload these app examples first ( Refer to chapter 7.2.3 Upload Example ), and then you

can associate these examples with the board by this step. When other users choose your board, they could see the app examples which you specified at this step in “Board” page of “Repository” view.

140

6. Step 5-“Document Files”. Edit your board document in “HTML Editor”.

7. Set your board image and then click “Publish” to upload your board.

141

7.3.4 Modify a Board

1. After you login in, in “Board” page of “Repository” view, if you are the committer of the board, the “Modify” button will be enabled. Click “Modify”, then you can modify your board.

2. Then you can modify the board. Refer to the chapter 7.3.3 Upload a Board .

142

Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement

Table of contents