1 # This file was taken from arm-utilites project, located at
2 # http://code.google.com/p/arm-utilities/, which is licensed under GPL3.
3 # An explicit permission to include any code from that project in
4 # this one under BSD license was granted by arm-utilites author, Donald Becker.
6 # This file watches for a STMicro ST-Link or STM32VLDiscovery board
7 # and creates a device named /dev/stlink
8 # See udev(7) for syntax.
10 # Written 2010,2011 by Donald Becker
12 # The STLink on the Discovery has a USB ID 0483:3744 and presents itself
13 # as a mass storage (i.e. SCSI) device. The SCSI emulation is signficantly
14 # broken, and the kernel spews error reports for a while until it is
15 # accepted. Further problems are encountered when if it is automatically
18 # Options that may prevent the mount are
19 # ENV{UDISKS_PRESENTATION_HIDE}:="1",
20 # ENV{UDISKS_PRESENTATION_NOPOLICY}:="1",
21 # ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}:="1"
23 ACTION!="add|change", GOTO="stlink_rules_end"
25 SUBSYSTEMS=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="3744", \
26 MODE="0664", GROUP="tape", NAME="stlinkusb%n", ENV{STLINK}="1", \
27 ENV{UDISKS_PRESENTATION_HIDE}:="1", \
28 ENV{UDISKS_PRESENTATION_NOPOLICY}:="1", \
29 ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}:="1", \
32 # Other possible settings:
33 # OPTIONS="last_rule", ATTRS{vendor}=="STM32"
35 KERNEL=="sg[0-9]*", MODE="0664", GROUP:="tape", \
36 NAME+="stlink-sg%n", SYMLINK+="stlink", \
37 ENV{UDISKS_PRESENTATION_HIDE}:="1", \
38 ENV{UDISKS_PRESENTATION_NOPOLICY}:="1", \
39 ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}:="1"
41 SUBSYSTEM=="scsi", ATTR{vendor}=="STM32", MODE="0664", GROUP="tape", NAME="stlinksg-scsi%n", SYMLINK+="stlinkscsi", OPTIONS="last_rule"
43 LABEL="stlink_rules_end"