HW Debugging ARM Controller with J-Link error (Truncated register 16 in remote 'g' packet*) - eclipse

I tried to debug my code with eclipse with the j-link debugger and gdb sserver and client.
I tried different settings but couldn't solve the error.
Eclipse error:
Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:2331
Error message from debugger back end:
Truncated register 16 in remote 'g' packet
Connecting to J-Link...
J-Link is connected.
Firmware: J-Link LITE-Cortex-M-5V compiled Mar 3 2016 12:49:54
GDB Server output:
Hardware: V8.00
S/N: 638100545
Feature(s): GDB
Checking target voltage...
Target voltage: 5.03 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
GDB closed TCP/IP connection
Any hint what could solve my problem?

Related

debugging with OpenOCD reports Protocol error with Rcmd

I'm working on establishing a debug connection to a Renesas RZ/G2L MPU.
My OpenOCD connection appears to launch fine (and i can connect to it with gdb from the shell afterwards with (gdb) target remote localhost:3333 fine):
Open On-Chip Debugger 0.12.0-rc2+dev-00989-g9501b263e-dirty (2022-12-12-17:03)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
G2L
G2L - 0 CA57(s), 2 CA55(s), 0 CA53(s), 0 CR7(s), 1 CM33(s)
Boot Core - CA55
r9a07g044l.cpu
SMP targets: r9a07g044l.a55.0 r9a07g044l.a55.1
init_reset
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : J-Link V11 compiled Dec 5 2022 13:50:41
Info : Hardware version: 11.00
Info : VTarget = 1.812 V
Info : clock speed 4000 kHz
Info : JTAG tap: r9a07g044l.cpu tap/device found: 0x6ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x6)
Info : r9a07g044l.a55.0: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for r9a07g044l.a55.0 on 3333
Info : Listening on port 3333 for gdb connections
Info : starting gdb server for r9a07g044l.m33 on 3334
Info : Listening on port 3334 for gdb connections
Info : gdb port disabled
I'm trying to hook it up with eclipse to debug Flash Writer which should allow me to bring up the system. I createda debug configuration, set the init commands under start up (per instructions from Renesas) and set the launch target to localhost:3333. Upon launch of a debug session from Eclipse however, I get the following error:
Error in final launch sequence:
Failed to execute MI command:
source /home/mistywest/git/rzg2_flash_writer/gdb_smarc_g2l_flash_writer
Error message from debugger back end:
/home/mistywest/git/rzg2_flash_writer/gdb_smarc_g2l_flash_writer:12: Error in sourced command file:
Protocol error with Rcmd
Failed to execute MI command:
source /home/mistywest/git/rzg2_flash_writer/gdb_smarc_g2l_flash_writer
Error message from debugger back end:
/home/mistywest/git/rzg2_flash_writer/gdb_smarc_g2l_flash_writer:12: Error in sourced command file:
Protocol error with Rcmd
Failed to execute MI command:
source /home/mistywest/git/rzg2_flash_writer/gdb_smarc_g2l_flash_writer
Error message from debugger back end:
/home/mistywest/git/rzg2_flash_writer/gdb_smarc_g2l_flash_writer:12: Error in sourced command file:
Protocol error with Rcmd
/home/mistywest/git/rzg2_flash_writer/gdb_smarc_g2l_flash_writer:12: Error in sourced command file:\nProtocol error with Rcmd
and on the OpenOCD console:
Info : accepting 'gdb' connection on tcp/3333
Info : r9a07g044l.a55.0 cluster 0 core 0 multi core
r9a07g044l.a55.0 halted in AArch64 state due to debug-request, current mode: EL3H
cpsr: 0x400003cd pc: 0x3a94
MMU: disabled, D-Cache: disabled, I-Cache: enabled
Info : New GDB Connection: 1, Target r9a07g044l.a55.0, state: halted
Warn : Prefer GDB command "target extended-remote :3333" instead of "target remote :3333"
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: r9a07g044l.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Invalid ACK (0) in DAP response
Info : Deferring arp_examine of r9a07g044l.a55.1
Info : Use arp_examine command to examine it manually!
Info : Deferring arp_examine of r9a07g044l.m33
Info : Use arp_examine command to examine it manually!
Error: Invalid ACK (0) in DAP response
Error: Debug regions are unpowered, an unexpected reset might have happened
Error: JTAG-DP STICKY ERROR
Error: Could not initialize the APB-AP
Info : dropped 'gdb' connection
Oh I'm running this from a Fedora 36 host - if it matters

Unable to install and configure a J-Link JTAG debugger on a Mac

