Hello Shuichi Yokota:
Unfortunately there is no example code for emulating an EEPROM memory in I2C slave mode with KSDK.
About the example projects you found:
- The i2c_interrupt_transfer indeed requires fixed buffer lengths for transmission and reception, since it uses the transactional APIs from the I2C driver. I think this project would not be useful in your case.
- The i2c_interrupt project has fixed buffer lengths just to demonstrate the use of the driver APIs. You can actually take this project to understand the use of the slave mode APIs and construct your application. Then you have to redesign the interrupt handler for the EEPROM use case. In the example project the handler is called I2C_SLAVE_IRQHandler().
Regards!
Jorge Gonzalez