Configuring UDEV Rules for a Bus Blaster Probe on Linux

This topic contains 0 replies, has 1 voice, and was last updated by  Kevin 5 months, 3 weeks ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #55777

    Kevin
    Admin

    When a USB usb device is plugged in, the Linux kernel will create a node under /dev/bus/usb/<bus>/<device>; such a node will be owned by root and have 0664 permissions by default.

    As bus and device numbers are chosen by the kernel and may vary every time we plug a USB device in, it is essential to have a way to perform automatic actions like setting properties, permissions or run scripts based on the USB device firmware regardless of the bus and device number assigned to it.

    This can be done on most Linux distros by creating a file containing rules in /etc/udev/rules.d. To do this, you will need root access, and you will also need to know the major and minor device numbers for your Bus Blaster. Rules files in the rules.d folder are executed in lexical order on the file name, and the standard practice is to pre-pend the name with numbers in order to determine such order. A suitable filename for this purpose might be 90-busblaster.rules

    To set up the udev rules for your Bus Blaster

    1. Connect the Bus Blaster to your host PC via the USB cable.

    2. Discover the Major/Minor numbers, for example by reading the output of lsusb. Every line in the output represents a connected USB device. An example of a line representing a BusBluster might be:

    Bus 001 Device 003: ID 0403:6010 Future Technology Devices International, Ltd FT2232C Dual USB-UART/FIFO IC

    where 0403 is the major number and 6010 is the minor number.

    3. Create a new file in /etc/udev/rules.d. You will need root access to do this. As mentioned above, a suitable name would be something like 90-busblaster.rules

    4. Enter one line in the file for each Bus Blaster probe you are using, in the following syntax:

    ATTRS{idProduct}==”nnnn”, ATTRS{idVendor}==”mmmm”, MODE=”0666″

    where mmmm is the major number and nnnn is the minor number. The MODE sets the desired permissions of 0666.

    An example of such file could be:

    # 90-busblaster.rules file
    ATTRS{idProduct}==”6010″, ATTRS{idVendor}==”0403″, MODE=”0666″
    ATTRS{idProduct}==”7780″, ATTRS{idVendor}==”0403″, MODE=”0666″
    

    Note that in the above example permissions are set to 0666 so every user and group on that system will be able to read and write the device.

    If you need specific group or user Unix permissions for a Bus Blaster, this can be done by using GROUP=”<unix group>” and/or OWNER=”<unix user>” on in the udev rules file. For example:

    ATTRS{idProduct}==”6010″, ATTRS{idVendor}==”0403″, MODE=”0660″, GROUP=”plugdev”
    ATTRS{idProduct}==”7780″, ATTRS{idVendor}==”0403″, MODE=”0660″, OWNER=”john”
    

    In the above example the firmware ID 0403:6010 can be read and written by all the members of plugdev group, while the firmware ID 0403:7780 can be read and written only by user john.

Viewing 1 post (of 1 total)

This topic is temporarily locked.