This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Eclipse, GDB, MacOS...So Close...

I am seeing signs of the chip wanting to be debugged by Eclipse on my Mac. It really does. I can feel it.

Two things seem to be plaguing me:

  1. 90% of the time it fails to download the code from gdb, citing a "block verification error". Would like to get to the bottom of this.

  2. Once in a while it successfully downloads, then it breaks at the reset handler. I don't know why (I haven't set any breakpoints), but it shows me where it is and is looking like it might be starting to work.

Then I hit "resume", and I get this:


Read 2 bytes @ address 0x000003D4 (Data = 0x50D0)
Read 2 bytes @ address 0x000003D6 (Data = 0xDCFB)
Read 2 bytes @ address 0x000003D8 (Data = 0x4805)
Read 2 bytes @ address 0x000003DA (Data = 0x4780)
Starting target CPU...
ERROR: Programming failed @ address 0x00000000 (block verification error)
...Target halted (PC = 0xFFFFFFFE)
Reading all registers
Read 4 bytes @ address 0xFFFFFFFE (Data = 0x00007FFF)
Read 4 bytes @ address 0x1FFFFFFC (Data = 0x00000000)
Reading 64 bytes @ address 0x1FFFFFC0
Read 4 bytes @ address 0x00000000 (Data = 0x20004000)
Read 2 bytes @ address 0xFFFFFFFE (Data = 0x0000)
Read 2 bytes @ address 0x00000000 (Data = 0x4000)
Read 2 bytes @ address 0x00000002 (Data = 0x2000)
Read 2 bytes @ address 0x00000004 (Data = 0x03BD)

It starts the target CPU again, and I get another block verification error. What is it trying to download to address 0?

My gdb startup script looks like this:

mon speed 30 mon endian little mon flash download = 1 mon flash device = NRF51822 mon sleep 1000 mon reset 0 mon sleep 1000

The sleeps seem to help, but this is starting to feel like a bad game of whack-a-mole.

Any ideas?

Parents
  • I have the same problem but in Windows 7. My Segger output looks like this:

    SEGGER J-Link GDB Server V5.02d Command Line Version

    JLinkARM.dll V5.02d (DLL compiled Sep 18 2015 20:21:49)

    -----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: off Verify download: on Init regs on start: on Silent mode: off Single run mode: on 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: Cortex-M4 Target interface: SWD Target interface speed: 1000kHz Target endian: little

    Connecting to J-Link... J-Link is connected. Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Aug 28 2015 19:26:24 Hardware: V1.00 S/N: 682869800 Checking target voltage... Target voltage: 3.30 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 Read 4 bytes @ address 0x00000000 (Data = 0xFFFFFFFF) Target interface speed set to 1000 kHz Resetting target Halting target CPU... ...Target halted (PC = 0xFFFFFFFE) R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000 R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000 R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000 R12= 00000000, R13= FFFFFFFC, MSP= FFFFFFFC, PSP= 00000000 R14(LR) = FFFFFFFF, R15(PC) = FFFFFFFE XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000 CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00 Reading all registers Read 4 bytes @ address 0xFFFFFFFE (Data = 0xFFFF0000) Select auto target interface speed (1000 kHz) Flash breakpoints enabled Semi-hosting enabled (Handle on BKPT) Semihosting I/O set to TELNET Client Read 4 bytes @ address 0xFFFFFFFE (Data = 0xFFFF0000) Downloading 3244 bytes @ address 0x00000000 - Verify failed Downloading 8 bytes @ address 0x00000CAC - Verify failed Downloading 1344 bytes @ address 0x00000CB4 - Verify failed Writing register (PC = 0x00000a18) Read 4 bytes @ address 0x00000A18 (Data = 0xFFFFFFFF) Read 2 bytes @ address 0x000008E6 (Data = 0xFFFF) Read 2 bytes @ address 0x000008E6 (Data = 0xFFFF) Resetting target Halting target CPU... ...Target halted (PC = 0xFFFFFFFE) Read 2 bytes @ address 0x000008E6 (Data = 0xFFFF) Read 2 bytes @ address 0x000008E6 (Data = 0xFFFF) Read 2 bytes @ address 0x000008E6 (Data = 0xFFFF) R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000 R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000 R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000 R12= 00000000, R13= FFFFFFFC, MSP= FFFFFFFC, PSP= 00000000 R14(LR) = FFFFFFFF, R15(PC) = FFFFFFFE XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000 CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00 Reading all registers Read 4 bytes @ address 0xFFFFFFFE (Data = 0xFFFF0000) Setting breakpoint @ address 0x000008E6, Size = 2, BPHandle = 0x0001 Starting target CPU... ...Target halted (PC = 0xFFFFFFFE) Reading all registers Read 4 bytes @ address 0xFFFFFFFE (Data = 0xFFFFFFFF) Removing breakpoint @ address 0x000008E6, Size = 2 Read 4 bytes @ address 0xFFFFFFF4 (Data = 0x00000000) Read 4 bytes @ address 0xFFFFFFF0 (Data = 0x00000000) Read 4 bytes @ address 0x00000000 (Data = 0xFFFFFFFF) Reading 64 bytes @ address 0x00000000 Reading 64 bytes @ address 0x00000040 Read 4 bytes @ address 0xFFFFFFEC (Data = 0x00000000) Read 4 bytes @ address 0xFFFFFFEC (Data = 0x00000000) Read 4 bytes @ address 0x00000000 (Data = 0xFFFFFFFF) Read 4 bytes @ address 0xFFFFFFF4 (Data = 0x00000000) Read 4 bytes @ address 0xFFFFFFEC (Data = 0x00000000) Read 4 bytes @ address 0x00000000 (Data = 0xFFFFFFFF) Reading 64 bytes @ address 0xFFFFFF80 Reading 64 bytes @ address 0xFFFFFFC0

Reply Children
No Data
Related