Cheers jimrh, thanks for the reply!
The multi_installer.sh script can be found here.
The relevant part for me is this line, which in this case uses address 3:
sudo avrdude -c gpio -p m328p -U flash:w:grove_pi_v1_2_2_addr3.cpp.hex
Here the file grove_pi_v1_2_2_addr3.cpp.hex is used. The exact file can be found on the same github page linked above. So far I was unable to actually understand the file, since I don’t know how to de-hex it.
But I was able to find this:
Using the GNU “diff” tool I learned that the only difference between two of those cpp.hex files is one line, for example:
diff grove_pi_v1_2_2_addr3.cpp.hex grove_pi_v1_2_2_addr4.cpp.hex
addr3 :100F200084EB92E00E944A1663E070E087EE91E065
addr4 :100F200084EB92E00E944A1664E070E087EE91E064
(Output slightly adjusted for readability, the relevant parts have been marked with bold font)
Some googling led me to this site, where I learnt that the format presumably is:
[:][Byte Count][Address][Record Type][Data][Checksum]
So for the strings above this gives me:
addr3 [:] [10] [0F20] [00] [84EB 92E0 0E94 4A16 63E0 70E0 87EE 91E0] [65]
addr4 [:] [10] [0F20] [00] [84EB 92E0 0E94 4A16 64E0 70E0 87EE 91E0] [64]
The same is true for all the other cpp.hex files - when the address goes up, that one digit on the left goes up and the last digit in the checksum is reduced by one. From this I conclude that I could just copy the file, adjust this one line and the script and it should work.
For address 8 and 9 for example, the lines would be:
addr8 [:] [10] [0F20] [00] [84EB 92E0 0E94 4A16 68E0 70E0 87EE 91E0] [60]
addr8 [:] [10] [0F20] [00] [84EB 92E0 0E94 4A16 69E0 70E0 87EE 91E0] [5F]
(obviously without the additional formatting)
Now I haven’t tested it yet, I am kinda afraid after all that this is horribly stupid.
Any thoughts?