Welcome! Log In Create A New Profile

Advanced

backup installed firmware?

Posted by Adrian 
backup installed firmware?
May 25, 2011 12:24PM
Hello,
I would like to backup the installed firmware on my gen 6 controller before updating to te latest version, does anyone know te steps to do this via the arduino software?
I have the arduino software & sanguino files installed and there is communication between my computer and the Gen6 controller, I just don't know how to use the interface.

I found this command on the Gen6 reprap wiki but I don't know how to implement it:
avrdude -c avrisp -b 38400 -i 10 -p m644p -P /dev/ttyUSB0 -F -U flash:r:factory_gen6.hex:i

FYI Mac version of Arduino software 0022

Thanks for any help!
Re: backup installed firmware?
May 26, 2011 12:03AM
Arduino IDE comes with avrdude, so you can use this. Find the file "avrdude" inside the package, go to the terminal and change directory there. Then use a command looking like this:
./avrdude -C ./avrdude.conf -c avrisp -b 38400 -i 10 -p m644p -P /dev/tty.usbserial- -F -U flash:r:factory_gen6.hex:i


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: backup installed firmware?
May 27, 2011 11:13AM
Thanks Traumflug
Re: backup installed firmware?
July 02, 2011 02:41PM
Stephen Lane wrote:
hi guys I've had a play with the avrdude program to backup the firmware on my Huxley before I fiddle with it but I can't get it to connect (avrdude that is the printer works as a printer OK it just needs some XYZ calibration but I want a fall back incase I stuff it up)
I'm running
Windows 7
Huxley Techzone Kit
Com6
I think I am missing something in the connection as a programmer part, the arduino IDE see's the COM 6 port so I think I would be able to write to the microcontroller but I can't read back from it

I have used the following command line string and all the syntax looks like it should work from reading the config file and the manual so any help would be appreciated.

avrdude -c arduino -b 19200 -i 10 -p m644p -P com6 -F -U flash:r:factory_gen5.hex:i & it comes back with a obscure message about the stk500 programmer not being in sync ????

Thanks in advance
Regards
Stephen

Adrian Wrote:
-------------------------------------------------------
> Hello,
> I would like to backup the installed firmware on
> my gen 6 controller before updating to te latest
> version, does anyone know te steps to do this via
> the arduino software?
> I have the arduino software & sanguino files
> installed and there is communication between my
> computer and the Gen6 controller, I just don't
> know how to use the interface.
>
> I found this command on the Gen6 reprap wiki but I
> don't know how to implement it:
> avrdude -c avrisp -b 38400 -i 10 -p m644p -P
> /dev/ttyUSB0 -F -U flash:r:factory_gen6.hex:i
>
> FYI Mac version of Arduino software 0022
>
> Thanks for any help!
Re: backup installed firmware?
July 03, 2011 11:15AM
Stephen Lane wrote:
OK after significant searching the forums the error message appears to be related to the baud rate hence for giggles I doubled the baud rate to 38400 and wo ho the string
avrdude -p m644p -P com4 -c arduino -b 38400 -F -U flash:r:factory_gen5.hex:i
resulted in a good read of the flash memory of the monotronics board so now I have a copy of the firmware backed up before I play with it.
So hopefully this hint will help others

Regards
Stephen
Re: backup installed firmware?
July 04, 2011 04:30AM
Stephen Lane wrote a bit more
I forgot to mention that avrdude run from the command line seems to have a problem finding any com port above 4 which is why the string has com4 not com6 in it.
But when you use the Arduino IDE to (022) update the firmware it appears to use avrdude to upload the file & has no problems with com6, go figure.
Anyway it appears to work now so I hope this helps

Regards
Stephen
tjo
Re: backup installed firmware?
October 19, 2012 08:17AM
This is what i did to backup my GEN6 electronics

1. make sure FTDI drivers are installed
2. take note of the correct com port (subsitute COM5 with your com port)
3. use the following command but press the REST button immediately after running the command (VERY IMPORTANT)

avrdude -c stk500v1 -b 38400 -i 10 -p m644p -P COM5 -F -U flash:r:factory_gen6.hex:i

i find if you dont press reset i get the sync error, took me days to find out why
Re: backup installed firmware?
January 13, 2015 03:59AM
Reviving this very old subject...

I'm trying to backup the firmware currently on my MakerFarm Prusa i3. I'm using the following command:

avrdude.exe -C ..\etc\avrdude.conf -p m1280 -c avrisp -i 10 -P com6 -U flash:ryawning smileyriginal-firmware.hex:i
Note: There's a colon followed by o in the command above, don't know how stop it from turning into a smiley...


I'm getting the following error:

avrdude.exe: stk500_getsync(): not in sync: resp=0x00

