Hi all! The issue I've come across is that I have an Arduino Leonardo board with an uploaded code in it, and one in which I need to copy this code into. I don't have access to the original code, I only have the board. I've tried using AVRdude to create the hex file of the first board, in order to then upload it to the other board, typing the following command in cmd:
avrdude -c arduino -P com6 (this is where it is) -p atmega32u4 -Uflash:r:c:\hexfiles\test.hex:i
But then nothing happens. What am I doing wrong? I really need to finish this as quickly as possible and I am pretty noob to it.
I am no expert but simply ask for it. It should be under the software licence they should be happy to share it unless it has been copyrighted. If so then the legalities come with the libraries that were used.
I'd really like to rewrite it, but I haven't got the time. I want it as a temporary solution and then try to rewrite the code. Isn't there any way to do this?
I find that the Arduino copy of avrdude is not on any search path and the easiest way to get the right command is to turn on "Preferences: Show verbose output during: [ ] compilation [X] upload". UNPLUG THE ARDUINO and click on the upload button for a small or empty sketch. The upload will fail but the first three lines in the log window will be:
Sketch uses 444 bytes (1%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
/Users/john/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/john/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -P/dev/cu.usbserial-14230 -b115200 -D -Uflash:w:/var/folders/kq/89qrmhn9563d565c5th318kw0000gn/T/arduino_build_795458/sketch_mar29a.ino.hex:i
Take the third line and replace "Uflash:w:/var/folders/.../sketch_mar29a.ino.hex:i" with "Uflash:r:test.hex:i", resulting in a command line that looks like:
Plug the Arduino back in and run the command line. The result should be a "test.hex" file in the current directory. If you then plug in the new Arduino and run the command again with "Uflash:r:" changed back to "Uflash:w:" the "test.hex" file will be uploaded to the FLASH on the new board.
It runs the command, shows some characteristics such as using port, using programmer, overriding baud rate etc, then a table with memory type mode delay size etc, it says
Programmer type: butterfly
Description: atmel appnote avr109 boot loader
Connecting to programmer..: .avrdude: butterfly_recv(): programmer is not responding
And then it says the same message about programmer not responding once more and stays there forever until I cancel the command or reset the board.
Did you put a copy of the Arduino bin/avrdude and etc/avrdude.conf into C:\Avrdude?
Are you sure you have the Leonardo plugged in as COM6? I don't have a Leonardo plugged in and got the same "avrdude: butterfly_recv(): programmer is not responding" messages.