Internships/ProjectIdeas/I2CPassthrough: Difference between revisions

From QEMU
(Created page with "=== I2C Passthrough === '''Summary:''' Implement I2C bus passthrough on Linux hosts so that an emulated Raspberry Pi or micro:bit board can talk to real I2C devices. QEMU em...")
 
Line 1: Line 1:
=== I2C Passthrough ===
=== I2C Passthrough ===


'''Summary:''' Implement I2C bus passthrough on Linux hosts so that an emulated Raspberry Pi or micro:bit board can talk to real I2C devices.
'''Summary:''' Implement I2C bus passthrough on Linux hosts so that a single board computer like a Raspberry Pi can be used to develop application for a microcontroller such as micro:bit.


QEMU emulates I2C devices in software but currently cannot pass through real I2C devices from the host to the guest.  It would be useful to access real I2C devices from inside the guest, for example for developers writing and testing software under QEMU on their computer.
QEMU emulates I2C devices in software but currently cannot pass through real I2C devices from the host to the guest.  It would be useful to access real I2C devices from inside the guest, for example for developers writing and testing software under QEMU on their computer.


The project consists of the following tasks:
The project consists of the following tasks:
* Implement -object i2c-bus-passthrough,adapter=N,id=my-i2c-bus
* Write tests for one or more I2C emulated controllers using the qtest framework
* Add i2c-bus-passthrough support to at least 1 existing emulated I2C controller
* Implement ''-device i2c-passthrough,device=/dev/i2c-N'' (another possibility is to implement Linux I2C device support as a character device, like ''-chardev linux-i2c,device=/dev/i2c-N,id=i2c-chardev -device i2c-passthrough,chardev=i2c-chardev''; this enables testing even without actual I2C devices available)
* Add i2c-bus-passthrough support for the bitbanging I2C emulation
* Implement micro:bit TWI controller emulation on the nRF51 system-on-chip
* Implement micro:bit TWI controller emulation on the nRF51 system-on-chip


Line 18: Line 19:


'''Details:'''
'''Details:'''
* Skill level: intermediate
* Skill level: advanced (the project is not very difficult, but it is larger than usual)
* Language: C
* Language: C
* Mentor: Paolo Bonzini <pbonzini@redhat.com> ("bonzini" on IRC), Stefan Hajnoczi <stefanha@redhat.com> ("stefanha" on IRC)
* Mentor: Paolo Bonzini <pbonzini@redhat.com> ("bonzini" on IRC), Stefan Hajnoczi <stefanha@redhat.com> ("stefanha" on IRC)

Revision as of 20:48, 9 January 2019

I2C Passthrough

Summary: Implement I2C bus passthrough on Linux hosts so that a single board computer like a Raspberry Pi can be used to develop application for a microcontroller such as micro:bit.

QEMU emulates I2C devices in software but currently cannot pass through real I2C devices from the host to the guest. It would be useful to access real I2C devices from inside the guest, for example for developers writing and testing software under QEMU on their computer.

The project consists of the following tasks:

  • Write tests for one or more I2C emulated controllers using the qtest framework
  • Implement -device i2c-passthrough,device=/dev/i2c-N (another possibility is to implement Linux I2C device support as a character device, like -chardev linux-i2c,device=/dev/i2c-N,id=i2c-chardev -device i2c-passthrough,chardev=i2c-chardev; this enables testing even without actual I2C devices available)
  • Add i2c-bus-passthrough support for the bitbanging I2C emulation
  • Implement micro:bit TWI controller emulation on the nRF51 system-on-chip

This project will allow you to learn about the I2C bus and how to write device emulation code in QEMU. You will enjoy it if you like working with physical hardware.

Links:

Details:

  • Skill level: advanced (the project is not very difficult, but it is larger than usual)
  • Language: C
  • Mentor: Paolo Bonzini <pbonzini@redhat.com> ("bonzini" on IRC), Stefan Hajnoczi <stefanha@redhat.com> ("stefanha" on IRC)