# Arduino IDE 2.2.1 debug failure

**URL:** <https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757>\
**Category:** GIGA R1 WiFi\
**Created:** [December 1, 2023, 9:15pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757 "2023-12-01T21:15:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwatson](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wwatson/32/1014212_2.png) [@wwatson](https://forum.arduino.cc/u/wwatson)\
**Post date:** [December 1, 2023, 9:15pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/1 "2023-12-01T21:15:20Z")

</div>

IDE 2.2.1, Linux 22.04, GIGA R1 and any\*.ino. Fresh install of the IDE after deleting '.arduino15' and 'arduinoIDE'.Then load a sketch from ~/Arduino/libraries/Arduino\_USBHostMBed5/FileWrite. Verify the sketch with the verify button. Click the debug icon on leftmost panel. Click on the debug console button. Click the green arrow button and:

```arduino
Request 2 cancelled on connection close

```

shows up in the notification area. In the debug console:

```arduino
Cortex-Debug: VSCode debugger extension version 1.5.1 git(be7d3c8+dirty). Usaage info: https://github.com/Marus/cortex-debug#usage
Reading symbols from /home/wwatson/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-objdump --syms -C -h -w /tmp/arduino/sketches/AA562697E8B5ADCE9B41A16F2451346D/FileWrite.ino.elf
Reading symbols from /home/wwatson/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-nm --defined-only -S -l -C -p /tmp/arduino/sketches/AA562697E8B5ADCE9B41A16F2451346D/FileWrite.ino.elf
Launching GDB: /home/wwatson/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-gdb -q --interpreter=mi2 /tmp/arduino/sketches/AA562697E8B5ADCE9B41A16F2451346D/FileWrite.ino.elf
    IMPORTANT: Set "showDevDebugOutput": "raw" in "launch.json" to see verbose GDB transactions here. Very helpful to debug issues or report problems

```

Cannot and do not know where to find "launch.json" to further diagnose this issue.  
Help Please...

---

<div class="post-metadata">

**Author:** ![KurtE](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kurte/32/1246572_2.png) [@KurtE](https://forum.arduino.cc/u/KurtE)\
**Post date:** [December 1, 2023, 11:57pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/2 "2023-12-01T23:57:40Z")

</div>

I can be totally wrong, I think you need a hardware debugger connected, I tried configuring for a few different ones, but I get the same error as you…

---

<div class="post-metadata">

**Author:** ![wwatson](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wwatson/32/1014212_2.png) [@wwatson](https://forum.arduino.cc/u/wwatson)\
**Post date:** [December 2, 2023, 12:19am UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/3 "2023-12-02T00:19:19Z")

</div>

Thanks, They keep talking about a 'launch.json' file but the only time it comes up is when you click the gear button at the top of the debug pane but the file is read only. All of the posts I have seen never pertain to the GIGA and IDE 2.2.1 specifically and do not work. I am hoping someone that has this working will respond. I have spent a couple of weeks trying to put together all of the information into something that works. Sigh...

---

<div class="post-metadata">

**Author:** ![KurtE](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kurte/32/1246572_2.png) [@KurtE](https://forum.arduino.cc/u/KurtE)\
**Post date:** [December 2, 2023, 12:58am UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/4 "2023-12-02T00:58:30Z")

</div>

Some of the time, I can debug using the Seger lite edu using ozone, but... Sometimes it won't connect

> [@Source level debug - IDE2 - GIGA R1](https://forum.arduino.cc/t/source-level-debug-ide2-giga-r1/1178496/2):
>
> Hi Kurt, I guess you are using the Arduino IDE? You have a couple of options as I couldn't get the Arduino IDE to debug the giga, it just looks like it is not supported: Use PlatformIO and the jlink using cortex-debug. Use Arduino but use the Segger Ozone debugger: [https://docs.arduino.cc/tutorials/portenta-breakout/breakout-jlink-setup](https://docs.arduino.cc/tutorials/portenta-breakout/breakout-jlink-setup) The Giga R1 is not a supported board in PlatformIO, I have a PR put in to add it but who knows if that will ever happen. If you want to get PlatformI…

---

<div class="post-metadata">

**Author:** ![wwatson](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wwatson/32/1014212_2.png) [@wwatson](https://forum.arduino.cc/u/wwatson)\
**Post date:** [December 2, 2023, 2:07am UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/5 "2023-12-02T02:07:05Z")

</div>

Might just order up the Segger J-Link as well and try it out...

---

<div class="post-metadata">

**Author:** ![KurtE](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kurte/32/1246572_2.png) [@KurtE](https://forum.arduino.cc/u/KurtE)\
**Post date:** [December 2, 2023, 1:23pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/6 "2023-12-02T13:23:44Z")

</div>

First wondering if anyone has actually been able to get the built-in debugger to work?

I know that @Merlin513 and I played around with some other boards awhile ago and I remember that @ptillisch had some good information, which I finally found the posting again:

> [@Adding debug support to a non-ARM EABI board type](https://forum.arduino.cc/t/adding-debug-support-to-a-non-arm-eabi-board-type/1138076/5):
>
> Thanks for the update. If you end up still running into that problem with the debug.toolchain.prefix property, please let me know and I'll investigate. I'm using this nice little open source CMSIS-DAP compliant debug probe: It works perfectly with the SAMD boards and the Arduino IDE 2.x integrated sketch debugger. The creator [Alex Taradov](https://github.com/ataradov) also suggests a DIY debug probe based on a RPi Pico board in the description of that product listing. I haven't found the time to try that out yet, but …

I am wondering if the Seger debugger works with it, if we need to do similar to what he mentioned for the other boards and create a configuration file. The linked in post here has a link to what you need to do for using the Seger with MKR boards...

Edit: I have one of those little boards mentioned in the posting. Also I believe we tried it as well using the RPI Pico boards as well.

---

<div class="post-metadata">

**Author:** ![KurtE](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kurte/32/1246572_2.png) [@KurtE](https://forum.arduino.cc/u/KurtE)\
**Post date:** [December 2, 2023, 2:03pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/7 "2023-12-02T14:03:21Z")

</div>

@wwatson @Merlin513 @ptillisch:  
Some success 😃  
I downloaded the latest version of the JLINK software:

I created the debug\_custom.json file:

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

```

Note: Update the above to where you installed the JLINK code. ..

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/0/f/0/0f0200d2ad383e7477e415bcc368770d95f93355.png)

Edit: wondering if other debugger modules will work as well, like the STLink/V2  
Or the Tinde cmis-dap (likewise Pico)?

---

<div class="post-metadata">

**Author:** ![Merlin513](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@Merlin513](https://forum.arduino.cc/u/Merlin513)\
**Post date:** [December 2, 2023, 2:40pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/8 "2023-12-02T14:40:10Z")

</div>

> [@KurtE](#):
>
> Some success 😃  
> I downloaded the latest version of the JLINK software:
> 
> I created the debug\_custom.json file:
> 
> ```arduino
> {
> "servertype": "jlink",
> "device": "STM32H747XI_M7",
> "interface": "SWD",
> "serverpath": "D:/Program Files/SEGGER/JLink_V794/JLinkGDBServerCL"
> }
> 
> ```
> 
> Note: Update the above to where you installed the JLINK code. ..

Just gave it a quick try and after got the hook up to the jlink correct its working now for me as well - now to debug 🙂

 ![Screenshot 2023-12-02 093924](https://europe1.discourse-cdn.com/arduino/original/4X/7/6/e/76ea92f6afe4e453f362f91f8b690fafd580f725.png)

---

<div class="post-metadata">

**Author:** ![wwatson](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wwatson/32/1014212_2.png) [@wwatson](https://forum.arduino.cc/u/wwatson)\
**Post date:** [December 2, 2023, 3:09pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/9 "2023-12-02T15:09:34Z")

</div>

@KurtE @Merlin513 - This is awesome news 😂 I will definitely order up a Jlink. In the mean time I play with the STlink. You said the "debug\_custom.json file" goes into the sever path. I assume this will probably be the same for the STlink...

Nice work @KurtE

---

<div class="post-metadata">

**Author:** ![Merlin513](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@Merlin513](https://forum.arduino.cc/u/Merlin513)\
**Post date:** [December 2, 2023, 8:41pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/10 "2023-12-02T20:41:58Z")

</div>

@KurtE - @wwatson

Been playing with debug on and off most of the day (between chores) and think there is going to be one drawback. Let me explain.

I have been trying to debug why partitions are not working with the USB sticks. Have an idea but can not seem to find where it is the function is getting called from.

The sketch I am using is as follows;

```arduino
#include <LibPrintf.h>

#include <Arduino_USBHostMbed5.h>
#include "MBRBlockDevice.h"
#include "FATFileSystem.h"
#include <errno.h>

USBHostMSD msd;

mbed::MBRBlockDevice part1(&msd, 1);
mbed::MBRBlockDevice part2(&msd, 2);
static mbed::FATFileSystem fs1;
static mbed::FATFileSystem fs2;

void setup() {
  Serial.begin(115200);
    
  pinMode(PA_15, OUTPUT); //enable the USB-A port
  digitalWrite(PA_15, HIGH);
    
  // put your setup code here, to run once:

  while(!Serial);
  Serial.println("Test diskio");

    while (!msd.connect()) {
        delay(1000);
    }

    Serial.println("done.");
    Serial.print("Mounting USB device... ");

    int err;
    err = forcemountboth();
    printf("forcemountboth %d\n", err);

    FILE *f;
    fopen("/fs1/hi.txt", "w+");
    printf("fopen fs1 %p %d\n", f, errno);

    if(!errno){
      for (int i = 0; i < 10; i++) {
        Serial.print("Writing numbers (");
        Serial.print(i);
        Serial.println("/10)");
        fflush(stdout);
        err = fprintf(f, "%d\n", i);
        if (err < 0) {
          Serial.println("Fail :(");
          error("error: %s (%d)\n", strerror(errno), -errno);
        }
      }

      err = fclose(f);
      printf("fclose fs1 %d\n", err);
    }

    f = fopen("/fs2/hi2.txt", "w");
    printf("fopen fs2 %p %d\n", f, errno);

    if(!errno) {
      err = fwrite("hello", 1, 5, f);
      printf("fwrite fs2 %d\n", err);

      err = fclose(f);
      printf("fclose fs2 %d\n", err);
    }

/*
    Serial.println("Content of partition 1:");
    printDirectory("/fs1");
    Serial.println("Content of partition 2:");
    printDirectory("/fs2");
*/

  Serial.println("Unmounting partitions...");
  fs1.unmount();
  fs2.unmount();
}

void loop() {
  digitalWrite(LED_BUILTIN,!digitalRead(LED_BUILTIN));
  delay(1000);
}

void printDirectory(char* name) {
  DIR *d;
  struct dirent *p;

  d = opendir(name);
  if (d != NULL) {
    while ((p = readdir(d)) != NULL) {
      Serial.println(p->d_name);
    }
  }
  closedir(d);
}

int mountboth() {
  int err;
    err = 0;
      if (!err) {
          Serial.println("partition 1 exists\n");
          err = fs1.mount(&part1);
          if (!err) {
              Serial.println("FAT filesystem exists on partition 1");
          }
      } else {
        Serial.print("ERROR: "); Serial.println(err);
        Serial.println("Partition 1 not found");
        return 1;
      }

     err = 0;
      if (!err) {
          Serial.println("partition 2 exists\n");
          err = fs2.mount(&part2); // checkfor FAT filesystem
          if (!err) {
              Serial.println("FAT filesystem exists on partition 2");
          }
      } else {
        Serial.println("Partition 2 not found");
        return 1;
      }

     return 0;
}

int forcemountboth() {
  int err = mountboth();
  if (err) {
      Serial.print("Mount both error: "); Serial.println(err);
      while(1){}
  }
}

```

When I insert the breakpoints on the fopen for instance it should show me what function is begin called and where like it would do if i put a breakpoint on print for instance but it doesn't. More than likely since there is no associated .cpp file since that stuff is all precompiled. All I see in the serial monitor is;

```arduino
Test diskio
done.
Mounting USB device... partition 1 exists

FAT filesystem exists on partition 1
partition 2 exists

forcemountboth 0
fopen fs1 (nil) 19
fopen fs2 (nil) 19
Unmounting partitions...

```

Error code 19 I believe is

```arduino
"FR_INVALID_PARAMETER"	/* (19) Given parameter is invalid */

```

---

<div class="post-metadata">

**Author:** ![KurtE](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kurte/32/1246572_2.png) [@KurtE](https://forum.arduino.cc/u/KurtE)\
**Post date:** [December 2, 2023, 9:14pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/11 "2023-12-02T21:14:14Z")

</div>

Hopefully we will figure out a way to get those type of breakpoints to work.

Wondering if building and running version from /hardware direct from sources might give more of it that can be found...

---

<div class="post-metadata">

**Author:** ![Merlin513](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@Merlin513](https://forum.arduino.cc/u/Merlin513)\
**Post date:** [December 2, 2023, 9:23pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/12 "2023-12-02T21:23:03Z")

</div>

> [@KurtE](#):
>
> Wondering if building and running version from /hardware direct from sources might give more of it that can be found...

Have a feeling you would have too. Unless there is a setting that can be changed easily.

---

<div class="post-metadata">

**Author:** ![wwatson](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wwatson/32/1014212_2.png) [@wwatson](https://forum.arduino.cc/u/wwatson)\
**Post date:** [December 3, 2023, 8:48pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/13 "2023-12-03T20:48:39Z")

</div>

@KurtE @Merlin513 - Well I finally got to the bottom of the issues with debugging and the ST-Link V2. After updating to the latest firmware for the ST-Link it appears that the GIGA still is not recognized by it 😞 So which version of the Segger Jlink are you guy's using?

Thanks

---

<div class="post-metadata">

**Author:** ![Merlin513](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@Merlin513](https://forum.arduino.cc/u/Merlin513)\
**Post date:** [December 3, 2023, 9:20pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/14 "2023-12-03T21:20:22Z")

</div>

> [@wwatson](#):
>
> o which version of the Segger Jlink are you guy's using?

[SEGGER J-Link EDU Mini - JTAG/SWD Debugger : ID 3571 : $59.95 : Adafruit Industries, Unique & fun DIY electronics and kits](https://www.adafruit.com/product/3571)

---

<div class="post-metadata">

**Author:** ![KurtE](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kurte/32/1246572_2.png) [@KurtE](https://forum.arduino.cc/u/KurtE)\
**Post date:** [December 3, 2023, 9:24pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/15 "2023-12-03T21:24:03Z")

</div>

> [@Merlin513](#):
>
> SEGGER J-Link EDU Mini - JTAG/SWD Debugger : ID 3571 : $59.95 : Adafruit Industries, Unique & fun DIY electronics and kits

Ditto 😉

> [@wwatson](#):
>
> the ST-Link it appears that the GIGA still is not recognized by it 😞 So which version of the Segger Jlink are you guy's using?

Wonder if it does not handle it or simply we don't have the right glue. Or have heard from anyone who knows differently.

---

<div class="post-metadata">

**Author:** ![wwatson](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wwatson/32/1014212_2.png) [@wwatson](https://forum.arduino.cc/u/wwatson)\
**Post date:** [December 3, 2023, 10:04pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/16 "2023-12-03T22:04:55Z")

</div>

I also tried using ST-Util and it did not recognize the GIGA. I checked their forum and I think it was STM32H745 that is supported by the STlink V2. Also, I have successfully recompiled Arduino\_core source with debug enabled. Setting up for that was kinda hairy but it did work. libmbed.a went from 7.x meg to 47.x meg. I followed these instructions:  
[https://github.com/arduino/ArduinoCore-mbed#recompiling-libmbed-with-source-level-debug-support](https://github.com/arduino/ArduinoCore-mbed#recompiling-libmbed-with-source-level-debug-support)

---

<div class="post-metadata">

**Author:** ![KurtE](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kurte/32/1246572_2.png) [@KurtE](https://forum.arduino.cc/u/KurtE)\
**Post date:** [December 6, 2023, 3:14pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/17 "2023-12-06T15:14:56Z")

</div>

Using the Arduino IDE hardware debugger with Arduino GIGA or Portenta or ... on Windows.

As mentioned in the post:

> [@Merlin513](#):
>
> When I insert the breakpoints on the fopen for instance it should show me what function is begin called and where like it would do if i put a breakpoint on print for instance but it doesn't. More than likely since there is no associated .cpp file since that stuff is all precompiled. All I see in the serial monitor is;

By default you are pretty limited on what code you can set breakpoints on, as a lot of the code is linked in as a prebuilt static library.

There are some instructions in the Readme file:  
[ArduinoCore-mbed/README.md at main · arduino/ArduinoCore-mbed (github.com)](https://github.com/arduino/ArduinoCore-mbed/blob/main/README.md)

On steps on how to change this code to allow you to debug. However, what is not mentioned, is that all of the instructions assume you are running on a Linux system.  
For example the instructions:

```arduino
./mbed-os-to-arduino -a -g PORTENTA_H7_M7:PORTENTA_H7_M7

```

And of course the Readme file does tell you:

> The backbone of the packaging process is the [ArduinoCore-mbed/mbed-os-to-arduino at main · arduino/ArduinoCore-mbed · GitHub](https://github.com/arduino/ArduinoCore-mbed/blob/master/mbed-os-to-arduino) script. It basically compiles a blank Mbed OS project for any supported target board, recovering the files that will be needed at compile time and copying them to the right location. This script is compatible only with Linux. If you are using macOS, use the [ArduinoCore-mbed/mbed-os-to-arduino-macos at main · arduino/ArduinoCore-mbed · GitHub](https://github.com/arduino/ArduinoCore-mbed/blob/master/mbed-os-to-arduino-macos) script.
> 
> It can be used for a variety of tasks including:

the file mbed-os-to-arduino is a linux bash script. Are there instructions for how to do this on a Windows machine? Should I run it using a WSL command prompt?

Aargh!

Edit: Then you run into things like, how do you load a source file to actually set a break in it.... Especially ones that are libraries and/or in the core... The only way I have found so far is to set a breakpoint somehere in the sketch file and then hopefully be able to step your way into something in the file you are interested in.

---

<div class="post-metadata">

**Author:** ![wwatson](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wwatson/32/1014212_2.png) [@wwatson](https://forum.arduino.cc/u/wwatson)\
**Post date:** [December 6, 2023, 6:54pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/18 "2023-12-06T18:54:02Z")

</div>

I'll have my Segger Jlink today. Interesting about setting breakpoints in debug enabled core code. I have the core recompiled for debug. The build with all source code appears to wind up in the "/tmp" directory. I am trying to figure out were and how the POSIX API is tied to FatFS, LittleFs etc... The reason is I have LWext4 pretty much working on the GIGA board. But that's another topic 😄

---

<div class="post-metadata">

**Author:** ![KurtE](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kurte/32/1246572_2.png) [@KurtE](https://forum.arduino.cc/u/KurtE)\
**Post date:** [December 6, 2023, 9:31pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/19 "2023-12-06T21:31:33Z")

</div>

> [@KurtE](#):
>
> On steps on how to change this code to allow you to debug. However, what is not mentioned, is that all of the instructions assume you are running on a Linux system.  
> For example the instructions:
> 
> ```arduino
> ./mbed-os-to-arduino -a -g PORTENTA_H7_M7:PORTENTA_H7_M7
> 
> ```

So I booted up my Ubuntu machine and downloaded the sources and the like as mentioned int the above...

Then tried the command and ran into the mbed is not a command...

Tried finding information up on website... Nothing. Finally did search on all Pull Requests and issues and found:

> <https://github.com/arduino/ArduinoCore-nRF528x-mbedos/issues/66>
>
> I want to add some debug code inside “class Thread”, but I find this class may b…e implemented in 
> \> ARDUINO\_NANO33BLE/libs/libmbed.a
> Can I find a way to get the libmbed.a's source code and build it locally?

Which directed me to:

> **[Install and set up - Build tools | Mbed OS 6 Documentation](https://os.mbed.com/docs/mbed-os/v5.15/tools/manual-installation.html)**

which I needed to first instal pip and ...  
And add the ~/.local/bin to my path...  
And now it runs farther...

Now dies with:

```arduino
done.
Generating defines... done.
Generating includes... copying to destination... /tmp/mbed-os-program
 done.
Generating libs... done.
Generating flags..../mbed-os-to-arduino: line 184: jq: command not found

```

now to see if I can find what jq is and where to install it from...

What a PIA

Needless to say the Readme file for Arduinocore-mbed  
could use some updates!

**Update** : jq - appears to ba a command you can install using sudo apt install...

I tried running the same command again and got tons of errors about patches don't apply.. So I am going to try it again with a clean directory...

---

<div class="post-metadata">

**Author:** ![wwatson](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wwatson/32/1014212_2.png) [@wwatson](https://forum.arduino.cc/u/wwatson)\
**Post date:** [December 6, 2023, 9:49pm UTC](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757/20 "2023-12-06T21:49:19Z")

</div>

I forgot that I had created instructions for rebuilding Arduino Mbed-OS in Linux.  
Here are those steps:

```arduino
How to build or rebuild Arduino Mbed-os core library in Linux.

1. First step is to install all of the needed tools to build the mbed os. See the following web page as a guide.
   "https://os.mbed.com/docs/mbed-os/v6.16/build-tools/install-and-set-up.html".
2. "sudo apt install python3 python3-pip git mercurial"
3. "python3 -m pip install mbed-cli".
4. Create "sketchbook/hardware/arduino-git" in your home directory with "mkdir -p sketchbook/hardware/arduino-git".
5. Download "ArduinoCore-mbed.zip" from "https://github.com/arduino/ArduinoCore-mbed"
   and use the "README.md" in addition to this guide.
6. Download "ArduinoCore-API.zip" from "https://github.com/arduino/ArduinoCore-API".
7. Extract both zip files and rename "ArduinoCore-API-master" to "ArduinoCore-API".
8. copy "ArduinoCore-API" to "skectbook/hardware/arduino-git".
9. Now create a directory in "skectbook/hardware/arduino-git" named "mbed".
   This gives you "skectbook/hardware/arduino-git/mbed".
10. Next step is to copy the contents of "ArduinoCore-mbed-main" that you extracted earlier
   to "skectbook/hardware/arduino-git/mbed".
11. Next you will create a symbolic link (shortcut) in "sketchbook/hardware/arduino-git/mbed/cores/arduino"
   to "ArduinoCore-API/api".
12. If not already there, "cd sketchbook/hardware/arduino-git/mbed"
13. Then do "./mbed-os-to-arduino -a -g GIGA:GIGA". This builds the Arduino Mbed core library for the GIGA R1 board.

Other boards can be substitued for "GIGA:GIGA" like ???

```

Hope this helps 😄

By the way I got my JLink mini and I am confused as to where to put "debug\_custom.json". I have:

```arduino
{
  "servertype": "jlink",
  "device": "STM32H747XI_M7",
  "interface": "SWD",
  "serverpath": "/opt/SEGGER/JLink_V794/JLinkGDBServer"
}

```

The JLink software installs in the "/opt" directory. Any advice?

[Next page](https://forum.arduino.cc/t/arduino-ide-2-2-1-debug-failure/1195757.md?page=2)
