Unable to lock chain (Insufficient port permissions)
Asked Answered
P

3

8

I am new to Linux , and I am trying to install AlteraQuartus 2 WEb Edition and NIOS2 EDS to play with Nios2 Processor.

However , after installing Quartus and when I am trying to execute jtagconfig.

I do not see something like below , even after running /altera/nios2eds/nios2_command_shell.sh

1.)[Nios2 EDS] $ 2.) Unable to lock chain (Insufficient port permissions)

Please Help,

Plainspoken answered 9/9, 2013 at 18:49 Comment(0)
T
7

"Insufficient permissions" or "permission denied" or whatever relating to not having permissions on *nix usually means you must run the command as user root (or as another user who has the permissions, but root has all of them).

So run jtagconfig as root:

$ sudo jtagconfig

Alternatively, as root, put this in a new file /etc/udev/rules.d/51-altera-usb-blaster.rules:

SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6002", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6003", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6010", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6810", MODE="0666"

and then, run:

$ sudo udevadm control --reload

This should change the permission of your USB-Blaster Download Cable device so that any user may access it (if this is what you want), so you should be able to issue jtagconfig without sudo. Those five idProducts are all the known USB-Blaster Download Cable USB product IDs (for the Altera vendor ID, 0x09fb).

I wrote a fairly complete Arch Linux wiki page about Altera softwares on Linux if you want more details.

Treviso answered 9/9, 2013 at 19:28 Comment(2)
Please don't recommend running commands like this as root (it's not only a security problem, a tool which leaves log files behind may then block the user from overwriting those); granting permission to the device node as in the second half of your post is far more appropriate.Inbreed
jtagd should be killed before starting jtagconfig as root, otherwise, if jtagd is already running as user, it will continue to do so and starting jtagconfig as root will have no effect. I took the liberty of posting a separate answer.Day
D
10

To check if this is indeed a port permission problem, start the trouble-shooting by running jtagd (the deamon between the Altera tool and the driver) as root. At first, you must make sure that jtagd is not running, since if it is already running as a user, trying to start it as root will have no effect.

$ sudo killall -9 jtagd   # Kill jtagd, ...
$ sudo killall -9 jtagd   # ...and verify jtagd is indeed not running.
jtagd: no process found   # Good, verified.
$ sudo jtagconfig         # Will also start jtagd as root
1) CV SoCKit [2-1]
  02D020DD   5CSEBA6(.|ES)/5CSEMA6/..
  4BA00477   SOCVHPS

If the above is successful, this is indeed a port permission problem. To fix it permanently, try with udev rules, as suggested by @eepp.

(On a side note, jtagd will be started by jtagconfig if not already running, as the same user that started jtagd. Hence @eepps command will work as well, but jtagd should be killed first.)

For further trouble-shooting, running jtagd with some debug command-line options can give useful information:

$ jtagd --foreground --debug
JTAG daemon started
Using config file /etc/jtagd/jtagd.conf
Remote JTAG permitted when password set
Cant bind to TCP port 1309 - exiting

(The above error message is typical if jtagd is already running.)

(Above is taken från http://www.fpga-dev.com/altera-usb-blaster-with-ubuntu/. See that page for more details.)

Day answered 24/7, 2014 at 19:6 Comment(1)
My environment is Quartus Prime 15.1 + Ubuntu 16.04 LTS. sudo killall -9 jtagd works.Steinbok
T
7

"Insufficient permissions" or "permission denied" or whatever relating to not having permissions on *nix usually means you must run the command as user root (or as another user who has the permissions, but root has all of them).

So run jtagconfig as root:

$ sudo jtagconfig

Alternatively, as root, put this in a new file /etc/udev/rules.d/51-altera-usb-blaster.rules:

SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6002", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6003", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6010", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6810", MODE="0666"

and then, run:

$ sudo udevadm control --reload

This should change the permission of your USB-Blaster Download Cable device so that any user may access it (if this is what you want), so you should be able to issue jtagconfig without sudo. Those five idProducts are all the known USB-Blaster Download Cable USB product IDs (for the Altera vendor ID, 0x09fb).

I wrote a fairly complete Arch Linux wiki page about Altera softwares on Linux if you want more details.

Treviso answered 9/9, 2013 at 19:28 Comment(2)
Please don't recommend running commands like this as root (it's not only a security problem, a tool which leaves log files behind may then block the user from overwriting those); granting permission to the device node as in the second half of your post is far more appropriate.Inbreed
jtagd should be killed before starting jtagconfig as root, otherwise, if jtagd is already running as user, it will continue to do so and starting jtagconfig as root will have no effect. I took the liberty of posting a separate answer.Day
L
0

It may be obvious but make sure you're not going through a USB hub. That was my problem for Altera DE2-115 with Quartus Prime Lite 20.1.1 on Ubuntu 20.04. The above answers fixed my permissions issue (Specifically adding ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666" to the new file /etc/udev/rules.d/51-altera-usb-blaster.rules).

But I was still getting.

1) USB-Blaster [1-2.1]
  unable to lock chain - Chain in use - check

Going straight to my PC solved it.

Locarno answered 9/10, 2021 at 13:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.