Giter Club home page Giter Club logo

Comments (29)

kampfk3ks avatar kampfk3ks commented on May 28, 2024 1

is there a list of supported Boards? I tried with Uno, nano and Mega and nothing worked so far.

from arduino-ide.

el-samiyel avatar el-samiyel commented on May 28, 2024 1

Hi @ubidefeo Yes, just as @rei-vilo has said. I used an Arduino M0, this is the same as the Arduino zero but without the edgb. So I plug in my atmel ICE into the SWD connector but am presented with the message mentioned above.

Its as if the PRO IDE doesn't see the Atmal ICE? However, what extra parameters should be set in the boards.txt?

Board: https://store.arduino.cc/arduino-m0

Thanks

from arduino-ide.

rei-vilo avatar rei-vilo commented on May 28, 2024

It seems only boards based on the SAMD MCU and featuring a debugger are supported. I tested debugging successfully against the Arduino Zero —see arduino/arduino-pro-ide#216.

from arduino-ide.

rei-vilo avatar rei-vilo commented on May 28, 2024

Changelog:

  • Debugger support for SAMD boards

from arduino-ide.

Matszwe02 avatar Matszwe02 commented on May 28, 2024

Will it support 8 bit Atmega boards?

from arduino-ide.

rei-vilo avatar rei-vilo commented on May 28, 2024

You need a debugger. Only the Arduino Zero board includes a debugger for the moment. The Arduino Nano 33 provisions pads for a SWD connection to an external debugger.

from arduino-ide.

ubidefeo avatar ubidefeo commented on May 28, 2024

@Matszwe02
debugging 8bit AVR involves using a protocol called DebugWire.
Right now we support SAMD chips, and since DebugWire is a complex thing to work with, I can't see it being supported.
You also need either an Atmel ICE, STK500 or Dragon

from arduino-ide.

el-samiyel avatar el-samiyel commented on May 28, 2024

Even with the atmel ICE the message remains: Error during Debug: Cannot get command line for tool: cannot get programmer tool: undefined 'debug.tool' property

Does anything need to be done in a config?

from arduino-ide.

ubidefeo avatar ubidefeo commented on May 28, 2024

@el-samiyel which board are you testing this with?

from arduino-ide.

el-samiyel avatar el-samiyel commented on May 28, 2024

I am using the M0. Considering it doesn't have a edbg can't the atmel ice via swd be used in its place? Thanks

from arduino-ide.

ubidefeo avatar ubidefeo commented on May 28, 2024

could you please provide a link to the product?
of course if you have SWD pins exposed you can debug, but need the board in question to have the extra config settings defined within boards.txt of its core

from arduino-ide.

rei-vilo avatar rei-vilo commented on May 28, 2024

I tried first with the Arduino M0 Pro from Arduino.org and it didn’t work.

Then, with the Arduino Zero from Arduino.cc / Genuino, debugging worked fine.

from arduino-ide.

ericklein avatar ericklein commented on May 28, 2024

What boards and external debuggers are currently supported and is there a configuration guide available? I've tried an Adafruit M0 Express via JLINK and get the error "https://adafruit.github.io/arduino-board-index/package_adafruit_index.json" and when I try a MKR1000 via JLINK I get the error "Error: unable to find CMSIS-DAP device".

from arduino-ide.

tomsihap avatar tomsihap commented on May 28, 2024

You need a debugger. Only the Arduino Zero board includes a debugger for the moment. The Arduino Nano 33 provisions pads for a SWD connection to an external debugger.

Could other boards (Arduino Uno for example) be supported in the future or is it technically not possible because of this lack of built-in debugger ?

from arduino-ide.

ubidefeo avatar ubidefeo commented on May 28, 2024

@tomsihap
the ATMega328 (on the Arduino UNO) only supports debugging via WireDebug interface, which needs to be enabled at low level using fuses and is only supported by a bunch of programmers and has never really been successful.
We will support interfaces based on GDB and OpenOCD for our own boards, as well as hybrid debugging over USB like we're experimenting with the Portenta H7.
Debugging on each platform requires implementation by the platform supplier, with a series of debug scripts that launch the required tools, which also have to be installed based on platform specification.

You can read about DebugWire here http://www.ruemohr.org/docs/debugwire.html out of curiosity, but I doubt anyone will ever put effort into implementing tooling for that

from arduino-ide.

tuxedo0801 avatar tuxedo0801 commented on May 28, 2024

