@@ -11,22 +11,47 @@ called stlink and there are 2 versions:
11
11
. STLINKv1 uses SCSI passthru commands over USB,
12
12
. STLINKv2 uses raw USB commands.
13
13
14
- It means that if you are using a STM32VL board, you have to install and load
15
- SCSI related software. First, load the sg kernel module:
16
- # modprobe sg
14
+ Common requirements
15
+ ~~~~~~~~~~~~~~~~~~~
17
16
18
- Then, you need to install the package libsgutils2-dev. On Ubuntu:
19
- # sudo apt-get install libsgutils2-dev
17
+ libusb-1.0 (You probably already have this, but you'll need the
18
+ development version to compile)
20
19
21
- LIBUSB is required for both cases.
20
+ IF YOU HAVE AN STLINKv1
21
+ ~~~~~~~~~~~~~~~~~~~~~~~
22
+ The STLINKv1's SCSI emulation is very broken, so the best thing to do
23
+ is tell your operating system to completely ignore it.
24
+
25
+ Options (do one of these before you plug it in)
26
+ *) modprobe -r usb-storage && modprobe usb-storage quirks=483:3744:i
27
+ or *)1. add "options usb-storage quirks=483:3744:i" to /etc/modprobe.conf
28
+ *)2. modprobe -r usb-storage && modprobe usb-storage
29
+ or *)1. cp stlink_v1.modprobe.conf /etc/modprobe.d
30
+ *)2. modprobe -r usb-storage && modprobe usb-storage
31
+
32
+ IF YOU HAVE AN STLINKv2
33
+ ~~~~~~~~~~~~~~~~~~~~~~~
34
+
35
+ You're ready to go :)
22
36
23
37
To run the gdb server, do (you do not need sudo if you have set up
24
38
permissions correctly):
25
- $ make -C build && sudo ./build/st-util [/dev/sgX]
39
+ $ make && [sudo] ./gdbserver/st-util
40
+
41
+ There are a few options:
42
+
43
+ ./gdbserver/st-util - usage:
26
44
27
- Currently, the GDB server listening port is hardcoded to 4242:
45
+ -h, --help Print this help
46
+ -vXX, --verbose=XX specify a specific verbosity level (0..99)
47
+ -v, --verbose specify generally verbose logging
48
+ -s X, --stlink_version=X
49
+ Choose what version of stlink to use, (defaults to 2)
50
+ -1, --stlinkv1 Force stlink version 1
51
+ -p 4242, --listen_port=1234
52
+ Set the gdb server listen port. (default port: 4242)
28
53
29
- Then, in gdb:
54
+ Then, in gdb: (remember, you need to run an _ARM_ gdb, not an x86 gdb)
30
55
(gdb) target remote :4242
31
56
32
57
Have fun!
@@ -50,13 +75,14 @@ for GDB.
50
75
Setting up udev rules
51
76
=====================
52
77
53
- For convenience, you may install udev rules file, 10-stlink .rules, located
78
+ For convenience, you may install udev rules file, 49-stlinkv2 .rules, located
54
79
in the root of repository. You will need to copy it to /etc/udev/rules.d,
55
80
and then either reboot or execute
56
81
$ udevadm control --reload-rules
57
82
58
- Udev will now create a /dev/stlink file, which will point at appropriate
59
- /dev/sgX device. Good to not accidentally start debugging your flash drive.
83
+ Udev will now create a /dev/stlinkv2_XX file, with the appropriate permissions.
84
+ This is currently all the device is for, (only one stlinkv2 is supported at
85
+ any time presently)
60
86
61
87
Running programs from SRAM
62
88
==========================
0 commit comments