Setting up a Nuvoton Nu-Maker-M032SE

Post Reply
Posts: 12
Joined: 27 Jun 2022, 11:33

02 Jul 2022, 14:31

As a newb to the Nuvoton platform, I purchased a Nu-Maker-M032SE, which is an evaluation board for the m032 micro-controller (uC). This is a record of my initial fiddlings with it.

Where I am, and considering my time pressures, I got the board from digikey (as opposed to techDesign or Nuvoton Direct, which'd have shipped from Taiwan, at least in the latter case), which got here quickly.

As well, I got a programmer, to write compiled images with. As it turned out, though, the eval board comes with a mini-programmer, the Nu-Link2-Me. The one I purchased is the mid-tier one -- though developers are encouraged to use the latter, rather than the entry-level one. The options are: ... rogrammer/

My focus is on the m031, though IIRC I did not find an eval board for it-- not in-stock anyway. So I am using an m032's, which is the same thing, except that it supports USB devices. (No, not the usb receptacle used to talk to the development host; I mean a usb device on the target product.)

The eval board's user manual is under ... ion-board/

Other user manuals are under ... nual&tab=2

There is a Quick Start in the eval board's manual. For linux, it's simple: I plugged the eval board into the development host's usb port, via a micro-usb cable. That resulted in 2 LEDs lighting up on the board: one on the main board itself, and one on the mini debugger. Linux immediately saw the device, and created a new file under /dev eg /dev/ttyACM0 . The baud rate to be used for the latter is 112500. So, minicom's command-line would be
minicom -D /dev/ttyACM0 -b 112500

Linux Eclipse was gotten from ... -compiler/
or ... &rt=Driver

IIRC that gives you the compiler toolchain as well.
Next, the eval board's manual says that you should get the BSP. Mine is under ... t-package/

Next, I'll see if I can get a Hello World going, from Eclipse.

Posts: 12
Joined: 27 Jun 2022, 11:33

02 Jul 2022, 23:20

I forgot: Before connecting the usb, 2 dip-switches have to be toggled, in order to enable the serial (COM port) connection. These are shown in the eval board's manual, and on the upper left-hand side of the attached picture.
The dip switches are on the upper right-hand side. Toggle the first two: 1 & 2.
import26248.jpeg (65.07 KiB) Viewed 2419 times
The eval board. Again, the dip switches are on the RHS.
import3739.jpeg (59.39 KiB) Viewed 2419 times

Posts: 12
Joined: 27 Jun 2022, 11:33

03 Jul 2022, 13:17

I mentioned where to get the Linux eclipse (Nu-Eclipse) from.
The version i got was

Once extracted, it contains a

which must be run, and as a regular user ie non-root. It assumes that you have 'sudo' available and enabled; that basically/IIRC sets up a udev rule, and adds you to the plugdev group.
The creates a ~/local/ directory.

The extracted tree contains, within it, the toolchain, sample codes and various other things. The actual 'eclipse' executable is

which seems to be runnable from this location! I soft-linked to it, of course, which does work from any directory.

Now, the eval board's manual says to open a sample project, as your first project in eclipse. It points to a Template project under the BSP tree. Mine is

(BTW, where should one place all these extractions? Good question! For now, the eclipse extraction seems to work from anywhere you place it. The BSP tree is something that I think you can open from within eclipse ie you don't have to tell it where the BSP tree is, though I may be wrong.
And the ~/local/ tree it creates itself.)

But the Template project need not be opened. The current version of eclipse already offers that via a more intuitive path:

eclipse > File > New > C/C++ Project > C Managed Build

which lists some hello-world projects, including a
Hello World Nuvoton Cortex-M Project

with a choice of the following toolchains :
Cross GCC
Linux GCC

This seems to be the proverbial Hello World, which is to write to UART. I've not built this yet, so that'll be in another post.

Posts: 12
Joined: 27 Jun 2022, 11:33

03 Jul 2022, 13:44

To ensure that eclipse has found your toolchain (which, after all, it _should_ because it comes _bundled_ with it), check

eclipse > Window > Preferences > C/C++ > Build > Global Tools Paths

This will show your paths. On Linux, "Build tools folder" should be blank.
eclipse > Window > Preferences > C/C++ > Run/Debug > OpenOCD Nu-Link

should have found ~/local/OpenOCD/bin

Posts: 12
Joined: 27 Jun 2022, 11:33

03 Jul 2022, 14:00

The Linux eclipse (Nu Eclipse) manual is indispensable. It has a lot of info, which I am following, step by step.

Posts: 12
Joined: 27 Jun 2022, 11:33

03 Jul 2022, 14:16

is the latest, April 2022, user manual for eclipse.

Posts: 12
Joined: 27 Jun 2022, 11:33

05 Jul 2022, 14:13

So far, I've not had success in building Hello World. The first error was that it could not find the file M031Series.h!
That is in




which are all the same file.
Curiously, there is also

which is different in only name. As the latter is iirc created by eclipse, and my version of eclipse is slightly more recent than the BSP, I'd have thought the lower-case name to be more recent. Yet, the compilation looks for the upper-case one! A mere rename might be called for.

Note: The Library/Device/Nuvoton/M031Series/Include/* which the BSP has is different from the one in ~/eclipse-workspace/! Unfortunately, I cannot tell which is more recent, since the file-dates of the latter had not been preserved, and the version numbers within are the same!!!!!

Posts: 12
Joined: 27 Jun 2022, 11:33

07 Jul 2022, 11:09

Before I forget:
I had trouble compiling the Hello World project! Just now, it built.

To cut to the chase:
. Somehow, -Werror and -Wconversion were set. I highly doubt that I set them, despite my predilection for the former. I know better than to set -Wconversion on a project that's not mine! De-selecting these helped.

. I had set Big Endian for the target. That choked because compilation links with objects that were built as Little Endian. Reverting the endian to the 'toolchain default' (ie Little), helped.

BTW, by default, the build log is stored in somewhere inane such as

Thankfully, that can be changed in Project Properties.

Posts: 12
Joined: 27 Jun 2022, 11:33

07 Jul 2022, 12:38

I realized where I had set -Werror. It was at project-creation!

When the sample-code project of Hello World is first created, it asks you some questions eg the flash and RAM of the target. The following are also selectable:

. Check most warnings
. Check some warnings
. -Werror

I think I selected them all, now knowing that they'd include -Wconversion!

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests