I2C-STUB-FROM-DUMP(8)

✨ I2C-STUB-FROM-DUMP ✨

okay bestie, so this is a page from the System Manager's Manual β€” section 8, system administration girlies rise up πŸ’… β€” and the command is called i2c-stub-from-dump. Let's get into it πŸ’–


πŸŽ€ NAME πŸŽ€

i2c-stub-from-dump β€” feed i2c-stub with dump files πŸ“


🌸 SYNOPSIS 🌸

i2c-stub-from-dump address[,address,...] dump-file [dump-file ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

So what IS this? i2c-stub-from-dump is a lil helper script for the i2c-stub kernel driver, and it's genuinely so useful, no cap. It lets you set up one or more fake I2C chips on the i2c-stub bus, based on dumps of the chips you wanna emulate πŸ‘‘

Important detail bestie: i2c-stub-from-dump needs i2cdetect and i2cset to be installed and reachable through the user's PATH. The way that i2cdetect is used is to find out the i2c-stub bus number, while i2cset is the one that does the writing to your fake I2C chips ✍️✨


πŸ’œ EXAMPLE πŸ’œ

Say you have an I2C chip on system A πŸ…°οΈ and you wanna do some development on its driver over on system B πŸ…±οΈ. Iconic. Here are the few steps you have to follow:

Step 1 β€” on system A, use i2cdump to capture a dump from the chip. Assuming the chip in question lives at address 0x4c on I2C bus 0, you would run:

i2cdump -y 0 0x4c b > chip.dump

Adjust the bus number and chip address for your case, fr fr. i2cdetect can help you find out their values. And heads up: if the device uses word (16-bit) register access instead of the traditional byte (8-bit) access, use mode w instead of b πŸ‘€

Step 2 β€” copy the dump file to system B. Slay, we're moving πŸ’¨

Step 3 β€” on system B, run:

i2c-stub-from-dump 0x4c chip.dump

This will load the required i2c-dev and i2c-stub kernel drivers if needed, then write all the register values to the emulated I2C chip at address 0x4c. Again, adjust the address as needed 🌈


πŸ™ˆ LIMITATIONS πŸ™ˆ

ngl, there are some limitations to the kind of devices that can be handled, and we're listing them for you so you don't get got:

  • Device must not have banks (as most Winbond devices do). πŸ’€

πŸ› BUGS πŸ›

To report bugs or send fixes, please write to the Linux I2C mailing list <linux-i2c@vger.kernel.org> with Cc to the current maintainer: Jean Delvare <jdelvare@suse.de> πŸ’Œ

bestie don't be shy, they literally want your bug reports 🫢

πŸ‘€ SEE ALSO πŸ‘€


πŸ‘‘ AUTHOR πŸ‘‘

Jean Delvare ✨


and that's the whole page, main character energy only πŸ’… this one's dated March 2010 β€” vintage, lowkey iconic, still out here doing the lord's work πŸ’– stay emulated bestie πŸ¦‹