Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12689 Discussions

how to control through jtag uart

Altera_Forum
Honored Contributor II
1,785 Views

I'd like to control my board through jtag uart from my original program. 

 

I've found that jtagserver listens network port# 1309 and 

nios2-terminal connects to it and then communicates with jtag uart. 

 

Does anybody know how to connect to jtagserver via socket interface? 

 

I've tried to connect to port 1309, but no reaction from it other than greeting 

message like below: 

 

$ telnet localhost 1309 

Trying 127.0.0.1... 

Connect to myhost. 

Escape character is '^]'. 

JTAG Server 

 

(no action from here.) 

 

Or is there any idea to control through jtag uart?
0 Kudos
10 Replies
Altera_Forum
Honored Contributor II
884 Views

I don't know, but if I were you, I'd sniff the TCP traffic on your local machine while running nios2-terminal. Then, from the data you could come up with the protocol which I'd assume should be very simple. A good sniffer is Ethereal.

0 Kudos
Altera_Forum
Honored Contributor II
884 Views

Thank you, wizzy. 

 

I've had an idea that you wrote. 

But ethereal does not support sniffing loopback interface on Windows. 

 

http://www.ethereal.com/media.html (http://www.ethereal.com/media.html

 

When I googled sniffing tool for loopback interface, 

I've found a tool called CommView. 

 

http://www.tamos.com/products/commview/ (http://www.tamos.com/products/commview/

 

It can sniff it! 

 

It seemed to be serial raw data, but I cannot understand it. 

I might give up doing by myself. 

 

Regards.
0 Kudos
Altera_Forum
Honored Contributor II
884 Views

Although its not of use to you know we are looking at providing better support for this in a future release; perhaps with a simple C API that you could link to via DLL. This may even be independent of the JTAG uart. 

 

If you don't mind me asking, can you describe the sorts of operations you'd like such an interface to support? (Reading/writing memory, throughput requirements, any advanced features?).
0 Kudos
Altera_Forum
Honored Contributor II
884 Views

Hello Jesse. 

 

We are developing product using Cyclone and are investigating 

writing FPGA image to EPCS through JTAG interface. 

 

As you know it can be achived by nios2-flash-programmer 

for this purpose. 

 

But there are some Cyclone chips on our board, and we'd like to 

write all EPCSs through only one JTAG interface. 

 

(see below) 

 

Host PC 

JTAG 

C1-----C2-----C3-----C4----- ... 

| | | | 

EPCS1 EPCS2 EPCS3 EPCS4 

 

We have developed a functionality of receiving FPGA image 

from UART and writing it from a Cyclone (C1) to EPCS which configures 

the other Cyclone (C2, C3,,,) by using SPI. 

 

Is there a way to send data through JTAG uart from my original 

program on host PC? 

 

If there is, writing procedure will be 

1. configure C1 from JTAG by quartus_pgm. 

(or write EPCS1 by nios2-flash-programmer) 

2. boot C1. 

3. software on C1 receives FPGA image from JTAG uart. 

4. write it to EPCS2 by SPI. 

 

Best regards.
0 Kudos
Altera_Forum
Honored Contributor II
884 Views

Hi Jesse, 

 

Will your C API have basic read and set of pins at the JTAG Level? 

 

We just wrote an app that reads a board's netlist file and generates a pin assignment file for Quartus.  

 

I was thinking it would be easy to add JTAG test vectors to its abilities since the netlist tells you everything you need to know. 

 

It would be even better if it could control the JTAG port directly from within itself using your API. 

 

Thanks, 

Ken
0 Kudos
Altera_Forum
Honored Contributor II
884 Views

if all of the cyclone devices are in the same JTAG chain there is no reason not to just use the nios2_flash_programmer. You can specify the chain possition of the device beng programmed. It is also easy to script the programming of the board with a batch file using the nios2-flash-programmer from the command line.  

 

--Dalon
0 Kudos
Altera_Forum
Honored Contributor II
884 Views

Ken - no, I think I was getting at something completely different. Think of a host-PC running code you compile directly accessing Nios-side memory.  

 

Actually truth be told I think I spoke too soon on the above.... we kick around a lot of ideas here, but this isn't the place for our product planning to be done.
0 Kudos
Altera_Forum
Honored Contributor II
884 Views

Hi dalon, 

 

These three chips are not on the same JTAG chain. 

I don't know why my fellow did not apply such things. 

 

Thanks, 

isao
0 Kudos
Altera_Forum
Honored Contributor II
884 Views

 

--- Quote Start ---  

Although its not of use to you know we are looking at providing better support for this in a future release; perhaps with a simple C API that you could link to via DLL. This may even be independent of the JTAG uart. 

 

If you don't mind me asking, can you describe the sorts of operations you'd like such an interface to support? (Reading/writing memory, throughput requirements, any advanced features?). 

--- Quote End ---  

 

 

Hi Jesse, 

Found this old discussion from 2004. We have similar requirement - to communicate with NIOS-II via JTAG-UART <-> USBblaster from our own Windows C/C++ program. Protocol is our own: short packets request/response). We could use JTAGserver and socket on port 1309 - can't find any description of socket comm.protocol. You mentioned in the post a simple C API/DLL - that would be even better! Was such API/DLL developed at that time ? Is it available ? 

Best regards,  

Juri Cizas,  

Infineon Technologies
0 Kudos
Altera_Forum
Honored Contributor II
884 Views

See this software from the Nios Wiki and several contributions on the Altera Forum related to JTAG UART. http://www.nioswiki.com/index.php?title=exampledesigns/highspeedimagedownloaddemo

0 Kudos
Reply