Verify Installation

In this section we check that some of the required tools / drivers have beencorrectly installed and configured.

Connect your laptop / PC to the discovery board using a micro USB cable. Thediscovery board has two USB connectors; use the one labeled "USB ST-LINK" thatsits on the center of the edge of the board.

Also check that the ST-LINK header is populated. See the picture below; theST-LINK header is circled in red.

1.4.4. Verify Installation - 图1

Now run the following command:

  1. $ openocd -f interface/stlink-v2-1.cfg -f target/stm32f3x.cfg

You should get the following output and the program should block the console:

  1. Open On-Chip Debugger 0.10.0
  2. Licensed under GNU GPL v2
  3. For bug reports, read
  4. http://openocd.org/doc/doxygen/bugs.html
  5. Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
  6. adapter speed: 1000 kHz
  7. adapter_nsrst_delay: 100
  8. Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
  9. none separate
  10. Info : Unable to match requested speed 1000 kHz, using 950 kHz
  11. Info : Unable to match requested speed 1000 kHz, using 950 kHz
  12. Info : clock speed 950 kHz
  13. Info : STLINK v2 JTAG v27 API v2 SWIM v15 VID 0x0483 PID 0x374B
  14. Info : using stlink api v2
  15. Info : Target voltage: 2.919881
  16. Info : stm32f3x.cpu: hardware has 6 breakpoints, 4 watchpoints

The contents may not match exactly but you should get the last line aboutbreakpoints and watchpoints. If you got it then terminate the OpenOCD processand move to the next section.

If you didn't get the "breakpoints" line then try the following command.

  1. $ openocd -f interface/stlink-v2.cfg -f target/stm32f3x.cfg

If that command works that means you got an old hardware revision of thediscovery board. That won't be a problem but commit that fact to memory asyou'll need to configure things a bit differently later on. You can move to thenext section.

If neither command worked as a normal user then try to run them with rootpermission (e.g. sudo openocd ..). If the commands do work with rootpermission then check that the udev rules have been correctly set.

If you have reached this point and OpenOCD is not working please open an issueand we'll help you out!