[SOLVED]: "No matching RAMCode found" - STM32 and J-Link

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

  • [SOLVED]: "No matching RAMCode found" - STM32 and J-Link

    Hi,
    I face some issues with debugging a simple LED application for my STM32 stamp module (steitec.net/product_info.php?l…12-Stamp&products_id=143&).
    My setup: I use the CodeSourcery toolchain, along with Eclipse Helios (CDT) and MingW in a Windows 7 (64 bit) environment.
    My J-Link is pretty new: Firmware: J-Link ARM V8 compiled Nov 19 2010 11:55:23 and the Segger toolchain has version 4.20p. The init file - based on page 21 of the Jlink GDB Server documentation - is:

    Source Code

    1. # Connect to the J-Link gdb server
    2. target remote localhost:2331
    3. monitor speed Auto
    4. # STM32F103RBT6
    5. monitor flash device = STM32F103RB
    6. monitor flash breakpoints = 1
    7. monitor flash download = 1
    8. load elf/main.elf
    9. # Initializing PC and stack pointer
    10. monitor reg r13 = (0x00000000)
    11. monitor reg pc = (0x00000004)
    Display All

    When starting the gdb server, the log says:
    J-Link found 2 JTAG devices, Total IRLen = 9
    JTAG ID: 0x3BA00477 (Cortex-M3)

    When starting the debugging in Eclipse, the following log output is generated:
    Connected to 127.0.0.1
    Reading all registers
    Read 4 bytes @ address 0x00000000 (Data = 0x20004FFF)
    Select auto JTAG speed (1000 kHz)
    Select flash device: STM32F103RB
    Flash breakpoints enabled
    Flash download enabled
    Downloading 484 bytes @ address 0x08000000
    Downloading 5736 bytes @ address 0x080001E4
    Downloading 40 bytes @ address 0x0800184C
    Writing register (PC = 0xE4010008)
    ERROR: No matching RAMCode found (11713201)
    Failed to download RAMCode.
    Please check your flash settings!
    Connection to debugger closed !

    Obviously, there are some issues with the download.
    Furthermore, the GDB-Debugger throws an error window stating "Can not read register 27 (CONTROL) while CPU is running".
    I would like to add that the download of the related main.hex file via serial interface works without any problems.
    Attached is the zip archive with main.elf and the linker script.

    Can anybody help me?

    Cheers
    Christoph
    Files
    • main.zip

      (13.25 kB, downloaded 846 times, last: )

    The post was edited 4 times, last by christoph ().

  • Unfortunately, I had to realize that the download did not happen.My impression is:
    The connection has been established, data has been sent to target and a verification took place. But the data has not been written.As I had flashed the target via STM Flashloader and serial port beforehand, the verification read the already flashed data.

    When I changed the sources and compiled again, the GDB-Server showed:
    Connected to 127.0.0.1
    Reading all registers
    Read 4 bytes @ address 0x00000000 (Data = 0x20004FFF)
    Select auto JTAG speed (1000 kHz)
    Target endianess set to "little endian"
    Select flash device: STM32F103RB
    Flash breakpoints enabled
    Flash download enabled
    Reading all registers
    Downloading 484 bytes @ address 0x08000000
    Downloading 5736 bytes @ address 0x080001E4
    Downloading 40 bytes @ address 0x0800184C
    Writing register (PC = 0x080001E4)
    ERROR: Verification failed @ address 0x08000000
    Connection to debugger closed !

    What could be the reason? Is it possible that the cabling is not correct? As my stamp has no JTAG connection, I had to solder and wire a solution on my breadboard.
    BTW, the error also happens if the JTAG speed remains at 5 kHz.
    Cheers
    christoph
  • I rechecked the JTAG-cabling and tested the consequences when removing single cables. Everytime, the GDB-Server showed errors to identify the target. Therefore, I assume that the cabling is not the root cause.
  • Success! :thumbsup:
    The Flash could be written when using the right device type (so simple... X( ). My stamp module has a STM32F103RET6 with 512K Flash. The board description @ steitec.net (see first post) mentioned a STM32F103RBT6- even though this is definitely wrong, as B indicates a 128K Flash. After editing this letter, it worked!
    So final setup with arm-none-eabi-gdb.exe is as follows:

    Source Code

    1. # Connect to the J-Link gdb server
    2. set mem inaccessible-by-default off
    3. target remote localhost:2331
    4. monitor speed Auto
    5. monitor endian little
    6. # STM32F103RET6
    7. monitor flash device = STM32F103RE
    8. monitor flash breakpoints = 1
    9. monitor flash download = 1
    10. # insert your elf file here:
    11. file elf/main.elf
    12. load
    13. break main
    14. # Initializing PC and stack pointer
    15. monitor reg r13 = (0x00000000)
    16. monitor reg pc = (0x00000004)
    17. monitor reset
    18. continue
    Display All