Go Down

Topic: MegaCore issue flashing sketch over serial must compile as a Uno for Mega2560 (Read 123 times) previous topic - next topic

KawasakiZx10r

Hello i have been working on ways to flash my Arduino remotely with no need for a pc it has to run just of a  second MCU in my case an ESP8266-12.

I have a sketch that can run on any MCU and flash a Uno via Serial0 with the HEX file stored on an SD card, it uses stk500v1 protocols to flash over Serial and as i said this works fine on any 328p chip but not a Mega, so i flashed over Optiboot to my mega so i can use stk500v1 protocols to flash it and that works, well kind of, in the Arduino IDE i have to choose MegaCore Mega 2560 and i can flash the sketch, standard mega 2560 does not work as expected while running Megacore.

But using a slave MCU and the BootDrive sketch i found written by Kevin i can only flash the Mega 2560 over Serial when i compile the code as a Uno, selecting Megacore 2560 or just the standard Mega 2560 and compiling then flashing those Hex files fails.

Now this would be fine it i just had a simple sketch like blink but i need to use Serial2 and 3 and all the pins that a Mega offers ect, and when i try to compile a sketch for a Mega as a Uno with things that the Uno does not have i gets erros like Serial2 was not defined of course...

So i swear i read somewhere about changing the boards config in the Arduino files and rename or create one just named Uno with the Mega configs and so on, But i cant find that info, lol you know whats its like when you find something and can never find it again.

Any help please :)

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

Albert Einstein

KawasakiZx10r

Never mind i have added the custom board now and its working, i just copied the Mega settings made a copy and renamed it and changed the bootloader link to optiboot
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

Albert Einstein

Go Up