cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
20,260 Views
Registered: ‎10-24-2014

JTAG-UART on Zynq Howto

Jump to solution

Can anyone write a short howto guide for JTAG-UART on Zynq SoC?

 

I have a ZC702 and the USB-UART works fine. However, in preperation for a custom Zynq board I want to use the JTAG-UART like with MDM core for MicroBlaze designs.

 

What I tried so far is:

- Created a new ZC702 project in Vivado

- Instantiate a MDM in the PL part with JTAG-UART enabled

- Connected the MDM to PS via AXI

- Synth./ Impl. / Bitgen and Export to SDK

- New SDK Project with Xilinx "Hello World" example

- SDK BSP standalone settings for stdin/stdout changed to mdm_0

- Created a new GDB debug session with STDIO set to JTAG UART

- Programm FPGA

- Start GDB session via Debug As -> Launch on Hardware

 

The console says:

Error opening JTAG UART @ localhost:-1

 

The SDK log says:

13:09:57 ERROR    : Unexpected error while opening JTAG UART:  
java.lang.RuntimeException: Error while opening JTAG UART server: MDM Uart NOT Present in the System
Could not detect MDM peripheral on hardware. Please check:
    1. If FPGA is configured correctly
    2. MDM Core is instantiated in the design
    3. If the correct FPGA is referred, in case of multiple FPGAs
    4. If the correct MDM is referred, in case of a multiple MDM system
     
 
    at com.xilinx.sdk.targetmanager.internal.TM.startJTAGUARTServer(TM.java:931)
    at com.xilinx.sdk.debug.core.internal.comm.JTAGUARTStreamsProxy.<init>(JTAGUARTStreamsProxy.java:32)

 

Am I on the right track here?

0 Kudos
1 Solution

Accepted Solutions
Highlighted
29,749 Views
Registered: ‎10-24-2014

Re: JTAG-UART on Zynq Howto

Jump to solution

Thanks trenz-al.
 
So it is possible to implement JTAG-UART feature on Zynq without PL by using the ARM Debug Communications Channel (DCC).
 
