[SOLVED] JLink memory read(mem) return old value until exit and re-connect

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

  • [SOLVED] JLink memory read(mem) return old value until exit and re-connect

    I use J-Link plus to debug my FW on NRF52840 MCU - they connected by SWD
    I use JLinkExe to monitor the connection and read memory and in parallel get logs in JLinkRTTClient

    Few times today I saw this phenomena:
    I read using the mem command a value from the flash of the MCU
    I saw from logs that the FW updated this value in flash
    I read again using the mem command and saw that the value in flash didn't change(against my expectations)
    I exited from JLinkExe and re-entered (without reset the MCU) and got with mem command the new value.

    What can cause this? Does mem command use caching that can cause errors
  • Hi,

    If J-Link knows that the given area is in flash, it is considered as "constant" (not writable by the application) by default.
    Similar as you would define that region in an MPU / MMU.
    This has to do with debug speed optimizations done by J-Link.
    So accesses to these areas are cached. This default works fine for the majority of customers (> 90%).

    See here for a solution to the problem you are seeing:
    wiki.segger.com/UM08001_J-Link…flash_contents_at_runtime


    BR
    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.