Can't read RAM memory through J-Link GDB Server for LPC2367 in Eclipse

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

  • Can't read RAM memory through J-Link GDB Server for LPC2367 in Eclipse

    Using J-Link GDB Server, I can't seem to read memory from any variable between 0x40000000-0x40008000, which is the same address block as the internal RAM data for the LPC2367. It does seem to display values for local function variables, which don't seem to have addresses within the internal RAM block. When I hover over a variable after pausing application, I get the following message on the J-Link GDB Server console:


    ERROR: Read memory error @ address 0x40000B40, word access: Memory access timeout.
    WARNING: Failed to read memory @ address 0x40000B40
    Read 4 bytes @ address 0x40000B40 (Data = 0xAAAAAAAA)

    When I hover over a local variable that it is able to read, I get the following output.
    Read 4 bytes @ address 0x00025A28 (Data = 0xEA00000F)


    The internal RAM for the LPC2367 is at 0x4000000-0x40008000

    I can read the memory from JLink Commander:
    mem32 0x40000B40 4
    40000B40 = 00000000 00011AE4 0A9FD7A5 00000000

    However, when I try to read the memory through the eclipse gdb console it fails:

    (gdb)
    monitor memu32 0x40000B40
    50-interpreter-exec console "monitor memu32 0x40000B40"
    @"Reading from address 0x40000B40 (Failed)\r\n"
    50^done
    (gdb)

    The JLink GDB Console returned the message:
    Reading from address 0x40000B44 (Failed)


    Here is my .gdbinit file:

    #
    # J-LINK GDB SERVER initialization
    #
    # This connects to a GDB Server listening
    # for commands on localhost at tcp port 2331
    target remote localhost:2331

    # Setup GDB for faster downloads
    set remote memory-write-packet-size 1024
    set remote memory-write-packet-size fixed

    set mem inaccessible-by-default off

    # Select flash device
    monitor flash device = LPC2367
    monitor flash download = 1
    monitor flash breakpoints = 1

    # Set JTAG speed to auto
    monitor speed adaptive

    # Set GDBServer to little endian, which is set permanently on the LPC23xx
    monitor endian little

    # Reset the chip to get to a known state.
    monitor reset 9

    # Load the program executable
    load Debug/1022547_Platform_Control.elf

    I'm using V4.80 JLink software

    Does anyone have any ideas on how to resolve this problem?

    The post was edited 3 times, last by Willvandijk ().

  • Watchdog was enabled

    The problem appears to be that I had the watchdog enabled, so when the program was paused manually or by a breakpoint, the watchdog would reset the process, and the memory could not be read.

    Once I disabled the watchdog timer, everything seems to be working as it should. I can see all the RAM variables when I hover over them or when I look at the variable window. I can also use the Memory browser with out any problems.

    Thanks.
  • Hi,

    Good to hear that everything is working now.
    Most watchdogs can be configured to stop counting while the CPU is in debug mode (halted) to allow debugging with the watchdog being enabled.
    Sounds like in your case the watchdog was configured to continue running while the CPU is in debug mode, which of course is somewhat problematic...


    Best regards
    Alex
    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.