[SOLVED]gdbserver can't flash STM32F103C8

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

  • [SOLVED]gdbserver can't flash STM32F103C8

    I'm using a Jlink edu v8.0 and the Linux gdb server v4.22 with an STM32F103C8T6 board.
    With the included JLinkExe, I can program the STM's flash without any issue. Trying to
    do the same using gdb,

    target remote localhost:2331
    monitor flash download 1
    monitor flash device STM32F103C8
    load main.elf,

    I can see the contents of main.elf in memory, but they don't overwrite the flash.
    What gives? What am I doing wrong?
  • Hi,

    the flash programming itself is only triggered when really necessary.
    So in your case nothing than download has been done, so the J-Link lib caches the data to download.

    If you add the following line at the end of your script, a flash download should be triggered:

    monitor reset

    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.
  • SEGGER - Alex wrote:

    Hi,

    the flash programming itself is only triggered when really necessary.
    So in your case nothing than download has been done, so the J-Link lib caches the data to download.

    If you add the following line at the end of your script, a flash download should be triggered:

    monitor reset

    Best regards
    Alex
    Alex -- thanks for your prompt reply. Unfortunately, this results in


    ERROR: No matching RAMCode found (11713201)
    Failed to download RAMCode.
    Please check your flash settings!
    Connection to debugger closed !

    Is "STM32F103C8" the correct device string? (There's no way of knowing -- gdbserver accepts arbitrary strings without error).
  • Hi,

    is it possible that you are running the GDB Server in big endian mode?

    To be sure that it is running in little endian mode, could you please add
    monitor endian little
    as the first line in your GDB Init?

    Is "STM32F103C8" the correct device string? (There's no way of knowing -- gdbserver accepts arbitrary strings without error).

    Yes, it is correct.


    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.