[SOLVED] Write and read memory of Kinetis

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

  • [SOLVED] Write and read memory of Kinetis

    Hello,
    I'm trying to write and read some bytes from memory of Kinetis using JLinkEDU.

    Command w4 works but when I use command mem32 I receive an error:
    "Could not read memory"

    Command unlock also doesn't works. I Receive an error:
    "...Timeout while unlocking device"

    How can I solve this problem?
    Michal
  • Hi Michales,


    could you please start J-Link Commander (jlink.exe) and post a screenshot of the output?


    Best regards,
    Niklas
    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.
  • Hi,

    just pasted the img here for convenience.

    Could you please describe exactly what you do?
    What is the name of the target device? With which parameters do you invoke mem32/unlock?


    Best regards,
    Niklas
    Images
    • 1.jpg

      75.87 kB, 675×363, viewed 1,319 times
    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.
  • Hello,

    I put
    J-Link> mem32 0x000007D0 4
    I received
    J-Link>Could not read memory.



    or
    J-Link>unlock Kinetis

    J-Link>Unlocking Device...Timeout while unlocking device <=this erase my device KE02Z64
    After unlock command I can use mem32 command
    I always receive FFFFF......so the memory is empty


    For microcontrollers Kinetis option "read" is blocked?



    Best Regards
    Michał
  • Hi,


    the unlocking procedure erases the device.
    Whether RAM access is allowed while the device is locked depends on the chip design implementation.
    Unlocking Device...Timeout while unlocking device <=this erase my device KE02Z64

    Not sure what you mean. The command does what is expected, but it prints an error?

    Best regards,
    Niklas
    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.
  • Hello,


    Yes. Command prints an error but erases my device.

    Source Code

    1. J-Link>unlock Kinetis
    2. Unlocking Device...Timeout while unlocking device
    3. J-Link>


    If programmer can't read memory because is locked, how verify it after programming?

    For programming I use JLink.exe.
    I can program microcontroller only when is empty. I can't program or erase microcontroller second time.
    I receive an error:

    [IMG=http://s1.fotowrzut.pl/M0JMO9YJ92/1_medium.jpg][/IMG]

    My script:

    Source Code

    1. device MKE02Z64xxx4
    2. si 1
    3. speed 1000
    4. erase
    5. loadfile C:\my\test.srec
    6. r
    7. g


    But When I use J-Flash Lite I can do this. Why?

    Best Regards
    Michał

    The post was edited 1 time, last by michales ().

  • Hi Michales,

    If programmer can't read memory because is locked, how verify it after programming?

    On most Freescale devices, security (if activated) will take effect after a reset. While J-Link will execute a verify after each download, you can do an additional verify before resetting the device.
    But When I use J-Flash Lite I can do this. Why?

    J-Flash Lite resets the target before download.
    Try:

    Source Code

    1. device MKE02Z64xxx4
    2. si 1
    3. speed 1000
    4. r
    5. loadfile C:\my\test.srec


    Best regards,
    Niklas
    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.