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

You are not logged in.

  • Login
  • Register

Dave

Beginner

Date of registration: Aug 19th 2016

Posts: 11

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: 1,048

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


Dave

Beginner

Date of registration: Aug 19th 2016

Posts: 11

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: 1,048

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


Dave

Beginner

Date of registration: Aug 19th 2016

Posts: 11

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: 1,048

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


Dave

Beginner

Date of registration: Aug 19th 2016

Posts: 11

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: 1,048

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


Dave

Beginner

Date of registration: Aug 19th 2016

Posts: 11

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: 1,048

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


Dave

Beginner

Date of registration: Aug 19th 2016

Posts: 11

11

Thursday, May 3rd 2018, 1:49pm

Hello Nino,

sorry for delay, but finaly I was able to create just a small project with trace problems on SAMe70q21.
Please try to trace this with j-Trace pro Firmware 2018 Apr 20 and Ozone V2.56i and same70-xpld board.
The project will maybe stop at a breakpoint. This is just to show a other M7 bug.
If you than just try to continue, stop and use single step the mcu show very strange behavior.
I try to reproduce this with two differnet PC and two demoboards and two j-Trace so I hope you can also see this problem with your setup.
If not, I can also do a video for you.

Regards, Dave
Dave has attached the following file:
  • BugDemo.zip (997.85 kB - 27 times downloaded - Last download: May 20th 2018, 10:41am)

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

12

Tuesday, May 8th 2018, 9:52am

Hello Dave,

The project you provided does not contain an elf file for debugging.
Rebuilding did not work as Atmel Studio kept rewriting some files once launched.
One thing we noticed is that your Ozone project does not include the pex file for the Trace init. This is required for Trace to be initialized and working.

Does it working when using the latest J-Link software and Ozone version?

Best regards,
Nino
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/


Dave

Beginner

Date of registration: Aug 19th 2016

Posts: 11

13

Wednesday, May 9th 2018, 3:49pm

Hello Nino,

yes, you're right the pex file is missing. Perhaps it works because I run a other project with the pex-file befor. Be that as it may, I add it to the jdebug file.
I remove the *.elf file because of the 1.05MB data limit. But I send the same zip file to microchip and they can build it so maybe there is a pack missing in you atmel studio.
Please try again with the attachments.

Regards, David
Dave has attached the following file:
  • BugDemo.zip (574.17 kB - 23 times downloaded - Last download: May 20th 2018, 10:42am)

This post has been edited 1 times, last edit by "Dave" (May 9th 2018, 3:55pm)


SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

14

Monday, May 14th 2018, 1:56pm

Hello Dave,

We are not quite sure what we should see with the example project?
Tracing is working as expected and the example application runs to the "Dummy_Handler" and keeps counting the execution counter up.

Please understand that we can't put more time into this as the trace example application from our Wiki is working normally.
So from J-Trace perspective everything is working correctly.
Any issues you see with target hardware specific code we suggest discussing with the target hardware manufacturer.

Best regards,
Nino
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/


Dave

Beginner

Date of registration: Aug 19th 2016

Posts: 11

15

Today, 4:14pm

Hello Nino,

sorry for the insufficient problem description, but I still don't think that trace is working as expected.
For example the Dummy_Handler is located at 0x0040019C (see Program counter picture). But trace data stops with a BLS at 0x00401286.
So you see the core execution the dummy_handler, but can you also see this in the trace data?
Or the HAL_timeUsGet call from the TC1_Handler, just try to trace this execution.
For me it looks like trace hide some core executions.

Regards, Dave
Dave has attached the following images:
  • traceData.PNG
  • missingTimeUsGet.PNG

This post has been edited 5 times, last edit by "Dave" (Today, 4:44pm)