Author Topic: how to dump the firmware from Arduino Mega?  (Read 1598 times)

0 Members and 1 Guest are viewing this topic.

Online DiTBhoTopic starter

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
how to dump the firmware from Arduino Mega?
« on: July 31, 2022, 02:41:15 pm »
I have never played with that stuff, and rarely play with Arduino, probably it's a silly question but ... I really don't know.

Is it possible to dump the firmware of an Arduino Mega without corrupting the flash(1)?

if so, how? Does it require an Avr-Dragon or something?  :-//

(dunno anything about FUSE and protections)


(1) I am not sure the flash contains the standard Arduino bootloader, it may contain a custom loader, so I'd like to avoid to inject a dumper.
I am only sure that's the board is an Arduino Mega, I don't know anything about its firmware, except ... I'd like to download and disassembly for personal interest.
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3710
  • Country: nl
Re: how to dump the firmware from Arduino Mega?
« Reply #1 on: July 31, 2022, 04:00:43 pm »
An Arduino Mega, when based on an atmega2560, has JTAG, so you should be able to use that to get the content of the FLASH.

Have not done this myself, and don't know which software can be used for it. Did buy a jtag adapter for it way back: https://nl.aliexpress.com/item/32985895910.html and do have an Arduino Mega lying around. Can do some experiments if needed.

Edit1: https://forum.arduino.cc/t/small-guide-to-arduino-atmega2560-jtag-interfacing-with-avrstudio6/186473
Edit2: https://doc.riot-os.org/group__boards__arduino-mega2560.html
Edit3:https://www.rapid7.com/blog/post/2019/04/16/extracting-firmware-from-microcontrollers-onboard-flash-memory-part-1-atmel-microcontrollers/
« Last Edit: July 31, 2022, 04:12:59 pm by pcprogrammer »
 
The following users thanked this post: DiTBho

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: how to dump the firmware from Arduino Mega?
« Reply #2 on: July 31, 2022, 10:07:07 pm »
If it does have the Arduino bootloader, you can extract the flash contents using that, over the serial port, using avrdude.  Worth a try.

If it doesn't have a bootloader, the next thing to try is an ISP programmer.  There are lot of sources of AVR ISP programmers.  (Some of them have trouble with >128k of flash.)  AVR Dragon is old and pretty obsolete.  I've heard good things about https://www.pololu.com/product/3172 for a low-cost programmer   Official Microchip programmers would include the SNAP and the PicKit4.  If you have "other" Arduino boards, you can use the "Arduino as ISP" sketch (maybe.  Note sure about the 256k issue.)  (all assuming that the chip has not been "protected" against having its code read.

JTAG needs to be specifically enabled via a fuse setting, so it probably still needs an ISP programmer.
 
The following users thanked this post: DiTBho


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf