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

Unable to flash using eclipse

Hi, 

I was using eclipse for the development of our board using the nRF52832 and when I launch the debug on eclipse, the program does not flash and this is the output that I get in the console

SEGGER J-Link GDB Server V6.44e Command Line Version

JLinkARM.dll V6.44e (DLL compiled Apr  5 2019 16:15:03)

Command line: -if swd -device nRF52832_xxAA -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0
-----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:                 nRF52832_xxAA
Target interface:              SWD
Target interface speed:        1000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link EDU Mini V1 compiled Mar 15 2019 12:47:02
Hardware: V1.00
S/N: 801011244
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 2.28 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 = 0x20000400)
Received monitor command: speed 1000
Target interface speed set to 1000 kHz
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x000008E8)
Received monitor command: regs
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= 20000400, MSP= 20000400, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 000008E8
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 0x000008E8 (Data = 0x47184B06)
Received monitor command: speed auto
Select auto target interface speed (2000 kHz)
Received monitor command: flash breakpoints 1
Flash breakpoints enabled
Received monitor command: semihosting enable
Semi-hosting enabled (Handle on BKPT)
Received monitor command: semihosting IOClient 1
Semihosting I/O set to TELNET Client
Read 4 bytes @ address 0x000008E8 (Data = 0x47184B06)
Downloading 4096 bytes @ address 0x00026000 - Verified OK
Downloading 4096 bytes @ address 0x00027000 - Verified OK
Downloading 4096 bytes @ address 0x00028000 - Verified OK
Downloading 4096 bytes @ address 0x00029000 - Verified OK
Downloading 4096 bytes @ address 0x0002A000 - Verified OK
Downloading 4096 bytes @ address 0x0002B000 - Verified OK
Downloading 4096 bytes @ address 0x0002C000 - Verified OK
Downloading 4096 bytes @ address 0x0002D000 - Verified OK
Downloading 4096 bytes @ address 0x0002E000 - Verified OK
Downloading 4096 bytes @ address 0x0002F000 - Verified OK
Downloading 4096 bytes @ address 0x00030000 - Verified OK
Downloading 4096 bytes @ address 0x00031000 - Verified OK
Downloading 4096 bytes @ address 0x00032000 - Verified OK
Downloading 4096 bytes @ address 0x00033000 - Verified OK
Downloading 4096 bytes @ address 0x00034000 - Verified OK
Downloading 4096 bytes @ address 0x00035000 - Verified OK
Downloading 4096 bytes @ address 0x00036000 - Verified OK
Downloading 4096 bytes @ address 0x00037000 - Verified OK
Downloading 4096 bytes @ address 0x00038000 - Verified OK
Downloading 4096 bytes @ address 0x00039000 - Verified OK
Downloading 4096 bytes @ address 0x0003A000 - Verified OK
Downloading 4096 bytes @ address 0x0003B000 - Verified OK
Downloading 4096 bytes @ address 0x0003C000 - Verified OK
Downloading 2488 bytes @ address 0x0003D000 - Verified OK
Downloading 24 bytes @ address 0x0003D9B8 - Verified OK
Downloading 104 bytes @ address 0x0003D9D0 - Verified OK
Downloading 168 bytes @ address 0x0003DA38 - Verified OK
Downloading 24 bytes @ address 0x0003DAE0 - Verified OK
Downloading 16 bytes @ address 0x0003DAF8 - Verified OK
Downloading 16 bytes @ address 0x0003DB08 - Verified OK
Downloading 8 bytes @ address 0x0003DB18 - Verified OK
Downloading 8 bytes @ address 0x0003DB20 - Verified OK
Downloading 196 bytes @ address 0x0003DB28 - Verified OK
Downloading 84 bytes @ address 0x0003DBEC - Verified OK
Downloading 20 bytes @ address 0x0003DC40 - Verified OK
ERROR: Verification of RAMCode failed @ address 0x20000000.
Write: 0xA801BE00 F0009900
Read: 0x00013C00 E0001000
Failed to prepare for programming.
Failed to download RAMCode!
Writing register (PC = 0x   262d0)
Read 4 bytes @ address 0x000262D0 (Data = 0xFFFFFFFE)
Read 2 bytes @ address 0x000359B8 (Data = 0xFFFE)
Read 2 bytes @ address 0x000359B8 (Data = 0xFFFE)
Read 2 bytes @ address 0x000359B4 (Data = 0xFFFE)
Received monitor command: clrbp
Received monitor command: reset
WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x000000C0)
Read 2 bytes @ address 0x000359B8 (Data = 0xFFFE)
Read 2 bytes @ address 0x000359B8 (Data = 0xFFFE)
Read 2 bytes @ address 0x000359B4 (Data = 0xFFFE)
Received monitor command: regs
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= 00000000, MSP= 00000000, PSP= 00000000
R14(LR) = FFFFFFFE, R15(PC) = 000000C0
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 0x000000C0 (Data = 0x00000602)
Setting breakpoint @ address 0x000359B4, Size = 2, BPHandle = 0x0001
Starting target CPU...
ERROR: Communication timed out: Requested 4 bytes, received 0 bytes !
ERROR: Can not read register 15 (R15) while CPU is running
WARNING: Target connection lost.
Reading all registers
WARNING: Failed to read memory @ address 0x00C16F52
Removing breakpoint @ address 0x000359B4, Size = 2
WARNING: Could not remove breakpoint @ address 0x000359B4
ERROR: Failed to set breakpoint at 0x000359B4
WARNING: Failed to read memory @ address 0x00C16F52

