So I have an arduino nano (and I tested an Arduino Uno in this situation, which has similar behavior, though the post is mostly about the Nano, and I've tested a baremetal ATMega328p, all exhibiting this behavior, so I'm assuming it's software related(?)) acting as an I2C slave that is occasionally having the I2C bus fail, I have no idea why it's failing as such, but I'll be putting several messages towards the Arduino nano and eventually the I2C bus stops receiving or sending data. I have no idea why. At first the data is fine, but potentially up to 10 minutes later it stops receiving data (confirmed by serial plotter, which it can fail during the use of).
I have checked the TWSR register, which returns 0xF8, which doesn't show up in the datasheet as a valid error code, so I have no idea what is happening.
I do have pull-up resistors, it is pulled up to 5v via 2 4.7k resistors, one for SDA and one for SDL.
I am actively able to see that the device is being sent I2C data via a logic analyzer.
The I2C master is operating on 100kHz standard mode speed, so that is also not the issue.
The strangest part of all of this is that I can open up the serial plotter and the error just will clear out, this happens while sending data over UART and while I'm not sending data over UART, my code does not receive any data over UART so that can't be the issue.
At this point it has been a couple of days of this, and I have no idea what the origin of this issue is or why it's affecting literally everything now.
This code also worked for over a year without modification, so I'm wondering what could be the cause of this now.
Thank you for your help if at all possible.