Troubles uploading firmware to mutable instruments grids

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: Kent, Joe., luketeaford, lisa

baszor
Learning to Wiggle
Posts: 11
Joined: Sat Oct 27, 2018 4:25 pm
Location: Utrecht

Troubles uploading firmware to mutable instruments grids

Post by baszor » Mon Nov 04, 2019 5:32 pm

Hi guy's,

I've build a lot of st32 driven modules and was able to flash the chips with the st-link/v2 adapter.

Grids makes use of the mega328P chip and I try to use an arduino uno to flash.

I'm able to start the flashing process now after solving some USB access issues by Virtualbox running on OSX.
But i still get error's. Especially on the efuse flashing and in the end i get the error the programmer is not responding.

Does anybody have a clue what's going on here?
Or is only the bootloader and main part needed to pass? See the log below:

vagrant@vagrant-ubuntu-trusty-64:/vagrant/eurorack-modules$ sudo make -f grids/makefile bootstrap_all
make -f grids/makefile
make[1]: Entering directory `/vagrant/eurorack-modules'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/vagrant/eurorack-modules'
make -f grids/bootloader/makefile
make[1]: Entering directory `/vagrant/eurorack-modules'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/vagrant/eurorack-modules'
make -f grids/bootloader/makefile fuses
make[1]: Entering directory `/vagrant/eurorack-modules'
/usr/local/CrossPack-AVR/bin/avrdude -V -p m328p -c arduino -P /dev/ttyACM0 -B 10 -e -u \
-U efuse:w:0x05:m \
-U hfuse:w:0xd8:m \
-U lfuse:w:0xff:m \
-U lock:w:0x2f:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: erasing chip
avrdude: reading input file "0x05"
avrdude: writing efuse (1 bytes):

Writing | | 0% 0.00s ***failed;
Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of efuse written
avrdude: reading input file "0xd8"
avrdude: writing hfuse (1 bytes):

Writing | | 0% 0.00s ***failed;
Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of hfuse written
avrdude: reading input file "0xff"
avrdude: writing lfuse (1 bytes):

Writing | | 0% 0.00s ***failed;
Writing | ################################################## | 100% 0.06s

avrdude: 1 bytes of lfuse written
avrdude: reading input file "0x2f"
avrdude: writing lock (1 bytes):

Writing | | 0% 0.00s ***failed;
Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of lock written

avrdude done. Thank you.

make[1]: Leaving directory `/vagrant/eurorack-modules'
/usr/local/CrossPack-AVR/bin/avrdude -B 1 -V -p m328p -c arduino -P /dev/ttyACM0 \
-U flash:w:build/grids/grids.hex:i \
-U flash:w:build/grids_bootloader/grids_bootloader.hex:i \
-U lock:w:0x2f:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "build/grids/grids.hex"
avrdude: writing flash (12278 bytes):

Writing | ################################################## | 100% 2.36s