Everything was working fine some days ago and it just stopped working. 

I am pretty sure most of my settings are good. I tried re cloning the project, starting a fresh new work space and even reinstalling eclipse.

Note that I followed this guide for the setup of eclipse:
 https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/development-with-gcc-and-eclipse

Any help is appreciated

  • Hi Xavier

    Are you still having trouble? Could it be that your configure environment has changed? Please check that the paths to your Build and Toolchain are set correctly, and if not, add these paths where you have them installed. Also, enter Run/Debug, click on SEGGER J-Link, and make sure that it's pointing to your latest version of the SEGGER software. You can see our development with GCC and Eclipse guide for more detailed steps.

    A side note. Have there been any updates to Eclipse lately that might have caused this? Are you able to flash any of the standard SDK examples using Eclipse?

    Best regards,

    Simon

  • Hi Simon,
    Yes I am still having trouble and I cannot flash. My build and toolchain path are set correctly since I can build, I just cannot flash. I tried fully reinstalling eclipse to an older version (oxygen) and redoing all the configs but it still does not work.

  • Hi Xavier

    Does it work programming your application with nrfjprog or does it only fail when you use Eclpse? Could you try using -noir and not -ir in your command line? The debugger should not have to initialize the register on the nRF5 device.

    Best regards,

    Simon

  • Hi, thanks for the input

    I can flash using nrfjprog and it does work as intended. I tried using -noir instead of -ir but it still did not flash the new image and the debugger stopped at a random address

    Here's the output in eclipse

    SEGGER J-Link GDB Server V6.44e Command Line Version
    
    JLinkARM.dll V6.44e (DLL compiled Apr  5 2019 16:15:03)
    
    Command line: -if swd -device nRF52832_xxAA -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 2333 -noir -localhostonly 1 -singlerun -strict -timeout 0
    -----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:               off
    Init regs on start:            off
    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:                 nRF52832_xxAA
    Target interface:              SWD
    Target interface speed:        1000kHz
    Target endian:                 little
    
    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link EDU Mini V1 compiled Jul 10 2019 16:32:48
    Hardware: V1.00
    S/N: 801011244
    Feature(s): FlashBP, GDB
    Checking target voltage...
    Target voltage: 2.25 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 0x00029F86 (Data = 0x0F10F01E)
    Received monitor command: speed 1000
    Target interface speed set to 1000 kHz
    Received monitor command: clrbp
    Received monitor command: reset
    Resetting target
    Received monitor command: halt
    Halting target CPU...
    ...Target halted (PC = 0x000008E8)
    Received monitor command: regs
    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= 20000400, MSP= 20000400, PSP= 00000000
    R14(LR) = FFFFFFFF, R15(PC) = 000008E8
    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 0x000008E8 (Data = 0x47184B06)
    Received monitor command: speed auto
    Select auto target interface speed (2000 kHz)
    Received monitor command: flash breakpoints 1
    Flash breakpoints enabled
    Received monitor command: semihosting enable
    Semi-hosting enabled (Handle on BKPT)
    Received monitor command: semihosting IOClient 1
    Semihosting I/O set to TELNET Client
    Read 4 bytes @ address 0x000008E8 (Data = 0x47184B06)
    Downloading 4096 bytes @ address 0x00026000
    Downloading 4096 bytes @ address 0x00027000
    Downloading 4096 bytes @ address 0x00028000
    Downloading 4096 bytes @ address 0x00029000
    Downloading 4096 bytes @ address 0x0002A000
    Downloading 4096 bytes @ address 0x0002B000
    Downloading 4096 bytes @ address 0x0002C000
    Downloading 4096 bytes @ address 0x0002D000
    Downloading 4096 bytes @ address 0x0002E000
    Downloading 4096 bytes @ address 0x0002F000
    Downloading 4096 bytes @ address 0x00030000
    Downloading 4096 bytes @ address 0x00031000
    Downloading 4096 bytes @ address 0x00032000
    Downloading 4096 bytes @ address 0x00033000
    Downloading 4096 bytes @ address 0x00034000
    Downloading 4096 bytes @ address 0x00035000
    Downloading 4096 bytes @ address 0x00036000
    Downloading 4096 bytes @ address 0x00037000
    Downloading 4096 bytes @ address 0x00038000
    Downloading 4096 bytes @ address 0x00039000
    Downloading 4096 bytes @ address 0x0003A000
    Downloading 4096 bytes @ address 0x0003B000
    Downloading 4096 bytes @ address 0x0003C000
    Downloading 4096 bytes @ address 0x0003D000
    Downloading 4096 bytes @ address 0x0003E000
    Downloading 4096 bytes @ address 0x0003F000
    Downloading 272 bytes @ address 0x00040000
    Downloading 24 bytes @ address 0x00040110
    Downloading 104 bytes @ address 0x00040128
    Downloading 168 bytes @ address 0x00040190
    Downloading 24 bytes @ address 0x00040238
    Downloading 16 bytes @ address 0x00040250
    Downloading 16 bytes @ address 0x00040260
    Downloading 8 bytes @ address 0x00040270
    Downloading 8 bytes @ address 0x00040278
    Downloading 200 bytes @ address 0x00040280
    Downloading 84 bytes @ address 0x00040348
    Downloading 20 bytes @ address 0x0004039C
    ERROR: Verification of RAMCode failed @ address 0x20000000.
    Write: 0xA801BE00 F0009900
    Read: 0x00013C00 F0001000
    Failed to prepare for programming.
    Failed to download RAMCode!
    Writing register (PC = 0x   262d0)
    Read 4 bytes @ address 0x000262D0 (Data = 0x00060004)
    Read 2 bytes @ address 0x000359C8 (Data = 0xE7E0)
    Read 2 bytes @ address 0x000359C8 (Data = 0xE7E0)
    Read 2 bytes @ address 0x000359C4 (Data = 0xF072)
    Read 2 bytes @ address 0x0003A06A (Data = 0x0300)
    Read 2 bytes @ address 0x0003A4E0 (Data = 0x0000)
    Received monitor command: clrbp
    Received monitor command: reset
    WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
    Resetting target
    Received monitor command: halt
    Halting target CPU...
    ...Target halted (PC = 0x000008C0)
    Read 2 bytes @ address 0x000359C8 (Data = 0xF7E0)
    Read 2 bytes @ address 0x000359C8 (Data = 0xF7E0)
    Read 2 bytes @ address 0x000359C4 (Data = 0xF072)
    Received monitor command: regs
    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= 00000000, MSP= 00000000, PSP= 00000000
    R14(LR) = FFFFFFFE, R15(PC) = 000008C0
    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 0x000008C0 (Data = 0xF0003E10)
    Setting breakpoint @ address 0x000359C4, Size = 2, BPHandle = 0x0001
    Starting target CPU...
    Debugger requested to halt target...
    WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
    ...Target halted (PC = 0x00031770)
    Reading all registers
    Read 4 bytes @ address 0x00031770 (Data = 0x4420C00C)
    Removing breakpoint @ address 0x000359C4, Size = 2
    Starting target CPU...
    

  • Hi, after two weeks I have found the problem.. it was my jlink edu mini. I tried using my coworker Jlink and it worked.

Related