[SOLVED] Erase a SAMD21 with security bit set?

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

  • [SOLVED] Erase a SAMD21 with security bit set?

    Using the Jlink tools v 6.52 under MacOS, I'm scratching my head how to unlock a Microchip/Atmel ATSAMD21J18A...

    The "unlock" command isn't right, as it only supports other chips. I tried just "erase", and that also doesn't work. What am I missing here? (I bet it's obvious).

    The wiki ( wiki.segger.com/ATSAM_Device_Series ) implies that it should auto-unlock, but that's definitely not what I see.

    Here's what I see when I try:

    Source Code

    1. JLinkExe -device ATSAMD21J18 -if swd -speed 4000
    2. SEGGER J-Link Commander V6.52e (Compiled Oct 16 2019 12:33:23)
    3. DLL version V6.52e, compiled Oct 16 2019 12:33:11
    4. Connecting to J-Link via USB...O.K.
    5. Firmware: J-Link Pro V4 compiled Oct 8 2019 14:58:45
    6. Hardware version: V4.00
    7. S/N: 17450XXXXX
    8. License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    9. IP-Addr: DHCP (no addr. received yet)
    10. VTref=3.303V
    11. Type "connect" to establish a target connection, '?' for help
    12. J-Link>connect
    13. Device "ATSAMD21J18" selected.
    14. Connecting to target via SWD
    15. InitTarget()
    16. Connect Under Reset
    17. Connect Under Reset
    18. InitTarget()
    19. Connect Under Reset
    20. Connect Under Reset
    21. ****** Error: InitTarget(): PCode returned with error code -1
    22. InitTarget()
    23. Connect Under Reset
    24. Connect Under Reset
    25. InitTarget()
    26. Connect Under Reset
    27. Connect Under Reset
    28. ****** Error: InitTarget(): PCode returned with error code -1
    29. Cannot connect to target.
    30. J-Link>erase
    31. Target connection not established yet but required for command.
    32. Device "ATSAMD21J18" selected.
    33. Connecting to target via SWD
    34. InitTarget()
    35. Connect Under Reset
    36. Connect Under Reset
    37. InitTarget()
    38. Connect Under Reset
    39. Connect Under Reset
    40. ****** Error: InitTarget(): PCode returned with error code -1
    41. InitTarget()
    42. Connect Under Reset
    43. Connect Under Reset
    44. InitTarget()
    45. Connect Under Reset
    46. Connect Under Reset
    47. ****** Error: InitTarget(): PCode returned with error code -1
    48. Cannot connect to target.
    49. J-Link>
    Display All
  • Hello,

    Thank you for your inquiry.
    The auto unlock may only work if reset is connected. This does not seem to be the case here.
    Check if your board has the reset line connected.

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