Hi @hfranco.tx,
Thank you for your quick response. As you have mentioned, I have the linux-toradex inside linux folder and I can see other changes I have made custom config file such as CONFIG_SPI_SLAVE, CONFIG_SPI_DEBUG getting reflected.
I enabled SPI_SLAVE option and tired doing a spidev_test: first I ran the spidev_test from the slave device so that the FIFO will have the data. As soon as the master sends the data, the slave should be able to send the message from it’s end. But the message didn’t go through and hanged at the slave:
root@colibri-imx6ull-06764338:~# spidev_test -D /dev/spidev0.0 -p “SLAVE_HELLO_TO_MASTER” -v
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
^C
[ 353.574605] spidev spi0.0: SPI transfer failed: -4
[ 353.579893] spi_slave spi0: failed to transfer one message from queue
root@colibri-imx6ull-06764338:~# spidev_test -D /dev/spidev0.0 -v
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
This is my dmesg output for spi:
root@colibri-imx6ull-06764338:~# dmesg | grep spi
[ 1.611538] spi_imx 2008000.spi: can’t get the TX DMA channel, error -517!
[ 2.244455] spi_imx 2008000.spi: can’t get the TX DMA channel, error -517!
[ 2.260039] spi_imx 2008000.spi: can’t get the TX DMA channel, error -517!
[ 2.261089] spi_imx 2008000.spi: can’t get the TX DMA channel, error -517!
[ 11.623166] spi_imx 2008000.spi: can’t get the TX DMA channel, error -517!
[ 11.763420] spi_imx 2008000.spi: registered slave spi0
[ 11.788439] spi_slave spi0: /soc/aips-bus@2000000/spba-bus@2000000/spi@2008000/spidev@0 is not called ‘slave’
[ 11.802239] spi_slave spi0: Failed to create SPI device for /soc/aips-bus@2000000/spba-bus@2000000/spi@2008000/spidev@0
[ 12.055306] spi spi0.0: spi_imx_setup: mode 0, 8 bpw, 0 hz
[ 12.055349] spi spi0.0: setup mode 0, 8 bits/w, 0 Hz max → 0
[ 12.067312] spi_imx 2008000.spi: registered child spi0.0
[ 12.067333] spi_imx 2008000.spi: probed
FYI, this is my device tree definition of spi for the slave device:
&ecspi1 {
pinctrl-0 = <&pinctrl_ecspi1_cs &pinctrl_ecspi1>;
status = "okay";
spi-slave;
slave@0 {
compatible = "toradex,evalspi";
spi-max-frequency = <20000000>;
reg = <0>;
status = "okay";
};
};
pinctrl_ecspi1_cs: ecspi1-cs-grp {
fsl,pins = <
MX6UL_PAD_LCD_DATA21__ECSPI1_SS0 0x70a0 /* SODIMM 86 */
>;
};
pinctrl_ecspi1: ecspi1-grp {
fsl,pins = <
MX6UL_PAD_LCD_DATA20__ECSPI1_SCLK 0x000a0 /* SODIMM 88 */
MX6UL_PAD_LCD_DATA23__ECSPI1_MISO 0x100a0 /* SODIMM 90 */
MX6UL_PAD_LCD_DATA22__ECSPI1_MOSI 0x000a0 /* SODIMM 92 */
>;
};
I am not sure if this is because both the the SPI_MASTER and SPI_SLAVE option are set.