Power consumption high cause serial communcation failure?

When I upload a sketch to my arduino 2560 mega with three modules connected to the 5v and Gnd pins of that mega board directly, the uploading failed. And after I disconnected these power supplies, it worked. I know that pin 0 and pin1 should not be connected while uploading sketch, so that they are not used in my case.

So may I assume that it is due to the fact that the power supply of the usb port on my computer is insufficient?

Will this problem be solved, if I add a second power supply (7V~12V) to the power port of the 2560?

Is it safe to keep both the usb cabled to my computer and the second power supply (7V~12V) connecting?

When I upload a sketch to my arduino 2560 mega with three modules connected

Which modules? Which pins are the modules connected to?

Will this problem be solved, if I add a second power supply (7V~12V) to the power port of the 2560?

Not if your problem is over current, the Arduino's 5V regulator has less capacity than your computer's USB power.

Is it safe to keep both the usb cabled to my computer and the second power supply (7V~12V) connecting?

Not according to the more experienced users here.

pin 12, 13, 2 ,8,9,10,11,51,52. SCL, SDA, Modules are BH1750, SIM900, small led (which doesn't consume much power), a stepmotor controller.

That would be a start, try it but in the long run add an external power supply to power the external modules, be sure to connect the grounds. You can disconnect one at a time to see which one is causing the problem, I Have a feeling it may have a motor on it or other relative heavy load.
Good Luck & Have Fun!
Gil

SIM modules require up to 2 Amperes and cannot be powered from the Arduino 5V output, or the USB port. Use a separate 5V, 2A power supply and connect the grounds.