avrdude: 12278 bytes of flash written
avrdude: reading input file "build/grids_bootloader/grids_bootloader.hex"
avrdude: writing flash (31278 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: stk500_recv(): programmer is not responding
make: *** [bootstrap_all] Error 1

User avatar
djthopa
Super Deluxe Wiggler
Posts: 1863
Joined: Thu Mar 22, 2012 5:48 pm
Location: Somewhere between a nappy and a wire

Post by djthopa » Mon Nov 04, 2019 5:50 pm

Hope this helps, cant guarantee but i seem to remember doing this:

make -f grids/bootloader/makefile hex

make -f grids/makefile

make -f grids/makefile upload

make -f grids/makefile bake

make -f braids/makefile upload

baszor
Learning to Wiggle
Posts: 11
Joined: Sat Oct 27, 2018 4:25 pm
Location: Utrecht

Post by baszor » Mon Nov 04, 2019 6:30 pm

djthopa wrote:Hope this helps, cant guarantee but i seem to remember doing this:

make -f grids/bootloader/makefile hex

make -f grids/makefile

make -f grids/makefile upload

make -f grids/makefile bake

make -f braids/makefile upload
thanks ... but that didn't help... :despair: especially the braids part :hihi:

User avatar
djthopa
Super Deluxe Wiggler
Posts: 1863
Joined: Thu Mar 22, 2012 5:48 pm
Location: Somewhere between a nappy and a wire

Post by djthopa » Mon Nov 04, 2019 6:40 pm

baszor wrote:
djthopa wrote:Hope this helps, cant guarantee but i seem to remember doing this:

make -f grids/bootloader/makefile hex

make -f grids/makefile

make -f grids/makefile upload

make -f grids/makefile bake

make -f braids/makefile upload
thanks ... but that didn't help... :despair: especially the braids part :hihi:
Oh shite!

I do recall the bake bit!

Good luck :tu:

baszor
Learning to Wiggle
Posts: 11
Joined: Sat Oct 27, 2018 4:25 pm
Location: Utrecht

Post by baszor » Mon Nov 04, 2019 7:23 pm

If you take a look at the log, the fuses are written at the 2nd try, the grids.hex passes, but the writing of the bootloader.hex passes/fails? Also the lock bits are not written....

User avatar
col
Veteran Wiggler
Posts: 552
Joined: Tue Feb 04, 2014 3:47 pm
Location: Melbourne

Post by col » Mon Nov 04, 2019 8:43 pm

My notes on flashing a uGrids via Vagrant:

avrdude -V -p atmega328p -c usbasp -P usb -B 10 -e -u -U efuse:w:0x0f:m -U hfuse:w:0xd8:m -U lfuse:w:0xff:m -U lock:w:0x2f:m


avrdude -V -p atmega328p -c usbasp -P usb -B 10 -U flash:w:grids.hex

User avatar
Altitude909
Super Deluxe Wiggler
Posts: 3542
Joined: Wed Aug 24, 2011 5:13 pm
Location: Meesheegan

Post by Altitude909 » Mon Nov 04, 2019 9:09 pm

I'd say the device your flashing with is causing the issues. The codes running, but the programmer is hanging up

User avatar
col
Veteran Wiggler
Posts: 552
Joined: Tue Feb 04, 2014 3:47 pm
Location: Melbourne

Post by col » Mon Nov 04, 2019 9:56 pm

what comes up if you run lsusb ?

It should list the programing device then you can run the commands directly and see whats going on.

baszor
Learning to Wiggle
Posts: 11
Joined: Sat Oct 27, 2018 4:25 pm
Location: Utrecht

Post by baszor » Tue Nov 05, 2019 9:29 am

col wrote:what comes up if you run lsusb ?

It should list the programing device then you can run the commands directly and see whats going on.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 2341:0001 Arduino SA Uno (CDC ACM)
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

and when I run dmesg i get:

[ 48.879325] usb 2-1: new full-speed USB device number 2 using ohci-pci
[ 49.187287] usb 2-1: New USB device found, idVendor=2341, idProduct=0001
[ 49.187300] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 49.187310] usb 2-1: Product: Arduino Uno
[ 49.187320] usb 2-1: Manufacturer: Arduino (www.arduino.cc)
[ 49.187329] usb 2-1: SerialNumber: 6493534313335121A061
[ 49.196113] cdc_acm 2-1:1.0: ttyACM0: USB ACM device
[ 49.208786] usbcore: registered new interface driver cdc_acm
[ 49.208790] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

So I can program at /dev/ttyACM0?


[EDIT] "The weirdest thing is that if I remove some leads from the arduino to the grids board the same communication happens... maybe i'm communicating with the arduino instead of the grids boards :eek:
I just ordered a cheap USBavr programmer. Will continue when the thing has been delivered..."

baszor
Learning to Wiggle
Posts: 11
Joined: Sat Oct 27, 2018 4:25 pm
Location: Utrecht

Post by baszor » Wed Nov 06, 2019 9:51 am

col wrote:My notes on flashing a uGrids via Vagrant:

avrdude -V -p atmega328p -c usbasp -P usb -B 10 -e -u -U efuse:w:0x0f:m -U hfuse:w:0xd8:m -U lfuse:w:0xff:m -U lock:w:0x2f:m


avrdude -V -p atmega328p -c usbasp -P usb -B 10 -U flash:w:grids.hex
... how do i program the bootloader? with what command?

User avatar
slo
Common Wiggler
Posts: 56
Joined: Wed Jun 03, 2009 9:27 am
Location: Victoria

Post by slo » Wed Nov 06, 2019 11:18 am

I had all kinds of trouble with my Uno’s, I was trying to use them as an ISP.
Finally I flashed Optiboot bootloader and then they worked.
http://www.gammon.com.au/bootloader

baszor
Learning to Wiggle
Posts: 11
Joined: Sat Oct 27, 2018 4:25 pm
Location: Utrecht

Post by baszor » Wed Nov 06, 2019 2:56 pm

