On Tue, Feb 7, 2012 at 9:54 AM, Fabio Estevam <[email protected]> wrote:
> ...
> sudo openocd
I just realized that OpenOCD documentation does not fully cover this topic.
There is no need to run OpenOCD as "root" on Linux.
Moreover, for security reason, it's also a bad idea to use root
account when not strictly needed.
Also, every file created by OpenOCD will have root permission, and you
will be forced to be root again to use or delete them.
OpenOCD needs proper permission to access to JTAG dongles, either USB
devices and parallel port adapters.
These devices are usually restricted to normal user.
For parallel port JTAG, you need to enable your user ID (e.g.
"username") to access /dev/parportX
$> ls -l /dev/parport*
crw-rw----. 1 root lp 99, 0 Feb 1 12:51 /dev/parport0
Add your user ID to the same group "lp" and you skip the need to be root.
You can achieve it typing (this time as root)
$> usermod -a -G lp username
and verify it with command
$> id username
uid=500(username) gid=500(username) groups=500(username),7(lp)
For USB JTAG devices, you need to instruct Linux to detect a JTAG
device and to assign it to the right group.
You have to copy a file provided with OpenOCD source in the UDEV
configuration directory.
This should work with all modern Linux distribution based on UDEV.
As root, type:
$> cp ./contrib/openocd.udev /etc/udev/rules.d/95-openocd.rules
and activate it with:
$> udevadm control --reload-rules
This file will assign to group "plugdev" all the USB devices
recognized by OpenOCD.
Please verify that group "plugdev" already exists in your system
$> grep plugdev /etc/group
plugdev:x:501:user1
If does not exists, create it, typing as root:
$> groupadd plugdev
At last you need to put your user (e.g. "username") in group "plugdev"
$> usermod -a -G plugdev username
Verify it:
$> id username
uid=500(username) gid=500(username) groups=500(username),7(lp),501(plugdev)
>From now on, enjoy OpenOCD and forget "sudo", "su" and "root".
Best Regards,
Antonio
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel