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++

USB-Blaster under Linux?

Altera_Forum
Honored Contributor II
1,144 Views

Hi all, 

 

I've tried getting the NIOS IDE to work under Linux. Everything's fine up to the point where I want to download my code to the eval board (Cyclone 1c20). Apparently the USB Blaster is recognized but no devices are visible. When I run "jtagconfig" I get the error "Unable to lock chain (Chain in use)". 

 

When I move the USB cable to the Windows machine everything works so I know all the HW is ok. 

 

Any ideas how to get the USB-Blaster to work under Linux? I'm using RedHat 9 but could try any other distro. 

 

 

Thanks, 

Andrew
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
343 Views

It does work. Here are the instructions, that I followed: 

 

To use USB-Blaster under Linux you need to set up the permissions correctly. On redhat you need to add the following lines to /etc/hotplug/usb.usermap - on Debian create a file /etc/hotplug/usb/usbblaster.usermap and copy the lines into it. # # Altera USB-Blaster# usbblaster 0x03 0x09fb 0x6001 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 usbblaster 0x03 0x09fb 0x6002 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 usbblaster 0x03 0x09fb 0x6003 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 And then add the following script as /etc/hotplug/usb/usbblaster: # !/bin/sh # USB-Blaster hotplug script. # Allow any user to access the cable chmod 666 $DEVICE Don't forget to make the script executable. This should set up your USB-Blaster so that any user can access it. You may of course care about security, in which case you would put more careful rules into the script, for example you could set the files to mode 660 and set the group to a group of users who should be allowed to use it. Now plug in and go... (If you plugged in before making these changes then the permissions will still be wrong - you'll need to unplug and replug your USB-Blaster). 

 

I'm running this on an amd64 Gentoo box. RH9 is way out of date, though I've seen some who are still stuck on 7.3... 

 

YMMV... 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
343 Views

Hi Slacker, 

 

Thanks for the info. That's exactly what was needed for the USB-Blaster and I can now connect. However, I always get a SYSID mismatch and when I bypass the SYSID checking the download works ok but it hangs saying "Leaving target processor paused". Again, the Windows machine works with the same .SOF and I also programmed it into the EPCS thinking I might be able to work around it that way but it still doesn't work. Any hints very welcome. 

 

Next I'll try programming everything into ( SOF into EPCS, program into flash) so I don't need any download and then see if I can break in with the debugger. 

 

Andrew
0 Kudos
Altera_Forum
Honored Contributor II
343 Views

The routines which perform the sysid checks, on the host (Win32/Linux), are pretty much the same. All Run/Download/Debug traffic is routed through nios2-gdb-server.  

 

What are the differences between what your PTF contains, in the sysid peripheral, and what the IDE is reporting? Posting your exact error message could help. 

 

Also, if I were you, I would try doing the following on your Linux box: 

 

1. Generating/Re-generating your SOPC Builder system. 

2. Building your project in the IDE. 

3. Compiling in Quartus II. 

 

In my experience, IDE Builds and SOPC Builder generations are noticeably quicker running in Linux. 

 

Good luck! 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
343 Views

Hi Slacker, 

 

You're right, everything works just fine now. It turns out that my project was fouled up and SOPC/Quartus didn't match NIOS IDE. 

 

I don't have Quartus running on Linux yet, waiting for the licensing to be straightened out. My main goal is to run the NIOS IDE because I just didn't want to put up with the pain of working with it under Win anymore. It's gotten so sluggish I just can't bear it anymore. 

 

For now I build the SOF under Windows, burn it into flash and then download my software from Linux-NIOS. That way I have at least the IDE working in it's proper environment. 

 

Thanks for the tips, 

Andrew 

 

 

 

 

--- Quote Start ---  

originally posted by slacker@Sep 30 2005, 12:29 AM 

the routines which perform the sysid checks, on the host (win32/linux), are pretty much the same.  all run/download/debug traffic is routed through nios2-gdb-server.   

 

what are the differences between what your ptf contains, in the sysid peripheral, and what the ide is reporting?  posting your exact error message could help. 

 

also, if i were you, i would try doing the following on your linux box: 

 

1.  generating/re-generating your sopc builder system. 

2.  building your project in the ide. 

3.  compiling in quartus ii. 

 

in my experience, ide builds and sopc builder generations are noticeably quicker running in linux. 

 

good luck! 

 

- slacker 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10058) 

--- quote end ---  

 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
343 Views

Andrew, 

 

Windows IDE slowness, in my experience, is generally due to some other Win32 network/"active" directory issue. It seems to behave the worst when one of your mapped drives becomes disconnected. The same is true for the auto-magically connected "My Network Places"... 

 

That being said, I feel that Linux is better suited for robust development environments. Win32 still just doesn&#39;t "get" networking. For real design work (HW or SW), Linux/UNIX is a superior environment. 

 

Cheers, 

 

- slacker
0 Kudos
Reply