Added udev rules file.

pull/2/head
Peter Zotov 2011-04-04 19:10:04 +04:00
rodzic aaf1a0cd84
commit d1c3176f3a
2 zmienionych plików z 57 dodań i 0 usunięć

43
10-stlink.rules 100644
Wyświetl plik

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

14
README
Wyświetl plik

@ -1,6 +1,9 @@
HOWTO
=====
First, load the sg kernel module.
# modprobe sg
To run the gdb server, do (you do not need sudo if you have set up
permissions correctly):
$ make -C build && sudo ./build/st-util 1234 /dev/sg1
@ -26,6 +29,17 @@ Starting program: /home/whitequark/ST/apps/bally/firmware.elf
Remember that you can shorten the commands. `tar ext :1111' is good enough
for GDB.
Setting up udev rules
=====================
For convenience, you may install udev rules file, 10-stlink.rules, located
in the root of repository. You will need to copy it to /etc/udev/rules.d,
and then either reboot or execute
$ udevadm control --reload-rules
Udev will now create a /dev/stlink file, which will point at appropriate
/dev/sgX device. Good to not accidentally start debugging your flash drive.
Running programs from SRAM
==========================