Hello
I'm quite new to the J-Link EDU and got a bit stuck...
I have a J-Link EDU connected via JTAG to a LPC2146.
Downloading a hex file to flash works good, but i cant't sucessfully verify it over the GDB Server.
It seems to work well from J-Flash Lite on Windows 7:
SEGGER J-Flash Lite 4.85a output:
First try with automatic verification and JTAG set as interface (on Linux):
JLinkGDBServer output:
Display All
GDB output:
Display All
Second try, JLinkGDBServer started without any options (on Linux):
JLinkGDBServer output:
Display All
GDB output:
Display All
Both tries fail at 0x0
I have tried it also with an other LPC2146 which results in the exact same error on the same memory adress (0x0).
I guess the origin of this error are wrong commands, since it seems to work with JFlash lite (and one of the LPCs can sucessfully be flashed and verified with OpenOCD/FTDI).
What is my mistake here or what can I try else?
Thanks, Marius
(btw. I have removed S/N, directory named and some parts of the code)
I'm quite new to the J-Link EDU and got a bit stuck...
I have a J-Link EDU connected via JTAG to a LPC2146.
Downloading a hex file to flash works good, but i cant't sucessfully verify it over the GDB Server.
It seems to work well from J-Flash Lite on Windows 7:
SEGGER J-Flash Lite 4.85a output:
Source Code
- Downloading C:\dir\to\file.hex to LPC2146 via JTAG-Interface@1000kHz
- Programming Thread started.
- Device "LPC2146" selected.
- TotalIRLen = 4, IRPrint = 0x01
- Debugger initialized successfully.
- J-Link: Flash download: Flash programming performed for 1 range (4096 bytes)
- J-Link: Flash download: Total time needed: 1.513s (Prepare: 0.385s, Compare: 0.328s, Erase: 0.448s, Program: 0.094s, Verify: 0.013s, Restore: 0.242s)
- Programming Thread exited
- Programming done
First try with automatic verification and JTAG set as interface (on Linux):
JLinkGDBServer output:
Source Code
- [user@machine JLink_Linux_V498b_x86_64]$ ./JLinkGDBServer -vd -if JTAG
- SEGGER J-Link GDB Server V4.98b Command Line Version
- JLinkARM.dll V4.98b (DLL compiled Apr 10 2015 20:27:35)
- -----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: yes
- Generate logfile: off
- Verify download: on
- Init regs on start: off
- Silent mode: off
- Single run mode: off
- Target connection timeout: 0 ms
- ------J-Link related settings------
- J-Link Host interface: USB
- J-Link script: none
- J-Link settings file: none
- ------Target related settings------
- Target device: unspecified
- Target interface: JTAG
- Target interface speed: 1000kHz
- Target endian: little
- Connecting to J-Link...
- J-Link is connected.
- Firmware: J-Link V9 compiled Apr 21 2015 18:10:40
- Hardware: V9.30
- S/N: -deleted-
- OEM: SEGGER-EDU
- Feature(s): FlashBP, GDB
- Checking target voltage...
- Target voltage: 3.31 V
- Listening on TCP/IP port 2331
- Connecting to target...
- J-Link found 1 JTAG device, Total IRLen = 4
- JTAG ID: 0x4F1F0F0F (ARM7)
- Connected to target
- Waiting for GDB connection...Connected to 127.0.0.1
- Reading all registers
- ERROR: Can not read register 0 (R0) while CPU is running
- .
- .
- .
- ERROR: Can not read register 78 (R14) while CPU is running
- ERROR: Can not read register 9 (R15 (PC)) while CPU is running
- ERROR: Can not read register 8 (CPSR) while CPU is running
- Read 4 bytes @ address 0x00000000 (Data = 0xE59FF018)
- Read 4 bytes @ address 0x00000000 (Data = 0xE59FF018)
- Reading all registers
- ERROR: Can not read register 0 (R0) while CPU is running
- .
- .
- .
- ERROR: Can not read register 78 (R14) while CPU is running
- ERROR: Can not read register 9 (R15 (PC)) while CPU is running
- ERROR: Can not read register 8 (CPSR) while CPU is running
- Read 4 bytes @ address 0x00000000 (Data = 0xE59FF018)
- Read 4 bytes @ address 0x00000000 (Data = 0xE59FF018)
- Downloading 4096 bytes @ address 0x00000000 - Verify failed
- Downloading 4096 bytes @ address 0x00001000 - Verified OK
- .
- .
- .
- Downloading 232 bytes @ address 0x00015000 - Verified OK
- Read 4 bytes @ address 0x00000000 (Data = 0xE59FF018)
- Read 4 bytes @ address 0x00000000 (Data = 0xE59FF018)
- GDB closed TCP/IP connection
- ^CRestoring target state and closing J-Link connection...
- Shutting down...
- [user@machine JLink_Linux_V498b_x86_64]$
GDB output:
Source Code
- [user@machine]$ arm-none-eabi-gdb
- GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.1.20141128-cvs
- Copyright (C) 2014 Free Software Foundation, Inc.
- License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
- This is free software: you are free to change and redistribute it.
- There is NO WARRANTY, to the extent permitted by law. Type "show copying"
- and "show warranty" for details.
- This GDB was configured as "--host=i686-linux-gnu --target=arm-none-eabi".
- Type "show configuration" for configuration details.
- For bug reporting instructions, please see:
- <http://www.gnu.org/software/gdb/bugs/>.
- Find the GDB manual and other documentation resources online at:
- <http://www.gnu.org/software/gdb/documentation/>.
- For help, type "help".
- Type "apropos word" to search for commands related to "word".
- (gdb) target remote localhost:2331
- Remote debugging using localhost:2331
- 0x00000000 in ?? ()
- (gdb) file /dir/to/file.hex
- A program is being debugged already.
- Are you sure you want to change the file? (y or n) y
- Reading symbols from /dir/to/file.hex..(no debugging symbols found)...done.
- (gdb) load
- Loading section .sec1, size 0x10000 lma 0x0
- Loading section .sec2, size 0x50e8 lma 0x10000
- Start address 0x0, load size 86248
- Transfer rate: 25 KB/sec, 3920 bytes/write.
- (gdb)
- (gdb) q
- A debugging session is active.
- Inferior 1 [Remote target] will be killed.
- Quit anyway? (y or n) y
- [user@machine]$
Second try, JLinkGDBServer started without any options (on Linux):
JLinkGDBServer output:
Source Code
- [user@machine JLink_Linux_V498b_x86_64]$ ./JLinkGDBServer
- SEGGER J-Link GDB Server V4.98b Command Line Version
- JLinkARM.dll V4.98b (DLL compiled Apr 10 2015 20:27:35)
- -----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: yes
- Generate logfile: off
- Verify download: off
- Init regs on start: off
- Silent mode: off
- Single run mode: off
- Target connection timeout: 0 ms
- ------J-Link related settings------
- J-Link Host interface: USB
- J-Link script: none
- J-Link settings file: none
- ------Target related settings------
- Target device: unspecified
- Target interface: JTAG
- Target interface speed: 1000kHz
- Target endian: little
- Connecting to J-Link...
- J-Link is connected.
- Firmware: J-Link V9 compiled Apr 21 2015 18:10:40
- Hardware: V9.30
- S/N: -deleted-
- OEM: SEGGER-EDU
- Feature(s): FlashBP, GDB
- Checking target voltage...
- Target voltage: 3.32 V
- Listening on TCP/IP port 2331
- Connecting to target...
- J-Link found 1 JTAG device, Total IRLen = 4
- JTAG ID: 0x4F1F0F0F (ARM7)
- Connected to target
- Waiting for GDB connection...Connected to 127.0.0.1
- Reading all registers
- Read 4 bytes @ address 0x7FFFD2D6 (Data = 0x07806808)
- Select JTAG as target interface
- Selecting device: lpc2146
- Reading all registers
- Read 4 bytes @ address 0x7FFFD2D6 (Data = 0x07806808)
- Downloading 4096 bytes @ address 0x00000000
- .
- .
- .
- Downloading 4096 bytes @ address 0x00014000
- Downloading 232 bytes @ address 0x00015000
- Writing register (PC = 0x00000000)
- Read 4 bytes @ address 0x00000000 (Data = 0xE59F4034)
- Reading 1024 bytes @ address 0x00000000
- .
- .
- .
- Reading 1024 bytes @ address 0x00014C00
- Reading 232 bytes @ address 0x00015000
- GDB closed TCP/IP connection
- ^CRestoring target state and closing J-Link connection...
- Shutting down...
- [user@machine JLink_Linux_V498b_x86_64]$
GDB output:
Source Code
- [user@machine]$ arm-none-eabi-gdb
- GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.1.20141128-cvs
- Copyright (C) 2014 Free Software Foundation, Inc.
- License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
- This is free software: you are free to change and redistribute it.
- There is NO WARRANTY, to the extent permitted by law. Type "show copying"
- and "show warranty" for details.
- This GDB was configured as "--host=i686-linux-gnu --target=arm-none-eabi".
- Type "show configuration" for configuration details.
- For bug reporting instructions, please see:
- <http://www.gnu.org/software/gdb/bugs/>.
- Find the GDB manual and other documentation resources online at:
- <http://www.gnu.org/software/gdb/documentation/>.
- For help, type "help".
- Type "apropos word" to search for commands related to "word".
- (gdb) target remote localhost:2331
- Remote debugging using localhost:2331
- 0x7fffd2d6 in ?? ()
- (gdb) monitor interface JTAG
- Select JTAG as target interface
- (gdb) monitor device lpc2146
- Selecting device: lpc2146
- (gdb) file /dir/to/file.hex
- A program is being debugged already.
- Are you sure you want to change the file? (y or n) y
- Reading symbols from /dir/to/file.hex...(no debugging symbols found)...done.
- (gdb) load
- Loading section .sec1, size 0x10000 lma 0x0
- Loading section .sec2, size 0x50e8 lma 0x10000
- Start address 0x0, load size 86248
- Transfer rate: 1380 KB/sec, 3920 bytes/write.
- (gdb) compare-sections
- Section .sec1, range 0x0 -- 0x10000: MIS-MATCHED!
- Section .sec2, range 0x10000 -- 0x150e8: matched.
- warning: One or more sections of the target image does not match
- the loaded file
- (gdb) q
- A debugging session is active.
- Inferior 1 [Remote target] will be killed.
- Quit anyway? (y or n) y
- [user@machine]$
Both tries fail at 0x0
I have tried it also with an other LPC2146 which results in the exact same error on the same memory adress (0x0).
I guess the origin of this error are wrong commands, since it seems to work with JFlash lite (and one of the LPCs can sucessfully be flashed and verified with OpenOCD/FTDI).
What is my mistake here or what can I try else?
Thanks, Marius

(btw. I have removed S/N, directory named and some parts of the code)