]>
Commit | Line | Data |
---|---|---|
9fa01778 XL |
1 | # Verify Installation |
2 | ||
3 | In this section we check that some of the required tools / drivers have been | |
4 | correctly installed and configured. | |
5 | ||
781aab86 | 6 | Connect your laptop / PC to the discovery board using a Mini-USB USB cable. The |
9fa01778 XL |
7 | discovery board has two USB connectors; use the one labeled "USB ST-LINK" that |
8 | sits on the center of the edge of the board. | |
9 | ||
10 | Also check that the ST-LINK header is populated. See the picture below; the | |
9ffffee4 | 11 | ST-LINK header is highlighted. |
9fa01778 XL |
12 | |
13 | <p align="center"> | |
14 | <img title="Connected discovery board" src="../../assets/verify.jpeg"> | |
15 | </p> | |
16 | ||
17 | Now run the following command: | |
18 | ||
19 | ``` console | |
cdc7bbd5 | 20 | openocd -f interface/stlink.cfg -f target/stm32f3x.cfg |
9fa01778 XL |
21 | ``` |
22 | ||
6a06907d XL |
23 | > **NOTE**: Old versions of openocd, including the 0.10.0 release from 2017, do |
24 | > not contain the new (and preferable) `interface/stlink.cfg` file; instead you | |
25 | > may need to use `interface/stlink-v2.cfg` or `interface/stlink-v2-1.cfg`. | |
26 | ||
9fa01778 XL |
27 | You should get the following output and the program should block the console: |
28 | ||
29 | ``` text | |
30 | Open On-Chip Debugger 0.10.0 | |
31 | Licensed under GNU GPL v2 | |
32 | For bug reports, read | |
33 | http://openocd.org/doc/doxygen/bugs.html | |
34 | Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'. | |
35 | adapter speed: 1000 kHz | |
36 | adapter_nsrst_delay: 100 | |
37 | Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD | |
38 | none separate | |
39 | Info : Unable to match requested speed 1000 kHz, using 950 kHz | |
40 | Info : Unable to match requested speed 1000 kHz, using 950 kHz | |
41 | Info : clock speed 950 kHz | |
42 | Info : STLINK v2 JTAG v27 API v2 SWIM v15 VID 0x0483 PID 0x374B | |
43 | Info : using stlink api v2 | |
44 | Info : Target voltage: 2.919881 | |
45 | Info : stm32f3x.cpu: hardware has 6 breakpoints, 4 watchpoints | |
46 | ``` | |
47 | ||
48 | The contents may not match exactly but you should get the last line about | |
49 | breakpoints and watchpoints. If you got it then terminate the OpenOCD process | |
50 | and move to the [next section]. | |
51 | ||
416331ca | 52 | [next section]: ../../start/index.md |
9fa01778 | 53 | |
3dfed10e | 54 | If you didn't get the "breakpoints" line then try one of the following commands. |
9fa01778 XL |
55 | |
56 | ``` console | |
cdc7bbd5 | 57 | openocd -f interface/stlink-v2.cfg -f target/stm32f3x.cfg |
9fa01778 XL |
58 | ``` |
59 | ||
3dfed10e | 60 | ``` console |
cdc7bbd5 | 61 | openocd -f interface/stlink-v2-1.cfg -f target/stm32f3x.cfg |
3dfed10e XL |
62 | ``` |
63 | ||
64 | If one of those commands works it means you got an old hardware revision of the | |
9fa01778 XL |
65 | discovery board. That won't be a problem but commit that fact to memory as |
66 | you'll need to configure things a bit differently later on. You can move to the | |
67 | [next section]. | |
68 | ||
3dfed10e | 69 | If none of the commands work as a normal user then try to run them with root |
9fa01778 | 70 | permission (e.g. `sudo openocd ..`). If the commands do work with root |
48663c56 | 71 | permission then check that the [udev rules] have been correctly set. |
9fa01778 XL |
72 | |
73 | [udev rules]: linux.md#udev-rules | |
74 | ||
75 | If you have reached this point and OpenOCD is not working please open [an issue] | |
76 | and we'll help you out! | |
77 | ||
78 | [an issue]: https://github.com/rust-embedded/book/issues |