USB JTAG Access

520 views
Skip to first unread message

osh...@me.com

unread,
Apr 1, 2017, 8:12:12 PM4/1/17
to snickerdoodle forum

I have been investigating JTAG programming on my newly arrived Snickerdoodle and I was wondering if JTAG via the microusb connector is currently working and supported? Is there any documentation on this?

Cousins

unread,
Apr 10, 2017, 3:50:44 PM4/10/17
to snickerdoodle forum, osh...@me.com
Hello, sorry for the delay... We don't currently support JTAG over USB but do have plans to incorporate it in the future.

-Ryan

osh...@me.com

unread,
Apr 10, 2017, 4:01:49 PM4/10/17
to snickerdoodle forum, osh...@me.com

Are we talking weeks or months?

 

Not having USB JTAG access means I have to purchase an expensive JTAG adapter, completely removing any benefit there was of buying a Snickerdoodle

 

I just wanted a cheap, fully-baked Zynq dev board to play around with at weekends.

 

What can I do with my Snickerdoodle other than run Ubuntu from the SD card at the moment? I can’t program the board using XSDK without JTAG.

 

The app you feature prominently on your Crowdsupply page and in lots of your documentation does not seem to exist either.

Nick Burkitt

unread,
Apr 10, 2017, 4:15:56 PM4/10/17
to snickerdoodle forum, osh...@me.com
You don't need a JTAG at all to program the FPGA. You just need to be able to copy the bitstream file to the SD card.

-Nick

osh...@me.com

unread,
Apr 10, 2017, 4:17:12 PM4/10/17
to snickerdoodle forum, osh...@me.com
Can you point me to where this is documented?

Nick Burkitt

unread,
Apr 10, 2017, 4:52:31 PM4/10/17
to snickerdoodle forum, osh...@me.com
I did a quick search of the forum for "config.txt." Here's a link that contains a description of what goes where.
Basically, part of the Linux boot process is to load the FPGA bitstream from a location defined in a configuration file (config.txt).
It's also supposedly possible to reload the bitstream at any time by writing to a special device file, but I haven't played with that feature.
Also, get the Snickerdoodle Book.

-Nick

Rob Barris

unread,
Apr 10, 2017, 5:03:37 PM4/10/17
to snickerdoodle forum, osh...@me.com

I use these: http://store.digilentinc.com/jtag-hs3-programming-cable/

It plugs directly into the breakyBreaky's JTAG connector.  If you want to jumper it directly to the snickerdoodle via the J2 connector, it takes a handful of wire connections.  I have done both.

On Monday, April 10, 2017 at 1:01:49 PM UTC-7, osh...@me.com wrote:

osh...@me.com

unread,
Apr 10, 2017, 5:12:36 PM4/10/17
to snickerdoodle forum, osh...@me.com
I don't understand why you searched for config.txt. Please can you explain where this leap came from?

I tried searching for config.txt or anything related in the Snickerdoodle book and I still could not find anything related to it unless I'm missing something obvious.

Where does config.txt go? Where is it specified?

How do I avoid booting into Linux? I just want bare metal access for the most part.

Are there clear instructions on how to get started with this anywhere? I think I am very lost :(

Rob Barris

unread,
Apr 10, 2017, 5:30:10 PM4/10/17
to snickerdoodle forum, osh...@me.com
Short version now, will try to write more later:

If you have the JTAG adapter rigged up, you can directly control the Zynq from Vivado IDE, and you can download and run a combination of a PL design (HDL code living in the FPGA side) and CPU code (running "bare metal" on the ARM CPU side).  There are a fair number of boilerplate steps you have to go through to get the Vivado project set up from scratch.

Do you already have the Vivado and Xilinx SDK installed?  The former is used for PL/FPGA end of things, the latter is for writing the CPU side software.  (You can actually cook up a PL-only design and send it down to the hardware without any CPU involvement, a trivial example would be a blinking LED based off of a counter dividing down the system clock).

osh...@me.com

unread,
Apr 10, 2017, 5:36:04 PM4/10/17
to snickerdoodle forum, osh...@me.com
Hi Bob,

I have an example project in XSDK ready to go. It is based on this example using the board files I found on GitHub.

What I am after is just a clear set of instructions on how to get up and running after I compile the PL and PS. The fast AXI interface between the processor and logic is what I want to start exploiting really.

Thanks for your reply :)

Nick Burkitt

unread,
Apr 10, 2017, 6:10:28 PM4/10/17
to snickerdoodle forum, osh...@me.com
I appreciate your confusion. There are a lot of moving parts, figuratively speaking, and documentation is spotty. 
config.txt goes in the root of the BOOT partition. It's the "configuration file" mentioned in the forum link.
The contents of config.txt consist of a single line of text, which is the path to the directory (which must also be in the BOOT partition) containing the system.bit file, and the devictree.dtb file, to load at boot time.
What's your comfort level with embedded Linux?

-Nick

On Monday, April 10, 2017 at 2:12:36 PM UTC-7, osh...@me.com wrote:

osh...@me.com

unread,
Apr 10, 2017, 6:15:13 PM4/10/17
to snickerdoodle forum, osh...@me.com
Thanks Nick :)

I would say that I know enough to be dangerous but not enough to do most things without an example or some hints.

I'll see if I can get something working later this week and report back.

Thanks for your help!

Bush

unread,
Apr 10, 2017, 6:34:01 PM4/10/17
to snickerdoodle forum, osh...@me.com
If you use the latest boot scripts, you don't need the separate config.txt file to specify the bitstream file (or any other boot component). You can specify the name and location of the boot components within the BOOT partition directly in uEnv.txt. The latest boot script will attempt to load the bitstream specified directly in uEnv.txt. This is the default configuration in uEnv.txt:

bootargs=console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootwait earlyprintk
bitstream_image=system.bit
script_address=0x80000
script_name=boot.script.img
load_script=source ${script_address}
boot_script=load mmc 0:1 ${script_address} ${script_name} && source ${script_address}
uenvcmd=run boot_script


Your BOOT partition will look like this:

boot.bin
boot.script.img
uEnv.txt
devicetree.dtb
system.bit
uImage


You can still keep you bitstreams/devicetrees in sub-directories in your BOOT partition and declare the location in uEnv.txt with a configuration like this:

boot.bin
config
`-- gpio
    `-- system.bit
    `-- devicetree.dtb
`-- custom
    `-- system.bit
    `-- devicetree.dtb
boot.script.img
uEnv.txt
uImage


And declare the location in uEnv.txt:

bootargs=console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootwait earlyprintk
bitstream_image=config/custom/system.bit
devicetree_image=config/custom/devicetree.dtb

script_address=0x80000
script_name=boot.script.img
load_script=source ${script_address}
boot_script=load mmc 0:1 ${script_address} ${script_name} && source ${script_address}
uenvcmd=run boot_script


This is using the latest boot configuration found on the SD card images http://krtkl.com/downloads

Derek Mulcahy

unread,
Apr 12, 2017, 5:18:44 PM4/12/17
to snickerdoodle forum, osh...@me.com
I might have a solution for your expensive JTAG cable woes.

If you are feeling adventurous then you could cobble together a JTAG interface which will work with Vivado, XSDK etc for very little outlay. The magic is in something called XilinxVirtualCable. Here is a brain dump of the documentation that I found.


Xilinx Virtual Cable uses the Xilinx hw_server to connect to an application running on anything that can toggle GPIO pins and thus talk JTAG.

I am currently extracting the code from openocd which uses the native raspberry pi BCM2835GPIO JTAG implementation and gluing it into the server from the first link. This will give me a networked JTAG "cable" which will integrate with Xilinx and talk to the Snickerdoodle. I have used the raspberry PI for JTAG before and it was both fast and reliable!

A nice alternative would be to use an ESP8266. Basically, you need anything with a network interface and 4 x 3.3V GPIO pins.

Derek

Derek Mulcahy

unread,
Apr 18, 2017, 3:29:44 PM4/18/17
to snickerdoodle forum, osh...@me.com
Success! I have used a Raspberry Pi to connect from Vivado to the JTAG interface on the Zynq. It requires a small server running on the Pi. I will tidy it up and put it on Github.



Brad P

unread,
Apr 18, 2017, 6:45:55 PM4/18/17
to snickerdoodle forum, osh...@me.com
That's fantastic to hear - nice work! This could be very handy in a number of scenarios... look forward to giving it a try!

Cheers,
Brad

weath...@krtkl.com

unread,
Apr 18, 2017, 7:04:35 PM4/18/17
to snickerdoodle forum, osh...@me.com
Thank you so much for contributing that.  It will make an excellent starting point for inexpensive JTAG implementations for Zynq!

I am curious about how fast the uploads and downloads are with this solution?  Are you bit banging the GPIO or using a hybrid SPI hack of some sort?

Jamil

Derek Mulcahy

unread,
Apr 18, 2017, 9:10:46 PM4/18/17
to krtkl-sni...@googlegroups.com, osh...@me.com
It is bit banging the Pi gpio pins. The bitbang code is entirely borrowed from openocd. Currently I am getting about 1.5MHz. Openocd manages 4MHz so that will be my target.

Derek Mulcahy

unread,
Apr 19, 2017, 11:17:38 AM4/19/17
to snickerdoodle forum, osh...@me.com
I have packaged the XVC Pi server and posted it to https://github.com/derekmulcahy/xvcpi

Share and Enjoy,
Derek

Graham Gunderson

unread,
Aug 19, 2017, 12:50:54 AM8/19/17
to snickerdoodle forum, osh...@me.com
I'd assumed Snickerdoodle was plug n' play based on marketing copy. Bought a Digilent JTAG adapter for over $50, attached it to Snickeroodle with double sided tape. Still can't find a wiring diagram... perhaps I shouldn't need one, but that's not any kind of customer support at all. I just want bare metal C on ARM with the FPGA in Zynq. Didn't know I'd have to reinvent the wheel :\


On Saturday, April 1, 2017 at 5:12:12 PM UTC-7, osh...@me.com wrote:

I have been investigating JTAG programming on my newly arrived Snickerdoodle and I was wondering if JTAG via the microusb connector is currently working and supported? Is there any documentation on this?;

weath...@krtkl.com

unread,
Aug 19, 2017, 12:42:21 PM8/19/17
to krtkl-sni...@googlegroups.com, osh...@me.com
I agree that having to do that for bare metal sucks.  The USB JTAG adapters like the Digilent one have special support so they are correctly recognized within the Xilinx hardware manager tools.
Unfortunately, supporting bare metal was not our first use case objective precisely because the wireless stack is only widely enabled under Linux.
This is something that has been bugging me a lot because I'm a hardware guy and despite that 95% of the projects for Zynq are targeted to Linux I still find bare metal C development cuts through a lot of the unnecessary Linux noise especially when you are first developing FPGA IP and want to test it prior to the Linux kernel developers getting a hold of it.

I would like to see some version of what you are imagining work.  This is something that I am actively working on addressing.
As for the wiring diagram for JTAG hookup, you can find my post on that here:
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/krtkl-snickerdoodle/VyVlpJ6T0-c
Reply all
Reply to author
Forward
0 new messages