same issue here as @el-samiyel described ... using M0 board with Atmel ICE SAM debugger. does not work. same error here.

Uploading via Programme (Atmel ICE SAM) works ... but not debugging.

from arduino-ide.

ubidefeo avatar ubidefeo commented on May 28, 2024

@tuxedo0801
that board is lacking the debug line in the platform
when you read the boards.txt file in the hardware platform definition package, you can see that while the MKRZERO and other boards have this block

mkrzero.debug.tool=gdb-openocd
mkrzero.upload.tool=bossac
mkrzero.upload.protocol=sam-ba
mkrzero.upload.maximum_size=262144
mkrzero.upload.maximum_data_size=32768
mkrzero.upload.use_1200bps_touch=true
mkrzero.upload.wait_for_upload_port=true
mkrzero.upload.native_usb=true
mkrzero.build.mcu=cortex-m0plus
mkrzero.build.f_cpu=48000000L
mkrzero.build.usb_product="Arduino MKRZero"
mkrzero.build.usb_manufacturer="Arduino LLC"
mkrzero.build.board=SAMD_MKRZERO
mkrzero.build.core=arduino
mkrzero.build.extra_flags=-DUSE_ARDUINO_MKR_PIN_LAYOUT -D__SAMD21G18A__ {build.usb_flags}
mkrzero.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
mkrzero.build.openocdscript=openocd_scripts/arduino_zero.cfg
mkrzero.build.variant=mkrzero
mkrzero.build.vid=0x2341
mkrzero.build.pid=0x804f
mkrzero.bootloader.tool=openocd
mkrzero.bootloader.file=mkrzero/samd21_sam_ba_arduino_mkrzero.bin

(notice the debug and openocdscript entries)

the block defining other boards such as the M0 (which has been discontinued way before we began this project and is not for sale anymore) does not have it.

If you go and edit the M0 block you'll be able to make it work, just takes some copy/paste and trial/error, which are great activities for the weekend :)

IMPORTANT!!!
when you update a platform these changes are lost

let me know if you manage to make it work ✌️

from arduino-ide.

tuxedo0801 avatar tuxedo0801 commented on May 28, 2024

Thanks @ubidefeo for your input.
I tried adding my own variant as described. The only difference I see between the EDBG and non-EDBG version of zero regarding debugging:

xyz.debug.tool=gdb-openocd

So the new section for my "special board setup" in boards.txt now looks like:

# KONNEKTING SAMD Generic
# --------------------------------------
konnekting_samd_generic.name=KONNEKTING SAMD Generic
konnekting_samd_generic.vid.0=0x2341
konnekting_samd_generic.pid.0=0x804d
konnekting_samd_generic.vid.1=0x2341
konnekting_samd_generic.pid.1=0x004d
konnekting_samd_generic.vid.2=0x2341
konnekting_samd_generic.pid.2=0x824d
konnekting_samd_generic.vid.3=0x2341
konnekting_samd_generic.pid.3=0x024d

# for debugging purpose
konnekting_samd_generic.debug.tool=gdb-openocd

konnekting_samd_generic.upload.tool=bossac
konnekting_samd_generic.upload.protocol=sam-ba
konnekting_samd_generic.upload.maximum_size=262144
konnekting_samd_generic.upload.maximum_data_size=32768
konnekting_samd_generic.upload.use_1200bps_touch=true
konnekting_samd_generic.upload.wait_for_upload_port=true
konnekting_samd_generic.upload.native_usb=true
konnekting_samd_generic.build.mcu=cortex-m0plus
konnekting_samd_generic.build.f_cpu=48000000L
konnekting_samd_generic.build.usb_product="Arduino Zero"
konnekting_samd_generic.build.usb_manufacturer="Arduino LLC"
konnekting_samd_generic.build.board=SAMD_ZERO
konnekting_samd_generic.build.core=arduino
konnekting_samd_generic.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags}
konnekting_samd_generic.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
konnekting_samd_generic.build.openocdscript=openocd_scripts/arduino_zero.cfg
konnekting_samd_generic.build.variant=arduino_zero
konnekting_samd_generic.build.variant_system_lib=
konnekting_samd_generic.build.vid=0x2341
konnekting_samd_generic.build.pid=0x804d
konnekting_samd_generic.bootloader.tool=openocd
konnekting_samd_generic.bootloader.file=zero/samd21_sam_ba.bin

As I use the ATMEL ICE debugger, I need to tell the Arduino Pro IDE the debugu launch configuration. I had this before in VS Code working. The launch.json looks like this:

