Nuvoton Nu-Maker-M032SE: Programming write fails in openocd init.

Post Reply
nanoController
Posts: 22
Joined: 27 Jun 2022, 11:33

25 Dec 2022, 05:23

I set up a Nuvoton Nu-Maker-M032SE, which is an evaluation board for the m031, in
viewtopic.php?t=10971

I wrote the sample helloWorld image to it, and it did run, and stepped through the code. However, as noted in that (and IIRC another) thread, printing to serial did not work. It just seemed to hang at the printf(). So, I ended up testing it on Windows, which worked immediately.
.
Then, I tried to do another write to the target ie program the eval board with a new image. That failed, persistently, with the following shown in a pop-up dialogue:

"
'Launching testProj' has encountered a problem.
OpenOCD failed with code (1).
For more details, see the openocd console."


The eclipse Console printed 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
Error: nulink_usb_reset failed
in procedure 'init'
in procedure 'ocd_bouncer'
"

I have scoured the manuals, and 'googled' to no end. The eclipse configurations are fine, matching the manuals. The eval board, too, is unchanged; I even tested it on Windows, successfully writing another helloWorld.elf to it, and saw it print in putty.
.
I ran openocd with extra debugs,

# in ~/local/OpenOCD
./bin/openocd -d3 -f scripts/interface/nulink.cfg -f scripts/target/numicroM0.cfg

which resulted in

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
User : 13 1 command.c:544 command_print(): debug_level: 3
Debug: 14 1 options.c:166 add_default_dirs(): bindir=bin
...
Debug: 275 14 nulink_usb.c:1581 nulink_usb_open(): max_packet_size: 1024
Debug: 276 14 nulink_usb.c:1582 nulink_usb_open(): jtag_libusb_open succeeded
Debug: 277 14 nulink_usb.c:1588 nulink_usb_open(): detach kernel driver failed(-5)
Debug: 278 14 nulink_usb.c:1601 nulink_usb_open(): jtag_libusb_claim_interface succeeded
Debug: 279 14 nulink_usb.c:306 nulink_usb_version(): nulink_usb_version
Debug: 280 16 nulink_usb.c:1611 nulink_usb_open(): nulink_usb_version failed with cmdSize(4 * 5)
Debug: 281 16 nulink_usb.c:306 nulink_usb_version(): nulink_usb_version
Debug: 282 18 nulink_usb.c:1615 nulink_usb_open(): nulink_usb_version failed with cmdSize(4 * 6)
Debug: 283 18 nulink_usb.c:1366 nulink_speed(): nulink_speed: query(0)
Debug: 284 18 nulink_usb.c:1385 nulink_speed(): NULINK nulink_speed: 1000
Debug: 285 20 nulink_usb.c:1411 nulink_speed(): nulink_speed: h->hardwareConfig(0)
Debug: 286 70 nulink_usb.c:1640 nulink_usb_open(): nulink_usb_open: we manually perform nulink_usb_reset
Debug: 287 70 nulink_usb.c:503 nulink_usb_reset(): nulink_usb_reset: RESET_HW
Debug: 288 70 nulink_usb.c:527 nulink_usb_reset(): nulink_usb_reset: EXTMODE_NORMAL
Debug: 289 80 nulink_usb.c:1366 nulink_speed(): nulink_speed: query(0)
Debug: 290 80 nulink_usb.c:1385 nulink_speed(): NULINK nulink_speed: 1000
Debug: 291 82 nulink_usb.c:1411 nulink_speed(): nulink_speed: h->hardwareConfig(0)
Debug: 292 132 nulink_usb.c:503 nulink_usb_reset(): nulink_usb_reset: RESET_HW
Debug: 293 132 nulink_usb.c:527 nulink_usb_reset(): nulink_usb_reset: EXTMODE_NORMAL
Debug: 294 142 nulink_usb.c:1366 nulink_speed(): nulink_speed: query(0)
Debug: 295 142 nulink_usb.c:1385 nulink_speed(): NULINK nulink_speed: 1000
Debug: 296 144 nulink_usb.c:1411 nulink_speed(): nulink_speed: h->hardwareConfig(0)
Debug: 297 194 nulink_usb.c:503 nulink_usb_reset(): nulink_usb_reset: RESET_HW
Debug: 298 194 nulink_usb.c:530 nulink_usb_reset(): nulink_usb_reset: EXTMODE_M0A21
Debug: 299 204 nulink_usb.c:503 nulink_usb_reset(): nulink_usb_reset: RESET_HW
Debug: 300 204 nulink_usb.c:533 nulink_usb_reset(): nulink_usb_reset: EXTMODE_M030G
Error: 301 215 nulink_usb.c:1653 nulink_usb_open(): nulink_usb_reset failed
Debug: 302 216 hla_layout.c:47 hl_layout_open(): failed
Debug: 303 216 command.c:626 run_command(): Command failed with error code -4
User : 304 216 command.c:687 command_run_line(): in procedure 'init'
in procedure 'ocd_bouncer'
Debug: 305 216 command.c:626 run_command(): Command failed with error code -4
User : 306 216 command.c:687 command_run_line():
Debug: 307 216 hla_interface.c:117 hl_interface_quit(): hl_interface_quit
Debug: 308 216 nulink_usb.c:1431 nulink_usb_close(): nulink_usb_close

The exit status was 1. The PC has not been rebooted, but the usb dongle (ie the burner aka programmer aka jtag pod aka debugger ie NU-Link2-Me) has been ejected/inserted a few times. But I've checked the presence of /dev/ttyACM0 every time.
The LEDs of the burner/debugger suggest nothing, nor does the LED on the target board.
I do possess a nu-link-pro burner, so I could circumvent the NU-Link2-Me. But I don't see the latter as being the culprit. (Yes, VCOM pins 1-2 are On.)
I've looked at a lot of the openocd documentation, but I really do not want to dig into its source code. I could update it to the latest (and the NU-Link2-Me firmware to the latest), but that could easily go wrong -- because nuvoton supposedly tested all of these together.
There is an ICSP-like header on the target board; I could try that, but I'm unsure as to how the eclipse Debug Configurations will need to be changed.
.
NB I am not interested in debugging; I just want to burn the image to the target! So, I don't care if I can't step through the code. Yes, that means that i could go the openocd+gdb route, but I have no desire to iron out the inevitable hiccups.

So, TBD.

nanoController
Posts: 22
Joined: 27 Jun 2022, 11:33

25 Dec 2022, 06:01

The attached is a screenshot of it happening with the sample helloWorld project. (This forum does not seem to work properly, except with Chrome! So, who knows if the attachment will show!)
Attachments
import22869.jpeg
OpenOCD failed with code (1).
import22869.jpeg (54.95 KiB) Viewed 27281 times

wclin
Posts: 6
Joined: 21 Apr 2021, 14:34

26 Dec 2022, 10:24

Sorry for any inconvenience caused.

Due to some BUGFIXs are solved in latest version, could you upgrade the Nuvoton OpenOCD version to 0.10.0-dev-00486-g43a1564e and NuLink firmware to >r7380?

By the way, NuLink also supports Drag-and-Drop programming. It implies the binary and hexadecimal file format of image are supported by copying the image file into NuMicro MCU disk to finish image directly.
It is without OpenOCD supporting. I also record a video clip to demo the function. See https://youtu.be/ROoaYA3Eq4E

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests