# Update the firmware

Here are the instructions on how to upload the latest firmware to the RaccoonLab nodes.

# Step 1. Download the latest firmware

We keep links to the binaries in the Software Versions section for each board.

A binary have the following name pattert: <protocol>_<node_name>_<software_version>_<git_hash>.bin. An example of binary name is: dronecan_micro_v0.10.17_3960cc2.bin.

Here is the list of links to the binaries with DroneCAN software for some of the devices:

Download the latest available versions.

The similar instruction is for Cyphal firmwares.

# Step 2. Connect the programmer to the device

You have 2 options here. You can either use a RaccoonLab Programmer-Sniffer (opens new window) or another one.

# 2.1. Using RaccoonLab Programmer-Sniffer

An example of a connection is shown below.

connection-prog.png

Fig. Example of SWD connection with can-mini node.

SWD-NEEDLE connector (opens new window) is designed for easy acces to TARGET device SWD.

drawing

# 2.2. Using Dronecode Probe

Another way to upload firmware is to use the Dronecode Probe (opens new window).

First you will need next stuff:

Name Pics
1. SWD Needle connector drawing
2. DEBUG-WIRE drawing
3. Dronecode Probe drawing

Connect all relative to the diagram below

connection-prog-dcp.png

Third way to upload firmware is to use ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32 (opens new window)

You will need:

  • ST-LINK debugger/programmer
  • Female wires
  • Adapter
  • DEBUG-WIRE
  • SWD Needle connector

Here is the connection example

st-link-connection

Most common issues

WARNING

Please, read this section carefully to avoid most common issues!

  1. 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.
  2. Be sure that your SWD pins are connected correctly (3.3 to 3.3, GND to GND)
  3. On the sniffer VUSB led should be orange, 3.3 led should be red, ST-link led should be blue, and blink led should blink with yellow. If they are not, probably you are making something wrong. It also may indicate that the board works incorrectly.
  4. 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.

# Step 3. Upload the firmwares to the devices

# 3.1 Windows

  1. Install ST-LINK utility from the official site (opens new window)

  2. Open ST-LINK utility, connect the programmer to the PC via USB

  3. 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.

  4. Choose option Target -> Connect. Device should be successfully connected. If you get an error, check the issues below.

drawing
  1. You should see Device ID if everything fine (as shown in picture below)
drawing
  1. Choose file -> open file ... and navigate to the downloaded firmware .bin as shown in the pictures below
drawing drawing
  1. Choose Target -> Program & Verify ... CTRL+P
drawing
  1. Wait until downloading is in progress
drawing
  1. You should see Verification...OK if everything is ok.
drawing

At that point, the firmware is succesfully downloaded. You can verify the software version by using gui_tool.

Windows issues

DETAILS

Wrong connection may leds to one of 2 following errors:

  1. Can not connect to target
drawing

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 & Verify one more time.

  1. No ST-LINK detected
drawing

Either your programmer is not connected to your PC, or it is broken. Check the leds on the programmer device.

# 3.2 Linux

  1. Install st-link using the instruction from the official GitHub repository (opens new window)
  2. Program your device with desired .bin file.

To program the boards with stm32f103 (they all have version v2), you should explicitly specify the flash size (128 KBytes):

st-flash --flash=0x00020000 --reset write desired_bin_file.bin 0x8000000

For boards with stm32g0 (they all have version v3), you should type:

st-flash --reset write desired_bin_file.bin 0x8000000

where desired_bin_file.bin is the name of the binary file.

# Step 4. Test the device

You need to connect CAN-Sniffer to your node via CAN connector and to your PC via USB. It can be either RaccoonLab Programmer-Sniffer (opens new window) or Zubax Babel (opens new window).

RaccoonLab Programmer-Sniffer have 2 different CAN sockets. You can use any of them.

# 4.1 Connect device

An example of connection to RaccoonLab Programmer-Sniffer (opens new window) is shown below, or to Zubax Babel (opens new window).

connection-sniffer

WARNING

Be careful, SWD and CAN sockets look similar. Don't use SWD instead of CAN socket!

# 4.2. Cyphal usage

After connection, you can use yakut (opens new window) or Yukon (opens new window) utility or something other.

On the picture below there is an example of Yukon usage.

yukon_monitor

# 4.3. DroneCAN usage

Alternatively, you can use gui_tool (opens new window) for DroneCAN applications.

app_setup

In the Application Setup menu you need to set 1000000 to both can bus and adapter baud rates.

After that you will get following window:

gui_tool

# 4.4 Make sure that device is accessible

circuit-status-check

fix2-check

# 4.5 Register the device