UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor
13,820 Views
Registered: ‎02-24-2014

Debugging Linux Applications using over JTAG

Jump to solution

Hi all

 

I need some help connecting my debugger a Zynq board over JTAG.

 

Windows 7/CentOS 7

SDK v2015.2

Petalinux v2015.2

 

 

I have created an Hello World (Linux) application and can debug it on my Zedboard over ethernet by creating a Linux TCF Agent connection with my custom IP address. (SDK debugging guide etc...)

 

However, using a Digilent USB-JTAG cable (JTAG-HS3), running the hw_server with 

 

hw_server -s tcp:127.0.0.1:1534

and creating another Linux TCF Agent connection pointing to 127.0.0.1:1534, the debugger won't start. It shows the following error: "Target does not provide Processes service"

 

Linux debugging error.png

I can't find much information on this error anywhere. This occurs on a Zedboard with custom Linux build and on a custom Zynq board (without ethernet).

 

If I don't run the hw server, I get a "connection refused" error so that's understandable. My JTAG cable allows standalone debugging so I don't suspect that side.

 

Presumably, there is something in the Petalinux kernel configuration I has missed? The TCF server is running on the board as it is listed in the process list. Is there a list of kernel settings required to support it? I believe I have things like dropbear enabled for TFTP access.

  

I need to get JTAG debugging working on our custom board so any help would be appreciated.

 

Thanks

Chris

 

PS. I've just tracked down a Xilinx Platform Cable USB II and this shows the same thing.

0 Kudos
1 Solution

Accepted Solutions
Contributor
Contributor
24,702 Views
Registered: ‎02-24-2014

Re: Debugging Linux Applications using over JTAG

Jump to solution

Hi

 

I've been investigating this in the background with the support of our Xilinx FAE and local specialists. I thought it was high time to give feedback to anyone interested.

 

Summary:

  • TCF over is JTAG is not supported and we didn't get any indication on imminent implementation

Suggestions:

  • Break out the USB i/f from the PS to a PHY board and use the kernel's USB Gadget to provide USB to Ethernet.
  • Find serial port device (since I have a PS_UART available) to provide serial to Ethernet

 

Using the serial port was not an option as any module I found simply transported the serial data instead of presenting an ethernet interface to the TCF agent.

 

I eventually settled on using an ENC28J60 SPI-Ethernet module, e.g. from Olimex or HanRun, and connected it to the PS SPI0 + GPIO INT. The driver module is included in the mainline kernel so, after some learning (!) and configuration, it appears as eth0 with a static IP address. TCF agent can then use it directly and the SDK debugger connects happily. My plan is that this sits outside the product on a plug-on board for use by developers.

 

I haven't measured the transfer speed but it is perfectly adequate for debugging. Even tftp to the target is bearable.

 

To conclude, we have a useable solution to allow the standard Xilinx tools. Unfortunately it took me a while to get to this point, but as they say, "Every day's a school day"! Hopefully the discussion here will help someone else down the line.

 

Thanks to all for their help on these forums.

Regards

Chris

12 Replies
Highlighted
Xilinx Employee
Xilinx Employee
13,818 Views
Registered: ‎09-10-2008

Re: Debugging Linux Applications using over JTAG

Jump to solution
Hi Chris,

That (JTAG for Linux Apps) is not supported (that I know of). Most people don't want to stop the kernel while debugging their application as it brings the whole system down. Is there a reason you want to do that? I realize you can do that with some debug systems like BDI.

Thanks
John
0 Kudos
Scholar stephenm
Scholar
13,807 Views
Registered: ‎05-06-2012

Re: Debugging Linux Applications using over JTAG

Jump to solution

If you just want to debug an linux application, you can use the process at the attached pdf (this used the ethernet connection to connect remotely).

Note: discard the second part of the doc as this is about the QEMU

 

0 Kudos
Contributor
Contributor
13,799 Views
Registered: ‎02-24-2014

Re: Debugging Linux Applications using over JTAG

Jump to solution

John, Stephen

 

Thanks for the responses.

