Page 1
The information described in this document is the exclusive intellectual property of Nuvoton Technology Corporation and shall not be reproduced without permission from Nuvoton. Nuvoton is providing this document only for reference purposes of NuMicro microcontroller based system design. Nuvoton assumes no responsibility for errors or omissions.
NuEclipse OVERVIEW 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: ...
NuEclipse REQUIREMENTS The following table lists system requirements for the user to run the NuEclipse. Minimum Requirements Recommended Specifications Operating System Windows® 7 x64 or GNU/Linux Windows® 10 x64 or Ubuntu 18.04 LTS GNU ARM Embedded Toolchain 6-2017-q1-major The latest version Note: To have a fully usable and pleasant experience on Linux, the recommended Linux distribution is Ubuntu 18.04 LTS (64-bit).
Performing the NuEclipse Installer on Microsoft Windows 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.
Extracting the NuEclipse Tar File on GNU/Linux 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.
NuEclipse 3.1.3 Verifying the Eclipse Preferences 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.
OpenOCD executable. On Microsoft Windows, for example, the path of OpenOCD folder could be C:/Program Files (x86)/Nuvoton Tools/OpenOCD. Similarly, on GNU/Linux it could be /usr/local/OpenOCD. The OpenOCD executable provided by Nuvoton is customized for Nu-Link.
NuEclipse Running Eclipse To run NuEclipse, double-click the eclipse.exe. Note that the .exe file and the related folders, such as the OpenOCD folder, should stay in the same directory; otherwise, the application will not work properly. Figure 3-5 Eclipse.exe and Related Folders Apr.
NuEclipse DEVELOPMENT TUTORIAL Select Workspace When Eclipse launches, we have to select a workspace which groups a set of related projects together that usually make up an application. In addition, some configuration settings for Eclipse and projects are stored here, too. For different computers, the configuration settings may change. We should create our own workspace rather than copying another user’s workspace.
C project, click File > New > C Project. The New Project Wizard appears. Here we choose Hello World Nuvoton Cortex-M C Project for Project type. Input the project name and click the Next > button to continue.
NuEclipse 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 >...
Select General > Existing Project into Workspace and click Next. Choose either Select root directory or Select archive file and click the associated Browse to locate the directory or file containing the projects. In the Nuvoton BSP, the Eclipse projects are stored in the GCC folder.
NuEclipse Build Settings After projects have been created, we still have a chance to alter the build settings by clicking Project > Properties. The Properties wizard shows up. Then go to C/C++ Build > Settings. From there, we can alter the build settings according to the actual target chip. Then click the Apply button to take effect.
Double click on the GDB Nuvoton Nu-Link Debugging group. The Nuvoton Nu-Link debug configuration appears on the right-hand side. In the Main tab, the name of Project should coincide with the project name. The C/C++ Application should point to the elf application generated by the build process.
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.
NuEclipse 4.5.2 Startup Tab 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.
NuEclipse Debug Views Eclipse provides many debug views. Each of them contains specific information for debugging. 4.6.1 Registers View When entering the debug mode, we can open the Registers view in the bottom of Debug perspective. The Registers view lists information about the registers in a selected stack frame.
NuEclipse 4.6.2 Memory View 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.
NuEclipse 4.6.3 Disassembly View 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: Setting breakpoints at the start of any assembler instruction. Enabling and disabling breakpoints.
NuEclipse 4.6.4 Peripheral Registers View To display the Peripheral Registers view, we need to utilize Packs mechanism. Packs can help the user download special function register (SFR) files from the Keil repository. Firstly, we open the Packs perspective by choosing it in the Open Perspective dialog.
NuEclipse 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 an online repository.
NuEclipse The locations of repositories are specified in the Window > Preferences > C/C++ > Packages > Repositories. The default is from Keil’s CMSIS Pack. Figure 4-15 Locations of Repositories Apr. 25, 2022 Page 25 of 57 Rev 1.02.019...
NuEclipse When the download is completed, we can find the Nuvoton SFR files and install them on Eclipse if needed. Figure 4-16 Installing SFR Files Apr. 25, 2022 Page 26 of 57 Rev 1.02.019...
NuEclipse 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 As a result, we can monitor the peripheral registers when debugging. Figure 4-18 Peripheral Registers View Apr. 25, 2022 Page 28 of 57 Rev 1.02.019...
NuEclipse Watchpoints To add watchpoints on Eclipse, we need to do the following steps: Selecting a globe variable, i.e. g_seconds, in the Outline view. Right-clicking on the global variable and choosing Toggle Watchpoint. Figure 4-19 Toggle Watchpoint Apr. 25, 2022 Page 29 of 57 Rev 1.02.019...
NuEclipse 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. Figure 4-20 Properties for C/C++ Watchpoint When the watchpoint is added, it appears in the Breakpoints view.
NuEclipse Debug in RAM To debug in RAM, there are several steps to follow: Modifying the ld script. Assigning PC to the specific RAM address. Assigning SP to the specific RAM address. Downloading the binary file to RAM. The ld script is responsible for telling the linker the layout of the compiled executable. For example, the...
NuEclipse 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 Reset_Handler and 0x20001400, respectively. In addition, set ector Table Offset Register (0xE000ED08) should be 0x20000000 and unselect the Pre-run/Restart reset Button.
NuEclipse 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.
Import an executable for debugging (referring to Figure 4-26). Click Browse following Select executable, then select an executable (referring to Figure 4-27). Choose GDB Nuvoton Nu-Link Debugging as a Launch Configuration (referring to Figure 4-28). Locate the GDB executable in the debug configuration (referring to Figure 4-29).
Nu-Link2 had built-in CMSIS-DAP interface from v3.09.7380r, and this CMSIS-DAP interface is used to support Single Cortex-A, Multi-Core SMP and AMP (Cortex-A + Cortex-M). Besides, NuEclipse provides GNU toolchain for the Cortex-A family which resides in NuEclipse/Others folder. After configuring this toolchain (see Section 3.1.3), we can build MA35D1’s projects.
This section describes how to configure a single Cortex-A core debug. Take Nuvoton MA35D1 as an example, which has dual Arm Cortex-A35 cores and one Arm Cortex-M4 core. To debug it, we should choose NuMicro A35 and resume the target at the position where the executable starts running in the Startup tab, as follows.
NuEclipse When the images are too large, the download command may face a timeout. To avoid that, go to Window > Preferences > C/C+ > Debug > GDB and disable the Command timeout or increase it. Figure 4-33 How to Disable Command Timeout Apr.
To debug single A35 core, we have to disable CPU1 setting by commenting out the following code in the numicroMA35D1.cfg. On Windows, the location where numicroMA35D1.cfg resides could be C:\Program Files (x86)\Nuvoton Tools\ OpenOCD\scripts\target. On GNU/Linux, it could be /usr/local/OpenOCD/scripts/target.
NuEclipse 4.10.3 Configuration of debugging Dual-core Cortex-A in SMP mode To debug SMP, e.g. dual A35 core, please refer to Section 4.10.2, but bypass the step that disabling CPU1 setting. 4.10.4 Configuration of debugging Single-core Cortex-A and Cortex-M in AMP mode To debug AMP, e.g.
NuEclipse To launch A35 and M4 applications simultaneously, we use Launch Group by the following steps: Give a name to the newly created launch group. Press on the Add button. Add the expected launch configurations to the launch group. Press on the OK button.
To debug AMP, e.g. dual A35 core and M4 simultaneously, we have to disable the CPU Symmetric Multi- Processors (SMP) by commenting out the following code in the numicroMA35D1.cfg. On Windows, the location where numicroMA35D1.cfg resides could be C:\Program Files (x86)\Nuvoton Tools\ OpenOCD\scripts\target. On GNU/Linux, it could be /usr/local/OpenOCD/scripts/target.
Import an executable for debugging (referring to Figure 4-26). Click browse following select executable, then select an executable (referring to Figure 4-27). Choose GDB Nuvoton Nu-Link Debugging as a Launch Configuration (referring to Figure 4-28). Locate the GDB executable in the debug configuration (referring to Figure 4-40).
NuEclipse Figure 4-40 Locating the AARCH64 GDB Executable Figure 4-41 The First Time to Enter the Debug Mode Settings Apr. 25, 2022 Page 49 of 57 Rev 1.02.019...
NuEclipse Figure 4-42 The Second Time to Enter the Debug Mode Settings Figure 4-43 AARCH32 Program Debugging Apr. 25, 2022 Page 50 of 57 Rev 1.02.019...
NuEclipse 4.10.7 System Registers Access When entering the debug mode, we can open the Registers View in the bottom of Debug perspective. The Registers view lists information about the registers in a selected stack frame. Some system registers are listed after general registers.
Page 52
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. 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.
NuEclipse Q: How to add udev rules for Nu-Link on GNU/Linux? A: When accessing target chips via Nu-Link, GNU/Linux requires the USB permission. We can get the permission by adding udev rules for Nu-Link. Here are the steps to do that: Add the User to the plugdev Group.
Q: How to edit string substitution for openocd_nulink_path? A: The openocd_nulink_path string stores where the OpenOCD executable resides. After upgrading NuEclipse, the string may keep the previous OpenOCD path. To fix it, click Window > Preferences, the Preferences wizard appears. Go to Run/Debug > String Substituion.
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 Windows, the location where we place software packs is C:\Program Files (x86)\Nuvoton Tools\Packages. 10. Q: How to adjust output voltage of Nu-Link2? A: Upgrade the NuLink2 firmware greater than version v3.08.7249, open NU_CFG.TXT file in...
NuEclipse REVISION HISTORY Date Revision Description 2017.03.31 0.01.000 Alpha version released. 2017.06.30 1.01.000 Beta version released. 2018.09.15 1.01.013 Official version released. 1. Supported NUC505. 2018.11.30 1.01.014 2. Updated the new project wizard. 2019.08.09 1.01.015 Supported M031 ,M261 and M480LD. 2020.03.06 1.01.016...
Page 57
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.