Thursday, April 26th 2018, 9:38am 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.

Dave

Beginner

Date of registration: Aug 19th 2016

Posts: 8

1

Thursday, April 12th 2018, 5:09pm

Segger J-Trace on ATSAME70-XPLD

Hello,

I try to use trace with the Microchip demoboard, but I am unable to get the trace working.
I found the AppNote for setting up the trace for Keil MDK-ARM IDE: Advanced Debugging with ETM for SAM V7/E7/S7 MCUs
http://ww1.microchip.com/downloads/en/Ap…TM_App-Note.pdf

In chapter 7.1 is written that:
IAR has not yet implemented its own ETM configuration. The configuration must be added in the user software.
So I understand that you need to config the device first, pins and so on. But how is this possible with Ozone.
Can you maybe provide a trace example for this device atsame70q21 too?

Regards, Dave

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 960

2

Thursday, April 12th 2018, 5:23pm

Hello Dave,

Trace example projects for Ozone can be found on our Website for multiple devices including the SAME70:
https://www.segger.com/products/debug-pr…tested-devices/

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purposes 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/


Dave

Beginner

Date of registration: Aug 19th 2016

Posts: 8

3

Thursday, April 12th 2018, 5:40pm

Hello Nino,

thank you very much for your help.
I try this example but I can't see any trace date after open the instruction trace windwos.
Do I need to add some trace timings on the demoboard?
And why do I need a JLinkScriptfile requested at support@segger.com?
Is this file responsible for device setup (pins and so on) and why not for free download?

Regards, Dave
Ozone V2.56g
J-Link V6.30j
Dave has attached the following image:
  • Same70_NoTrace.PNG

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 960

4

Friday, April 13th 2018, 11:51am

Hello Dave,

The project is designed to work out-of-the-box for the Smart SAME70 Xplained Ev. Kit.
See screenshot attached. Everything is working as expected.
Which eval board are you trying to debug?
Did you use the project from the Wiki? https://wiki.segger.com/Tracing_on_Atmel_ATSAME70
How did you load it in Ozone?
Per default the Eval board has no Trace pin header equipped. Did you solder one to it?

Quoted

Do I need to add some trace timings on the demoboard?

Not if you are using the mentioned eval board. For other hardware that might be needed.

More information about troubleshooting in trace setups can be found here: https://www.segger.com/products/debug-pr…tting-up-trace/

Quoted

And why do I need a JLinkScriptfile requested at support@segger.com?
Is this file responsible for device setup (pins and so on) and why not for free download?

Yes that file sets up device specific settings e.g. clocks and pins.
It is included in the example project as a compiled .pex file.
It is designed as generic as possible for the mentioned eval board so it simply works for the user without needing to worry about it.
The Source for the Scriptfile is not freely available to protect our IP.
However we offer the J-Link script for the Cortex-M Trace Reference Board in source form as reference so the user gets an idea on how to implement such init for custom or unlisted hardware.

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 purposes 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/


Dave

Beginner

Date of registration: Aug 19th 2016

Posts: 8

5

Friday, April 13th 2018, 12:41pm

Hello Nino,

Trace:
I try the example again on a new demoboard and it works.
The only different, in my opinion, is the chip lable.
OK: ASTAME70Q21AN 1714C A AF8BDB
FAIL: ASTAME70Q21AN 1535C A AD7FMA

Do you know if there is any changes in this chip affecting the trace?

JLinkScriptfile:

If I have a custom hardware can I still use the .pex file from the example and just add this line in the .jdebug file?

void BeforeTargetConnect (void) {
Project.SetJLinkScript("./ATMEL_ATSAME70_TraceExample.pex");
}
Because there is no possibility to use different pins and clock for trace.


