Custom Arduino board package missing JLink and openOCD options?

Sysprogs forums Forums VisualGDB Custom Arduino board package missing JLink and openOCD options?

Tagged: ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24561
    iklask
    Participant

    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 the com.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 whatever GNUTargetFilter 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.

    • This topic was modified 5 years ago by iklask.
    • This topic was modified 5 years ago by support. Reason: formatting
    #24564
    support
    Keymaster

    No 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.

     

    #24567
    iklask
    Participant

    Thanks 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!

    #24578
    support
    Keymaster

    No 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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.