I managed to get JTAG-UART via DCC running using the following procedure (Tool Version 2014.4):
- Create a new SDK project with Xilinx "Hello World" example and ZC702 as HW specification
- Change SDK BSP standalone settings for stdin/stdout to "none" (DCC won't work with stdin/stdout and print/xil_printf etc.)
- Replace the xil_printf() call in the example with my own dcc_printf()
- Start GDB session via Debug As -> Launch on Hardware
- Open TAG UART server/terminal by executing "jtag_terminal dcc" in the SDK XMD Console
 
Xilinx uboot has a DCC driver at https://github.com/Xilinx/u-boot-xlnx/blob/master/drivers/serial/arm_dcc.c
With a little bit of rewriting, one can make it work on Standalone BSP. 

 

 



 
For those interested in the JTAG-UART via MicroBlaze Debug Module (MDM) solution I managed to get STDOUT running with a slight modification to the procedure first described:
- Create a new ZC702 project in Vivado
- Instantiate a MDM in the PL part with JTAG-UART enabled
- Connected the MDM to PS via AXI
- Synth./ Impl. / Bitgen and Export to SDK
- New SDK Project with Xilinx "Hello World" example
- SDK BSP standalone settings for stdin/stdout changed to mdm_0
- Programm FPGA
- Open JTAG UART server/terminal by executing "jtag_terminal" in the SDK XMD Console
- Start GDB session via Debug As -> Launch on Hardware
 
So instead of trying to use the SDK console as a terminal I needed to open the jtag_terminal to connect to the MDM. Please note that this won't work if the GDB session is already started.
 
I failed to get STDIN working though. When I try to send characters back to Zynq the XMD Console says:
errorInfo is ERROR: Unknown Error Occured
    Target '256' Does NOT exist in the Current System
 
 
    while executing
"error $retval"
    (procedure "terminal_sock_reader" line 19)
    invoked from within
"terminal_sock_reader 256 sock968"
error msg is ERROR: Unknown Error Occured
    Target '256' Does NOT exist in the Current System
 
This problem was reported earlier here:
http://forums.xilinx.com/t5/Embedded-Processor-System-Design/Error-With-STDIN-when-using-JTAG-UART-on-Zynq/m-p/416759

 

Regards,

 

Ole

View solution in original post

6 Replies
Highlighted
Scholar
Scholar
20,242 Views
Registered: ‎11-09-2013

Re: JTAG-UART on Zynq Howto

Jump to solution

zynq has built in JTAG console, kind of

 

DCC

 

it can be used in SDK, it is used by flash programming too, the files that SDK uses for flashing are uboot.elf files configured to work over jtag console, that is DCC channel

 

unfortunatly DCC console can not be selected as console in sdk bsp gen

 

but the possibility is there

0 Kudos
Highlighted
29,750 Views
Registered: ‎10-24-2014

Re: JTAG-UART on Zynq Howto

Jump to solution

Thanks trenz-al.
 
So it is possible to implement JTAG-UART feature on Zynq without PL by using the ARM Debug Communications Channel (DCC).
 
I managed to get JTAG-UART via DCC running using the following procedure (Tool Version 2014.4):
- Create a new SDK project with Xilinx "Hello World" example and ZC702 as HW specification
- Change SDK BSP standalone settings for stdin/stdout to "none" (DCC won't work with stdin/stdout and print/xil_printf etc.)
- Replace the xil_printf() call in the example with my own dcc_printf()
- Start GDB session via Debug As -> Launch on Hardware
- Open TAG UART server/terminal by executing "jtag_terminal dcc" in the SDK XMD Console
 
Xilinx uboot has a DCC driver at https://github.com/Xilinx/u-boot-xlnx/blob/master/drivers/serial/arm_dcc.c
With a little bit of rewriting, one can make it work on Standalone BSP. 

 

 



 
For those interested in the JTAG-UART via MicroBlaze Debug Module (MDM) solution I managed to get STDOUT running with a slight modification to the procedure first described:
- Create a new ZC702 project in Vivado
- Instantiate a MDM in the PL part with JTAG-UART enabled
- Connected the MDM to PS via AXI
- Synth./ Impl. / Bitgen and Export to SDK
- New SDK Project with Xilinx "Hello World" example
- SDK BSP standalone settings for stdin/stdout changed to mdm_0
- Programm FPGA
- Open JTAG UART server/terminal by executing "jtag_terminal" in the SDK XMD Console
- Start GDB session via Debug As -> Launch on Hardware
 
So instead of trying to use the SDK console as a terminal I needed to open the jtag_terminal to connect to the MDM. Please note that this won't work if the GDB session is already started.
 
I failed to get STDIN working though. When I try to send characters back to Zynq the XMD Console says:
errorInfo is ERROR: Unknown Error Occured
    Target '256' Does NOT exist in the Current System
 
 
    while executing
"error $retval"
    (procedure "terminal_sock_reader" line 19)
    invoked from within
"terminal_sock_reader 256 sock968"
error msg is ERROR: Unknown Error Occured
    Target '256' Does NOT exist in the Current System
 
This problem was reported earlier here:
http://forums.xilinx.com/t5/Embedded-Processor-System-Design/Error-With-STDIN-when-using-JTAG-UART-on-Zynq/m-p/416759

 

Regards,

 

Ole

View solution in original post

Highlighted
Participant
Participant
19,175 Views
Registered: ‎04-13-2015

Re: JTAG-UART on Zynq Howto

Jump to solution

Hello,

 

I'm trying to get the USB-JTAG connectiion working and am having a terrible time.

I can see the two USB Serial Converter (A & B) devices under USB controllers but NO COM ports.

When I follow the 5-min video for the SDK and it comes to connect to the ZYNQ board I have no port to connect to.

I tried using the USB UART connection and it does help and I get an error

"Unable to connect to ps7_cortexa9"

"Unknown Error Occured"

"Cable is not powered-on"

 

Is there something fundemental I'm missing?

 

I tried re-installing the Digilent drivers as mentioned elsewhere.

I've installed 2014.4 SDK and updated Vivado to 2014.4

 

OS: Windows 7 Enterprise 64bit

Intel Core i7

16 GB

 

Thanks,

Gary

 

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
19,171 Views
Registered: ‎02-14-2014

Re: JTAG-UART on Zynq Howto

Jump to solution
Hello Gary,

It is recommended to start a new thread for fresh query. Check if below threads are helpful in your case.
http://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/Cable-is-not-powered-on-SDK-2014-4/td-p/563049
http://forums.xilinx.com/t5/Embedded-Development-Tools/Need-Help-Unable-to-connect-to-ps7-cortexa9/td-p/485708
Regards,
Ashish
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Highlighted
Visitor
Visitor
15,819 Views
Registered: ‎08-02-2016

Re: JTAG-UART on Zynq Howto

Jump to solution

Hello. I'm trying launch dcc with jtag according to this instructions:

"- Create a new SDK project with Xilinx "Hello World" example and ZC702 as HW specification
- Change SDK BSP standalone settings for stdin/stdout to "none" (DCC won't work with stdin/stdout and print/xil_printf etc.)
- Replace the xil_printf() call in the example with my own dcc_printf()
- Start GDB session via Debug As -> Launch on Hardware
- Open TAG UART server/terminal by executing "jtag_terminal dcc" in the SDK XMD Console"

But i don't understand what i need to modify in project and in board support package for use dcc_printf()

Can anybody explain it more detail for me? Thanks

0 Kudos
Visitor
Visitor
454 Views
Registered: ‎01-24-2020

Re: JTAG-UART on Zynq Howto

Jump to solution

I think they created a "dcc_print" function and did not provide the implementation in the post.

 

0 Kudos