Unfortunately I don't have an ethernet port on our custom board. I have used that successfully with TCF on a ZedBoard. I only have the JTAG and a PS UART for a shell and other debugging output.

 

I'll read through your attachment in more detail tomorrow. I see I can use QEMU to debug 'virtually' but I will also need to debug on the target to allow interaction with the hardware system. I can also see posts on debugging the kernel but I'm interested in application debugging. I'm a little surprised that this is not supported. I didn't think this was so unusual :D.

 

Am I right in thinking that GDB (instead of TCF) would also not be supported?

 

Perhaps I can write a daemon to use the PS UART in place of the ethernet interface. :(

 

Regards

Chris

 

 

0 Kudos
Xilinx Employee
Xilinx Employee
13,795 Views
Registered: ‎09-10-2008

Re: Debugging Linux Applications using over JTAG

Jump to solution
GDB was the old way before TCF and I would imagine it would still work.
0 Kudos
Scholar stephenm
Scholar
13,771 Views
Registered: ‎05-06-2012

Re: Debugging Linux Applications using over JTAG

Jump to solution

he GDB is still there. still delivered with the SDK. It is just not documented as we are promoting the system debugger (which used the TCF). 

 

Your use case (debugging Linux app via JTAG) is planned to be support in the coming releases

0 Kudos
Contributor
Contributor
13,728 Views
Registered: ‎02-24-2014

Re: Debugging Linux Applications using over JTAG

Jump to solution

Thanks for the clarification. That's good to know.

I'll set up using GDB for now.

 

Regards

Chris

 

0 Kudos
Contributor
Contributor
13,707 Views
Registered: ‎02-24-2014

Re: Debugging Linux Applications using over JTAG

Jump to solution

Ok. I'm back, scratching my virtual head.

 

Here's where I've got to.

Zedboard:

Run gdbserver using ttyPS0 after tftp transfer of executable (over ethernet!)

> gdbserver /dev/ttyPS0 /tmp/LinuxTest.elf

 

Windows host:

From the SDK shell, run gdb connecting through COM8

> arm-xilinx-linux-gnueabi-gdb.exe

> target remote COM8

 

This allows debug using command line gdb, at least it did yesterday - I have read you need to have a Linux host to connect to a remote Linux gdbserver.

(Ref. http://www.uclinux.org/pub/uClinux/ports/blackfin/docs/pdf-docs/gdb.pdf , http://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_130.html and http://svenand.blogdrive.com/archive/138.html)

 

I can't see how to to integrate this into the Eclipse SDK.

I'm assuming I need to debug as a Remote ARM Linux Application or C++ Remote Application with the correct debugger settings. In either case, the connection type doesn't allow me to specify a serial port. Is this the right approach?

 

@stephenm To clarify your comment "Your use case (debugging Linux app via JTAG) is planned to be support in the coming releases", do you know for which release this is planned?

 

Am I going to have to buy a JTAG background debugger to achieve what I want (SDK-integratged Linux application debug over JTAG). Can anyone recommend one? BDI3000? J-Link?

 

Thanks again

Chris

 

 

0 Kudos
Observer q
Observer
13,691 Views
Registered: ‎04-29-2008

Re: Debugging Linux Applications using over JTAG

Jump to solution

@stephenm Back in the early days of Microblaze we used to be able to instruct GDB to use a serial port for the debugging session rather than using JTAG.  I think that's what @linnj is referring to as well.  The problem is that the settings for this connection type seem to no longer be in the SDK GUI, and this is apparently confirmed by @c.mcclenaghan 's findings.  I have just tried it to on my machine and I can't find it either.

 

@c.mcclenaghan , your observation about using a com/tty port in the gdbserver settings seems to be valid.  That's how we used to debug targets back in the old days.  The limitation seems to be in the SDK GUI.

 

 

0 Kudos
Contributor
Contributor
24,703 Views
Registered: ‎02-24-2014

Re: Debugging Linux Applications using over JTAG

Jump to solution

Hi

 

I've been investigating this in the background with the support of our Xilinx FAE and local specialists. I thought it was high time to give feedback to anyone interested.

 

Summary:

  • TCF over is JTAG is not supported and we didn't get any indication on imminent implementation

Suggestions:

  • Break out the USB i/f from the PS to a PHY board and use the kernel's USB Gadget to provide USB to Ethernet.
  • Find serial port device (since I have a PS_UART available) to provide serial to Ethernet

 

Using the serial port was not an option as any module I found simply transported the serial data instead of presenting an ethernet interface to the TCF agent.

 

I eventually settled on using an ENC28J60 SPI-Ethernet module, e.g. from Olimex or HanRun, and connected it to the PS SPI0 + GPIO INT. The driver module is included in the mainline kernel so, after some learning (!) and configuration, it appears as eth0 with a static IP address. TCF agent can then use it directly and the SDK debugger connects happily. My plan is that this sits outside the product on a plug-on board for use by developers.

 

I haven't measured the transfer speed but it is perfectly adequate for debugging. Even tftp to the target is bearable.

 

To conclude, we have a useable solution to allow the standard Xilinx tools. Unfortunately it took me a while to get to this point, but as they say, "Every day's a school day"! Hopefully the discussion here will help someone else down the line.

 

Thanks to all for their help on these forums.

Regards

Chris

Contributor
Contributor
8,720 Views
Registered: ‎02-24-2014

Re: Debugging Linux Applications using over JTAG

Jump to solution

Hi all

 

I've been researching this problem in the background with our FAE and local Xilinx specialists. I thought it was high time to provide some feedback to the group.

 

Summary:

  • TCF debugging is not supported over JTAG and I couldn't get any indication of imminent support.

 

Suggestions from Xilinx support channels:

 

  1. Break out the PS USB interface to an external PHY board. Use the USB gadget drivers in kernel to provide a USB-Ethernet interface.
  2. Use the available PS_UART and source a serial to Ethernet module to provide an ethernet interface.

 

 

The USB pins were not available in our design so (1) was not an option. Any module I found for (2) simply transported serial data over Ethernet instead of presenting an Ethernet interface.

 

I eventually settled with an ENC28J60 SPI-Ethernet module, e.g. from Olimex or Hanrun, and connected it to the PS using SPI + GPIO INT. The ENC28J60 driver is provided with the kernel so after some configuration and learning (!), the module provides eth0 with a static IP address. From here on, the TCF debugging from the SDK GUI works happily. My plan is that this external module will plug on to our production board when required for development activities.

 

I've tested both the products linked above and they work well. I haven't measured the speed available but it is more than adequate for debugging. Even tftp to the target is useable.

 

So to conclude, I now have a working debugger solution even if I had to take the long way round. Every day's a school day! Hopefully this may be of use to someone in the future.

 

Thanks again to all who helped

Regards

Chris

 

0 Kudos
Xilinx Employee
Xilinx Employee
8,711 Views
Registered: ‎09-10-2008

Re: Debugging Linux Applications using over JTAG

Jump to solution

Hi Chris,

 

Great solution (with some work)!  Thanks for providing the details as that may be helpful for others and I learned a bit too.

 

The key was finding a chip that was well supported in Linux. Ethernet over SPI, didn't know there was such a thing.

 

Thanks

John

0 Kudos
Adventurer
Adventurer
8,704 Views
Registered: ‎02-14-2014

Re: Debugging Linux Applications using over JTAG

Jump to solution

Thank you Chris for posting your experience, I like the idea of SPI-Ethernet on a separate board.   We have a separate "diagnostics board" with ethernet for debugging only like you suggest (and console, JTAG and a few others) but with the actual ethernet signals going between the boards.   It's been very valuable for debugging on the desktop, and means our actual core embedded board is still nice and small.

 

As for (2), networking over a serial console used to be fairly common (showing my age here...) with "slirp". It's not strictly ethernet; it's TCP/IP which would work for gdbserver or TCF, but implemented by squeezing PPP into a serial line terminal session.

 

0 Kudos