# 3. Programmer usage
You may program your devices in any way you want. The easiest way in our opinion is to use st-link utility.
# Connection example diagram
The example of connection is shown below.
Fig. Example of SWD connection with can-mini node.
SWD-NEEDLE connector (opens new window) is designed for easy acces to TARGET device SWD.
# 3.1. Most common issues
Please, read this section carefully to avoid most common issues!
- SWD and CAN sockets look similar and they use the same 4-pin cable. SWD has 3.3V, but CAN has 5V. Don't mix them up.
- Be sure that your SWD pins are connected correctly (3.3 to 3.3, GND to GND)
- On the sniffer
VUSBled should be orange,
3.3led should be red,
ST-linkled should be blue, and
blinkled should blink with yellow. If they are not, probably you are making something wrong. It also may indicate that the board works incorrectly.
- If your node already has a correct firmware, after such connection it should blink. If it is not, probably the firmware is wrong or the connection is mistaken.
# 3.2. Windows
ST-LINK utilityfrom the official site (opens new window)
ST-LINK utility, connect the programmer to the PC via USB
Connect target device to the programmer via SWD connectors as shown on the picture above with respect to the warnings. If you gen an error, check the Windows issues section.
Target -> Connect. Device should be successfully connected. If you get an error, check the issues below.
- You should see
Device IDif everything fine (as shown in picture below)
file -> open file ...and navigate to the downloaded firmware .bin as shown in the pictures below
Target -> Program & Verify ... CTRL+P
- Wait until downloading is in progress
- You should see
Verification...OKif everything is ok.
At that point, the firmware is succesfully downloaded. You can verify the software version by using
Wrong connection may leds to one of 2 following errors:
- Can not connect to target
Programmer is successfully detected, but your device is not detected via SWD by the programmer. Either SWD connection is not ok, or there is a problem on the target side.
Sometimes it may happen that the 3.3 and GND is connected, but SWDIO and SWCLK are not ok enough. In this case the node blinks because it has a power, but connection is not stable enough to start a programming. Just make more tension by pushing jumpers a little bit and then press
Program & Verifyone more time.
- No ST-LINK detected
Either your programmer is not connected to your PC, or it is broken. Check the leds on the programmer device.
# 3.3. Linux
st-linkusing the instruction from the official GitHub repository (opens new window)
- Type the following to program your device with desired .bin file:
st-flash write desired_bin_file.bin 0x8000000
desired_bin_file.bin is the name of the binary file.
# 3.4. Alternatives (Dronecode Probe)
As alternative way to upload firmware Dronecode Probe (opens new window) can be used.
First you will need next stuff:
|1. SWD Needle connector|
|3. Dronecode Probe|
Connect all relative to the diagram below