You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several MCUs in one device often share an I2C bus, but getting them to talk usually means inventing a register map or a one-off protocol. Updating an MCU with no USB or radio takes yet more custom code.
Twixt is a multi-master I2C protocol for Zephyr, currently an Apache-2.0 module. I'd like to know if it, or parts of it, belong in Zephyr.
How it works
Every MCU is an I2C target at its own address, and a controller when it sends. One I2C transfer carries a request and its response, and twixt retries after a lost arbitration. A service id gives each request its meaning:
request: service, src, flags, data
response: status, data
Setup is Devicetree and Kconfig only. On top of the protocol, the repo provides:
Services: ping, echo, settings, UART and MCUmgr, plus your own
Remote shell: reach the shell of an MCU that has no USB, using the stock zephyr,uart-bridge
Firmware updates: a serial or Bluetooth gateway gives stock SMP tools such as smpmgr one endpoint per MCU
twixt,i2c-mm-gpio: a software controller for hardware that can't be controller and target in one I2C block
Native simulation: the whole multi-MCU system runs on native_sim under twister, one process per MCU
The README has the API, samples, tests and wiring.
Status
Twixt runs on native_sim and on a Raspberry Pi Pico with an nRF7002 DK, including image updates over the bus at about 3.6 KB/s.
Both boards use twixt,i2c-mm-gpio, so twixt has not yet run on a purely hardware multi-master I2C driver. STMlike good candidates, and I'd
welcome help testing them.
It also has known limits:
Handlers run in the I2C targo deferred responses yet
There is no CRC or duplicate` byte leaves room for both
An MCU can only be on one tw
The Bluetooth gateway has no's signature check protects the
images
Questions
Is this in scope for Zephyr? Would it fit in-tree as a subsystem, or is it better as an external module?
Could parts go upstream on their own? The most separable are the native_sim multi-master I2C bus, twixt,i2c-mm-gpio and the UART driver.
Should Zephyr define what multi-master means for I2C drivers? Twixt needs a lost arbitration reported as -EAGAIN, stuck-bus recovery before START, STOP reported to the target, and a target that can answer within a byte time. Would a documented contract or a shared test be welcome?
Does this overlap with existing work? I'd be glad to hear about anything I should build on, such as IPC service, RTIO or MCTP.
Who else needs this? If you solve this problem today, how do you do it, and what would twixt need to be useful to you?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Several MCUs in one device often share an I2C bus, but getting them to talk usually means inventing a register map or a one-off protocol. Updating an MCU with no USB or radio takes yet more custom code.
Twixt is a multi-master I2C protocol for Zephyr, currently an Apache-2.0 module. I'd like to know if it, or parts of it, belong in Zephyr.
How it works
Every MCU is an I2C target at its own address, and a controller when it sends. One I2C transfer carries a request and its response, and twixt retries after a lost arbitration. A service id gives each request its meaning:
Setup is Devicetree and Kconfig only. On top of the protocol, the repo provides:
zephyr,uart-bridgesmpmgrone endpoint per MCUtwixt,i2c-mm-gpio: a software controller for hardware that can't be controller and target in one I2C blocknative_simunder twister, one process per MCUThe README has the API, samples, tests and wiring.
Status
Twixt runs on
native_simand on a Raspberry Pi Pico with an nRF7002 DK, including image updates over the bus at about 3.6 KB/s.Both boards use
twixt,i2c-mm-gpio, so twixt has not yet run on a purely hardware multi-master I2C driver. STMlike good candidates, and I'dwelcome help testing them.
It also has known limits:
images
Questions
native_simmulti-master I2C bus,twixt,i2c-mm-gpioand the UART driver.-EAGAIN, stuck-bus recovery before START, STOP reported to the target, and a target that can answer within a byte time. Would a documented contract or a shared test be welcome?All reactions