Hi Arduino community,
I've been using the Arduino Mega along with the W5500 module for updating the code for the past two years without any issues, thanks to the Ariadne bootloader.
Recently, I've encountered a problem while integrating a sensor that connects to RX0 and TX0 on the Arduino Mega.
The sensor continuously provides data in NMEA format. However, whenever the sensor is connected during power-up, the Arduino code does not load and gets stuck on the default IP address of 192.168.1.128. I can ping the Arduino, but I cannot upload code via Ethernet. Interestingly, if I remove the sensor during power-up and connect it afterward, the program loads successfully.
After some investigation, I suspected that the bootloader might be polling the serial port, causing interference. To address this, I downloaded the Ariadne bootloader source code, found at [link], and commented out the following lines in the main.c file:
if(!tftpFlashing==true)
if(serialPoll()==0) break;
I hoped that this change would prevent the bootloader from looking at the serial port during boot time. However, after loading the modified bootloader and then attempting to load my program for the first time using the bootloader, everything seems to work fine. But on subsequent tries, I am unable to load any code via Ethernet. The previously stored program starts running without any delay.
I have checked the Arduino log for uploading the bootloader, and besides the file size, everything else appears to be the same (fuses, etc.).
I would appreciate any insights or suggestions on how to resolve this issue. Thank you!