@@ -6,24 +6,27 @@ Let's verify that all the tools were installed correctly.
6
6
7
7
### Verify permissions
8
8
9
- Connect the F3 to your computer using an USB cable. Be sure to connect the cable to the "USB ST-LINK"
9
+ Connect the STM32F3DISCOVERY to your computer using an USB cable. Be sure to connect the cable to the "USB ST-LINK"
10
10
port, the USB port in the center of the edge of the board.
11
11
12
- The F3 should now appear as a USB device (file) in ` /dev/bus/usb ` . Let's find out how it got
12
+ The STM32F3DISCOVERY should now appear as a USB device (file) in ` /dev/bus/usb ` . Let's find out how it got
13
13
enumerated:
14
14
15
+ ``` console
16
+ lsusb | grep -i stm
17
+ ```
18
+ This should result in:
15
19
``` console
16
20
$ lsusb | grep -i stm
17
21
Bus 003 Device 004: ID 0483:374b STMicroelectronics ST-LINK/V2.1
18
22
$ # ^^^ ^^^
19
23
```
20
24
21
- In my case, the F3 got connected to the bus #3 and got enumerated as the device #4 . This means the
22
- file ` /dev/bus/usb/003/004 ` * is* the F3. Let's check its permissions:
23
-
25
+ In my case, the STM32F3DISCOVERY got connected to the bus #3 and got enumerated as the device #4 . This means the
26
+ file ` /dev/bus/usb/003/004 ` * is* the STM32F3DISCOVERY. Let's check its permissions:
24
27
``` console
25
- $ ls -l /dev/bus/usb/003/004
26
- crw-rw-rw- 1 root root 189, 20 Sep 13 00:00 /dev/bus/usb/003/004
28
+ $ ls -la /dev/bus/usb/003/004
29
+ crw-rw-rw-+ 1 root root 189, 259 Feb 28 13:32 /dev/bus/usb/003/00
27
30
```
28
31
29
32
The permissions should be ` crw-rw-rw- ` . If it's not ... then check your [ udev
@@ -32,12 +35,12 @@ rules] and try re-loading them with:
32
35
[ udev rules ] : linux.md#udev-rules
33
36
34
37
``` console
35
- $ sudo udevadm control --reload-rules
38
+ sudo udevadm control --reload-rules
36
39
```
37
40
38
- Now let's repeat the procedure for the Serial module.
41
+ #### For older devices with OPTIONAL USB <-> FT232 based Serial Module
39
42
40
- Unplug the F3 and plug the Serial module. Now, figure out what's its associated file:
43
+ Unplug the STM32F3DISCOVERY and plug the Serial module. Now, figure out what's its associated file:
41
44
42
45
``` console
43
46
$ lsusb | grep -i ft232
@@ -53,36 +56,51 @@ crw-rw-rw- 1 root root 189, 21 Sep 13 00:00 /dev/bus/usb/003/005
53
56
54
57
As before, the permissions should be ` crw-rw-rw- ` .
55
58
56
- ## All
59
+ ## Verify OpenOCD connection
57
60
58
- ### First OpenOCD connection
59
-
60
- First, connect the F3 to your computer using an USB cable. Connect the cable to the USB port in the
61
+ Connect the STM32F3DISCOVERY using the USB cable to the USB port in the
61
62
center of edge of the board, the one that's labeled "USB ST-LINK".
62
63
63
64
Two * red* LEDs should turn on right after connecting the USB cable to the board.
64
65
65
- Next, run this command:
66
+ > ** IMPORTANT** There is more than one hardware revision of the STM32F3DISCOVERY board. For older
67
+ > revisions, you'll need to change the "interface" argument to ` -f interface/stlink-v2.cfg ` (note:
68
+ > no ` -1 ` at the end). Alternatively, older revisions can use ` -f board/stm32f3discovery.cfg `
69
+ > instead of ` -f interface/stlink-v2-1.cfg -f target/stm32f3x.cfg ` .
70
+
71
+ ### * Nix
72
+
73
+ > ** FYI:** The ` interface ` directory is typically located in ` /usr/share/openocd/scripts/ ` ,
74
+ > which is the default location OpenOCD expects these files. If you've installed them
75
+ > somewhere else use the ` -s /path/to/scripts/ ` option to specify your install directory.
66
76
67
77
``` console
68
- $ # *nix
69
- $ openocd -f interface/stlink-v2-1.cfg -f target/stm32f3x.cfg
78
+ openocd -f interface/stlink-v2-1.cfg -f target/stm32f3x.cfg
79
+ ```
70
80
71
- $ # Windows
72
- $ # NOTE cygwin users have reported problems with the -s flag. If you run into
73
- $ # that you can call openocd from the `C:\OpenOCD\share\scripts` directory
74
- $ openocd -s C:\O penOCD\s hare\s cripts -f interface/stlink-v2-1.cfg -f target/stm32f3x.cfg
81
+ ### Windows
82
+
83
+ Below the references to ` C:\OpenOCD ` is the directory where OpenOCD is installed.
84
+
85
+ ``` console
86
+ openocd -s C:\OpenOCD\share\scripts -f interface/stlink-v2-1.cfg -f target/stm32f3x.cfg
75
87
```
76
88
77
- > ** NOTE** Windows users: ` C:\OpenOCD ` is the directory where you installed OpenOCD to.
89
+ > ** NOTE** cygwin users have reported problems with the -s flag. If you run into
90
+ > that problem you can add ` C:\OpenOCD\share\scripts\ ` directory to the parameters.
78
91
79
- > ** IMPORTANT ** There is more than one hardware revision of the STM32F3DISCOVERY board. For older
80
- > revisions, you'll need to change the "interface" argument to ` -f interface/stlink-v2.cfg ` (note:
81
- > no ` -1 ` at the end). Alternatively, older revisions can use ` -f board/stm32f3discovery .cfg `
82
- > instead of ` -f interface/stlink-v2-1.cfg -f target/stm32f3x.cfg ` .
92
+ cygwin users:
93
+ ``` console
94
+ openocd -f C:\OpenOCD\share\scripts\interface\stlink-v2-1.cfg -f C:\OpenOCD\share\scripts\target\stm32f3x .cfg
95
+ ```
83
96
84
- You should see output like this:
97
+ ### All
85
98
99
+ OpenOCD is a service which forwards debug information from the ITM channel
100
+ to a file, ` itm.txt ` , as such it runs forever and does ** not** return to the
101
+ terminal prompt.
102
+
103
+ The initial output of OpenOCD is something like:
86
104
``` console
87
105
Open On-Chip Debugger 0.10.0
88
106
Licensed under GNU GPL v2
@@ -106,9 +124,7 @@ Info : stm32f3x.cpu: hardware has 6 breakpoints, 4 watchpoints
106
124
107
125
[ general troubleshooting ] : ../appendix/1-general-troubleshooting/index.html
108
126
109
- ` openocd ` will block the terminal. That's fine.
110
-
111
127
Also, one of the red LEDs, the one closest to the USB port, should start oscillating between red
112
128
light and green light.
113
129
114
- That's it! It works. You can now close/kill ` openocd ` .
130
+ That's it! It works. You can now use ` Ctrl-c ` to stop OpenOCD or close/kill the terminal .
0 commit comments