I have a Segger J-Link which I am trying to use on a Macbook running MacOS Catalina 10.15.4, with openocd and GDB against an ESP32 board. The problem is that I can not seen the device:
$ ls /dev/cu.*
/dev/cu.Bluetooth-Incoming-Port /dev/cu.JimsiPhone-WirelessiAP /dev/cu.SLAB_USBtoUART /dev/cu.usbserial-0001
None of these is the J-Link. If I run lsusb I can see it:
$ lsusb
Bus 020 Device 002: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
Bus 020 Device 003: ID 1366:0101 SEGGER J-Link ARM
I have installed the "J-Link Software and Documentation Pack" downloaded from Segger. I have checked the Mac "Security and privacy" settings and it does not report that it blocked any drivers or programs from being installed or run.
On the J-Link, the green LED is on, with a very brief flash about twice per second.
I'm sure I have a piece missing, and would appreciate some help.
UPDATE: I have been following instructions here:
OpenOCD Instructions
It all works until I get to step 6, and I follow these instructions:
Serial driver instructions
The problem is, a path for the driver never shows up, as I described above. I don't think I can run OpenOCD if I can't make it talk to my J-link.
When I run openocd-esp32, I get (full paste from openocd-esp32 output is below):
Error: No J-Link device found.
The contents of esp32-wroom-32.cfg is:
echo "WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release."
set ESP32_FLASH_VOLTAGE 3.3
source [find target/esp32.cfg]
Here is the full paste:
Jims-MacBook-Pro-486:~ jim$ openocd -f interface/jlink.cfg -f board/esp-wroom-32.cfg -c "program_esp32 build/hello-world.bin 0x10000 verify exit"
Open On-Chip Debugger v0.10.0-esp32-20200420 (2020-04-20-16:15)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
Info : Configured 2 cores
Error: No J-Link device found.
** OpenOCD init failed **
shutdown command invoked
Assertion failed: (jtag_trst == 0), function jtag_checks, file src/jtag/core.c, line 343.
Abort trap: 6
Running JLinkExe does find the J-Link:
Jims-MacBook-Pro-486:~ jim$ JLinkExe
SEGGER J-Link Commander V6.80b (Compiled Jun 5 2020 17:42:04)
DLL version V6.80b, compiled Jun 5 2020 17:41:46
Connecting to J-Link via USB...Updating firmware: J-Link V11 compiled Apr 23 2020 16:49:23
Replacing firmware: J-Link V11 compiled Aug 14 2019 16:21:09
Waiting for new firmware to boot
New firmware booted successfully
O.K.
Firmware: J-Link V11 compiled Apr 23 2020 16:49:23
Hardware version: V11.00
S/N: 51000936
License(s): GDB
VTref=0.000V
Type "connect" to establish a target connection, '?' for help
J-Link>
After doing the above I now get a different error message when running openocd-esp32 (perhaps because of the J-Link FW upgrade?). Initially it complained that there was not an adapter speed set, so I modified interface/jlink.cfg and added:
adapter_khz 3000
I now get a different error:
Error: JTAG scan chain interrogation failed: all ones
Which I have been Googling, and which could mean a bad board or still another configuration issue. There is no SD card in the SD card socket and no other SPI devices on the board, although the ESP32-WROVER-32U has SPI flash on it.
Here is the complete output from openocd-esp32:
Jims-MacBook-Pro-486:~ jim$ openocd -f interface/jlink.cfg -f board/esp-wroom-32.cfg -c "program_esp32 build/hello-world.bin 0x10000 verify exit"
Open On-Chip Debugger v0.10.0-esp32-20200420 (2020-04-20-16:15)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 3000 kHz
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
Info : Configured 2 cores
Info : J-Link V11 compiled Apr 23 2020 16:49:23
Info : Hardware version: 11.00
Info : VTarget = 0.000 V
Info : clock speed 3000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : Listening on port 3333 for gdb connections
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : cpu0: Debug controller 0 was reset.
Info : cpu0: Core 0 was reset.
Error: esp32_soc_reset: Couldn't halt target before SoC reset
embedded:startup.tcl:449: Error: ** Unable to reset target **
in procedure 'program_esp32'
in procedure 'program_esp' called at file "/Users/jim/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200420/openocd-esp32/share/openocd/scripts/target/esp32.cfg", line 64
in procedure 'program_error' called at file "/Users/jim/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200420/openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 75
at file "embedded:startup.tcl", line 449
Warn : Flash driver of esp32.flash does not support free_driver_priv()
Warn : Flash driver of esp32.irom does not support free_driver_priv()
Warn : Flash driver of esp32.drom does not support free_driver_priv()
Success! This circuit used the Segger 10 pin needle connector. On that connector pin 1 is VTREF and on my board it was left floating, when it should have been connected to V3.3. I connected it and:
Jims-MacBook-Pro-486:~ jim$ openocd -f interface/jlink.cfg -f board/esp32-wrover.cfg
Open On-Chip Debugger v0.10.0-esp32-20200420 (2020-04-20-16:15)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
WARNING: boards/esp32-wrover.cfg is deprecated, and may be removed in a future release.
If your board is ESP32-WROVER-KIT, use board/esp32-wrover-kit-1.8v.cfg instead.
Info : Configured 2 cores
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : J-Link V11 compiled Apr 23 2020 16:49:23
Info : Hardware version: 11.00
Info : VTarget = 3.290 V
Info : clock speed 1000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller 0 was reset.
Info : esp32: Core 0 was reset.
Info : esp32: Debug controller 1 was reset.
Info : esp32: Core 1 was reset.
Info : Listening on port 3333 for gdb connections
I would suggest to validate your setup step by step - I personally do not like big bang integrations.
Verify that your the Segger software can see your JLink probe - the good thing is that lsusb can see it. JLink Commander should provide some useful information.
Launch openocd without any executable-related arguments: openocd -f interface/jlink.cfg -f board/esp-wroom-32.cfg
Verify that basic commands are working, i.e. resetting the CPU, displaying registers, reading/writing memory.
If you you are still experimenting issues, double-check your wiring - see here for more information.

