Page 1 of 1

Development on Linux not supported

Posted: 29 Jun 2022, 21:53
by nanoController
Hello, world!
I've been looking into Nuvoton micro-controllers (uC) for a while now. The global supply crisis has caused me to look for alternatives, as stock-levels for everything else has crashed, and their prices skyrocketed! Nuvoton's do not suffer either problem--not for my purposes, anyway.
Unfortunately, despite offering a download of Eclipse for Linux, development on Linux is not quite supported--as confirmed by Support, via email. The code-generation utilities run on only Windows, and the same seems to go for burning/programming utilities that talk to the debugger/OCD/programming h/w (Nu-Link).
I've ordered the latter + an eval. board, though I don't recall what the interface to the development host was. If USB, then might there be a possibility of the Linux Eclipse possibly _burning_ the code it compiles? ... No, since the code needed to talk to the target uC, via Nu-Link, runs on only Windows. ... But, I am yet to test this.

Burning possible from Linux

Posted: 21 Dec 2022, 07:56
by nanoController
I tried the sample Hello World project, in eclipse (actually, NuEclipse, the version of eclipse which Nuvoton has presumably added the right plugins/modifications to), from Linux.
It did burn to the target. In my case, I was using the m032 se3ae eval board. (I will likely write more about this in my other thread, viewtopic.php?t=10971).
.
My initial attempt kept on running into "Program file does not exist." This was because it could not find the helloWorld.elf file, even though the compilation did generate it.
~/eclipse-workspace/helloWorld/Debug/helloWorld.elf

IIRC, to check whether eclipse can see the generated .elf file,
eclipse > helloWorld > Run > Debug Configurations > GDB Nuvoton Nu-Link Debugging > helloWorld Debug

Then, under its Main tab, click on
C/C++ Application

If that does not list the helloWorld.elf file, then click on Search Project, which should then find it.
IIRC, after that, you could click on the Debug button (in the same dialogue box) which should then burn the image to the target. The eclipse Console will show the image-write as it progresses. Something like the following:

Open On-Chip Debugger 0.10.0-dev-00479-g8e8e6623-dirty (2022-04-27-10:02)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1000 kHz
Info : NULINK is Nu-Link2
Info : NULINK firmware_version(6985), product_id(0x00d4851f)
Info : IDCODE: 0x0BB11477
Info : NuMicro.cpu: hardware has 4 breakpoints, 2 watchpoints
Started by GNU ARM Eclipse
Info : accepting 'gdb' connection on tcp/3333
Info : Device ID: 0x01132e10
Info : Device Name: M032SE3AE
Info : bank base = 0x00000000, size = 0x00020000
Info : Device ID: 0x01132e10
Info : Device Name: M032SE3AE
Info : bank base = 0x0001f000, size = 0x00000000
Info : Device ID: 0x01132e10
Info : Device Name: M032SE3AE
Info : bank base = 0x00100000, size = 0x00001000
Info : Device ID: 0x01132e10
Info : Device Name: M032SE3AE
Info : bank base = 0x00300000, size = 0x0000000c
NuMicro.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0x000000f0 msp: 0x200004b8
numicro chip_erase complete
NuMicro.cpu: target state: halted
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0xc1000003 pc: 0xfffffffe msp: 0xffffffd8
Info : numicro write_isp 0x00300008 0xffffff5a
Info : Nuvoton NuMicro: Flash Write ...
Info : Have written 9%
Info : Have written 18%
Info : Have written 27%
Info : Have written 36%
Info : Have written 46%
Info : Have written 55%
Info : Have written 64%
Info : Have written 73%
Info : Have written 83%
Info : Have written 92%
Info : Have written 100%
wrote 6932 bytes from file /home/bugger/eclipse-workspace/helloWorld/Debug/helloWorld.hex in 2.147938s (3.152 KiB/s)
NuMicro.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0x000006a8 msp: 0x20004000
===== arm registers
(0) r0 (/32): 0xFFFFFFFF
(1) r1 (/32): 0xFFFFFFFF
(2) r2 (/32): 0xFFFFFFFF
(3) r3 (/32): 0xFFFFFFFF
(4) r4 (/32): 0xFFFFFFFF
(5) r5 (/32): 0xFFFFFFFF
(6) r6 (/32): 0xFFFFFFFF
(7) r7 (/32): 0xFFFFFFFF
(8) r8 (/32): 0xFFFFFFFF
(9) r9 (/32): 0xFFFFFFFF
(10) r10 (/32): 0xFFFFFFFF
(11) r11 (/32): 0xFFFFFFFF
(12) r12 (/32): 0xFFFFFFFF
(13) sp (/32): 0x20004000
(14) lr (/32): 0xFFFFFFFF
(15) pc (/32): 0x000006A8
(16) xPSR (/32): 0xC1000000
(17) msp (/32): 0x20004000
(18) psp (/32): 0xFFFFFFFC
(19) primask (/1): 0x00
(20) basepri (/8): 0x00
(21) faultmask (/1): 0x00
(22) control (/2): 0x00
===== Cortex-M DWT registers
(23) dwt_ctrl (/32)
(24) dwt_cyccnt (/32)
(25) dwt_0_comp (/32)
(26) dwt_0_mask (/4)
(27) dwt_0_function (/32)
(28) dwt_1_comp (/32)
(29) dwt_1_mask (/4)
(30) dwt_1_function (/32)

Printing to serial failed, from Linux

Posted: 21 Dec 2022, 07:58
by nanoController
I forgot to mention that, though helloWorld burnt to the target, I could not see its printf() print anything. I had to jump to Windows to see it work! (Even in that, I had to do Search Project to get it to see its elf file!)
Hopefully, I'll elaborate in my other thread.

Keil and IAR EWARM

Posted: 21 Dec 2022, 09:38
by nanoController
One thing that the manuals do not note is that the Keil IDE is available for free (for cortex-m0), from Nuvoton! This is for only Windows.
IAR EWARM is available for Linux, but it is a paid licence. Annoyingly, there is no price listed on the site, for even a single seat.
See
https://www.nuvoton.com/tool-and-softwa ... -compiler/

Re: Development on Linux not supported

Posted: 21 Dec 2022, 13:16
by wclin
For IAR for Linux license fee, please contact IAR directly.
We suggest to use free MDK for Nuvoton CM0/CM23 series or NuEclipse IDEs to develop your project for cost down.