Solved the issue in a VM with windows... after installing the arduino IDE there, flashing went perfect with avrdude (could even use the gui version avrdudess)
copied the hex files to windows, wrote them and the fuses. And off we were.
Thanks for the support!

User avatar
col
Veteran Wiggler
Posts: 552
Joined: Tue Feb 04, 2014 3:47 pm
Location: Melbourne

Post by col » Wed Nov 06, 2019 3:02 pm

baszor wrote:
col wrote:My notes on flashing a uGrids via Vagrant:

avrdude -V -p atmega328p -c usbasp -P usb -B 10 -e -u -U efuse:w:0x0f:m -U hfuse:w:0xd8:m -U lfuse:w:0xff:m -U lock:w:0x2f:m


avrdude -V -p atmega328p -c usbasp -P usb -B 10 -U flash:w:grids.hex
... how do i program the bootloader? with what command?
I don't think mine used one, I thought it was combined in the grids.hex. If your "make" generated one then you would use:

avrdude -V -p atmega328p -c usbasp -P usb -B 10 -U flash:w:grids_bootloader.hex

baszor
Learning to Wiggle
Posts: 11
Joined: Sat Oct 27, 2018 4:25 pm
Location: Utrecht

Post by baszor » Thu Nov 07, 2019 9:39 am

Ready to go! thanks for the help guy's!

Image

PabloSrNaranja
Learning to Wiggle
Posts: 38
Joined: Sun Dec 29, 2019 3:07 pm

Re: Troubles uploading firmware to mutable instruments grids

Post by PabloSrNaranja » Fri Jun 05, 2020 2:58 am

Hi! Did anyone have a Grids .hex bootloader? Will be apreciated.

User avatar
EATyourGUITAR
has no life
Posts: 5798
Joined: Tue Aug 31, 2010 12:24 am
Location: Providence, RI, USA

Re: Troubles uploading firmware to mutable instruments grids

Post by EATyourGUITAR » Fri Jun 05, 2020 9:24 am

bootloader is not the same thing as firmware. maybe you are asking for the wrong thing?
WWW.EATYOURGUITAR.COM <---- MY DIY STUFF

User avatar
batchas
Super Deluxe Wiggler
Posts: 4801
Joined: Wed Nov 09, 2011 2:51 pm

Re: Troubles uploading firmware to mutable instruments grids

Post by batchas » Sat Jun 06, 2020 1:16 am

PabloSrNaranja wrote:
Fri Jun 05, 2020 2:58 am
Hi! Did anyone have a Grids .hex bootloader? Will be apreciated.
You do not have the required permissions to view the files attached to this post.
-----------------------------------
FS: KESAKO Player & Reverb for Serge and Buchla

PabloSrNaranja
Learning to Wiggle
Posts: 38
Joined: Sun Dec 29, 2019 3:07 pm

Re: Troubles uploading firmware to mutable instruments grids

Post by PabloSrNaranja » Tue Jun 09, 2020 3:38 pm

batchas wrote:
Sat Jun 06, 2020 1:16 am
PabloSrNaranja wrote:
Fri Jun 05, 2020 2:58 am
Hi! Did anyone have a Grids .hex bootloader? Will be apreciated.
Ohh, thanks so much! :yay:

PabloSrNaranja
Learning to Wiggle
Posts: 38
Joined: Sun Dec 29, 2019 3:07 pm

Re: Troubles uploading firmware to mutable instruments grids

Post by PabloSrNaranja » Sun Jun 28, 2020 12:33 pm

EATyourGUITAR wrote:
Fri Jun 05, 2020 9:24 am
bootloader is not the same thing as firmware. maybe you are asking for the wrong thing?
Hi, its possible. I assume that I need the grids.hex and the grids_bootloder.hex.

First I try to program the bootloader and I get this:

Can anyone guide me out? Thanks in advance

>>>: avrdude -u -c usbasp -p m328p -P COM1 -B 0.5 -U lfuse:w:0xff:m -U hfuse:w:0xd8:m -U efuse:w:0xff:m -U lock:w:0x2F:m -U flash:w:"\\192.168.1.67\home\Dropbox\DIY PROYECTOS\SMD2\1.- Grid\grids HEX\grids_bootloader-MI.hex":a

