Tuesday, May 22nd 2018, 11:46pm UTC+2

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.

mroszko

Beginner

Date of registration: May 16th 2018

Posts: 2

1

Thursday, May 17th 2018, 3:16pm

JLink unable to halt and erase SAMD51 and SAME54 micros

Hi,

I have a SAMD51 custom board and the Atmel SAME54 XPLAINED board which is Rev 0 (Engineering Sample).

Similar issue to this abandoned thread: [ABANDONED] J-Link ATSAME54 can't halt CPU

However I can confirm it is not just Atmel Studio but JLink Commander is 100% unable to operate on these micros.


I have tried JLink commander from 6.32c and 6.22c with no difference in error.


Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
SEGGER J-Link Commander V6.32c (Compiled May 11 2018 16:30:45)
DLL version V6.32c, compiled May 11 2018 16:30:26

Connecting to J-Link via USB...O.K.
Firmware: J-Link V9 compiled Apr 20 2018 16:47:26
Hardware version: V9.40
S/N: 29423994
License(s): RDI, GDB
OEM: SAM-ICE
VTref=3.320V


Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: ATSAMD51J18
Type '?' for selection dialog
Device>
Please specify target interface:
  J) JTAG (Default)
  S) SWD
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>Auto
Device "ATSAMD51J18" selected.


Connecting to target via SWD
Found SW-DP with ID 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: AHB-AP (IDR: 0x74770001)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0x41003000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ 41003000
ROMTbl[0][0]: E00FF000, CID: B105100D, PID: 000BB4C4 ROM Table
ROMTbl[1] @ E00FF000
ROMTbl[1][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
ROMTbl[1][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl[1][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl[1][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl[1][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
ROMTbl[1][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
ROMTbl[1][6]: E0042000, CID: B105900D, PID: 003BB907 ETB
Cortex-M4 identified.
J-Link>h

**************************
WARNING: CPU could not be halted
**************************

J-Link>erase

**************************
WARNING: CPU could not be halted
**************************

Erasing device (ATSAMD51J18)...

**************************
WARNING: CPU could not be halted
**************************


****** Error: Can not read register 16 (XPSR) while CPU is running
Can not read register 20 (CFBP) while CPU is running
Can not read register 0 (R0) while CPU is running
Can not read register 1 (R1) while CPU is running
Can not read register 2 (R2) while CPU is running
Can not read register 3 (R3) while CPU is running
Can not read register 4 (R4) while CPU is running
Can not read register 5 (R5) while CPU is running
Can not read register 6 (R6) while CPU is running
Can not read register 7 (R7) while CPU is running
Can not read register 8 (R8) while CPU is running
Can not read register 9 (R9) while CPU is running
Can not read register 10 (R10) while CPU is running
Can not read register 11 (R11) while CPU is running
Can not read register 12 (R12) while CPU is running
Can not read register 14 (R14) while CPU is running
Can not read register 15 (R15) while CPU is running
Can not read register 17 (MSP) while CPU is running
Can not read register 18 (PSP) while CPU is running

****** Error: Can not read register 20 (CFBP) while CPU is running

****** Error: CPU is not halted

**************************
WARNING: CPU could not be halted
**************************


****** Error: Can not read register 15 (R15) while CPU is running

****** Error: Can not read register 16 (XPSR) while CPU is running

****** Error: Can not read register 13 (R13) while CPU is running

****** Error: Timeout while checking target RAM, core does not stop. (PC = 0x00000000, XPSR = 0x00000000, SP = 0x00000000)!
Failed to prepare for programming.
Failed to execute RAMCode for RAM check!
ERROR: Erase returned with error code -1.
J-Link>
Unknown command. '?' for help.
J-Link>
Unknown command. '?' for help.
J-Link>regs
CPU is not halted !
J-Link>




The EDBG from Atmel has no issue with the SAME54, just the JLink. And this is just using Commander so its not Studio ;)

Both chips are revision A.





Edit:
According to this Microchip support response:

Quoted


This issue will be fixed in the upcoming releases of Studio with updates from SEGGER.


Is there a fix somewhere from SEGGER?

This post has been edited 2 times, last edit by "mroszko" (May 17th 2018, 3:21pm)


SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

2

Friday, May 18th 2018, 3:26pm

Hello,

Thank you for your inquiry.

Quoted

Is there a fix somewhere from SEGGER?

No, because this issue has never been reproducible for us.
What will change within the next 1-2 weeks is that unsecuring locked ATSAM devices will also work on SAME54/SAMD51 as the sequence from Atmel Studio was not correct.
So we implemented it in our J-Link software directly and it gets handled automatically like for SAMD20 series etc.
Attached is a successful connect sequence with a SAMD51 XPlained Pro board.
Everything is working as expected.

Now both our setups use the same J-Link/SAM-ICE hardware and same eval Board.
The only things that might be different in our setups are:

a) On your board some kind of boot mode is activated that disables/interferes with the debug connection.
b) On your target device an application was running prior to connecting with J-Link which inhibits J-Link communication.

Regarding a): this is rather unlikely as the XPlained Pro eval boards do not seem to have some external boot jumper settings that might interfere here (correct me if I am wrong).

So it will most likely be case b).
For reproduction purposes, could you provide us with the hex/bin of the application that was running on your eval board before connecting, halting and erasing with J-Link did not work?
Does this application set the security bit?
Does the application reconfigure the SWD debug pins for other purposes during run time?
Are any low power modes active or WFI?

Please understand that we can't put to much time in this matter as SAM-ICE support is not given through SEGGER but through Microchip.
Also the issue could so far not be recreated on any of the boards that we have available at our company. Neither our contacts at Microchip were able to reproduce these reported issues.

Best regards,
Nino
SEGGER - Nino has attached the following image:
  • Capture.PNG
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
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 contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/


mroszko

Beginner

Date of registration: May 16th 2018

Posts: 2

3

Friday, May 18th 2018, 4:24pm

Quoted



Please understand that we can't put to much time in this matter as SAM-ICE support is not given through SEGGER but through Microchip.



Hahahahahah. Bad news for you!

I have a JFlasher Portable Plus. Serial number 811000224. Even attached a photo.

Same exact problem, see the attached log.


Please help. :thumbsup:


(I really do need the JFlasher to work, we use them in our initial small run production lots before we get chips preprogrammed)







>a) On your board some kind of boot mode is activated that disables/interferes with the debug connection.


On my D51 board, there is no alternate boot mode and the Atmel-ICE works fine. On the E54-Xplained board, there doesn't look like theres a boot mode setting enabled

>b) On your target device an application was running prior to connecting with J-Link which inhibits J-Link communication.

My SAMD51 custom board has zero firmware and was a fresh chip. There is no way for security bit to be set.





I have attached the programmed hex file and even the sample project source because its just a bare startup project that keeps the micro on its external 12mhz clock, no PLL, and it has a simple loop.


I can confirm the Atmel-ICE works just fine after I acquired one today. And I programmed the project on my D51 board.
The segger still does not work with the D51 after programming this simple firmware file.

The .hex file is inside the zip file under the /Debug folder, along with .elf and .bin since. hex isn't an allowed attachment type.
mroszko has attached the following image:
  • IMG_20180518_100652.jpg
mroszko has attached the following files:

This post has been edited 1 times, last edit by "mroszko" (May 18th 2018, 4:56pm)