Window 10: How to run script on Genymotion emulator with appium using eclipse

Please help to solve my problem
Genymotion with VirtualBox download from genymotion site and install properly
Add Genymotion pluging on eclipse and set Genymotion directory
Add virtual device Nexus9 os version 5.1.0 API 22
Add Selenium and Appium java client jar files under project
Use Genymotion Android Tool and Custom Android SDK tool as Genymotion ADB tool connection setting
Configure Appium Setting and run appium
Run below source code
import java.io.IOException;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecuteResultHandler;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.ExecuteException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.net.URL;
import io.appium.java_client.android.AndroidDriver;
public class Firstappium {
static String deviceName = "Nexus9-6.0.0-API23";
static WebDriver driver;;
public static void main(String[] args) throws InterruptedException, ExecuteException, IOException {
DesiredCapabilities capabilities = new DesiredCapabilities();
DefaultExecutor executor = new DefaultExecutor();
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
capabilities.setCapability("deviceName","Nexus9-5.1.0API22");
capabilities.setCapability("platformVersion", "5.1");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("app","G:/appium/apk/cz.hipercalc.apk");
driver = new AndroidDriver(new URL("http://127.0.0.1:4720/wd/hub"),capabilities);
System.out.println("SetUp is successful and Appium Driver is launched successfully");
}
}
Show below log in Appium
info: [debug] 1 device(s) connected
info: Found device adb server version (32) doesn't match this client (36); killing...
info: [debug] Setting device id to adb server version (32) doesn't match this client (36); killing...
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
wait-for-device
info: [debug] Retrying restartAdb
error: Error running wait-for-device
info: [debug] executing cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
kill-server
error: Error killing ADB server, going to see if it's online anyway
info: [debug] Getting connected devices...
info: [debug] executing cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
devices
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
wait-for-device
error: Error running wait-for-device
info: [debug] Retrying restartAdb
info: [debug] executing cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
error: Error running wait-for-device
info: [debug] executing cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
kill-server
error: Error killing ADB server, going to see if it's online anyway
info: [debug] Getting connected devices...
info: [debug] executing cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
devices
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
wait-for-device
error: Error running wait-for-device
info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
warn: UiAutomator did not shut down fast enough, calling it gone
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
wait-for-device"
error: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
could not read ok from ADB Server
* could not start server *
info: [debug] Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
wait-for-device"
error: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
could not read ok from ADB Server
* could not start server *
at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1016:16)
at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c \"G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...\r wait-for-device\"\nerror: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)\r\ncould not read ok from ADB Server\r\n* could not start server *\r\n)","killed":false,"code":4294967295,"signal":null,"cmd":"C:\WINDOWS\system32\cmd.exe /s /c \"G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...\r wait-for-device\"","origValue":"Command failed: C:\WINDOWS\system32\cmd.exe /s /c \"G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...\r wait-for-device\"\nerror: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)\r\ncould not read ok from ADB Server\r\n* could not start server *\r\n"},"sessionId":null}
info: <-- POST /wd/hub/session 500 30628.747 ms - 1226
From the logs what I can is "adb server version does not match".
Try updating your Android SDK first through ANDROID SDK MANAGER.
And you need to start appium server before you try to initialise the driver.
When you start appium server, by default it starts with port number 4723.
If you are not mentioning any port number while starting appium server then the url should be http://127.0.0.1:4723/wd/hub