I am still unable to understand what kind of IP you try to protect.
All you need to do with other trace systems is:
// Trace Clock Setup
PMC->PMC_WPMR = 0x504D4300; // Disable PMC write protection
PMC->PMC_PCK[3] = 0x4; // Select Master clock for ETM
PMC->PMC_SCER = PMC->PMC_SCER | (1<< 11); // Enable PCK3
PMC->PMC_PCER0 = PMC->PMC_PCER0 | (1 << 16); // Enable PIOD clock
// Trace Pin Setup
PIOD->PIO_WPMR = 0x50494F00; // Disable PIOD write protection
PIOD->PIO_PDR = 0x000001F0; // Disable Peripherals PD04..PD08
// Set Peripheral C for PD04..PD07 and Peripheral D for PD08
PIOD->PIO_ABCDSR[0] = PIOD->PIO_ABCDSR[0] & (~0x0F0)|0x100;
PIOD->PIO_ABCDSR[1] = PIOD->PIO_ABCDSR[1] | 0x1F0;

Regards, Dave

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 960

6

Friday, April 13th 2018, 4:29pm

Hello Dave,

Great to hear that trace is working for you on the other board.

Quoted

OK: ASTAME70Q21AN 1714C A AF8BDB
FAIL: ASTAME70Q21AN 1535C A AD7FMA


This sounds really strange. Especially as we only have the 1535C A AD7FMA in house which is how I created the screenshot in my last post.

Quoted


Do you know if there is any changes in this chip affecting the trace?

I could not find any errata explaining this behaviour. We suggest contacting Microchip in that regard.

Quoted

If I have a custom hardware can I still use the .pex file from the example and just add this line in the .jdebug file?

The same pex/JLinkScript can be used with custom hardware as well if the same GPIOs are used for tracing as on the eval board hardware the example project is created for.
Should you have timing issues or can't commit all 5 pins for full 4-bit trace you can configure this within Ozone as explained on our website "Setting up Trace".

Quoted

Because there is no possibility to use different pins and clock for trace.

Some target devices offers this option though so we try to stay as flexible as possible with our Scriptfiles.

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purposes 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/


Dave

Beginner

Date of registration: Aug 19th 2016

Posts: 8

7

Wednesday, April 18th 2018, 2:40pm

Hello Nino,

I found the problem with the second demoboard. Bad connection to the trace pins, now fine on both boards.
When I start the example it looks not good. If in line 34 never is true (please see picture).
I use the *.pex in my Ozone project. Works but I am still unable to understand why you can't offer a *.JLinkScript for this mcu.
The second problem I have is that the reset is not working fine with trace enable. When I start debug the second time I alway see a hardfault.
I also add a picture of this problem.
It would be very nice if you can help me.

Regards, Dave
Dave has attached the following images:
  • TraceDemoIf.PNG
  • TraceReset.PNG

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 960

8

Wednesday, April 18th 2018, 3:01pm

Hello Dave,

This looks strange indeed. Just retested it with the project from Wiki with ozone V2.56g and J-Link DLL V6.30k and line 34 was executed normally as seen in my previous picture.
Try updating to J-Link software V6.30k and see if the issue resolves.
As the previous issue was linked to "bad" wiring could you try setting trace to 1-bit trace?
To access this option simply open the trace project in Ozone and go to Tools->Trace Settings...
Here you can switch between different trace sources and the number of trace pins used. Default for ETM trace is Trace Source = Trace Pins and Trace Port Width = 4-bit.
Try switching this to 1-bit for the example project. Does it work now?

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purposes 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/


Dave

Beginner

Date of registration: Aug 19th 2016

Posts: 8

9

Wednesday, April 18th 2018, 4:29pm

Now it works but not clear why.
I use the demoboard also with my code. If I clear the chip with the erase pin and download your demo code it works fine.
But if I use the board with my code befor I see this problem.
Is there any setup in Ozone like clear chip complete befor debug?

Regards, Dave

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 960

10

Thursday, April 19th 2018, 9:17am

Hello Dave,

Currently there is no option implemented in Ozone to delete a chip. Ozone will automatically erase and overwrite memory on the target if it is different from the application you are trying to debug/download.
However you can use the J-Link Commander in parallel to Ozone and use the "erase" command there prior to debugging.

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purposes 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/