Arduino Mega2560 as ISP to program another Arduino Mega2560

It would be nice of some can figure it out how this works. The you could program any Arduino with the 16u2.

See this and this: https://groups.google.com/a/arduino.cc/forum/#!msg/developers/V_T-Uvj8hSs/h9xlGyM9cJoJ https://github.com/NicoHood/Hoodloader

interesting the hoodloader, i sent you a pm. i can write a new virtualboard for resolve the "Not Run Mega problem"

we fixed the problem. fuse BootRST must be set to 1. to execute the program. Somehow its not needed for an uno. stay tuned on further hoodloader releases ;)

NicoHood: we fixed the problem. fuse BootRST must be set to 1. to execute the program. Somehow its not needed for an uno. stay tuned on further hoodloader releases ;)

Great.

BootRST must be set to 1.

That seems odd. Exactly what are your (working) fuses set to, now?

Add this to your boards.txt and burn the bootloader once. The bootloader is not used, its just to change the fuse. Then you can upload via isp and the sketch will load

## Arduino Mega w/ ATmega2560 Testato Mega ISP Version
## -------------------------
mega.menu.cpu.atmega2560T=ATmega2560 (Testato ISP Version)

mega.menu.cpu.atmega2560T.upload.protocol=wiring
mega.menu.cpu.atmega2560T.upload.maximum_size=258048
mega.menu.cpu.atmega2560T.upload.speed=115200

mega.menu.cpu.atmega2560T.bootloader.high_fuses=0xD9
mega.menu.cpu.atmega2560T.bootloader.extended_fuses=0xFD
mega.menu.cpu.atmega2560T.bootloader.file=stk500v2/stk500boot_v2_mega2560.hex

mega.menu.cpu.atmega2560T.build.mcu=atmega2560
mega.menu.cpu.atmega2560T.build.board=AVR_MEGA2560

It was uploading sketches via ISP that wasn't working? It's possible that that doesn't work on 2560, but does work on 328, because the program counter wrap-around happens differently on a chip with more than 64kwords of flash. On a 328, if you start in the "bootloader section" at 0x3F00 (where there isn't any actual code), it will execute relatively useless but unharmful instructions till it gets to 0x3FFF, and then wrap around to location 0x0, where your sketch actually begins. On a 2560, if the bootloader section starts at 0x1F000 and muddles along to 0x1FFFF, I'm not sure whether it will wrap to 0x0 (your sketch), or to 0x10000 (middle of nowhere, where it will eventually wrap again.)

I can't find this clarified in the documentation. Not that you need a "long" jump/call or to use EIND to change the high bit during normal program execution.

westfw: I'm not sure whether it will wrap to 0x0 (your sketch), or to 0x10000 (middle of nowhere, where it will eventually wrap again.)

Hi westfw, on the 2560 at the end of the flash the PC do not jump to 0x0, I discover this behavior some months ago and found that we need modifie the fuses. NOrmally in the arduino board the high_fuses=0xD8, we need it change to D9 (the submenu' code posted here is mine ;))

but Arduino team do not know this ? when it create the "Upload via Programmer" tab/option i test it (i write a guide on it in my sign) and discover that this command do not work on Mega. I do not know if we must manage this behaviour like a Bug, (bug on Mega, or bug on Uno, depend what the team means whit Upload via Programmer) I think the team wants to exploit the behavior of the ProgramCounter on the UNO, so the team do not want that the user must change the Fuses, but did not realize that this trick work only on the 328 :) What do you think ?

Hi there, yes! A Bug's it! I can use an Arduino Mega 2560 a 328P flashen- without problems. I can not flash with an Arduino Mega 2560 a Mega 2560. This only works with foreign hardware or complicated changing the software. But no one understands. What is this? Greeting and fun Andreas

P.S. I try to just: Arduino Maga 2560 -> Mega 2560 http://www.ebay.de/itm/Mikrocontroller-Atmel-ATMega2560-ATMega-SMD-Adapter-/271224130246?pt=Bauteile&hash=item3f2637cac6

It is equally a bug that the "bootrst" fuse is left programmed (0) on a m328 when you do "upload using programmer." It only works if the sketch is short enough not to overlap where the bootloader WOULD be...

This was apparently reported a long time ago, but never understood well enough to fix. I've added a comment to the bug. https://github.com/arduino/Arduino/issues/388

the lenght is not a problem, because in the board.txt you have the maximum sketch value, so if you do not change the original boards.txt you do not have problem.

I have the same problem:

  1. when trying to bootload a custom Atmega2560 pcb with arduinoMega as ISP i receive: content mismatch at 0x1e000…

  2. i tried uploading blink sketch and no results even after the terminal says uploaded.

I dont know how to change the bootRST to 1 and the change required for boards.txt file. Can someone please clarify this.

Thanks

NicoHood: we fixed the problem. fuse BootRST must be set to 1. to execute the program. Somehow its not needed for an uno. stay tuned on further hoodloader releases ;)

How do i change the bootRST to 1?

Thank you so much Testato!!! I was banging my head against the wall for days trying to figure this out.

guys, thanks a lot for this solution! i have lost several days with this issue, until i've found this topic!

best regards,

The issue related to this bug have about 10 years :) It was opened on googlecode and imported to github https://github.com/arduino/Arduino/issues/388

...but the problem was solved almost two years ago by the update to AVRDUDE 6.3.0.

Maybe @wanek You used USBasp with firmware versions other than PeterVH's 1.05 or PeterVH/bperrybap's 1.06-alpha ?