[SOLVED] Updating firmware for GrovePi+ on bullseye 64-bit OS && Changing GrovePi+ i2c address

I am having trouble flashing firmware onto the GrovePi+ on the latest version of Raspberry Pi OS ‘bullseye’ 64-Bit. The error occurs when the script calls the avrdude package using the -c gpio. This programmer ‘gpio’ is not a valid programmer on avrdude 6.1 → 7.1. Alternative gpio programmers ‘linuxgpio’ and ‘linuxspi’ are also not working. So i am wondering where i can get the gpio programmer that is declared in the installer.sh file, or what version of avrdude has that programmer.

For context, I am trying to change the i^2c address of my GrovePi+ from 0x04 to 0x08 as the latest version of Raspberry Pi OS has 0x04 marked as a reserved address so my idea was to use the multi_installer.sh to change the address to an unrestricted address but i am unable to flash the firmware with the new address due to this problem i am having with a working programmer.

Update, i solved the issue:
1./ Need to fix bug in avrdude (if avrdude -version == 6.3):
$ cd
$ sudo apt remove avrdude
$ sudo apt-get install build-essential flex bison gcc libusb-dev putty
$ sudo apt-get install libftdi-dev libhidapi-dev libpthread-stubs0-dev libelf-dev
$ wget http://download.savannah.gnu.org/releases/avrdude/avrdude-6.1.tar.gz
$ tar xvzf avrdude-6.1.tar.gz
$ cd avrdude-6.1
$ sudo nano linuxgpio.c
$ use ‘Ctrl’ ‘W’ to find every instance of ‘%ud’ and change to ‘%u’
$ then ‘Ctrl’ ‘S’ to save and then exit
$./configure --enable-linuxgpio
if not working run sudo apt install automake then try again
$ make
$ sudo make install
$ cd /usr/local/etc/
$ sudo nano avrdude.conf

1.1/ Or build avrdude from source(github)
if already installed run $ sudo apt remove avrdude
$ sudo apt-get install build-essential git cmake flex bison libelf-dev $ $ $ libusb-dev libhidapi-dev libftdi1-dev libreadline-dev
$ git clone GitHub - avrdudes/avrdude: AVRDUDE is a utility to program AVR microcontrollers
$ cd avrdude
$ ./build.sh
$ cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -D HAVE_LINUXGPIO=1 -D HAVE_LINUXSPI=1 -B build_linux
$ cmake --build build_linux
$ sudo cmake --build build_linux --target install
$ cd /usr/local/etc/
$ sudo nano avrdude.conf

2./ In nano use ‘Ctrl’ ‘W’ to search for linuxgpio and remove the # of the code:
programmer
id = “linuxgpio”;
desc = “Use the Linux sysfs interface to bitbang GPIO lines”;
type = “linuxgpio”;
reset = 22 #it is default pin 8 on the board but was busy
sck = 11
mosi/sdo = 10
miso/sdi = 9
;
2.5/ Connect the 4 SPI pins to the GrovePi’s SPI headers (may need to solder)
and attach the 5V and 3V and GND pins on Raspi GPIO to GrovePi GPIO

3./ Test the pins using the following command before flashing the software:
$ sudo apt install gpiod
$ sudo avrdude -p m328p -c linuxgpio -v
if pin busy use:
$ sudo gpioinfo gpiochip0
change pin to a not busy pin, in my case pin 8 was busy

4./ Flash the OS onto the GrovePi+
$ cd ~/Dexter/GrovePi/Script/multi_grovepi_installer
$ sudo nano multi_installer.sh
change the avrdude line to use linuxgpio instead of gpio
$ sudo chmod +x multi_installer.sh
$ sudo ./multi_installer.sh

5./ Check if the i2c name has change:
reconnect the GrovePi to the GPIO header
$ i2cdetect -y 1
should return the list with 08 showing

2 Likes

sidenote: in order to use linuxgpio i found building the latest version from github was working, i did not attempt to use v6.1-> v6.3 as they dont support gpiod

2 Likes