Sysprogs forums › Forums › VisualGDB › VisualGDB fails to upload compiled sketch using Picoprobe CMSIS-DAP
- This topic has 3 replies, 2 voices, and was last updated 1 year, 5 months ago by support.
-
AuthorPosts
-
July 20, 2023 at 10:02 #34494alefParticipant
Hi,
I am trying to use Picoprobe CMSIS-DAP to upload my Arduino sketch on a Raspberry Pi Pico. I can correctly configure and use the debugger with the same upload config, however I am not able to use picoprobe to simply upload the sketch. I can do this with no problems if I use Arduino IDE with the same sketch.
The error I get is this one:
Run “C:\Users\Tofanelli\AppData\Local\Arduino15\packages\rp2040\tools\pqt-openocd\1.5.0-b-c7bab52\bin\openocd -f “interface/cmsis-dap.cfg” -f “target/rp2040.cfg” -s “C:\Users\Tofanelli\AppData\Local\Arduino15\packages\rp2040\tools\pqt-openocd\1.5.0-b-c7bab52/share/openocd/scripts” -c “adapter speed 5000” -c “program {build.path}/Fearless_BS_rev03.ino.elf} verify reset exit”” in directory “” on local computer
It seems that a “{” is lost just before {build path}. The command executed by Arduino IDE is this one:
“C:\Users\Tofanelli\AppData\Local\Arduino15\packages\rp2040\tools\pqt-openocd\1.5.0-b-c7bab52/bin/openocd” -f “interface/cmsis-dap.cfg” -f “target/rp2040.cfg” -s “C:\Users\Tofanelli\AppData\Local\Arduino15\packages\rp2040\tools\pqt-openocd\1.5.0-b-c7bab52/share/openocd/scripts” -c “adapter speed 5000” -c “program {C:\Users\Tofanelli\AppData\Local\Temp\arduino\sketches\64084FD4C7680A4F44A4758446B5E15B/Fearless_BS_rev02.ino.elf} verify reset exit”
I’m using Visual Studio Community 2022 (version 17.5.3) and VisualGDB Custom Edition version 5.6R9 (build 4854).
Could you give some hints to solve this problem? Thanks!
Attachments:
You must be logged in to view attached files.July 23, 2023 at 10:07 #34505supportKeymasterHi,
Thanks for reporting this. It looks like the RP2040 platform definition uses a slightly unexpected syntax for the upload command template: program {{build.path}/{build.project_name}.elf} expecting it to expand to program {full-path.elf}.
Other platform definitions we checked used the “{{” to escape the “{” character, i.e. program {{{build.path}/{build.project_name}.elf}}.
Normally, you should not need this command at all – simply configure OpenOCD via VisualGDB Project Properties -> Debug Settings, and use Debug -> Program and Start without Debugging to program the FLASH memory using the VisualGDB-level commands.
If you would like to use the Arduino-level commands, you can also patch the C:\Users\<user>\Documents\ArduinoData\packages\rp2040\hardware\rp2040\<version>\platform.txt file by inserting the extra “{” and “}” to make it consistent with other platforms:
tools.picoprobe_cmsis_dap.upload.pattern="{cmd}/bin/openocd" -f "interface/cmsis-dap.cfg" -f "target/rp2040.cfg" -s "{cmd}/share/openocd/scripts" -c "adapter speed 5000" -c "program {{{build.path}/{build.project_name}.elf}} verify reset exit"
Please make sure you reload the project after patching the file.
We will consider updating VisualGDB to handle it automatically, however as we want to minimize the chance of breaking other platforms, and as there are 2 easy workarounds, we will wait for feedback from other users before updating it on VisualGDB side.
July 24, 2023 at 02:05 #34506alefParticipantHi,
I used the second solution and patched the
platform.txt
file as you suggested; the problem is now solved. The default location of the file isC:\Users\<user>\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\<version>\platform.txt
instead ofC:\Users\<user>\Documents\ArduinoData\packages\rp2040\hardware\rp2040\<version>\platform.txt
As for the first workaround, I am not able to see the VisualGDB Project Properties -> Debug Settings -> Debug -> Program and Start without Debugging option. Attached you can find a screenshot of the options visible in my case. Is there any advanced developer option that I can enable in VisualGDB to see this entry?
Thank you!
Attachments:
You must be logged in to view attached files.July 24, 2023 at 10:22 #34509supportKeymasterHi,
Good to know it works. The exact path of platform.txt depends on how the package was installed (different Arduino IDE variants use different directories), but as long as you found the file, it should work just fine.
The Program and Start without Debugging is not a setting in VisualGDB Project Properties, it’s a command under the Debug menu in Visual Studio.
-
AuthorPosts
- You must be logged in to reply to this topic.