I have created a project using attiny85, programming it with arduinoIDE. Attiny communicate with another device via I2C, so far so good, but at some point where my code go around 5-6KB I2C communication start to fails. At the start I was looking for hardware problem, but since do not found one, start to looking into software removing recently added parts from the program. At the end I discovered that as code grow I2C communication fail. That of course do not make any sense to me, I continue to investigate and finally found a solution:
I need to place I2C interrupt functions at the start of the code, instead at the end. It worked that way. Still got no idea why, perhaps someone with proper knowledge gonna enlight me.