[SOLVED] FLASH wrong memory read after erase. STM32L486RG. Jlink Ultra+

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

  • [SOLVED] FLASH wrong memory read after erase. STM32L486RG. Jlink Ultra+

    SEGGER J-Link GDB Server V6.46h Command Line Version , JLinkARM.dll V6.46h (DLL compiled Jun 28 2019 17:11:34)

    When the FLASH memory is erased, the GDB server reads the values from the 0x8000000 address range as they were before erase. The aliased address 0x000000 is read correctly. The program (C program) reads the flash correctly. The Jlink gdb server displays data before the erase 0x8000000

    In the example below you can see sample code. The program stops in the software breakpoint.



    And the pointers. The *ptr1 is read wrong.


    The data is shown as read:



    And some memory dumps. The jlink gdb server shows that the data was read from the 0x8000000+ address but it returns the old data instead the new one.
  • Hello,

    Thank you for your inquiry.
    Per default J-Link will cache Flash content to reduce Flash wear and tear. This is most likely displayed when reading from the Flash base address via GDB.
    You can also disable Flashcache. How is described in the J-Link user manual.
    One way is after starting GDB Server open localhost:19080/ in your webbrowser. Thisl will open the J-Link Control panel.
    In the Settings tab select "Allow Caching of Flash contents" which after clicking should go from On to Off.

    Does the read work correctly after disable Flash cache?

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    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.
  • Hello Piotr,

    Great to hear that you are up and running again.
    We will consider this thread as solved now.

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    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.