cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
c.mcclenaghan
Contributor
Contributor
16,639 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
c.mcclenaghan
Contributor
Contributor
27,519 Views
Registered: ‎02-24-2014

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

View solution in original post

12 Replies
linnj
Xilinx Employee
Xilinx Employee
16,635 Views
Registered: ‎09-10-2008
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
Anonymous
Not applicable
16,624 Views

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
c.mcclenaghan
Contributor
Contributor
16,616 Views
Registered: ‎02-24-2014

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
linnj
Xilinx Employee
Xilinx Employee
16,612 Views
Registered: ‎09-10-2008
GDB was the old way before TCF and I would imagine it would still work.
0 Kudos
Anonymous
Not applicable
16,588 Views

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
c.mcclenaghan
Contributor
Contributor
16,545 Views
Registered: ‎02-24-2014

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

I'll set up using GDB for now.

 

Regards

Chris

 

0 Kudos
c.mcclenaghan
Contributor
Contributor
16,524 Views
Registered: ‎02-24-2014

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?

 

@Anonymous 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
q
Observer
Observer
16,508 Views
Registered: ‎04-29-2008

@Anonymous 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
c.mcclenaghan
Contributor
Contributor
27,520 Views
Registered: ‎02-24-2014

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

View solution in original post

c.mcclenaghan
Contributor
Contributor
11,537 Views
Registered: ‎02-24-2014

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
linnj
Xilinx Employee
Xilinx Employee
11,528 Views
Registered: ‎09-10-2008

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
lcameron
Adventurer
Adventurer
11,521 Views
Registered: ‎02-14-2014

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