RPi4 GoPiGo3 firmware update fails

My old raspberry pi 3B+ died and since you can’t buy pi3’s anymore, I bought a pi4. I’m running raspian buster on it currently.

When I try to upgrade the firmware I get the following output:

GoPiGo3 firmware needs to be version 1.0.x but is currently version 0.3.4
Firmware upgrade is needed
Attempting to upgrade firmware.
Flashing the firmware using a Pi4
Using interface file 'rpi4-sysfsgpio.cfg' for RPi version 'RPI4'.
Updating the GoPiGo3 Firmware with '/home/pi/Dexter/GoPiGo3/Firmware/GoPiGo3_Firmware_1.0.0.bin'
Open On-Chip Debugger 0.10.0-dev (2016-12-16-18:07)
Licensed under GNU GPL v2
For bug reports, read
/home/pi/Dexter/GoPiGo3/Firmware/rpi4-sysfsgpio.cfg:1: Error: invalid command name "adapter"
in procedure 'script' 
at file "embedded:startup.tcl", line 60
at file "/home/pi/Dexter/GoPiGo3/Firmware/rpi4-sysfsgpio.cfg", line 1
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "build/bdist.linux-armv7l/egg/gopigo3.py", line 250, in __init__
gopigo3.FirmwareVersionError: GoPiGo3 firmware needs to be version 1.0.x but is currently version 0.3.4

It looks like the relevant line is:

/home/pi/Dexter/GoPiGo3/Firmware/rpi4-sysfsgpio.cfg:1: Error: invalid command name "adapter"

Looks like rpi4-sysfsgpio.cfg fails on the very first line:

adapter driver sysfsgpio

I’m unsure of how to troubleshoot this and without the upgrade I can’t use my gopigo3 anymore. I see some threads from a few years ago discussing issues with the pi4, but none of them match my exact issue and I’m unsure of how to proceed.


If it helps, this is the version of openocd that the gopigo3 script installs:

Open On-Chip Debugger 0.10.0-dev (2016-12-16-18:07)

Out of curiosity, I tried installing the one in the raspian ppas, this version:

Open On-Chip Debugger 0.10.0+dev-00114-g41bcbc67d-dirty (2021-01-18-16:43)

This results in a different error:

/home/pi/Dexter/GoPiGo3/Firmware/rpi4-sysfsgpio.cfg:3: Error: invalid command name "sysfsgpio"

Not sure if this helps, but I figured I’d share. I’ve since removed the version I installed myself and reverted to the one that gopigo3 installs, in case it’s a fork.


First copy your post to support@modrobotics.com

I also suggest supplying them the result of:
uname -a
more ~/Dexter/Version
python --version

Then come back here and post the solution please for other Pi4 users.


Good call! I’ll do that now. Will update this thread once it’s resolved.


First question:
Why can’t you use your Pi anymore?  I have a Pi-4 and it works just fine with the stock 1.0.0 firmware.

We need to know what the base issue is - you shouldn’t need to upgrade the firmware at all.

Second question:
Exactly what version of the Pi-4 and exactly which version of the software are you using?  Have you updated to the new GoPiGo O/S v 3.0.2?



I second this approach. It is the current recommended OS for GoPiGo3 users, and it might perform the needed firmware upgrade for your GoPiGo3. Once your bot is updated, you will then be able to use Legacy PiOS or even Ubuntu if desired.

You should read how to connect and set up GoPiGo OS because it defaults to offering an access point:


Why does his GoPiGp-3 even NEED a firmware update?

AFAIK, (and from what Nicole has said), a GoPiGo3 should not need a firmware update, unless they’re trying to do something with Bullseye, and then that’s a bogus error.

I really want to know what the base problem is that makes @prideaux74 think he needs a firmware update. . . .


Maybe because it is well over 4 years old? His GoPiGo3.get_firmware_version() is returning version 0.3.4:


What O/S?

That’s the reply given when someone tries Bullseye.

In any event, I want to know what he was trying to do, with what, and which version of the Pi, (and memory size if a Pi-4), before we start talking “firmware updates” as we know that Pi-4 firmware updates are problematic.

If, in fact, he really DOES need a firmware update, he should do it with a Pi-3.


He said it is some version of Buster, not Bullseye:


@jimrh , He stated Pi3 was not avail so he bought Pi4:

If ModRobotics software won’t update using Pi4, perhaps they will send him a new red board with the 1.0 firmware already installed. We’ll have to wait to hear what support tells him.



I checked and you are right.

The scalpers have cornered the market and the “$35 computer” is now a “$335 computer”.



On this.
The Pi4 should now be able to do a firmware update. We are investigating.


(You are in good hands with @cleoqc )

While all is ongoing, if you get a chance could you post the results of the following:

  • What Processor are you using?
cat /proc/cpuinfo | grep "Model"
  • What OS are you running:
cat /etc/os-release
  • What kernel:
uname -a
  • What version of Python is default:
python --version
  • What is the result of running:
python /home/pi/Dexter/GoPiGo3/Software/Python/Examples/Read_Info.py
  • What version of GoPiGo3 software installed:
find /usr/local/lib/ egg | grep gopigo3
  • What battery or batteries are you using?

  • Did you have a Pi4 Power Supply connected to the Raspberry Pi 4 during the firmware update attempt?


Firmware flashing with the Pi4 is newly supported. There may still be some issues.

Can you tell me what happens when you do the following?

cd ~/Dexter/GoPiGo3/Firmware
sudo openocd -f rpi4-sysfsgpio.cfg -c "transport select swd; set CHIPNAME at91samc20j18; source [find target/at91samdXX.cfg]; adapter srst delay 100; adapter srst pulse_width 100" -c "init; targets; reset halt; program  GoPiGo3_Firmware_1.0.0.bin verify; reset" -c "shutdown"

I would appreciate getting the full output from this command. Thank you.



After some investigation on my side, my test jig - which works - uses a newer version of openocd:

pi@GoPiGo:~/Dexter/GoPiGo3/Firmware $ openocd -v
Open On-Chip Debugger 0.11.0+dev-00562-g5ab74bde0 (2022-02-11-15:08)

Yours seems to be:

0.10.0-dev (2016-12-16-18:07)

Can you upgrade your openOCD and try the command in my previous post, just above? From 2016 to 2022 - that’s a huge gap.

Thank you.


Good find!  :+1:

Care to share instructions for those of us who may not know exactly how to do that?  Should a plain-vanilla sudo apt-get update and sudo apt-get upgrade fix it?

1 Like

Stepping into what I don’t actually know about here…

The GoPiGo3 install downloads openocd v 0.10.0-dev 2016 and copies the binary to /usr/bin/openocd, so you cannot just do an update and upgrade, or even an apt update.

  1. verify it is not “apt installed” with dpkg -l | grep openocd

  2. verify it is present with:
    $ openocd

  3. Suggest saving the v 0.10 version

sudo cp /usr/bin/openocd /usr/bin/openocd.gopigo
  1. Then install the latest version - 0.11.0-rc2 with:
sudo apt install openocd

This will overwrite /usr/bin/openocd with the latest
(for the gopigo_update_firmware script or the command @cleoqc asked to try)

To return to the GoPiGo3 installed version:

  1. sudo apt purge openocd
  2. sudo cp /usr/bin/openocd.gopigo /usr/bin/openocd

Just an update from my side! I was out of town for a little while unfortunately.

Dexter Industries got in touch with me and gave me the following instructions, due to an issue with the pi4 version:

  1. sudo apt install libgpiod-dev libgpiod2 python3-libgpiod
  2. git clone https://github.com/openocd-org/openocd.git
  3. cd openocd
  4. ./bootstrap
  5. ./configure --enable-sysfsgpio --enable-bcm2835gpio
  6. sudo make install

In order to make this work I had to install libtool (which wasn’t preinstalled on Raspian):
sudo apt install libtool

After installing libtool and following their instructions I tried to flash the firmware for the gopigo3 and it seems to have worked!

However, when I write a simple script to test it out, the script runs to completion with no errors and the robot itself is unresponsive. I’ve followed up with them on this. If I find a resolution I’ll post it here in hopes of helping whoever next runs across this issue.

A side note on why pi4 instead of pi3:
My old pi3b+ finally died and I decided to upgrade it since the pi3 is discontinued. I don’t want to wipe it and install DexterOS since I already have it running a few bunch of containers for a few different things and don’t want to have to set it up from scratch all over again. I hope that makes sense! :slight_smile:



I was researching this for a while now, and you have provided valuable feedback.  When I get back to researching this, I will try what you suggested.

Thanks again for the feedback!