Arduino IDE 2.2.1 debug failure

You need to add it to each sketch you wish to debug, like:

Thanks Kurt. It's working great once I deleted "/opt/SEGGER/JLink_V794a" from "serverpath". Probably a sudo thing. Now to get familiar with using it. Having any luck with setting up ArduinoCore-mbed? One thing I remembered is you will need to install an arm gcc toollchain if you don't already have one installed. I had one already installed after the episode with Mbed-CE for the Teensy...

glad it is working. I did not get much done myself. Kept running into little things not working, like needed to install the jq command, and tried to rerun the script at which point got tons of errors about the patch does not apply or some such thing...

So I decided to give it a break and come back to it tomorrow.

I thought I would try playing a little also with the new Portenta H8 board. There is another source level debugger also available for it, that I might try.

I am also curious about how similar and how different it is from the GIGA Probably has the same USB Host challenges and the like.

I am also curious about the SD slot, as I believe it is setup for SDIO. They have their own library using the same Fat library as the USB...

Yet another diversion :wink:

@wwatson - Using your instructions, I was able to complete the build For some reason it failed when I tried using git clone versus downloading the zip files... Probably something stupid I dd.

I am also attempting to use the generated debug setup on my WIndows machine. I copied the whole diretory over using a test SSD drive...

One thing I am curious about with using the IDE 2 debugger, is how to load up source files for things I may want to set a breakpoint in.

The file open, does not appear to allow me to open up random library or core files, to then set a breakpoint. I can get some of them by setting a breakpoint in the sketch and then maybe have some call or the like that uses that source file and walk into it, or in some cases to step back out of the function which may return to code in that file...

But wondering for example if I can set a breakpoint in some ISR handler, to maybe see why it is failing...

I'm glad you got that working. I actually tried the clone method myself without success. It was asking for some sort of signature. Did you find the libmbed.a file? After compiling the mbed core with debug info enabled you will find libmbed.a in:

"sketchbook/hardware/arduino-git/mbed/variants/GIGA/libs"

The size of this file is about 43.7 MB.
You can then replace:

".arduino15/packages/arduino/hardware/mbed_giga/4.0.10/variant/giga/libs/libmbed.a"

with the debug version. I rename the original one to "libmbed.a.org".
That was about as far as I got with it.
I got IDE 2.2.1 to recognize the Segger JLink adapter but when I would set a breakpoint in the blink sketch it would fail. I see it downloading the file to the GIGA ok but then I get this:

Setting breakpoint @ address 0x080405E6, Kind = 2, Type = THUMB, BPHandle = 0x0004
Setting breakpoint @ address 0x08061384, Kind = 2, Type = THUMB, BPHandle = 0x0005
Performing single step...
ERROR: CPU is not halted
ERROR: Cannot read register 15 (R15) while CPU is running
Reading common registers: ERROR: Cannot read register 0 (R0) while CPU is running
Read register 'r0' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 1 (R1) while CPU is running
Read register 'r1' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 2 (R2) while CPU is running
Read register 'r2' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 3 (R3) while CPU is running
Read register 'r3' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 4 (R4) while CPU is running
Read register 'r4' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 5 (R5) while CPU is running
Read register 'r5' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 6 (R6) while CPU is running
Read register 'r6' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 7 (R7) while CPU is running
Read register 'r7' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 8 (R8) while CPU is running
Read register 'r8' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 9 (R9) while CPU is running
Read register 'r9' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 10 (R10) while CPU is running
Read register 'r10' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 11 (R11) while CPU is running
Read register 'r11' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 12 (R12) while CPU is running
Read register 'r12' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 13 (R13) while CPU is running
Read register 'sp' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 14 (R14) while CPU is running
Read register 'lr' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 15 (R15) while CPU is running
Read register 'pc' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 16 (XPSR) while CPU is running
Read register 'xpsr' (4 bytes) from hardware: 0xEFBEADDE
WARNING: Failed to read memory @ address 0xDEADBEEE
Removing breakpoint @ address 0x08061384, Size = 2
Removing breakpoint @ address 0x080405E6, Size = 2
WARNING: Failed to read memory @ address 0xDEADBEEE
ERROR: Cannot read register 17 (MSP) while CPU is running
Reading register 'msp' = 0xDEADBEEF
ERROR: Cannot read register 18 (PSP) while CPU is running
Reading register 'psp' = 0xDEADBEEF
ERROR: Cannot read register 24 (PRIMASK) while CPU is running
Reading register 'primask' = 0xDEADBEEF
ERROR: Cannot read register 88 (CM3_R??) while CPU is running
Reading register 'basepri' = 0xDEADBEEF
ERROR: Cannot read register 89 (CM3_R??) while CPU is running
Reading register 'faultmask' = 0xDEADBEEF
ERROR: Cannot read register 90 (CM3_R??) while CPU is running
Reading register 'control' = 0xDEADBEEF
ERROR: Cannot read register 21 (APSR) while CPU is running
Reading register 'apsr' = 0xDEADBEEF
ERROR: Cannot read register 22 (EPSR) while CPU is running
Reading register 'epsr' = 0xDEADBEEF
ERROR: Cannot read register 23 (IPSR) while CPU is running
Reading register 'ipsr' = 0xDEADBEEF
ERROR: Cannot read register 29 (IAPSR) while CPU is running
Reading register 'iapsr' = 0xDEADBEEF
ERROR: Cannot read register 30 (EAPSR) while CPU is running
Reading register 'eapsr' = 0xDEADBEEF
ERROR: Cannot read register 31 (IEPSR) while CPU is running
Reading register 'iepsr' = 0xDEADBEEF
ERROR: Cannot read register 32 (FPSCR) while CPU is running
Reading register 'fpscr' = 0xDEADBEEF
ERROR: Cannot read register 33 (FPS0) while CPU is running
Reading register 's0' = 0xDEADBEEF
ERROR: Cannot read register 34 (FPS1) while CPU is running
Reading register 's1' = 0xDEADBEEF
ERROR: Cannot read register 35 (FPS2) while CPU is running
Reading register 's2' = 0xDEADBEEF
ERROR: Cannot read register 36 (FPS3) while CPU is running
Reading register 's3' = 0xDEADBEEF
ERROR: Cannot read register 37 (FPS4) while CPU is running
Reading register 's4' = 0xDEADBEEF
ERROR: Cannot read register 38 (FPS5) while CPU is running
Reading register 's5' = 0xDEADBEEF
ERROR: Cannot read register 39 (FPS6) while CPU is running
Reading register 's6' = 0xDEADBEEF
ERROR: Cannot read register 40 (FPS7) while CPU is running
Reading register 's7' = 0xDEADBEEF
ERROR: Cannot read register 41 (FPS8) while CPU is running
Reading register 's8' = 0xDEADBEEF
ERROR: Cannot read register 42 (FPS9) while CPU is running
Reading register 's9' = 0xDEADBEEF
ERROR: Cannot read register 43 (FPS10) while CPU is running
Reading register 's10' = 0xDEADBEEF
ERROR: Cannot read register 44 (FPS11) while CPU is running
Reading register 's11' = 0xDEADBEEF
ERROR: Cannot read register 45 (FPS12) while CPU is running
Reading register 's12' = 0xDEADBEEF
ERROR: Cannot read register 46 (FPS13) while CPU is running
Reading register 's13' = 0xDEADBEEF
ERROR: Cannot read register 47 (FPS14) while CPU is running
Reading register 's14' = 0xDEADBEEF
ERROR: Cannot read register 48 (FPS15) while CPU is running
Reading register 's15' = 0xDEADBEEF
ERROR: Cannot read register 49 (FPS16) while CPU is running
Reading register 's16' = 0xDEADBEEF
ERROR: Cannot read register 50 (FPS17) while CPU is running
Reading register 's17' = 0xDEADBEEF
ERROR: Cannot read register 51 (FPS18) while CPU is running
Reading register 's18' = 0xDEADBEEF
ERROR: Cannot read register 52 (FPS19) while CPU is running
Reading register 's19' = 0xDEADBEEF
ERROR: Cannot read register 53 (FPS20) while CPU is running
Reading register 's20' = 0xDEADBEEF
ERROR: Cannot read register 54 (FPS21) while CPU is running
Reading register 's21' = 0xDEADBEEF
ERROR: Cannot read register 55 (FPS22) while CPU is running
Reading register 's22' = 0xDEADBEEF
ERROR: Cannot read register 56 (FPS23) while CPU is running
Reading register 's23' = 0xDEADBEEF
ERROR: Cannot read register 57 (FPS24) while CPU is running
Reading register 's24' = 0xDEADBEEF
ERROR: Cannot read register 58 (FPS25) while CPU is running
Reading register 's25' = 0xDEADBEEF
ERROR: Cannot read register 59 (FPS26) while CPU is running
Reading register 's26' = 0xDEADBEEF
ERROR: Cannot read register 60 (FPS27) while CPU is running
Reading register 's27' = 0xDEADBEEF
ERROR: Cannot read register 61 (FPS28) while CPU is running
Reading register 's28' = 0xDEADBEEF
ERROR: Cannot read register 62 (FPS29) while CPU is running
Reading register 's29' = 0xDEADBEEF
ERROR: Cannot read register 63 (FPS30) while CPU is running
Reading register 's30' = 0xDEADBEEF
ERROR: Cannot read register 64 (FPS31) while CPU is running
Reading register 's31' = 0xDEADBEEF
ERROR: Cannot read register 33 (FPS0) while CPU is running
ERROR: Cannot read register 34 (FPS1) while CPU is running
Reading register 'd0' = 0x00000000
ERROR: Cannot read register 35 (FPS2) while CPU is running
ERROR: Cannot read register 36 (FPS3) while CPU is running
Reading register 'd1' = 0x00000000
ERROR: Cannot read register 37 (FPS4) while CPU is running
ERROR: Cannot read register 38 (FPS5) while CPU is running
Reading register 'd2' = 0x00000000
ERROR: Cannot read register 39 (FPS6) while CPU is running
ERROR: Cannot read register 40 (FPS7) while CPU is running
Reading register 'd3' = 0x00000000
ERROR: Cannot read register 41 (FPS8) while CPU is running
ERROR: Cannot read register 42 (FPS9) while CPU is running
Reading register 'd4' = 0x00000000
ERROR: Cannot read register 43 (FPS10) while CPU is running
ERROR: Cannot read register 44 (FPS11) while CPU is running
Reading register 'd5' = 0x00000000
ERROR: Cannot read register 45 (FPS12) while CPU is running
ERROR: Cannot read register 46 (FPS13) while CPU is running
Reading register 'd6' = 0x00000000
ERROR: Cannot read register 47 (FPS14) while CPU is running
ERROR: Cannot read register 48 (FPS15) while CPU is running
Reading register 'd7' = 0x00000000
ERROR: Cannot read register 49 (FPS16) while CPU is running
ERROR: Cannot read register 50 (FPS17) while CPU is running
Reading register 'd8' = 0x00000000
ERROR: Cannot read register 51 (FPS18) while CPU is running
ERROR: Cannot read register 52 (FPS19) while CPU is running
Reading register 'd9' = 0x00000000
ERROR: Cannot read register 53 (FPS20) while CPU is running
ERROR: Cannot read register 54 (FPS21) while CPU is running
Reading register 'd10' = 0x00000000
ERROR: Cannot read register 55 (FPS22) while CPU is running
ERROR: Cannot read register 56 (FPS23) while CPU is running
Reading register 'd11' = 0x00000000
ERROR: Cannot read register 57 (FPS24) while CPU is running
ERROR: Cannot read register 58 (FPS25) while CPU is running
Reading register 'd12' = 0x00000000
ERROR: Cannot read register 59 (FPS26) while CPU is running
ERROR: Cannot read register 60 (FPS27) while CPU is running
Reading register 'd13' = 0x00000000
ERROR: Cannot read register 61 (FPS28) while CPU is running
ERROR: Cannot read register 62 (FPS29) while CPU is running
Reading register 'd14' = 0x00000000
ERROR: Cannot read register 63 (FPS30) while CPU is running
ERROR: Cannot read register 64 (FPS31) while CPU is running
Reading register 'd15' = 0x00000000

I gave up after that :grinning:
I went back to setting up LWext4 for the GIGA...

I have not tried the copy of just the .a file,

But it does start up for me. For example here ia breakpoint from my keyboard viewer code, when the user presses a key:

In case your json file is different, mine is:

{
  "servertype": "jlink",
  "device": "STM32H747XI_M7",
  "showDevDebugOutput": "raw",
  "interface": "SWD",
  "serverpath": "D:/Program Files/SEGGER/JLink_V794/JLinkGDBServerCL"
}

Note: What I am running on now is:


Sorry for the quick and dirty markup... but the GIGA shows up in two sections. On this run I am using the version that hopefully has the updated built for debug archive.

Other than:

"showDevDebugOutput": "raw",

it is the same.
This is all I have in my boards manager???

I'm missing something again...

From my Ubuntu machine:

The stuff is in: /home/kurte/Arduino/hardware/arduino-git/mbed

And as you know Ubuntu names are case sensitive

Ok, I guess I have not got mine setup the same. Just downloaded Arduino IDE 2.2.1 zip file, unzipped to "/home/wwatson/" and created a launcher to the "arduino" executable in the desktop directory.

Have to play with it...