How to get the hex file from the arduino?

Hi! I have a 3D printing system, and 4 arduino nanos. The problem is that I have a working code on 2 of them, 1 is broken, the other one has the bad code. I was wondering if I could transfer the code from one arduino to another, without using a programmer, only usb. I tried so many times, but I have failed, this is asking for help, not a duplicate topic. And if I could do it, how?

I personally don't know how to do it without using a Programmer connected to the ICSP header pins.
You should have one anyway if you are doing projects. $7.77 at Pololu, free shipping in the US.

You can do it with avrdude and a bootloader-using Arduino, same as using a programmer (though you can't get EEPROM off it - they couldn't fit EEPROM functionality into 512 bytes. and felt (correctly I think) that losing 512b of flash wasn't worth eeprom read/write through bootloader, especially considering the IDE basically not handling eeprom anyway.)

Well I found this download code from arduino to computer? - Project Guidance - Arduino Forum. And what about that 512b? Will I lose half of my code? I just want to transfer the program I wrote, not the whole bootloader.

CrossRoads:
I personally don't know how to do it without using a Programmer connected to the ICSP header pins.
You should have one anyway if you are doing projects. $7.77 at Pololu, free shipping in the US.
Pololu USB AVR Programmer v2.1

I think you misunderstood me. I would like to read thethe program that I wrote, and uploaded to the arduino, not the bootloader.

I would use the Programmer and Atmel Studio, I don't know how to do it with the IDE.

I haven't downloaded from a chip in ages, would need some playing around time to do it again.

I don't have the latest either.

Atmel Studio - update.JPG

Atmel Studio - update.JPG

just use AVRdude,...

something like

C:\arduino-1.8.13-portable\portable\packages\arduino\tools\avrdude\6.3.0-arduino18/bin/avrdude -CC:\arduino-1.8.13-portable\portable\packages\DxCore\hardware\megaavr\1.3.2/avrdude.conf -pm328p -carduino -PCOM22 -b115200 -Uflash:r:output.hex:i

do a dummy upload with nothing connected, and verbose output during upload enabled. first upload line is the command it invokes, copy paste that into a text document and then get rid of everything other then the -p(part) -P(port) -b(baud rate). Replace -Uflash:w:path/to/file:i with -Uflash:r:output.hex:i . Double check that you have removed the -e (erase) , open a command window where you want the hex file to be created, and paste the modified command in.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.