I2C slave with SMBus communication

Hello, I have a very similar sample program, and I think that it is posble that the root of your problem might be on the other side partially.

On some of the documentation That I have read, SMBus requires two bytes, one for a register address and another for data.

Yet in your code you only read one of those bytes each time, and then you write back. I think that might be the reason. So you probably only need to add another call to read that other byte.

I hope this helps.