Our customer wants to use SPI-slave.
I tried spi-slave with this device tree overlays.
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
- Copyright 2020-2021 Toradex
*/
/dts-v1/;
/plugin/;
/ {
compatible = “toradex,verdin-imx8mp”;
};
&ecspi1 {
#address-cells = <0>;
#size-cells = <0>;
spi-slave;
status = “okay”;
/delete-property/cs-gpios;
pinctrl-0 = <&pinctrl_ecspi1>;
slave {
compatible = “rohm,dh2228fv”;
reg = <0>;
spi-max-frequency = <10000000>;
status = “okay”;
};
};
slave
spidev_test -v -D /dev/spidev1.0 -p 8765 -C
spi mode: 0x4
bits per word: 8
max speed: 500000 Hz (500 KHz)
TX | 38 37 36 35 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |8765|
RX | 30 30 30 30 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |0000|
master
spidev_test -D /dev/spidev1.0 -v -p 0001000200030004
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
TX | 30 30 30 31 30 30 30 32 30 30 30 33 30 30 30 34 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |0001000200030004|
RX | 00 00 00 00 00 00 00 00 36 00 00 00 35 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |…6…5…|
Data is sent, but the data received by the master is incorrect.
When the master sends 4 bytes, the slave can finally send 1 byte.
Best regards.