Longan Nano PlatformIO issues

Using and setting up PlatformIO.

I am trying to upload the demo longan LED blink program. I can build the project but I can’t upload it, I keep getting the error:

Processing sipeed-longan-nano (platform: gd32v; board: sipeed-longan-nano; framework: gd32vf103-sdk)
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/gd32v/sipeed-longan-nano.html
PLATFORM: GigaDevice GD32V 1.1.0 > Sipeed Longan Nano
HARDWARE: GD32VF103CBT6 108MHz, 32KB RAM, 128KB Flash
DEBUG: Current (altera-usb-blaster) External (altera-usb-blaster, gd-link, jlink, rv-link, sipeed-rv-debugger, um232h)
PACKAGES: framework-gd32vf103-sdk 1.0.0, tool-openocd-gd32v 0.1.1, tool-gd32vflash 0.1.0, toolchain-gd32v 9.2.0
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Checking size .pio/build/sipeed-longan-nano/firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [=         ]   7.0% (used 2310 bytes from 32768 bytes)
PROGRAM: [=         ]   5.0% (used 6572 bytes from 131072 bytes)
Configuring upload protocol...
AVAILABLE: altera-usb-blaster, dfu, gd-link, jlink, rv-link, serial, sipeed-rv-debugger, um232h
CURRENT: upload_protocol = dfu
Uploading .pio/build/sipeed-longan-nano/firmware.bin
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
dfu-util: Cannot open DFU device 28e9:0189
dfu-util: No DFU capable USB device available
*** [upload] Error 74
======================================================================================== [FAILED] Took 0.29 seconds ========================================================================================
The terminal process terminated with exit code: 1

What does Invalid DFU suffix signature mean?

Any thoughts? Thanks.

Can you see the longan board in the device manager? Is there a libusb driver for longan?

If you use linux, try adding a udev rule, or set the access permissions of the longan device to 777.

@BigBits Thanks for the help. I am using an Ubuntu flavor called Pop_OS!.

  1. Are you referring to PlatformIO’s Devices tab? If so then I don’t see it. However, if I plug in the JTAG debugger then I can see the debugger.

  2. Ironically I do have libusb installed. I had to compile and install the latest because I am programming in Go to access Adafruit’s FTDI breakout board. Also, I didn’t know there was a libusb requirement for the Longan–I guess I met it by happenstance ;-).

  3. I am aware of udev rules and have several for FPGAs and one for PlatformIO, but I didn’t know Longan’s dependency. So I added a udev rule that matched dmesg’s output:ATTR{idProduct}=="0189", ATTR{idVendor}=="28e9", MODE="0666". But I still don’t see it listed as a device by PlatformIO.

dmesg says:

[135296.414735] usb 1-2.2: Detected FT232H
[135296.415012] usb 1-2.2: FTDI USB Serial Device converter now attached to ttyUSB0
[135703.187951] usb 1-2.2: USB disconnect, device number 14
[135703.188327] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[135703.188365] ftdi_sio 1-2.2:1.0: device disconnected
[140307.855323] audit: type=1400 audit(1571281012.175:48): apparmor="DENIED" operation="open" profile="/usr/bin/evince-thumbnailer" name="/usr/local/lib/liblzma.so.5.2.4" pid=15441 comm="evince-thumbnai" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[142323.024848] usb 1-2.4.3: new full-speed USB device number 15 using xhci_hcd
[142323.126447] usb 1-2.4.3: New USB device found, idVendor=28e9, idProduct=0189, bcdDevice=10.00
[142323.126453] usb 1-2.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[142323.126456] usb 1-2.4.3: Product: GD32 0x418 DFU Bootloade
[142323.126459] usb 1-2.4.3: Manufacturer: GDMicroelectronics
[142323.126462] usb 1-2.4.3: SerialNumber: 䌳䩂

And as mentioned previously, I can’t upload because of some DFU error. :thinking:

Good news. It works ! :partying_face:

Re-triggering udev rules didn’t work so well. I needed to do a full reboot, and by full-reboot I mean I had to literally reboot the motherboard. I have a system76 machine and it has both a soft-reboot and hard-reboot–it took a hard-reboot.

I was able to finally upload the blink example. Yeah! :nerd_face: