You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SVD parser throws error on rp2040.svd file: Unable to parse SVD file: TypeError: Cannot read property ‘0’ of undefined #21
I’m using VSCode and I can’t fully use the debugger with SWD and cmsis-dap on my Raspberry Pi Pico, as it throws an error on the rp2040.svd file: Unable to parse SVD file: TypeError: Cannot read property ‘0’ of undefined. No variables, watches or peripherals can be viewed, as these are defined in the svd file. The debugger starts and functions correctly, but I am only able to see the breakpoints, call stack en registers.
People are helping out on making the svd compliant to the xsd, but so far it does not make any difference. I still get the error and missing debug features.
Any follow up on this? I've compiled the latest raspberry pi openocd version, but it has the same errors. The changes in the SVD did not solve any problems.
I'm using a simple Chinese ST Link v2 DAPLink compatible USB stick, and this works correctly with my STM32 boards.
(Aliexpress.com, search for daplink)
This still occurrs even when using the latests rp2040.svd file. Should be investigated in the parser what's going on, but that doesn't seem to be open-source.
Thanks for the reply Max, long time no follow up although the problem still exists. My opinion is the same as yours, it's most likely something in the parser, so the people working on platformio perhaps should look into it.
Just wanted to comment that the issue still exists, more than a year later, with the latest platformio core (6.1.13).
Thanks to Max' guides - 🙏 , I was able to make my setup of Arduino Nano RP2040 Connect + Raspberry Pi Debug probe start working/debugging.
Every time the debug session starts, the SVD error shows up - note that stepping through the code, breakpoints, variables inspection still work. The peripherals panel is not usable.
I have tried several flavors of the rp2040 SVD file - all with same results:
Hi @danluca et al., I am facing similar problems (I think) running the latest platformio core (6.1.13) and trying to use a Pico and the Pi Debug probe. almost immediately after initialisation the message
'Unable to parse SVD file: TypeError: Cannot read properties of undefined (reading '0')' pops up,
the debug console throws a warning:
----- Backtrace -----
Backtrace unavailable
---------------------
A fatal error internal to GDB has been detected, further
debugging is not possible. GDB will now terminate.
This is a bug, please report it.
For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>
and that's it. Im running on MacOS. Programming works fine. Starting the debugger from command line (arm-none-eabi-gdb) works fine. Sadly no nice debug tools from VScode.
The PlatformIO extension being unable to parse the SVD file should not cause GDB to crash -- those are two entirely different programs and GDB doesn't read the SVD file at all. Debugging should be possible, just no peripheral register view. I have not yet seen that one.
Can you modify ~/.platformio/platforms/raspberrypi/boards/pico.json to remove the "svd":.. line and retry after a clean VSCode restart? (There may be multiple raspberrypi directories, chose the right one.
There is a line "svd_path": "rp2040.svd" in the pico.json. (which I remove, and after clean start the 'unable to parse SVD file' is no longer there. GBD still crashes.
I have just investigated this issue for the rp2350.svd and found it, in a minimal example, that if a <peripheral> does not have a <description> tag, it fails to load the SVD file. Seems like the parser always expects it although it's optional. Let me see if I can fully fix RP2350 loadidng and do that the same for rp2040.svd.
Yes, for rp2350.svd, simply adding back dummy descriptions and removing the last "SPARE_IRQ" perpiheral (which has no defined registers, just interrupt definitions), makes the file loadable in PlatformIO.
Activity
gesture1968 commentedon Oct 27, 2021
People are helping out on making the svd compliant to the xsd, but so far it does not make any difference. I still get the error and missing debug features.
gesture1968 commentedon Nov 19, 2021
Any follow up on this? I've compiled the latest raspberry pi openocd version, but it has the same errors. The changes in the SVD did not solve any problems.
I'm using a simple Chinese ST Link v2 DAPLink compatible USB stick, and this works correctly with my STM32 boards.
(Aliexpress.com, search for daplink)
maxgerhardt commentedon Jun 9, 2022
This still occurrs even when using the latests
rp2040.svdfile. Should be investigated in the parser what's going on, but that doesn't seem to be open-source.gesture1968 commentedon Jun 10, 2022
Thanks for the reply Max, long time no follow up although the problem still exists. My opinion is the same as yours, it's most likely something in the parser, so the people working on platformio perhaps should look into it.
danluca commentedon Jan 15, 2024
Just wanted to comment that the issue still exists, more than a year later, with the latest platformio core (6.1.13).
Thanks to Max' guides - 🙏 , I was able to make my setup of Arduino Nano RP2040 Connect + Raspberry Pi Debug probe start working/debugging.
Every time the debug session starts, the SVD error shows up - note that stepping through the code, breakpoints, variables inspection still work. The peripherals panel is not usable.
I have tried several flavors of the rp2040 SVD file - all with same results:
Also note, other SVD files (for different chipsets - e.g. nrf52840) can be loaded fine.
Are we confident the issue is on platformio's core parser side?
edwindertien commentedon Mar 18, 2024
Hi @danluca et al., I am facing similar problems (I think) running the latest platformio core (6.1.13) and trying to use a Pico and the Pi Debug probe. almost immediately after initialisation the message
'Unable to parse SVD file: TypeError: Cannot read properties of undefined (reading '0')' pops up,
the debug console throws a warning:
and that's it. Im running on MacOS. Programming works fine. Starting the debugger from command line (arm-none-eabi-gdb) works fine. Sadly no nice debug tools from VScode.
as platformio.ini I use
[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico
framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0m
debug_tool = cmsis-dap
debug_speed = 30000
upload_protocol = cmsis-dap
build_type = debug
lib_deps =
adafruit/Adafruit NeoPixel
adafruit/Adafruit SSD1306 ; need to comment out the pgmspace.h
monitor_speed = 115200
Any obvious mistakes or steps I could take?
maxgerhardt commentedon Mar 18, 2024
The PlatformIO extension being unable to parse the SVD file should not cause GDB to crash -- those are two entirely different programs and GDB doesn't read the SVD file at all. Debugging should be possible, just no peripheral register view. I have not yet seen that one.
Can you modify
~/.platformio/platforms/raspberrypi/boards/pico.jsonto remove the"svd":..line and retry after a clean VSCode restart? (There may be multipleraspberrypidirectories, chose the right one.edwindertien commentedon Mar 18, 2024
There is a line "svd_path": "rp2040.svd" in the pico.json. (which I remove, and after clean start the 'unable to parse SVD file' is no longer there. GBD still crashes.
maxgerhardt commentedon Mar 18, 2024
Then it's independent of the SVD file and should be discussed in https://github.com/maxgerhardt/platform-raspberrypi/issues/.
edwindertien commentedon Mar 18, 2024
Thank you, I will
geonicz commentedon Mar 11, 2026
No updates on topic?
2026, March. Still rp2040.svd causes parser error and no peripherials available.
Any guesses how to solve it?
maxgerhardt commentedon Mar 11, 2026
I have just investigated this issue for the rp2350.svd and found it, in a minimal example, that if a
<peripheral>does not have a<description>tag, it fails to load the SVD file. Seems like the parser always expects it although it's optional. Let me see if I can fully fix RP2350 loadidng and do that the same for rp2040.svd.maxgerhardt commentedon Mar 11, 2026
Yes, for rp2350.svd, simply adding back dummy descriptions and removing the last "SPARE_IRQ" perpiheral (which has no defined registers, just interrupt definitions), makes the file loadable in PlatformIO.
Now let's see for RP2040..
maxgerhardt commentedon Mar 11, 2026
Bingo. Completely loadable rp2040.csv file after just adding dummy descriptions.
maxgerhardt commentedon Mar 11, 2026
Will be fixed by #89 or just download the latest rp2040.svd from https://github.com/maxgerhardt/platform-raspberrypi/blob/patch-2/misc/svd/rp2040.svd and overwrite your old one in
C:\Users\<user>\.platformio\platforms\raspberrypi\misc\svd.geonicz commentedon Mar 12, 2026
Works like a charm! Thanks a lot!
fix: avoid crash when optional <peripheral> is missing in svd. issue: p…