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: 
Observer fdpousa
Observer
1,688 Views
Registered: ‎11-08-2017

JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

Hi all,

 

I have a zynq connected to a remote machine which is running hardware server. I can program the target and debug it from my local machine using SDK 2017.4. However, I want to print the output traces generated with xil_printf through coresight in my local machine. Is this possible?

 

Now I can only manage to configure STDIO connection to JTAG UART when target is connected to local machine. If target is in remote I get this error on my console:

 

Error opening JTAG UART @ localhost:-1

 

Regards

1 Solution

Accepted Solutions
Moderator
Moderator
1,615 Views
Registered: ‎09-12-2007

Re: JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

So, the steps are:

 

Machine connected physically to your board (lets call you local)

Launch hw_server

 

Machine running SDK (lets call you remote machine):

Set Target connections (Drop down the Hardware Server, and select new (highlighted))

target_connections.PNG

Setup, using the information in the hw_server:

new_connection.PNG

 

 

Update your BSP to have the STDIN/OUT set to ps7_coresight

The Debug as -debug configurations, and set the Connection to the one your setup above, and Debug

This will launch the debug perspective, and the debugger should be stopped at main()

Launch the jtagterminal

To do this, open the XSCT and use the commands below:

connect -url TCP:<ip address>:<port>

for example connect -url TCP:XIRSTEPHENM32:3121

targets -set -nocase -filter {name =~ "ARM*#0"}

jtagterminal

Then debug as nornal in the debug perspective, the stdin/out should be displayed on the jtagterminal.

 

References (page 110);

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_1/ug1208-xsct-reference-guide.pdf

13 Replies
Moderator
Moderator
1,642 Views
Registered: ‎10-06-2016

Re: JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

Hi @fdpousa,

 

Yes you can use the JTAG UART for a remote target as well, you just need to connect first to the remote server to launch the jtag terminal.

 

How are you launching the JTAG UART? Can you share your steps?

 

Regards

Ibai


Ibai
Don’t forget to reply, kudo, and accept as solution.
Observer fdpousa
Observer
1,631 Views
Registered: ‎11-08-2017

Re: JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

Hi @ibaie,

 

When you say remote server this means HW server or I have to run the XSDB? Now I only launch HW server, then I execute xsdb tool and launch the jtag terminal. Have I to launch xsdb listening from incoming connections from SDK in my local machine?

 

Then in SDK local machine, I configure the stdin/stdout flow in ps7_coresight and in Debug Configurations I set STDIO Connection with JTAG UART.

 

Am I forgetting about something? Is there a guide to perform this steps?

 

Regards,

0 Kudos
Moderator
Moderator
1,616 Views
Registered: ‎09-12-2007

Re: JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

So, the steps are:

 

Machine connected physically to your board (lets call you local)

Launch hw_server

 

Machine running SDK (lets call you remote machine):

Set Target connections (Drop down the Hardware Server, and select new (highlighted))

target_connections.PNG

Setup, using the information in the hw_server:

new_connection.PNG

 

 

Update your BSP to have the STDIN/OUT set to ps7_coresight

The Debug as -debug configurations, and set the Connection to the one your setup above, and Debug

This will launch the debug perspective, and the debugger should be stopped at main()

Launch the jtagterminal

To do this, open the XSCT and use the commands below:

connect -url TCP:<ip address>:<port>

for example connect -url TCP:XIRSTEPHENM32:3121

targets -set -nocase -filter {name =~ "ARM*#0"}

jtagterminal

Then debug as nornal in the debug perspective, the stdin/out should be displayed on the jtagterminal.

 

References (page 110);

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_1/ug1208-xsct-reference-guide.pdf

Highlighted
Observer fdpousa
Observer
1,602 Views
Registered: ‎11-08-2017

Re: JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

Ok, finally I did it.

 

However, it should be debugged with TCF (System) instead of GDB. However with TCF, breakpoints are skipped and marked as unresolved. Is that related in working with remote machines? One is running in Windows (target connected) wheread the other where SDK is running has Ubuntu.

 

Regards,

0 Kudos
Scholar ronnywebers
Scholar
1,375 Views
Registered: ‎10-10-2014

Re: JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

is remote debugging from SDK described in some Xilinx UG / video? 

 

I'd like to :

- develop a Zynq application in SDK (running on a VM with Ubuntu)

- download it from SDK to my Zynq board (which is running Ubuntu)  over a network connection

- launch & debug this using the SDK GUI, put breakpoints, ...

 

->I'm a bit confused :  to be able to do this, do I need to run a TCF agent on the Zynq board? Or a GDB server? Should I enable one of these somewhere in Petalinux?

 

Then I'd also like to see the serial port output (PS uart1) in SDK, tunneled over the network connection -> what is the 'JTAG uart'? Do I need to add this to my block design? 

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
Xilinx Employee
Xilinx Employee
1,361 Views
Registered: ‎10-21-2010

Re: JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

Hi @ronnywebers,

