Debug Sipeed Longan invalid board option


I am trying to use one Sipeed Longan nano to debug another one. When I click on Start Debugging I get this

Verbose mode can be enabled via -v, --verbose option
KeyError: “Invalid board option ‘build.ldscript’”:
File “U:\LonganIDE.platformio\penv\Lib\site-packages\platformio\builder\”, line 175:
env.SConscript(item, exports=“env”)
File “U:\LonganIDE.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Script\”, line 591:
return _SConscript(self.fs, *files, **subst_kw)
File “U:\LonganIDE.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Script\”, line 280:
exec(compile(scriptdata, scriptname, ‘exec’), call_stack[-1].globals)
File “X:\Firmware\RV-link_longan\proj\”, line 65:
LDSCRIPT_PATH = join(PROJ_DIR, “src”, “link”, “gd32vf103c-start”, “RISCV”, “gcc”, board.get(“build.ldscript”))
File “u:\longanide.platformio\penv\lib\site-packages\platformio\platform\”, line 59:
raise KeyError(“Invalid board option ‘%s’” % path)

This is my platformio.ini
platform = gd32v
framework = gd32vf103-sdk
board = sipeed-longan-nano
monitor_speed = 115200
debug_tool = sipeed-rv-debugger

I have uploaded the RV Link debug project from this sipeed page
Using RV-LINK · Longan DOC (

This is the platformioi rv-link project I downloaded

I changed the upload from dfu to serial, as I cant get dfu work to at all.

I used a FTDI 232 to program the nano over serial, using this platformio.ini

Blockquote; PlatformIO Project Configuration File
; Build options: build flags, source filter, extra scripting
; Upload options: custom port, speed and extra flags
; Library options: dependencies, extra library storages
; Please visit documentation for the other options and examples
; Redirecting...

platform = gd32v
;framework = gd32vf103-sdk
board = sipeed-longan-nano
monitor_speed = 115200
upload_protocol = serial
debug_tool = sipeed-rv-debugger
build_flags =


extra_scripts =
src_filter =


It looks like it worked, I have a green LED flashing.

Then the second nano I want to debug, so I connected them all like this

FT232 Nano Debugger RV-Link Program to debug Nano
Rx Tx
Tx Rx
VCC 3.3V
Any ideas ?


This code is problematic if the board definition does not have this meta info. I’m not sure if one is supposed to use the linked project there because it looks really odd to me how it’s a baremetal project (framework = .. line is commented out!) and so they have to do a custom builder script to build the SDK. But then in that script they assume the board file has some attribute which is not there, breaking compilation.

My guess is that this is some old project where they didn’t have a builder script yet and it is superseeded by the examples in the current repository.

You should base your project off of platform-gd32v/examples/longan-nano-blink at master · sipeed/platform-gd32v · GitHub and then just add debug_tool = sipeed-rv-debugger.

Alternatively you can try and use the original project and add

board_build.ldscript =

in an attempt to fix the builder script.

Manyh thanks, you were right adding the linker script name in the file directly works.
I can now upload files to the Longan, still can’t debug it though using another nano or jlink.