[SOLVED] EM357 erasing error

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

  • [SOLVED] EM357 erasing error

    Hello,

    I'm using jlink base to erase EM357 chip (software version v6.14b). When chip is brand new than first erase works without any problems. But when I try to do next erase than I've got this error: "Timeout while erasing sectors" (full log in attachment).

    Did anyone faced this issue? How to fix this?

    Best Regards,
    Lukas
    Images
    • err.png

      95.45 kB, 827×857, viewed 802 times
  • Hi Lukas,


    you selected the EM357 (allow CIB) as a device.
    Hence, the "erase" command did not only erase the flash memory, but also the CIB.
    As described in the EM35x reference manual (silabs.com/documents/public/data-sheets/EM35x.pdf) in section 5.2.1.4 (page 30 - 32),
    this activates the Flash memory protection.

    You need to write 0x5AA5 to 0x08040800 in order to disable the Flash memory protection.
    Does this work for you?

    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 Niklas,

    Thank you for your quick reply.
    I've write a simple script:
    connect
    r
    h
    w2 0x08040800 0x5aa5
    mem16 0x08040800 1
    qc

    and the result is programming error. Details in attached print screen.

    Could you check what is wrong?

    Best Regards,
    Lukas
    Images
    • 2.png

      110.34 kB, 827×981, viewed 422 times
  • Hi Lukas,


    sorry for the delay in response.

    The following command file should do the trick:

    C Source Code

    1. con
    2. h
    3. mem32 8000000 1
    4. exec DisableFlashDL
    5. sleep 3000
    6. mem32 0x40004030 1
    7. w4 0x4000402C 1
    8. sleep 200
    9. mem32 0x40004030 1
    10. mem32 0x40008010 1
    11. w4 0x40008004 0x45670123
    12. w4 0x40008004 0xCDEF89AB
    13. sleep 100
    14. mem32 0x40008010 1
    15. w4 0x40008010 0
    16. sleep 100
    17. w4 0x40008008 0x45670123
    18. w4 0x40008008 0xCDEF89AB
    19. sleep 100
    20. w4 0x40008010 0220
    21. sleep 100
    22. w4 0x40008010 0260
    23. sleep 500
    24. mem32 0x4000800C 1
    25. sleep 500
    26. mem32 0x4000800C 1
    27. sleep 500
    28. mem32 0x4000800C 1
    29. sleep 100
    30. w4 0x40008010 0210
    31. sleep 100
    32. w2 0x08040800 5aa5
    33. sleep 100
    34. exec EnableFlashDL
    35. sleep 100
    Display All


    The setup parameters need to be passes as a command line argumtent, e.g.

    C Source Code

    1. jlink.exe -device "EM357 (ALLOW CIB)" -if SWD -speed 4000 -Commandfile UnlockEM357.jlink


    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.