{
    "version": "0.2.0",
    "configurations": [                 
        {
            "name": "Atmel ICE - SAMD",
            "type": "arduino",
            "request": "launch",
            "program": "${file}",
            "cwd": "${workspaceFolder}",
            "MIMode": "gdb",
            "targetArchitecture": "arm",
            "miDebuggerPath": "${env:HOME}/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-gdb",
            "debugServerPath": "${env:HOME}/.arduino15/packages/arduino/tools/openocd/0.9.0-arduino5-static/bin/openocd",
            "debugServerArgs": " -d2 -s ${env:HOME}/.arduino15/packages/arduino/tools/openocd/0.9.0-arduino5-static/share/openocd/scripts/ -f ${env:HOME}/.arduino15/packages/arduino/hardware/samd/1.8.8/variants/arduino_zero/openocd_scripts/arduino_zero.cfg",
            "customLaunchSetupCommands": [
                {
                    "text": "target remote localhost:3333"
                },
                {
                    "text": "file \"${file}\""
                },
                {
                    "text": "load"
                },
                {
                    "text": "monitor reset halt"
                },
                {
                    "text": "monitor reset init"
                }
            ],
            "stopAtEntry": true,
            "serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
            "launchCompleteCommand": "exec-continue",
            "filterStderr": true,
            "args": [],
            "logging": { "trace": true, "traceResponse": true, "engineLogging": true }
        }
    ]
}

I no longer receive the message with missing debug.tool property. It now tells me:

The gdb debugger terminated unexpectedly.

... without any further details. Any hints on what's still wrong?

from arduino-ide.

ubidefeo avatar ubidefeo commented on May 28, 2024

hi @tuxedo0801

in theory once you change those files the Pro IDE should pick them up and let you debug.
@per1234 I am missing something?

from arduino-ide.

tuxedo0801 avatar tuxedo0801 commented on May 28, 2024

I checked the paths and files mentioned in launch.json twice... all fine, all existing, no typo.

Looks like there is another issue invoking gdb. Is there a log file I can check or log-level I can activate?

br,
Alex

from arduino-ide.

ubidefeo avatar ubidefeo commented on May 28, 2024

you could run the debug in the CLI and add a -v, but not sure what that would yield.
I'll have to run a test myself with your entries

get back to you when I'm done :)

from arduino-ide.

ubidefeo avatar ubidefeo commented on May 28, 2024

@tuxedo0801
I don't have an M0, so I targeted a MKR1000 as your fictional board and it works for me.
You need to first compile or upload the sketch, in order for the script to find what it needs (.elf with debugging symbols).

Unless the M0 (which is a board we retired a while back) has some other weird quirks it should work.
It just requires the SWD header to be correctly wired.

do you have all the latest platforms updated through the Boards Manager?
Screenshot 2020-09-28 at 10 52 24

from arduino-ide.

tuxedo0801 avatar tuxedo0801 commented on May 28, 2024

I finally set the board to MKR1000 (which is more or less compatible to mine) and now debugging works fine.

Now I have to found out what's wrong with my own board definition. Thanks so far @ubidefeo

from arduino-ide.

ubidefeo avatar ubidefeo commented on May 28, 2024

it's my pleasure, @tuxedo0801
we're here to help :)

from arduino-ide.

tuxedo0801 avatar tuxedo0801 commented on May 28, 2024

Would be great if IDE could tell the user, that Debugging is not foreseen for the selected board, instead of failing with undefined 'debug.tool' property.

Then, the issue can be closed.

from arduino-ide.

ubidefeo avatar ubidefeo commented on May 28, 2024

@tuxedo0801
you have a really good point there.
I'll put it in our list to do asap :)

from arduino-ide.

ubidefeo avatar ubidefeo commented on May 28, 2024

@tuxedo0801
the debug button now only becomes active when platform's debug support is defined.
Thank you for bringing this up, it's been useful :)

from arduino-ide.

el-samiyel avatar el-samiyel commented on May 28, 2024

Hi All,

Does anyone have a step by step for this, as I am interested in debugging the SAMD51 where possible. I believe its much the same as the SAMD21.

Any assistance will be most appreciated.

from arduino-ide.

per1234 avatar per1234 commented on May 28, 2024

Hi @el-samiyel. Please request assistance over on the Arduino Forum. I'm sure we will be able to help you out over there:

https://forum.arduino.cc/c/software/arduino-ide-2-0/93

from arduino-ide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.