tock / libtock-rs

Rust userland library for Tock
Apache License 2.0
163 stars 109 forks source link

examples: add usb-i2c mctp app #525

Closed twilfredo closed 8 months ago

twilfredo commented 9 months ago

Overview

Add a sample libtock-rs app that allows a host machine without exposed I2C/SMBus capabilities to communicate to an MCTP endpoint.

The following topology is used:

[Host PC] <-- UART --> [Usb-I2C Bridge Device] <-- I2C --> [Target Endpoint]

This app operates by first waiting for an MCTP request packet to be sent over UART from the host, which is then forwarded to the target endpoint (based on the target address) through the I2C bus. The endpoint must then master the I2C bus and write a response back to us, as we wait in target mode (Note: MCTP mandates writes only). This is then forwarded to the host machine via UART.

A sample use-case can be to communicate with an SPDM responder that uses MCTP/SMBus/I2C, directly from the host machine.

Host app requirements

The host app must attach a small packet header (metadata) that wraps the data message, the packet formatting is detailed in the rust-docs for the app. It must also parse the same packet upon reception of data.

twilfredo commented 9 months ago

@alistair23

twilfredo commented 8 months ago

ping! this is ready to merge