UM NuEclipse en Rev1.01.014
UM NuEclipse en Rev1.01.014
ARM® Cortex® -M
32-bit Microcontroller
NuEclipse
User Manual
Nuvoton is providing this document only for reference purposes of NuMicro microcontroller based
system design. Nuvoton assumes no responsibility for errors or omissions.
All data and specifications are subject to change without notice.
Table of Contents
1 Introduction ......................................................................................................... 4
2 System Requirements and Installation Guide ..................................................... 5
2.1 System Requirements ............................................................................................ 5
2.2 Supported Chips .................................................................................................... 6
2.3 Installation.............................................................................................................. 6
2.3.1 Performing the NuEclipse installer on Microsoft Windows ................................................ 6
2.3.2 Extracting the NuEclipse Tar File on GNU/Linux ............................................................... 7
2.3.3 Verifying the Eclipse Preferences ...................................................................................... 8
2.4 Running Eclipse ................................................................................................... 10
3 Development Tutorial ............................................................................................... 11
3.1 Select Workspace ................................................................................................ 11
3.2 New Project Wizard.............................................................................................. 12
3.3 Import Existing Projects ....................................................................................... 14
3.4 Build Settings ....................................................................................................... 15
3.5 Debug Configuration ............................................................................................ 16
3.5.1 Debugger Tab ................................................................................................................. 17
3.5.2 Startup Tab...................................................................................................................... 18
3.6 Debug Views ........................................................................................................ 19
3.6.1 Registers View ................................................................................................................ 19
3.6.2 Memory View................................................................................................................... 20
3.6.3 Disassembly View ........................................................................................................... 21
3.6.4 Peripheral Registers View ............................................................................................... 22
NUECLIPSE USER MANUAL
List of Figures
Figure 2-1 NuEclipse Setup Wizard ······························································· 6
Figure 2-2 Install.sh Script ·········································································· 7
Figure 2-3 Preferences for Global Tools Paths ················································· 8
Figure 2-4 Preferences for OpenOCD Nu-Link ················································· 9
Figure 2-5 Eclipse.exe and Related Folders ·················································· 10
Figure 3-1 Selecting a Workspace ······························································· 11
Figure 3-2 New Project Wizard ··································································· 12
Figure 3-3 Target Processor Settings··························································· 13
Figure 3-4 Importing Projects ···································································· 14
Figure 3-5 Build Settings ··········································································· 15
Figure 3-6 Debug Configuration ·································································· 16
Figure 3-7 Configuring the Debugger Tab ···················································· 17
Figure 3-8 Configuring the Startup Tab ······················································· 18
Figure 3-9 Registers View ·········································································· 19
Figure 3-10 Memory View ·········································································· 20
Figure 3-11 Clicking the Instruction Stepping Mode Button ···························· 21
Figure 3-12 Disassembly View ···································································· 21
Figure 3-13 Opening the Packs Perspective ·················································· 22
1 Introduction
The NuEclipse is designed for cross-platform embedded ARM development. It includes a series
of Eclipse plug-ins and tools. The plug-ins allow the user to create, build, and debug ARM-based
projects within the Eclipse framework. Its features are listed below:
Creating projects by the New Project Wizard: The New Project Wizard provides several
templates for different target chips.
Building projects by the GNU ARM Toolchain: The toolchain contains the ARM Embedded
GCC compiler. The user can use it to build projects without restriction.
Debugging projects by GDB: The user can halt, step, run, and monitor target chips. Accessing
memory and flash is allowed. Setting hardware breakpoints and watchpoints is supported. In
addition, the user can erase target chips and program the user configuration.
Through the NuEclipse, the user can develop projects of the NuMicro® Family within the Eclipse
framework.
NUECLIPSE USER MANUAL
Operating System Windows® 7 with latest service pack or Windows® 10 with latest service pack or
GNU/Linux Ubuntu 16.04 LTS
Eclipse IDE Eclipse 4.4 Luna SR2 Eclipse 4.5 Mars SR2
Note: To have a fully usable and pleasant experience on Linux, the recommended Linux distribution is
Ubuntu 16.04 LTS (64-bit).
2.3 Installation
To make the NuEclipse ready for work, perform the following steps based on your operating
system:
1. Performing the NuEclipse installer on Microsoft Windows.
2. Extracting the NuEclipse tar file on GNU/Linux.
On Windows, it is very easy to install the NuEclipse only by performing the NuEclipse installer.
The installer will ask the user to install the GNU ARM Eclipse Windows Build Tools and GNU
ARM Embedded Toolchain because they are required by NuEclipse.
NUECLIPSE USER MANUAL
On GNU/Linux, it is very easy to install the NuEclipse only by extracting the NuEclipse tar file.
After that, run the install.sh script to complete the installation process. Please do not use the
sudo command to run the script.
After the installation, the Eclipse preferences are automatically written on Windows. To verify
them, click Window > Preferences, the Preferences wizard appears. Go to C/C++ > Build >
Global Tools Paths and make sure the Build tools and Toolchain folder be correctly configured
to what the installer has installed in the previous step. Click the Apply button to take effect. On
GNU/Linux, Build tools folder path is not required. The path should be empty.
NUECLIPSE USER MANUAL
Subsequently, go to Run/Debug > OpenOCD Nu-Link and make sure the OpenOCD folder be
configured to where the installer has put the OpenOCD executable. On Microsoft Windows, for
example, the path of OpenOCD folder could be C:/Program Files/Nuvoton Tools/OpenOCD.
Similarily, on GNU/Linux it could be /usr/local/OpenOCD. The OpenOCD executable provided by
Nuvoton is customized for Nu-Link. If the user tries to use other OpenOCD executable, OpenOCD
and Nu-Link may not cooperate well. Click the Apply button to take effect.
3 Development Tutorial
Based on the actual target chip, we select the corresponding chip series. For some chip series,
e.g., M2351_NonSecure, we need to input the additional library path. If not, the build process may
fail. In addition, input the real values to Flash and RAM size. If not, the default values will be used.
When all the settings are done, click the Next > buttons until clicking the Finish button.
The Debugger tab is used to provide the OpenOCD and GDB Client setup. OpenOCD requires
correct configuration files to know how to work with adapters and target chips. The configuration
files are specified in the Config options field. Nuvoton’s adapter is Nu-Link, which uses the
interface configuration file named nulink.cfg. In addition, Nuvoton has three different ARM
families, such as M0, M4, and M23. The corresponding target configuration files are
numicroM0.cfg, numicroM4.cfg, and numicroM23.cfg. For M23 2nd development, the target
configuration file would be numicroM23_NS.cfg.
As the first step, we should choose the right Chip Series in the Startup tab. When done, the
corresponding target configuration file will be automatically written in the Config options field of
the Debugger tab. To load executable to flash, we need to select the Load executable to flash
checkbox. To load executable to RAM, we need to select the Load executable to SRAM
checkbox. When all the settings are done, click the Apply button to take effect. To launch the
application into the debug mode, click the Debug button.
NUECLIPSE USER MANUAL
When entering the debug mode, we can open the Registers view in the upper-right corner of
Debug perspective. The Registers view lists information about the registers in a selected stack
frame.
The Memory view of the Debug perspective is used to monitor and modify the process memory.
The process memory is presented as a list of so called memory monitors. Each monitor
represents a section of memory specified by its location called base address. To open it, click the
Memory tab on the lower side of Debug perspective.
The Disassembly view shows the loaded program as assembler instructions mixed with source
code for comparison. We can do the following tasks in the Disassembly view:
To open it, we need to click the Instruction Stepping Mode button on the upper toolbar, as
follows:
To display the Peripheral Registers view, we need to utilize Packs mechanism. Packs can help
the user download SFR (special function register) files from the Keil repository. Firstly, we open
the Packs perspective by choosing it in the Open Perspective dialog.
NUECLIPSE USER MANUAL
For the first time we see the Packs perspective, its content is provided by the NuEclipse installer.
If the default content is missing, please switch to a new workspace and try again. To get the latest
version, click the Update the packages definitions from all repositories button at the upper-
right corner. After clicking, Eclipse begins downloading all the SFR files from a repository.
The locations of repositories are specified in the Window > Preferences > C/C++ > Packages >
Repositories. The default is from Keil’s CMSIS pack.
When the download is completed, we can find the Nuvoton SFR files and install them on Eclipse if
needed.
To use the specific SFR file, open the project’s properties dialog and go to the C/C++ Build >
Settings. From there, we should choose the specific device matching the real one. In this case, it
is M487JIDAE. Click the Apply button to take effect.
NUECLIPSE USER MANUAL
3.7 Watchpoints
To add watchpoints on Eclipse, we need to do the following steps:
1. Selecting a globe variable, i.e. g_seconds, in the Outline view.
2. Right-clicking on the global variable and choosing Toggle Watchpoint.
NUECLIPSE USER MANUAL
3. Configuring the settings for watchpoints. To stop execution when the watch expression is
read, select the Read checkbox. To stop execution when the watch expression is written to,
select the Write checkbox.
The ld script is responsible for telling the linker the layout of the compiled executable. For example,
the memory layout looks like:
The modified mem.ld script should meet the memory layout design.
To assign PC and SP to the specific addresses, we need to input them in the debug configuration,
as follows. Based on the previous memory layout, the PC and SP addresses should be
0x20001800 and 0x20001400, respectively. To download the binary to RAM, we select the Load
executable to SRAM button and unselect the Load executable to flash button. Click the Debug
button to start a debug session.
When the program stops in the main function, we open the Memory view. From there, we can
verify that the binary file is successfully downloaded into RAM. The first word denotes the SP
address. The following words denote the addresses of handlers.
NUECLIPSE USER MANUAL
4 Q&A
1. Q: Can we simultaneously debug on Eclipse, Keil and Iar?
A: No, we must stop the debug mode on Eclipse first. Then we can debug on another IDE.
2. Q: Can we simultaneously debug on Eclipse and use the Nuvoton development tools, such as ICP
Programming tool?
A: No, we must stop the debug mode on Eclipse first. Then we can use them and vice versa.
3. Q: How many breakpoints and watchpoints are supported?
A: It depends on the hardware. For M0 chips, the supported number of breakpoints and
watchpoints is 4 and 2, respectively. For M4 chips, the supported number of breakpoints and
watchpoints is 6 and 4, respectively. For M23 chips, the supported number of breakpoints and
watchpoints is 4 and 4, respectively. For now, we do not support flash breakpoints.
4. Q: How to update firmware for Nu-Link?
A: Please use ICP Programming tool or Keil to update firmware.
5. Q: How to change Flash and RAM size after projects are created?
A: Please find and open the ld script in the ldscripts folder. From there, we can change Flash and
RAM size.
6. Q: Why can the application not enter the debug mode?
A: Firstly, we must install all the stuff by following the previously mentioned steps. Then check the
following list:
I. Leave the previous debug mode first if exists.
II. Flash and RAM size must be correct.
III. OpenOCD should not be launched before debugging. To check that, please go to Windows
Task Manager or System Monitor. If an OpenOCD process has already been running, please
9. Q: Why does Eclipse fail to update or install new software packs on Windows?
A: One of possible reasons is that the write permission for Windows folders is denied. We need to
find the correct folder and allow the write permission. On the 64-bit Windows, the location where
we place software packs is C:\Program Files (x86)\Nuvoton Tools\Packages. Similarly, On the 32-
bit Windows, the location where we place software packs is C:\Program Files\Nuvoton
Tools\Packages.
NUECLIPSE USER MANUAL
5 Revision History
Date Revision Description
1. Supported NUC505.
2018.11.30 1.01.014
2. Updated the new project wizard.
Important Notice
Nuvoton Products are neither intended nor warranted for usage in systems or equipment, any
malfunction or failure of which may cause loss of human life, bodily injury or severe property
damage. Such applications are deemed, “Insecure Usage”.
Insecure usage includes, but is not limited to: equipment for surgical implementation, atomic
energy control instruments, airplane or spaceship instruments, the control or operation of
dynamic, brake or safety systems designed for vehicular use, traffic signal instruments, all
types of safety devices, and other applications intended to support or sustain life.
All Insecure Usage shall be made at customer’s risk, and in the event that third parties lay
claims to Nuvoton as a result of customer’s Insecure Usage, customer shall indemnify the
damages and liabilities thus incurred by Nuvoton.