Cooked Rx0 on Arduino Mega, Serial1,2,3 next

While trying to wire up the Arduino Mega board to the vehicle it's going to live in, I managed to cook the Rx0 pin, thus I'm now unable to upload anything to the board. USB port does not work but Tx0 does, as I can still monitor output from the board via a USB-UART adapter.

Is there any way to assign one of the other Serial ports as default for the IDE to use for uploads?

Thanks, Deniz

I have now tried to use another Arduino, and re-burn the bootloader from the ICSP pins. While the attempt was reported to be unsuccessful, the LED on the target board was left blinking about 2-3 times a second. And voila!, I was able to upload a sketch using the Serial port, which I had believed was cooked.

However, when I tried to upload again, it would not allow me, giving timeout() errors.

I had to attempt re-burning the boot loader again to be allowed upload via Serial. Just once!

USB still doesn't work, though all resistors and continuity seems fine between USB/Serial0 and the MCU.

Reassignment for serial download - not without changing the bootloader code.

Should not prevent ICSP loading tho.
If you have a real programmer, you can use File:Upload Using Programmer
and download your sketch and not have the bootloader. Code will start running right after a reset.
(I don't know if that works with Arduino as ISP, I have a couple of standalone programmers that I use instead)

I was trying to do just that.Found this bit in \hardware\arduino\bootloaders\stk500v2\stk500boot.c:

#elif defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) || defined(__AVR_ATmega162__) \
	 || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__)
	/* ATMega with two USART, use UART0 */
	#define	UART_BAUD_RATE_LOW			UBRR0L
	#define	UART_STATUS_REG				UCSR0A
	#define	UART_CONTROL_REG			UCSR0B
	#define	UART_ENABLE_TRANSMITTER		TXEN0
	#define	UART_ENABLE_RECEIVER		RXEN0
	#define	UART_TRANSMIT_COMPLETE		TXC0
	#define	UART_RECEIVE_COMPLETE		RXC0
	#define	UART_DATA_REG				UDR0
	#define	UART_DOUBLE_SPEED			U2X0

I replaced 0's with 1's and recompiled stk500boot_v2_mega2560.hex. Unfortunately, the traumatized board does not accept ICSP input from another Arduino. (I have used that master Arduino to burn the bootloader on yet another Arduino, so the setup should be fine)

Now that I'm able to upload (even once), I think Serial0 is fine, the damage must be elsewhere, reset circuit and the bootloader comes to mind. The board is possibly unreliable to use in this state, but for educational value, I'll try to upload with a programmer and bypass the bootloader altogether.

Thanks for you input.

Maybe the Atmega 16U2/8U2 need re-programming or the watchdog has some how been turned on as this can effect the older bootloaders.

Tried to reprogram the 8U2, the board did not even go into DFU mode (other boards do), it disappears from the device list while reset and ground are shorted, but re-appears right after.