[SOLVED] Flasher portable program ATSAMD20 issues.

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

  • [SOLVED] Flasher portable program ATSAMD20 issues.

    Hi Sir,

    I'm using the Flasher portable to program Atmel ATSAMD20G17. I found below issues.
    1) J-Flash doesn't support D20 Lock/unlock directly. Is it right?
    2) When D20 has locked, Flasher portable always fail in re-program it. The log only display FAIL. I can't find any solutions.
    3) The old version J-Flash, like V496l, if you select chip erase, the flasher won't erase the sector 0x804000 to 0x80401F. But the new version J-Flash, like V5.02i, the flasher will erase the sector No. 512. Is it right?

    My requirement is very easy as below.
    1) Flasher running stand alone mode, program D20 first, lock it.
    2) Re-program D20 whether it has locked.

    How can I realize it? Thanks a lot.

    Ohnail
    2015.11.11
  • Hi Ohnail,

    When D20 has locked, Flasher portable always fail in re-program it. The log only display FAIL. I can't find any solutions.

    SEGGER Flasher Standalone is designed for production purposes.
    At the start of a production process, devices are not secured.

    if you select chip erase

    Correct.On chip erase, either the build-in chip erase is used, or a sector erase is iterated over all sectors.

    1) Flasher running stand alone mode, program D20 first, lock it.
    2) Re-program D20 whether it has locked.

    How can I realize it? Thanks a lot.

    The unlock can be done using the Init Steps. (UM 8003 4.1.3.7 Init Steps)

    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hi Niklas,

    Thanks a lot for your quick response.

    SEGGER Flasher Standalone is designed for production purposes.
    At the start of a production process, devices are not unsecured.


    Yes, at the start of production process, the devices are unsecured. But we can't guarantee the operation of the worker. If he/she pressed two program button, it would show fail. Another case, if the firmware updated, the worker need rework the locked chips. As R&D, we should prepare solutions for them. Am I right?

    The unlock can be done using the Init Steps. (UM 8003 4.1.3.7 Init Steps)

    Yes, I followed the steps to add unlock commands. It works very well in online mode. But it can't work in stand alone mode.
    I changed to Flasher ARM V3, it has RS232 port to see what happend. Below is the log.


    #STATUS:INITIALIZING
    #ERR255:Configured flash algorithm (15813200) for flash bank 0 is not supported by this firmware version.
    #STATUS:CONNECTING
    #ERR255:Could not write target memory
    #ERR255:Failed to execute CPU init sequence
    #ERR255:Error while flashing


    Could you help to check what's wrong with flashers? Thanks a lot.

    Ohnail
    2015.11.13

    The post was edited 4 times, last by ohnail ().

  • Hi Ohnail,


    I changed to Flasher ARM V3, it has RS232 port to see what happend. Below is the log.
    #ERR255:Configured flash algorithm (15813200) for flash bank 0 is not supported by this firmware version.

    Flasher ARM V3 does not support the flash algo required, thus this is another problem.


    Yes, I followed the steps to add unlock commands. It works very well in online mode. But it can't work in stand alone mode.

    The Init Steps are executed on all current Flasher products, regardless of operation mode.

    However, I am not sure if i understood your setup correctly.
    Usual production procedure should be:
    1) Programming the target device.
    2) Locking the device via exit-steps.
    As an alternative, we suggest to
    1) program the device with an application that locks the device on its first run.
    This will make sure that the device is locked if the programming succeeds.

    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hi Niklas,

    Thank you very much again. Please forgive my poor English. It makes you confusion.

    Usual production procedure should be:
    1) Programming the target device.
    2) Locking the device via exit-steps.


    Yes, I used same step with you. Below is my configuration.




    The Flasher runs very well when the target chip is unsecured. In online mode, I can re-program it by press "F7". But In standalone mode, it always fail.

    I tried to add commands to unlock the chip as you said.
    The unlock can be done using the Init Steps. (UM 8003 4.1.3.7 Init Steps)
  • Hello,
    I found the same problem when secure the SAMD20G17!
    The D20G17 cant be re-programmed by the portable flasher if it is secured?? While if the chip is blank, it can be programm, secured smoothly with the flasher.
    Hope you can help on this issue!!
    Many thanks!
    Jane
  • Hi All,

    sorry for the delay in response.
    The Init steps are executed after the initial connect.
    Currently, the initial connect for ATSAMD20 devices fails in standalone mode if the target is secured.
    Therefore, unlocking ATSAMD20 devices by using the Init steps is not possible.

    A firmware that supports unlocking ATSAMD20 devices in standalone mode is planned for a future release.

    Until then, a possible workaround would be:

    As an alternative, we suggest to
    1) program the device with an application that locks the device on its first run.
    This will make sure that the device is locked if the programming succeeds.


    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hi Niklas,

    Thanks a lot for your below confirm. ;(

    Currently, the initial connect for ATSAMD20 devices fails in standalone mode if the target is secured.
    Therefore, unlocking ATSAMD20 devices by using the Init steps is not possible.


    May I ask more about this issue? Is that possible to use J-Link script file to realize adding initial steps before the initial connect?
    Thanks again.

    Best regards,
    Ohnail
    2015.11.18
  • Hi Ohnail,

    sorry for being imprecise about this:

    The unlock has to be done in order to be able to execute the Init steps, e.g. "Write 8bit 0x41002000 0x10", because the access to these registers is also denied if the device is locked.

    In order to unlock the device, you could set the Chip erase bit using JLINK_CORESIGHT_WriteAP() in a J-Link script file.
    Unfortunately, J-Link Script files are not supported in standalone mode.


    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hi Ohnail,

    automatic handling of secured ATSAMD20 devices has been added to V5.10a of the J-Link software & documentation pack
    - Flasher: Flash programming of secured Atmel SAMD20 devices did not work in stand-alone mode. Fixed.


    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hi Niklas,

    Thanks a lot for your work. I'm testing the new version V5.10a.
    It looks flasher can re-program the secured D20 after firmware update. But I failed serval times, not every time passed. I'm trying to exclude hardware issues. ?(

    Another thing need confirm here. When D20 has been secured, Flasher read the chip will erase the flash and the erase can't be disabled. Am I right?
    Thanks again.
  • Hi Ohnail,

    Can you please send us the FLASHER.LOG file located on the MSD device of the Flasher (press the start / stop button during supplying power to the Flasher to start in MSD)?

    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hi Ohnail,

    You are right, we have added support for programming secured SAMD20 devices in V5.10a. We are not able to reproduce any issues. We have verified functionality with different setups / configurations (100% success rate). Apart from the FLASHER.LOG, can you please provide us further information about how you proceed or what needs to be done to reproduce the behavior? Does it pop up when programming locked devices only? Does it pop up in both, J-Flash mode and stand-alone mode?

    If there still is a problem under special circumstances, we would like to investigate this further and of course fix it.


    Best regards
    Erik