avrdude.exe: set SCK frequency to 1500000 Hz
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude.exe: Device signature = 0x1e950f (probably m328p)
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: set SCK frequency to 1500000 Hz
avrdude.exe: reading input file "0xff"
avrdude.exe: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude.exe: 1 bytes of lfuse written
avrdude.exe: verifying lfuse memory against 0xff:
avrdude.exe: load data lfuse data from input file 0xff:
avrdude.exe: input file 0xff contains 1 bytes
avrdude.exe: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude.exe: verifying ...
avrdude.exe: 1 bytes of lfuse verified
avrdude.exe: reading input file "0xd8"
avrdude.exe: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude.exe: 1 bytes of hfuse written
avrdude.exe: verifying hfuse memory against 0xd8:
avrdude.exe: load data hfuse data from input file 0xd8:
avrdude.exe: input file 0xd8 contains 1 bytes
avrdude.exe: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude.exe: verifying ...
avrdude.exe: 1 bytes of hfuse verified
avrdude.exe: reading input file "0xff"
avrdude.exe: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude.exe: 1 bytes of efuse written
avrdude.exe: verifying efuse memory against 0xff:
avrdude.exe: load data efuse data from input file 0xff:
avrdude.exe: input file 0xff contains 1 bytes
avrdude.exe: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s

avrdude.exe: verifying ...
avrdude.exe: 1 bytes of efuse verified
avrdude.exe: reading input file "0x2F"
avrdude.exe: writing lock (1 bytes):

Writing | ***failed;
################################################## | 100% 0.04s

avrdude.exe: 1 bytes of lock written
avrdude.exe: verifying lock memory against 0x2F:
avrdude.exe: load data lock data from input file 0x2F:
avrdude.exe: input file 0x2F contains 1 bytes
avrdude.exe: reading on-chip lock data:

Reading | ################################################## | 100% 0.00s

avrdude.exe: verifying ...
avrdude.exe: verification error, first mismatch at byte 0x0000
0xef != 0x2f
avrdude.exe: verification error; content mismatch

avrdude.exe done. Thank you.
You do not have the required permissions to view the files attached to this post.

User avatar
EATyourGUITAR
has no life
Posts: 5798
Joined: Tue Aug 31, 2010 12:24 am
Location: Providence, RI, USA

Re: Troubles uploading firmware to mutable instruments grids

Post by EATyourGUITAR » Sun Jun 28, 2020 3:44 pm

WWW.EATYOURGUITAR.COM <---- MY DIY STUFF

PabloSrNaranja
Learning to Wiggle
Posts: 38
Joined: Sun Dec 29, 2019 3:07 pm

Re: Troubles uploading firmware to mutable instruments grids

Post by PabloSrNaranja » Mon Jun 29, 2020 6:17 am

EATyourGUITAR wrote:
Sun Jun 28, 2020 3:44 pm
This is why
https://forum.arduino.cc/index.php?topic=535617.0
Thanks for the answer! I use USBASP but no USBtiny or Arduino. Still applyes?
After including i get this:

>>>: avrdude
grids_bootloader-MI.hex: 2.606 / 32.768 Bytes (7,95%)
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
>>>: avrdude -u -c usbasp -p m328p -P COM1 -B 0.5 -U lfuse:w:0xff:m -U hfuse:w:0xd8:m -U efuse:w:0xff:m -U lock:w:0x2F:m -U flash:w:"\\192.168.1.67\home\Dropbox\DIY PROYECTOS\SMD2\1.- Grid\grids HEX\grids_bootloader-MI.hex":a

avrdude.exe: set SCK frequency to 1500000 Hz
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% -0.00s

avrdude.exe: Device signature = 0x1e950f (probably m328p)
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: set SCK frequency to 1500000 Hz
avrdude.exe: reading input file "0xff"
avrdude.exe: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude.exe: 1 bytes of lfuse written
avrdude.exe: verifying lfuse memory against 0xff:
avrdude.exe: load data lfuse data from input file 0xff:
avrdude.exe: input file 0xff contains 1 bytes
avrdude.exe: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude.exe: verifying ...
avrdude.exe: 1 bytes of lfuse verified
avrdude.exe: reading input file "0xd8"
avrdude.exe: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude.exe: 1 bytes of hfuse written
avrdude.exe: verifying hfuse memory against 0xd8:
avrdude.exe: load data hfuse data from input file 0xd8:
avrdude.exe: input file 0xd8 contains 1 bytes
avrdude.exe: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude.exe: verifying ...
avrdude.exe: 1 bytes of hfuse verified
avrdude.exe: reading input file "0xff"
avrdude.exe: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude.exe: 1 bytes of efuse written
avrdude.exe: verifying efuse memory against 0xff:
avrdude.exe: load data efuse data from input file 0xff:
avrdude.exe: input file 0xff contains 1 bytes
avrdude.exe: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s

