Wednesday, September 20th 2017, 8:08pm 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.

Masmiseim

Beginner

Date of registration: Oct 18th 2016

Posts: 13

Location: Kassel

1

Wednesday, October 19th 2016, 9:27am

[SOLVED] tracing with J-Trace

Hello Segger Team,

I would like to trace my program.

For this I’m using Ozone with a j-Trace Debugger (SW Version 610b) and a TWR-K60 Eval Board. While connecting to the Board I get a License Missing Error Message:

“The connected J-Link does not have a valid license for the use of Ozone – The J-Link Debugger. J-Link PLUS, UTRA+ and PRO models come with a build in license for Ozone – The J-Link Debugger. …”

Is the License not included in a j-Trace? You write on the Ozone-Product Page: “Ozone can be used with J-Link PLUS, ULTRA+, PRO and J-Trace” So it should work with my J-Trace, right?

The pure debugging with setting breakpoints, stepping, disassembly, etc. is working fine. Tracing is only working when I don’t touch the Clock-Distribution --> don’t call the SystemInit Function from the CMSIS.
Is there anything I should do, or not do to have trace with full core clock speed?


Thanks and regards

Markus

This post has been edited 1 times, last edit by "Masmiseim" (Oct 19th 2016, 9:30am)


SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,611

2

Wednesday, October 19th 2016, 9:46am

Hi Markus,

could you please open J-Link Commander and take a screenshot? Example:


Could you provide us with the exact label of the MCU?
There exist some revisions of the K60 which have no setup time for the trace data signal (= TRACE_CLK and TRACE_DATA are changed at the same time).

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

Masmiseim

Beginner

Date of registration: Oct 18th 2016

Posts: 13

Location: Kassel

3

Wednesday, October 19th 2016, 10:18am

Hello,


Thanks for the fast Reply. The Label of the MCU is:

PK60N512VMD100
0M33Z
CTDZM1047B

But this is not the final Hardware we want to use. I just wanted to get the trace running and see how it works. The final hardware will be a K66-based, but our
hardware-development is still not finished. That’s why I’ve started with this board.


Regards

Markus
Masmiseim has attached the following image:
  • J-Link Commander.png

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,611

4

Wednesday, October 19th 2016, 11:46am

Hi,

Unfortunately, 0M33Z is buggy hardware revision.
Tracing will not work reliable with this unit.

Regarding the Ozone license:
The unit was produced 2010-08-12. 6 years ago, the "J-Link Pro Software bundle" was not bundled, but an optional purchase (~500€).
In order to upgrade to a J-Trace with the required license, I recommend to make use of the SEGGER Trade-In Program, which would give you a credit of 498€ towards your next purchase. Therefore, a new J-Trace Cortex-M would be 498€ (instead of 995€), and a new J-Trace Pro Cortex-M would be 893€ (instead of 1390€).


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

Masmiseim

Beginner

Date of registration: Oct 18th 2016

Posts: 13

Location: Kassel

5

Wednesday, October 19th 2016, 1:10pm

Hello Niklas,

the silicon on the K60-Board is really rather old. But, I could organize a TWR-K80 Board and tried the trace. On this board it is not working at all, regardless if the clock is set or not. “Normal” debugging is working.

PK80
FN256VDC15
0N03P
CTVDCDA

Also a buggy silicon or Board?


Regards

Markus

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,611

6

Wednesday, October 19th 2016, 2:20pm

Hi Markus,


are you referring to this board?


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

Masmiseim

Beginner

Date of registration: Oct 18th 2016

Posts: 13

Location: Kassel

7

Wednesday, October 19th 2016, 2:37pm

Hello Niklas,

Looks like, but my controller-IC is soldered and not in a socket:

http://www.nxp.com/products/software-and…le:TWR-K80F150M


Regards

Markus

Masmiseim

Beginner

Date of registration: Oct 18th 2016

Posts: 13

Location: Kassel

8

Thursday, October 20th 2016, 1:12pm

Hello Niklas,

I took a closer look to the Registers of the K80 Board. It looks like the debugger initialized the GPIO-pins incorrect.


It initializes the Pins PTA6 – PTA9 as trace Pins, but on this board PTA12 – PTA16 is used for trace. I didn’t found a way to configure the pins in ozone, so I tried to configure it in my program. Sadly that didn’t work.

Any Idea how to configure the pins?

Regards

