|
| 1 | +# System / `i3c` I3C Tool |
| 2 | + |
| 3 | +The I3C tool provides a way to debug I3C related problems. This README file will |
| 4 | +provide usage information for the I3C tools. |
| 5 | + |
| 6 | +- System Requirements |
| 7 | + - I3C Driver |
| 8 | + - I2C Driver, If Has I2C Device |
| 9 | + - Configuration Options |
| 10 | + |
| 11 | +# Configuration Options |
| 12 | + |
| 13 | + - `CONFIG_NSH_BUILTIN_APPS` – Build the tools as an NSH built-in command. |
| 14 | + - `CONFIG_I3CTOOL_DEFBUS` – A default bus number (default `0`). |
| 15 | + |
| 16 | +# Usage: |
| 17 | + |
| 18 | +Write one data byte in single private transfer |
| 19 | + |
| 20 | +i3c -b bus -m manufid -p partid -w 0xde |
| 21 | + |
| 22 | +Write multiple data bytes in single private transfer |
| 23 | + |
| 24 | +i3c -b bus -m manufid -p partid -w "0xde,0xad,0xbe,0xef" |
| 25 | + |
| 26 | +Write multiple data bytes in multiple private transfers |
| 27 | + |
| 28 | +i3c -b bus -m manufid -p partid -w "0xde,0xad" -w "0xbe,0xef" |
| 29 | + |
| 30 | +Read multiple data bytes in single private transfer |
| 31 | + |
| 32 | +i3c -b bus -m manufid -p partid -r <data_length> |
| 33 | + |
| 34 | +Read multiple data bytes in multiple private transfer |
| 35 | + |
| 36 | +i3c -b bus -m manufid -p partid -r <data_length> -r <data_length> |
| 37 | + |
| 38 | +Read and write multiple data bytes in multiple private transfer |
| 39 | + |
| 40 | +i3c -b bus -m manufid -p partid -w "0xde,0xad,0xbe,0xef" -r <data_length> |
| 41 | + |
| 42 | +Get device information using PID |
| 43 | + |
| 44 | +i3c -b bus -m manufid -p partid -g |
| 45 | + |
| 46 | +Parameters: |
| 47 | + |
| 48 | + 1) bus: I3C bus number |
| 49 | + 2) manufid: Manufacturer ID (upper 16 bits of device PID) |
| 50 | + 3) partid: Part ID (middle 16 bits of device PID) |
| 51 | + 4) <data_length>: Data length to read on this message |
| 52 | + |
| 53 | +Note: The manufid and partid are extracted from the device's 48-bit Provisional |
| 54 | +ID (PID). To find these values, first use the -g option to get device information, |
| 55 | +then extract: |
| 56 | + - manufid = (PID >> 32) & 0xFFFF |
| 57 | + - partid = (PID >> 16) & 0xFFFF |
| 58 | + |
| 59 | +# Example |
| 60 | + 1. i3c -b 0 -m 0x01E0 -p 0x0001 -w 0xde |
| 61 | + 2. i3c -b 0 -m 0x01E0 -p 0x0001 -w "0xde,0xad,0xbe,0xef" |
| 62 | + 3. i3c -b 0 -m 0x01E0 -p 0x0001 -w "0xde,0xad" -w "0xbe,0xef" |
| 63 | + 4. i3c -b 0 -m 0x01E0 -p 0x0001 -r 0x10 |
| 64 | + 5. i3c -b 0 -m 0x01E0 -p 0x0001 -r 0x10 -r 0x10 |
| 65 | + 6. i3c -b 0 -m 0x01E0 -p 0x0001 -w "0xde,0xad,0xbe,0xef" -r 0x10 |
| 66 | + 7. i3c -b 0 -m 0x01E0 -p 0x0001 -g |
| 67 | + |
| 68 | +# Migration from target_addr |
| 69 | + |
| 70 | +Previous versions used `-d targetaddr` to specify the device address. The new |
| 71 | +version uses `-m manufid -p partid` to identify devices by their unique PID. |
| 72 | + |
| 73 | +To migrate: |
| 74 | +1. Get device PID using the old command (if available): |
| 75 | + ``` |
| 76 | + i3c -b 0 -d <addr> -g |
| 77 | + ``` |
| 78 | + Output: `i3c_device_info - pid 0x01E000010000XXXX` |
| 79 | + |
| 80 | +2. Extract manufid and partid from PID: |
| 81 | + ``` |
| 82 | + manufid = 0x01E0 (bits 47-32) |
| 83 | + partid = 0x0001 (bits 31-16) |
| 84 | + ``` |
| 85 | + |
| 86 | +3. Use new command format: |
| 87 | + ``` |
| 88 | + i3c -b 0 -m 0x01E0 -p 0x0001 -r 0x10 |
| 89 | + ``` |
0 commit comments