send-spi-cmd
Send a custom SPI command directly to the flash device. This is intended for advanced diagnostics when standard operations are not sufficient.
Options:
| Option | Description | Required |
|---|---|---|
--opcode
|
SPI opcode byte (hex) | Yes |
--rx-len
|
Expected response bytes (default: 0) | No |
--addr
|
Flash address (hex) | No |
--addr-size
|
Address size: 0, 3, or 4 bytes (default: 0) | No |
--dummy
|
Dummy cycles (default: 0) | No |
--proto
|
SPI protocol (default: SPI_1_1_1). Valid values: SPI_1_1_1, SPI_1_1_2,
SPI_1_1_4, SPI_1_1_8, SPI_4_4_4, SPI_8_8_8,
etc. |
No |
--tx-data
|
Transmit data as hex string (for example, DEADBEEF) |
No |
--is-ddr
|
Use DDR opcode (OSPI only) | No |
--extended-opcode
|
Dual-byte opcode hex (OSPI only) | No |
Note:
--tx-data
and --rx-len cannot both be used in the same
command.Read JEDEC ID (3 bytes):
cfgmem_util send-spi-cmd --url oyster11 --flash-type ospi-single-x8 \
--opcode 0x9F --rx-len 3
Example output:
SPI Command: opcode=0x9F, rx_len=3
...
Response: 2C 5B 1C
Read with dummy cycles:
cfgmem_util send-spi-cmd --url oyster11 --flash-type ospi-single-x8 \
--opcode 0x70 --rx-len 1 --dummy 2
Read from address:
cfgmem_util send-spi-cmd --url oyster11 --flash-type ospi-single-x8 \
--opcode 0x03 --addr 0x0 --addr-size 3 --rx-len 16
Quad output read:
cfgmem_util send-spi-cmd --url oyster11 --flash-type ospi-single-x8 \
--opcode 0x6B --addr 0x0 --addr-size 3 --rx-len 16 --proto SPI_1_1_4