Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using third party board and using debugging feature on Arduino IDE #2436

Open
3 tasks done
pammyleong opened this issue May 16, 2024 · 0 comments
Open
3 tasks done

Using third party board and using debugging feature on Arduino IDE #2436

pammyleong opened this issue May 16, 2024 · 0 comments
Labels
type: imperfection Perceived defect in any part of project

Comments

@pammyleong
Copy link

pammyleong commented May 16, 2024

Describe the problem

I am using a third party board, AMB82 MINI and JLink EDU to perform debugging on Arduino IDE 2.3.2, it works on Windows and Linux but not working on macOS Intel.

In debug console, it shows:

I'm sorry, Dave, I can't do that. Symbol format `elf32-littlearm' unknown.

Application.ntz is the executable, and the file format is in elf32-littlearm.

Screenshot 1

However, if I run gdb and gdb server using terminal, it is able to go to breakpoint if I call "file {executable path}". If "file {executable path}" is not called before target remote localhost:{port} the behavior will be the same as shown in Arduino IDE.

When "file {executable path}" is not called before target remote localhost:{port}:

Screenshot 2

When "file {executable path}" is called before target remote localhost:{port}:

Screenshot 3

To reproduce

In Arduino IDE:

debug_custom.json is written as follows:

[
  {
	"name": "JLink Attach",
	"request": "attach",
    "configId": "realtek:AmebaPro2:Ameba_AMB82-MINI",
    "server": "jlink",
    "servertype": "jlink",
    "device": "Cortex-M33",
    "serverArgs": ["-timeout", "10000", "-confirm", "0", "-scriptfile", "{replace with your Arduino15 packages directory}/packages/realtek/tools/ameba_pro2_tools/{replace with tools version number}/debug/RTL8735B_Arduino_debug.JLinkScript"],
    "interface": "swd",
    "serverPath": "/Applications/SEGGER/JLink_V796h/JLinkGDBServerCLExe",
    "serverpath": "/Applications/SEGGER/JLink_V796h/JLinkGDBServerCLExe",
    "postAttachCommands": [
      "pwd",
      "monitor clrbp",
      "monitor reset",
      "continue"
    ]
  }
]

The content in JLinkScript used:

void ConfigTargetSettings(void) {
  JLINK_ExecCommand("map add 0x08000000-0x0FFFFFFF N FLASH");
  JLINK_ExecCommand("DisableFlashBPs");
  JLINK_ExecCommand("DisableFlashDL");
  
  JTAG_WriteClocks(1);
  JTAG_Speed = 1000;
}

In the last part of the platform.txt is shown as follows:

image

debug_custom.json is placed with the .ino that we wish to debug.

image

After code is uploaded, the "Start Debugging" button is pressed. It successfully connects to the JLink and connect to Target. But after that, it quit unexpectedly.

image

In Terminal (which is working):
I open 2 terminal, one for gdb server and one for gdb.

The command to start gdb server is:

/Applications/SEGGER/JLink_V796h/JLinkGDBServerCLExe -singlerun -nogui -if swd -port 50000 -swoport 50001 -telnetport 50002 -device Cortex-M33 -select USB -timeout 10000 -confirm 0 -scriptfile /Users/apple/Library/Arduino15/packages/realtek/tools/ameba_pro2_tools/1.3.3/debug/RTL8735B_Arduino_debug.JLinkScript

After that it will show "Waiting for GDB connection..."

Starting gdb,

  1. Type gdb in terminal.
  2. Enter file {executable path}
  3. Then enter target remote localhost:{port}

Expected behavior

Able to start debugging successfully on MacOS Intel and M1.

Arduino IDE version

2.3.2

Operating system

macOS

Operating system version

Intel

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@pammyleong pammyleong added the type: imperfection Perceived defect in any part of project label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

1 participant