[ABANDONED] SAMC21 and SAM-ICE

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

  • [ABANDONED] SAMC21 and SAM-ICE

    Hello,

    I am trying to connect to my SAMC21E18 with the SAM-ICE debugger (SWD) but I'm having difficulties: target voltage is read correctly but Atmel Studio 7 is then incapable of programming as it fails with "Error: InitTarget(): PCode returned with error code -1"

    This is Jlink commander output:

    Source Code

    1. SEGGER J-Link Commander V6.20i (Compiled Nov 17 2017 17:47:07)
    2. DLL version V6.20i, compiled Nov 17 2017 17:46:22
    3. Connecting to J-Link via USB...O.K.
    4. Firmware: J-Link ARM V8 compiled Aug 26 2015 15:08:21
    5. Hardware version: V8.00
    6. S/N: 28023442
    7. License(s): RDI, GDB
    8. OEM: SAM-ICE
    9. VTref = 3.287V
    10. Type "connect" to establish a target connection, '?' for help
    11. J-Link>connect
    12. Please specify device / core. <Default>: ATSAMC21E18
    13. Type '?' for selection dialog
    14. Device>
    15. Please specify target interface:
    16. J) JTAG (Default)
    17. S) SWD
    18. TIF>s
    19. Specify target interface speed [kHz]. <Default>: 4000 kHz
    20. Speed>
    21. Device "ATSAMC21E18" selected.
    22. Connecting to target via SWD
    23. InitTarget()
    24. Secured Atmel SAMD device detected.
    25. For debugger connection the device needs to be unsecured.
    26. Note: Unsecuring will trigger a mass erase of the internal flash.
    27. Executing default behavior previously saved in the registry.
    28. Device will be unsecured now.
    29. InitTarget()
    30. Secured Atmel SAMD device detected.
    31. For debugger connection the device needs to be unsecured.
    32. Note: Unsecuring will trigger a mass erase of the internal flash.
    33. Executing default behavior previously saved in the registry.
    34. Device will be unsecured now.
    35. ****** Error: InitTarget(): PCode returned with error code -1
    Display All


    What do you think is wrong? I think connections are fine, the MCU gets 3.3V and the SWD cable should be ok.
    Thanks
  • Hello,

    Thank you for your inquiry.
    Such an issue is not known to us.
    SAM-ICE support is provided through Atmel and not SEGGER so I am not allowed to spend much time on your question.
    So I suggest contacting Atmel about that issue.

    Is the issue reproducible with a evalboard?
    Did you program a application that might have set flash read/write protections?

    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.
  • SEGGER - Nino wrote:

    Hello,

    Thank you for your inquiry.
    Such an issue is not known to us.
    SAM-ICE support is provided through Atmel and not SEGGER so I am not allowed to spend much time on your question.
    So I suggest contacting Atmel about that issue.

    Is the issue reproducible with a evalboard?
    Did you program a application that might have set flash read/write protections?

    Best regards,
    Nino
    Thanks, I already ordered an evaluation board and will try to see what's wrong. Meanwhile I already asked on Atmel forums.
    The problem happens even just by reading the processor ID, what is weird is that reset signal happens after some data is sent through SWDIO, not sure this is the correct behaviour.

    Thanks