Monday, December 11th 2017, 6:02pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

ohnail

Beginner

Date of registration: Feb 9th 2012

Posts: 24

1

Wednesday, November 11th 2015, 2:12pm

[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

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

2

Thursday, November 12th 2015, 3:44pm

Hi Ohnail,

Quoted

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.

Quoted


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.

Quoted

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

ohnail

Beginner

Date of registration: Feb 9th 2012

Posts: 24

3

Friday, November 13th 2015, 1:49am

Hi Niklas,

Thanks a lot for your quick response.

Quoted

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?

Quoted

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

This post has been edited 4 times, last edit by "ohnail" (Nov 13th 2015, 1:53am)


SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

4

Friday, November 13th 2015, 9:46am

Hi Ohnail,

Quoted


I changed to Flasher ARM V3, it has RS232 port to see what happend. Below is the log.

Quoted

#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.


Quoted

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

ohnail

Beginner

Date of registration: Feb 9th 2012

Posts: 24

5

Friday, November 13th 2015, 12:25pm

Hi Niklas,

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

Quoted

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.

Quoted

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

ohnail

Beginner

Date of registration: Feb 9th 2012

Posts: 24

6

Friday, November 13th 2015, 12:29pm




It also can be used in online mode. But it can't run in standalone mode.

Could you help me to check what's wrong with my operation? Thanks again.

Best regards
Taoist
2015.11.13

This post has been edited 1 times, last edit by "ohnail" (Nov 13th 2015, 12:33pm)


Jane

Beginner

Date of registration: Nov 13th 2015

Posts: 2

7

Monday, November 16th 2015, 6:24am

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

Jane

Beginner

Date of registration: Nov 13th 2015

Posts: 2

8

Tuesday, November 17th 2015, 3:34am

Dear Segger engineer,
How about your opinion on this issue?
It seems the Flahser fail to communicate with the D20 via SWD when it is secured.. So the earse command can't be excuted.
Thanks!
Jane

This post has been edited 1 times, last edit by "Jane" (Nov 17th 2015, 6:24am)


SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

9

Wednesday, November 18th 2015, 2:44pm

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:

Quoted

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

ohnail

Beginner

Date of registration: Feb 9th 2012

Posts: 24

10

Wednesday, November 18th 2015, 3:23pm

Hi Niklas,

Thanks a lot for your below confirm. ;(

Quoted

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

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

11

Wednesday, November 18th 2015, 4:42pm

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

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

12

Thursday, December 3rd 2015, 2:15pm

Hi Ohnail,

automatic handling of secured ATSAMD20 devices has been added to V5.10a of the J-Link software & documentation pack

Quoted

- 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

ohnail

Beginner

Date of registration: Feb 9th 2012

Posts: 24

13

Thursday, December 3rd 2015, 3:06pm

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.

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

14

Thursday, December 3rd 2015, 3:35pm

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

SEGGER - Erik

Super Moderator

Date of registration: Dec 20th 2011

Posts: 392

15

Friday, December 4th 2015, 9:05am

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