Linux app debug using TCF is described here. You can enable TCF agent in Petalinux config. SDK no longer supports Linux app debug using GDB.

 

https://www.xilinx.com/html_docs/xilinx2018_2/SDK_Doc/SDK_tasks/sdk_t_linux_application_debugging_system_debugger.html?hl=linux%2Capp

 

For STDOUT for Linux apps, you can use pseudo terminal supported by Linux OS. You can enable this in the Application tab of the debug config in SDK.

 

Jtag uart is  a virtual uart emulated over Jtag. This is only applicable to debug over Jtag. For standalone app debug, you should change stdio properties in BSP settings to use Jtag uart. This doesn't require any special IP; debugger uses data transfer registers in ARM debug interface to emulate Jtag uart

 

Scholar ronnywebers
Scholar
1,344 Views
Registered: ‎10-10-2014

Re: JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

thanks @sadanan for the clarification! Regarding JTAG UART :

 

Q1 : so JTAG UART avoids the need for a separate UART connection (i.e. an FTDI chip connected to Zynq UART1, as on my board), and it 'tunnels' a virtual uart over the JTAG debug interface (i.e. my Digilent HS-2 cable). So it's not re-routing UART0 or UART1 of the Zynq for example.

 

Q2 : Can you give some further guidence on the practical setup to get JTAG UART working, I couldn't find any instructions in a user guide (?), i.e. I checked UG908 and searched for UART but no luck.

 

I created an SDK template 'Helloworld' application on my Zynq board. I use a Digilent HS2 debug cable to download and debug the code. With the default stdio settings, I get the 'hello' message over UART1 in the SDK terminal window. (UART1 is connected to an FTDI chip on my board, which appears as COM port in the SDK terminal window).

 

Now I want to use the virtual JTAG UART in SDK, so I can get rid of the FTDI USB cable, and only use Digilent HS-2 to debug and to see my printf (or xil_printf) messages throug the same USB cable used for the Digilent HS-2, but I'm unsure how to do it. 

 

What exactly do I need to set in the BSP for stdout and stdin? 

 

stdout.png

 

And after that, what do I select in the SDK terminal tab? Should there be a 'JTAG Uart' listed in the drop-down box? Does it need some baud-rate settings?

 

serial port.png

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
Xilinx Employee
Xilinx Employee
1,340 Views
Registered: ‎10-21-2010

Re: JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

Hi @ronnywebers,

 

1. Yes, this is true

2. In BSP settings, set stdio/stdout to ps7_coresight_comp_0. This makes the BSP use data transfer regs in ARM debug interface for STDIO. When you launch debug, you should see a new console for Jtag UART, for each core. This will be in the console view, and not in SDK terminal view

Scholar ronnywebers
Scholar
1,333 Views
Registered: ‎10-10-2014

Re: JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

thanks @sadanan, I got it working with your suggestions, but there was one pitfall, so I'll describe the steps here in detail for other users :

 

note that this is using a local connection, as opposed to the OP's question about a remote target.

 

1) double click .mss, change stdin and stdout to 'ps7_coresight_comp_p'. This will redirect the printf output to the 'dcc driver' :

 

dcc.png

2) launch debug, and switch to the Console. This now shows the virtual TCF terminal. However, I still had not 'hello world message'.... but if you look close you'll see that SDK selected by default the terminal of cpu '1' (which is suspended / not used ...)

 

wrong tcf selected.png

solution : change this to core 0 -> 'hello world' will now appear in the virtual console

 

select virtual terminal.png

 

 

 

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
Scholar ronnywebers
Scholar
1,019 Views
Registered: ‎10-10-2014

Re: JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

@sadanan, a question that now immediately rises is :

 

While redirecting stdio to the virtual terminal, can I still use printf to print on other UARTs, like the PS UART0, PS UART1, or even AXI Uart Lite?

 

I skimmed the web, and found some post that explains that an option is to use 'fprintf', and tell it which io to use (guess this will work on linux) - but I don't now if this is true for the Xilinx SDK stdio library, and if yes, how to tell fprintf which UART to use (how is it referenced in the call to fprintf(...)

 

 

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
Xilinx Employee
Xilinx Employee
1,014 Views
Registered: ‎10-21-2010

Re: JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

Yes, you're right about cpu1 console being selected by default. This is a problem with eclipse; the last console is opened by default. You need to manually select the console you're interested in

0 Kudos
Xilinx Employee
Xilinx Employee
1,013 Views
Registered: ‎10-21-2010

Re: JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

Sorry, I'm not sure if there is a way to use other UARTs simultaneously. Certainly, printf or print would use the UART device selected in the BSP settings

0 Kudos
Observer fdpousa
Observer
950 Views
Registered: ‎11-08-2017

Re: JTAG Uart STDIO connection from remote target in local SDK

Jump to solution

Hi @ronnywebers, I performed the same steps as you and regarding using the PS UARTs, you can still using them but not through a printf functions.

You can create yourself some functions invoking the related PS registers to perform the UART communication or some functionalities to control an AXI UART peripheral on PL. That was my approach.

0 Kudos