avrdude.exe: verifying ...
avrdude.exe: 1 bytes of efuse verified
avrdude.exe: reading input file "0x2F"
avrdude.exe: writing lock (1 bytes):

Writing | ***failed;
################################################## | 100% 0.09s

avrdude.exe: 1 bytes of lock written
avrdude.exe: verifying lock memory against 0x2F:
avrdude.exe: load data lock data from input file 0x2F:
avrdude.exe: input file 0x2F contains 1 bytes
avrdude.exe: reading on-chip lock data:

Reading | ################################################## | 100% -0.00s

avrdude.exe: verifying ...
avrdude.exe: verification error, first mismatch at byte 0x0000
0xef != 0x2f
avrdude.exe: verification error; content mismatch

avrdude.exe done. Thank you.

Thanks!!
You do not have the required permissions to view the files attached to this post.

User avatar
EATyourGUITAR
has no life
Posts: 5798
Joined: Tue Aug 31, 2010 12:24 am
Location: Providence, RI, USA

Re: Troubles uploading firmware to mutable instruments grids

Post by EATyourGUITAR » Mon Jun 29, 2020 6:55 am

PabloSrNaranja wrote:
Sun Jun 28, 2020 12:33 pm
First I try to program the bootloader and I get this:

Can anyone guide me out? Thanks in advance
this thread is about programming the grids firmware using an arduino uno. please post a link or a picture so I can see what hardware you have for programming.

for example, the command line for AVRDUDE will have different options depending if you used this
https://www.microchip.com/DevelopmentTo ... /ATAVRISP2

or this
https://www.arduino.cc/en/Main/arduinoBoardDuemilanove

or this
https://store.arduino.cc/usa/arduino-uno-smd-rev3

I don't know what you are using so I can't say if it is correct.
WWW.EATYOURGUITAR.COM <---- MY DIY STUFF

PabloSrNaranja
Learning to Wiggle
Posts: 38
Joined: Sun Dec 29, 2019 3:07 pm

Re: Troubles uploading firmware to mutable instruments grids

Post by PabloSrNaranja » Mon Jun 29, 2020 1:36 pm

ok, sorry for the confusion. I´m trying to use an USBASP device like the one in the photo, more info is here: https://www.fischl.de/usbasp/

Thanks in advance.
You do not have the required permissions to view the files attached to this post.

User avatar
EATyourGUITAR
has no life
Posts: 5798
Joined: Tue Aug 31, 2010 12:24 am
Location: Providence, RI, USA

Re: Troubles uploading firmware to mutable instruments grids

Post by EATyourGUITAR » Mon Jun 29, 2020 2:48 pm

Ok I think I know what it is now. Usbasp is ok. The problem is that you can not set some fuses (lock bits) without first doing a chip erase. There is a possibility that the lock bit will write but not report the status correctly. I think this must be more rare. Start with a chip erase command in AVRDUDE. Take the build script apart. You do not need to write the locks bits every time you flash. That will generate more errors. Feed the commands in one at a time. Make sure you are flashing the bootloader. AVRdude must be 5.2 or newer.

See here
https://www.avrfreaks.net/forum/avrdude ... -lock-bits
WWW.EATYOURGUITAR.COM <---- MY DIY STUFF

PabloSrNaranja
Learning to Wiggle
Posts: 38
Joined: Sun Dec 29, 2019 3:07 pm

Re: Troubles uploading firmware to mutable instruments grids

Post by PabloSrNaranja » Tue Jun 30, 2020 3:56 am

EATyourGUITAR wrote:
Mon Jun 29, 2020 2:48 pm
Ok I think I know what it is now. Usbasp is ok. The problem is that you can not set some fuses (lock bits) without first doing a chip erase. There is a possibility that the lock bit will write but not report the status correctly. I think this must be more rare. Start with a chip erase command in AVRDUDE. Take the build script apart. You do not need to write the locks bits every time you flash. That will generate more errors. Feed the commands in one at a time. Make sure you are flashing the bootloader. AVRdude must be 5.2 or newer.

See here
https://www.avrfreaks.net/forum/avrdude ... -lock-bits
Now it uploads, except for the lock bit, it works but not the first channel, also the clock is slow. I will test with patience.
Thanks a lot I will get back if I cant make it work :yay:

Post Reply

Return to “Music Tech DIY”