Hi All,
I just needed to program and debug my Altera FPGAs remotely. So I've prepared a small script on the remote machine:
#!/bin/bash killall jtagd killall jtagd sleep 1 echo I have killed the old server export PATH=/home/me/quartus/bin:$PATH sudo rmmod ppdev echo I have removed the ppdev driver sleep 2 sudo modprobe ppdev echo I've lodaed the ppdev driver sleep 2 jtagd echo I have run jtagd server sleep 4 echo Started server configuration jtagconfig --remove 1 jtagconfig --add byteblastermv lpt1 jtagconfig --enableremote my_password jtagconfig
Unfortunately the last command outputs the following:
1) ByteBlasterMV [/dev/parport0] 0100A0DD ! 020030DD ! 0100A0DD ! 020030DD !Captured DR after reset = (0100A0DD020030DD0100A0DD020030DD) [128] Captured IR after reset = (5455554555) [40]
So the jtagd does not recognize the chips (probably it doesn't read the pgm_parts.txt file, when run in this mode) However the server is running and ready:
$netstat -l -t -p Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name [...] tcp 0 0 *:1309 *:* LISTEN
5444/jtagd [...]When I run the jtagd with --user-start option (adding it in the proper line of the script), it correctly recognizes chips, but fails to enable remote access:
Started server configuration Error (Unknown error) when setting password
1) ByteBlasterMV [/dev/parport0] 0100A0DD EPC16/4/8 020030DD EP1S25/_HARDCOPY_FPGA_PROTOTYPE 0100A0DD EPC16/4/8 020030DD EP1S25/_HARDCOPY_FPGA_PROTOTYPEnow netstat returns: $ netstat -l -t -p Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name [...] tcp 0 0 localhost:1309 *:* LISTEN
5767/jtagd [...]So jtagd listens only on the local machine. I tried to use ssh tunneling:
ssh snipped-for-privacy@remote.machine -L1309:localhost:1309
But then the local jtagd may not start, as 1309 port is occupied. Finally I've the solution, using the extended version of SSH tunneling:
ssh snipped-for-privacy@remote.machine -Laaa.bbb.ccc.ddd:1309:localhost:1309 (aaa.bbb.ccc.ddd - is the IP of my local machine, you can also create a fake additional IP with "ifconfig eth0:1 aaa.bbb.ccc.ddd up" using an unrouteable IP)
Now the local jtagd connects to the localhost 1309 port, while tunneled remote jtagd listens on the aaa.bbb.ccc.ddd 1309 port. If you now locally run $ qrt_path/jtagd --user-start $ qrt_path/jtagconfig --addserver aaa.bbb.ccc.ddd e ("e" is a dummy password, not used, but needed) $ qrt_path/bin/jtagconfig
1) ByteBlasterMV on aaa.bbb.ccc.ddd [/dev/parport0] 0100A0DD EPC16/4/8 020030DD EP1S25/_HARDCOPY_FPGA_PROTOTYPE 0100A0DD EPC16/4/8 020030DD EP1S25/_HARDCOPY_FPGA_PROTOTYPEBTW This method should provide better security. I know nothing about the security of Altera remote jtagd protocol. It seems (from ethereal dumps) that it doesn't send passwords as plaintext, but I don't know how easy it is to break. In the above method you connect via the proven SSH protocol.
So my final script "~/jtagstart" looks like this:
#!/bin/bash killall jtagd killall jtagd sleep 1 echo I have killed the old server export PATH=/home/me/quartus/bin:$PATH sudo rmmod ppdev echo I have removed the ppdev driver sleep 2 sudo modprobe ppdev echo I have lodaed the ppdev driver sleep 2 jtagd --user-start echo I have run jtagd server sleep 4 echo Started server configuration jtagconfig --remove 1 jtagconfig --add byteblastermv lpt1 jtagconfig
You should run on the local machine: $ssh snipped-for-privacy@remote.machine -Laaa.bbb.ccc.ddd:1309:localhost:1309 /home/me/jtagstart and then locally: $ qrt_path/jtagd --user-start $ qrt_path/jtagconfig --addserver aaa.bbb.ccc.ddd e
Works like a dream :-).
HTH & Regards Wojtek Zabolotny