There's a tip here about pressing the reset button, but can I actually access it? It's burried below the RAMPS.
Note: I also tried without the '-i', with the '-F', and higher baud rates (I'm using 250000 on Pronterface, so tried that too).

Please advise ;-)
Re: backup installed firmware?
January 25, 2015 03:00PM
For completeness - I couldn't backup the firmware, but there's a reset button on the side of the RAMPS.
RNJ
Re: backup installed firmware?
December 27, 2015 06:26PM
I found this solution with the help of this* blog from KarlP:
*[false.ekta.is]


0.For Firmware Backup and Reset goto the arduino folder where avrdude.exe is located and copy avrdude.conf (located within the arduino folder) to the same directory.

1. in cmd go to that folder (something like cd "C:\program files\Arduino\hardware\tools\avr\bin") and type the following line (without running it!)

for backup:
avrdude -p atmega2560 -P com17 -c stk500v2 -b115200 -F -U flash:w:factory_firmware.hex:i

for restore (the -D option is to skip erasing before programming):
avrdude -p atmega2560 -P com17 -c stk500v2 -b115200 -F -D -U flash:w:factory_firmware.hex:i

replace factory_firmware.hex with the your desired filename and com17 with your com port

2. now hold the reset button on the mega board and release it simultaneously with executing the avrdude command line (else you will get a timeout error)

I hope this helps sombody someday...
Re: backup installed firmware?
December 27, 2015 08:53PM
the "-c avrisp" above says you are trying to use a avrisp, ie a sperate hardware programmer

The boot loader baud rate is compleatly seperate to what ever baud rate your printer normally talks at (different programs)
Re: backup installed firmware?
March 25, 2016 06:13PM
Quote
RNJ
I found this solution with the help of this* blog from KarlP:
*[false.ekta.is]


0.For Firmware Backup and Reset goto the arduino folder where avrdude.exe is located and copy avrdude.conf (located within the arduino folder) to the same directory.

1. in cmd go to that folder (something like cd "C:\program files\Arduino\hardware\tools\avr\bin") and type the following line (without running it!)

for backup:
avrdude -p atmega2560 -P com17 -c stk500v2 -b115200 -F -U flash:w:factory_firmware.hex:i

for restore (the -D option is to skip erasing before programming):
avrdude -p atmega2560 -P com17 -c stk500v2 -b115200 -F -D -U flash:w:factory_firmware.hex:i

replace factory_firmware.hex with the your desired filename and com17 with your com port

2. now hold the reset button on the mega board and release it simultaneously with executing the avrdude command line (else you will get a timeout error)

I hope this helps sombody someday...

Hi RNG,

Shouldn't it be "-U flash:r" to read from Arduino (backup) and "-U flash:w" to write to Arduino (restore)?
Re: backup installed firmware?
May 13, 2017 11:07PM
You say to "replace factory_firmware.hex with the your desired filename and com17 with your com port"

How do you know the name of the hex file that is on the board?
Re: backup installed firmware?
December 03, 2017 11:17AM
Just went through a couple of days trying to get my cheap chinese made GT2560, which came with a Prusa i3 Clone (CTC D5983), to communicate with arduino.

I was getting repeated stk500v2_ReceiveMessage(): timeout errors from avrdude through both the arduino IDE upload function, and running it off the command line.
Turns out my GT2560 had an ancient bootloader and needed a different protocol, I used the following command to successfully read the bytecode out;

.\avrdude -p atmega2560 -C ..\etc\avrdude.conf -c wiring -P com3 -b 57600 -F -U flash:r:i3_bak -v

This command reads code out of the device flash ROM, writing it to a file.
I ran this from the \Arduino\hardware\tools\avr\bin directory.


Here's a youtube video with the same fix: stk500v2 timeout fix

Sorry for reviving an old thread, but it's the first hit on google for this.


Ps. The above post by Dust is incorrect, avrdudes commands specify that r reads the device memory and writes to a file, while w writes the contents of the file into the device memory. Docs:
avrdude option descriptions
Re: backup installed firmware?
February 03, 2019 11:09AM
This was a first / near first hit on google searching for backing up of firmware on a mainboard.

Want to point out as mentioned in the thread. Use of
:w:
Is "write" to the Arduino / mainboard memory NOT "writing" / "backing" it up to a local file where avrdude is running.

This is what I did to backup a CR-10 (non S) Marlin 1.1.9 firmware I had installed on it. I'm trying out 2.0.0 BF with a BL touch and a spliced Pin 27 for the servo pin.
avrdude -p m1284p -c arduino -P /dev/ttyUSB0 -b 115200 -F -U flash:r:existingMarlin_fw_20190202_01.hex:i
avrdude -p m1284p -c arduino -P /dev/ttyUSB0 -b 115200 -F -U eeprom:r:existingMarlin_eeprom_20190202_01.hex:i

Running that code on a USB connected OctoPi (Version 1.3.10) with Firmware Updater Plugin (Version 1.1.0). Firmware Update Plugin Github works for me to generate those files.
Sorry, only registered users may post in this forum.

Click here to login