[SOLVED] Unable to debug Eclipse project on Linux using Jlink GDB server, Unable to halt target sama5d2

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Unable to debug Eclipse project on Linux using Jlink GDB server, Unable to halt target sama5d2

    Hi
    I am trying to use Jlink GDB server to debug a baremetal project with eclipse on Linux. The target is Microchip (Atmel) SAMA5D2. Here is the log I get:
    $JLinkGDBServer -if SWD -device ATSAMA5D27 -localhostonly -halt

    SEGGER J-Link GDB Server V6.14c Command Line Version

    JLinkARM.dll V6.14c (DLL compiled Mar 31 2017 17:42:05)

    -----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: 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: ATSAMA5D27
    Target interface: SWD
    Target interface speed: 1000kHz
    Target endian: little

    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link ARM V8 compiled Aug 26 2015 15:08:21
    Hardware: V8.00
    SAM-ICE found !
    S/N: 28001034
    OEM: SAM-ICE
    Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
    Checking target voltage...
    Target voltage: 3.31 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 0x00218A26 (Data = 0xF04F0781)
    Read 2 bytes @ address 0x00218A26 (Data = 0x0781)
    Resetting target
    Downloading 4096 bytes @ address 0x00200000
    WARNING: CPU could not be halted
    ERROR: Could not start CPU core. (ErrorCode: -1)
    Downloading 4096 bytes @ address 0x00201000
    WARNING: CPU could not be halted
    ERROR: Could not start CPU core. (ErrorCode: -1)
    Downloading 4096 bytes @ address 0x00202000
    WARNING: CPU could not be halted
    ERROR: Could not start CPU core. (ErrorCode: -1)
    Downloading 4096 bytes @ address 0x00203000
    WARNING: CPU could not be halted
    ERROR: Could not start CPU core. (ErrorCode: -1)


    I tried to use JLINK commander to load the program as well and I get errors because the core could not be halted:
    $JLinkExe
    SEGGER J-Link Commander V6.14c (Compiled Mar 31 2017 17:42:12)
    DLL version V6.14c, compiled Mar 31 2017 17:42:05

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link ARM V8 compiled Aug 26 2015 15:08:21
    Hardware version: V8.00
    S/N: 28001034
    License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    OEM: SAM-ICE
    VTref = 3.306V


    Type "connect" to establish a target connection, '?' for help
    J-Link>connect
    Please specify device / core. : ATSAMA5D27
    Type '?' for selection dialog
    Device>ATSAMA5D27
    Please specify target interface:
    J) JTAG (Default)
    S) SWD
    TIF>S
    Specify target interface speed [kHz]. : 4000 kHz
    Speed>
    Device "ATSAMA5D27" selected.


    Found SW-DP with ID 0x5BA02477
    CoreSight AP[0]: 0x44770002, APB-AP
    ROMTbl 0 [0]: 00020003, CID: B105100D, PID:04-000BB4A5 ROM Table
    ROMTbl 1 [0]: 00010003, CID: B105900D, PID:04-001BBC05 Cortex-A5
    Found Cortex-A5 r0p1
    3 code breakpoints, 2 data breakpoints
    Debug architecture ARMv7.0
    Data endian: little
    Main ID register: 0x410FC051
    I-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
    D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
    System control register:
    Instruction endian: little
    Level-1 instruction cache enabled
    Level-1 data cache disabled
    MMU disabled
    Branch prediction enabled
    Cortex-A5 identified.
    J-Link>
    Unknown command. '?' for help.
    J-Link>loadbin getting-started_sama5d4-xplained_sram.bin 0x200000
    Halting CPU for downloading file.
    Downloading file [getting-started_sama5d4-xplained_sram.bin]...
    O.K.
    J-Link>setpc 0x200000
    J-Link>h
    PC: (R15) = 00200000, CPSR = 000001F3 (SVC mode, THUMB FIQ dis. IRQ dis.)
    Current:
    R0 =0021A33C, R1 =28000000, R2 =FC02C000, R3 =00000005
    R4 =FC02C000, R5 =00000200, R6 =02000001, R7 =00000200
    R8 =002098C0, R9 =002098C0, R10=0021A0B8, R11=00000000, R12=00010000
    R13=0021A33C, R14=00000020, SPSR=0021FF80
    USR: R8 =0021A0B8, R9 =00000000, R10=00010000, R11=0021A33C, R12=00000020
    R13=10630980, R14=2D660C8D
    FIQ: R8 =24117164, R9 =20C6666E, R10=2CB1B179, R11=C59B7116, R12=70D1D544
    R13=00340A44, R14=18012E5F, SPSR=24040FF2
    IRQ: R13=40018200, R14=DCB4000C, SPSR=E007A99A
    SVC: R13=0021FF80, R14=00218AAD, SPSR=000001D3
    ABT: R13=00200000, R14=DC9D2E9A, SPSR=1804021A
    UND: R13=000503C2, R14=48308AD9, SPSR=D5072B52
    J-Link>loadbin getting-started_sama5d4-xplained_sram.bin 0x200000
    Downloading file [getting-started_sama5d4-xplained_sram.bin]...
    O.K.
    J-Link>setpc 0x200000
    J-Link>r
    Reset delay: 0 ms
    Reset type NORMAL: Reset CPU + peripherals via reset pin. CPU halted immediately after reset.
    J-Link script: Reset
    J-Link script: Done
    J-Link>g

    ****** Error: CPU is not halted

    For some reason the JLink is not able to halt the core. Is this a known problem? Please help.
  • Hello,

    Thank you for your inquiry.
    You are using a V8 SAM-ICE which does not support Cortex-A5 debugging.
    I just tried to reproduce the issue with a SAMA5D2 xPlained eval board, a J-Link Plus and Software version V6.22c.
    Everything was working fine as expected.

    So we suggest upgrading it to a newer model thorough our trade in program: segger.com/purchase/trade-in-program/

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.