I'm working on device that is using AtMega2560 as main microcontroller and AtMega16u2 as USB/Serial converter. This is identical as can be found in Arduino Mega R3 (including bootloader).
When I connect device to PC, wait few seconds and open Serial communication everything works great.
Problem occurs when I open Serial communication and start sending data immediately after powering on microcontroller. In this situation AtMega2560 prevents to start.
I know that this is happening because AtMega2560 bootloader waits if there is new sketch waiting to be uploaded to it.
Is there any solution to force AtMega2560 to start even if it starts receiving serial data immediately after powering? Maybe modifying firmware of Atmega16u2 ?