# Update the firmware with Dronecode probe on Linux

# Step 1. Download firmware

Download the latest firmware from Update the firmware page.

You need .elf file here.

# Step 2.1. Install software

WARNING

do we need something to install?

# Step 2.2. Connect the programmer

Prerequisites are:

Connect all relative to the diagram below. connection-prog-dcp.png

# Step 2.3. Upload the firmware

Commonly zubax (opens new window) or black-magic (opens new window) instruction can be used.

TIP

You can make .elf file from .bin, in case if you can`t finde it in releases. Just tape next command with changing paths

arm-none-eabi-objcopy -I binary -O elf32-little --change-section-address .data=0x08000000 input.bin output.elf

Thanks to this gist (opens new window)

TIP

In case of using Dronecode Probe you should power up device from CAN port.

Firstly check GDB is installed:

GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
...
Type "apropos word" to search for commands related to "word".
(gdb) 

Type target extended-remote /dev/ttyACM0 in case of Ubuntu and target extended-remote COM4 in case of Windows. Apply next commands:

  • monitor tpwr enable - enable power rail
  • monitor swdp_scan - scan device
  • attach 1
  • load - load firmware
  • quit - quit GDB

You should see something like this replyes at the end:

(gdb) monitor tpwr enable
Enabling target power
(gdb) monitor swdp_scan
Target voltage: 3.3V
Available Targets:
No. Att Driver
 1      STM32F1 medium density M3
(gdb) attach 1
Attaching to program: C:\workspace\mini_v2_node\build\obj\cyphal_example.elf, Remote target
0x0800a38e in ?? ()
(gdb) load
Loading section .data, size 0x80d8 lma 0x8000000
Start address 0x00000000, load size 32984
Transfer rate: 16 KB/sec, 970 bytes/write.
(gdb) quit
A debugging session is active.

TIP

This (opens new window) instruction can be used to work with Dronecode Probe under STM32CubeIDE.