Sysprogs forums › Forums › VisualGDB › Custom Arduino board package missing JLink and openOCD options?
- This topic has 3 replies, 2 voices, and was last updated 5 years, 8 months ago by support.
-
AuthorPosts
-
April 3, 2019 at 20:22 #24561iklaskParticipant
I’ve been working on a custom Arduino board support package for a board we’re developing. I had been debugging it with my SAM-ICE via VSCode for a while now, but just jumped up to VisualGDB. However, I don’t see the J-Link/OpenOCD debug options with my Arduino board in VisualGDB. I only see the default GDB Simulator, Custom Stub, and Full Custom mode. What does VisualGDB and the Segger/OpenOCD packages look at to determine the GNUTarget for an Arduino project? I assume I am missing something in my board.txt/platform.txt? I’ve tested my Arduino Due with VisualGDB and can confirm J-Link and OpenOCD work fine, its just my custom Arduino board that is missing something.
I did some spelunking to find a
GNUTargetFilter
in the edp.xml of thecom.sysprogs.arm.segger-dmsp
debug package in %localappdata%. If I change the regex from^arm-.*
to^.*
(to allow it to accept anything) I see the J-link option and can debug fine. So I’m assuming VisualGDB is parsing my Arduino package and determining that whateverGNUTargetFilter
looks at does not match “arm-eabi” or “arm-none-eabi” when it should.I also found this in the ArduinoDeviceIDRules.xml. I have a feeling its not passing that
TargetRegex
either since I have a-D__SAMxxxxx__
flag that matches that regex.<Rule> <TargetRegex>^arm-.*</TargetRegex> <ParameterName>build.extra_flags</ParameterName> <ParameterRegex>-D__(SAM[A-Z0-9]+)__</ParameterRegex> <DeviceIDFormat>AT{1}</DeviceIDFormat> </Rule>
So assuming its an issue with my own board.txt/platform.txt, what does VisualGDB look at to determine this arm target? Note: I’m not using the sysprogs arm toolchain but one from the arm developer site.
April 3, 2019 at 20:55 #24564supportKeymasterNo problem, we can help you get it to work.
First of all, please ensure you have the OpenOCD package installed (you can use Tools->VisualGDB->Manage VisualGDB Packages to double-check).
Then check the %LOCALAPPDATA%\VisualGDB\EmbeddedDebugPackages\com.sysprogs.arm.openocd\edp.xml file.
The GNUTargetFilter element defines the toolchains that are considered compatible with this package:<GNUTargetFilter>^arm-.*</GNUTargetFilter>
For Arduino projects, the GNU target is automatically derived from the name of the gcc executable reported by the Arduino build logic. E.g. for arm-none-eabi-gcc.exe it would be arm-none-eabi. You can find out the GCC path by checking the CodeModel.json file inside the build directory of your project. Simply updating the GNUTargetFilter in edp.xml to match it and re-opening the VisualGDB Package Manager to have VisualGDB reload the package definitions should get it to work. If not, please let us know the gcc executable name reported via CodeModel.json and we will investigate this further.
April 3, 2019 at 21:51 #24567iklaskParticipantThanks for the quick reply! Ahh I see in my CodeModel.json it was grabbing “bin/arm-none-eabi-gcc”. When I change the regex in the edp.xml to “^bin/arm-.*” it works. So i’ll just update my Arduino platform.txt so it doesn’t need that “bin/”
Thank you!
April 4, 2019 at 17:29 #24578supportKeymasterNo problem. BTW, the “bin” prefix should normally be discarded automatically. Feel free to share your CodeModel.json file and we will update VisualGDB to compute the target ID fully automatically.
-
AuthorPosts
- You must be logged in to reply to this topic.