Debugging - GNU ARM Bare Metal Development

I am trying to debug a sample code given by Atmel. I have built the program successfully.
For debugging, I am using eclipse plusgdb plus JlinkGDBServer plus onboard Jtag.
Although the program can be downloaded to the board and is running well, I can't debug the program. Everytime I launch a debug session, the JLinkGDBServer will be terminated with an error as below:
Below are the messages shown in the console for each program termination:
JLinkGDBServer
SEGGER J-Link GDB Server V4.96g Command Line Version
JLinkARM.dll V4.96g (DLL compiled Feb 6 2015 17:54:32)
-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2331
SWO raw output listening port: 2332
Terminal I/O port: 2333
Accept remote connection: localhost only
Generate logfile: on
Verify download: on
Init regs on start: on
Silent mode: off
Single run mode: on
Target connection timeout: 5 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: Cortex-A5
Target interface: JTAG
Target interface speed: 1000kHz
Target endian: little
Connecting to J-Link...
J-Link is connected.
Firmware: J-Link OB-SAM3U128 V1 compiled Nov 28 2014 10:24:11
Hardware: V1.00
S/N: 480300770
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...
J-Link found 1 JTAG device, Total IRLen = 4
JTAG ID: 0x4BA00477 (Cortex-A5)
Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes # address 0x00000000 (Data = 0xE59FF070)
Target interface speed set to 1000 kHz
Resetting target
Halting target CPU...
...Target halted (PC = 0x00000000)
PC = 00000000, CPSR = 000001D3 (SVC mode, ARM FIQ dis. IRQ dis.)
R0 = 00000004, R1 = 0031E0C3, R2 = 00016AAD, R3 = 00016965
R4 = 0031FFA0, R5 = C0542A08, R6 = C0512000, R7 = C051DA90
USR: R8 =C051DD80, R9 =410FC051, R10=C0512000, R11 =0031FF94, R12 =003020C0
R13=BEBF5C70, R14=B6F12F1C
FIQ: R8 =9ABE0586, R9 =7E72A55E, R10=73DBFC6B, R11 =4F6717CF, R12 =05EDA809
R13=5AC81462, R14=24683958, SPSR=370D2C67
SVC: R13=0031FF80, R14=00300620, SPSR=000001D3
ABT: R13=C0542B4C, R14=C000DC80, SPSR=A0000193
IRQ: R13=00320000, R14=80000053, SPSR=80000053
UND: R13=C0542B58, R14=C000DB60, SPSR=60000093
Reading all registers
Select auto target interface speed (1000 kHz)
Flash breakpoints enabled
Semi-hosting enabled (VectorAddr = 0x08)
Semihosting I/O set to TELNET and GDB Client
Downloading 15488 bytes # address 0x00300000 - Verified OK
Writing register (PC = 0x00300080)
GDB closed TCP/IP connection
Connected to 127.0.0.1
Reading all registers
Read 4 bytes # address 0x00300080 (Data = 0xF1080100)
Resetting target
Writing register (PC = 0x00300000)
Writing register (PC = 0x00300000)
Starting target CPU...
GDB closed TCP/IP connection
arm-none-eabi-gdb
Warning: the current language does not match this frame.
The target endianness is set automatically (currently little endian)
Semihosting and SWV
SEGGER J-Link GDB Server V4.96g - Terminal output channel
Connection closed by the GDB server.
The following is my debugging configuration:
Under the Run Commands, the commands in the box are as below:
target remote localhost:2331
monitor reset
load
mon reg pc = 0x300000
mon reg pc = 0x300000
end
I dont know what root cause is. I suspect that it is arm-none-eabi-gdb that causes the JLinkGDBServer to terminate with an exit code of -1.
Please help.
Edit 1
FYI, I am using SAMA5D3x-EK development board.
It is difficult to say, but looks like if the processor is having an exception while loading your code. I suggest to verify the load address of the sections of your ELF file, and review the linker settings of your project.
Hope it helps...

Debug Jboss 7.x with intellij idea

I am trying to debug the application on my macbook pro ( os Mountain Lion ). But when I click on debug it is alerting that: unable to connect localhost 4010. I set the port to 4010 on jboss. Here is the output while app starting.
Listening for transport dt_socket at address: 4010
On Jidea; settings for debug is "remote server"
Remote Connection Settings;
host : localhost
port : 4010
Most likely you are using debugger port in place for HTTP port:
In case if you just want to connect to your local application server:
Open "Run/Debug configurations" window.
Add new configuration - Remote
Set up Port to your Jboss socket port