Markus
Masmiseim has attached the following images:
  • Ozone K80 Port A.png
  • K80Cortex JZAG.png

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,611

9

Thursday, October 20th 2016, 4:05pm

Hi Markus,

sorry for the delay in response.
We are temporarily a little low on manpower, but I will try to squeeze it in this week.
Thanks for the hint regarding the trace pins.

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,611

10

Tuesday, October 25th 2016, 5:39pm

Hi Markus,

you are correct, the J-Link Software currently configures PTA06-PTA10, which is not available on all pin-out options of the K80.
However, activating the pins in the target software or via Ozone worked fine for me.

Could you please replace the AfterTargetReset function in your Ozone project file with the following code and provide feedback if it works for you?

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*********************************************************************
*                                                                     
*       AfterTargetReset                                              
*                                                                     
* Function description                                                
*   Event handler routine. Optional.                                  
*                                                                     
**********************************************************************
*/                                                                    

void AfterTargetReset (void) {
  Target.WriteU32(0x40048038, 0xFFFF);     // System Clock Gating Control Register 5 (SIM_SCGC5): Enables Clock for PORT A-E, TSI, LPTMR1, and enables software access to the Low Power Timer module.
  Target.WriteU32(0x40048004, 0x00001000); // System Options Register 2 (SIM_SOPT2): TRACECLKSEL (Debug trace clock select) : 1 == Core/system clock
  Target.WriteU32(0x40049030, 0x00000400); // Select ALT Mode 4 of Pin A12 (Trace_CLKOUT) 
  Target.WriteU32(0x40049034, 0x00000440); // Select ALT Mode 4 of Pin A13 (Trace_D3) and enable High drive strength
  Target.WriteU32(0x40049038, 0x00000440); // Select ALT Mode 4 of Pin A14 (Trace_D2) and enable High drive strength
  Target.WriteU32(0x4004903C, 0x00000440); // Select ALT Mode 4 of Pin A15 (Trace_D1) and enable High drive strength
  Target.WriteU32(0x40049040, 0x00000440); // Select ALT Mode 4 of Pin A16 (Trace_D0) and enable High drive strength                                        
}  
 


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

Masmiseim

Beginner

Date of registration: Oct 18th 2016

Posts: 13

Location: Kassel

11

Thursday, October 27th 2016, 1:39pm

Hello Niklas,


Thanks for the scripts. With this extension it is working with my board. It is setting the alternative Pin configuration for the trace pins, but still keeps the original
one:




I already tried to deactivate the old pins by extending your code:


Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
void AfterTargetReset (void)
{
  Target.WriteU32(0x40048038, 0xFFFF);     // System Clock Gating Control Register 5 (SIM_SCGC5): Enables Clock for PORT A-E, TSI, LPTMR1, and enables software access to the Low Power Timer module.
  Target.WriteU32(0x40048004, 0x00001000); // System Options Register 2 (SIM_SOPT2): TRACECLKSEL (Debug trace clock select) : 1 == Core/system clock
  Target.WriteU32(0x40049030, 0x00000400); // Select ALT Mode 4 of Pin A12 (Trace_CLKOUT) 
  Target.WriteU32(0x40049034, 0x00000440); // Select ALT Mode 4 of Pin A13 (Trace_D3) and enable High drive strength
  Target.WriteU32(0x40049038, 0x00000440); // Select ALT Mode 4 of Pin A14 (Trace_D2) and enable High drive strength
  Target.WriteU32(0x4004903C, 0x00000440); // Select ALT Mode 4 of Pin A15 (Trace_D1) and enable High drive strength
  Target.WriteU32(0x40049040, 0x00000440); // Select ALT Mode 4 of Pin A16 (Trace_D0) and enable High drive strength                                        
  
  
  
  Target.WriteU32(0x40049018, 0x00000000); // Select ALT Mode 0 of Pin A6
  Target.WriteU32(0x4004901C, 0x00000000); // Select ALT Mode 0 of Pin A7
  Target.WriteU32(0x40049020, 0x00000000); // Select ALT Mode 0 of Pin A8
  Target.WriteU32(0x40049024, 0x00000000); // Select ALT Mode 0 of Pin A9
  Target.WriteU32(0x40049028, 0x00000000); // Select ALT Mode 0 of Pin A10
}



Which is not working, also resetting it in the Register-View of Ozone is not working, as the debugger is activating the original configuration immediately.


Regards

Markus