I have a i.mx287 with the L2.6.35_10.12.01, and the package of Qualcomm 7000 for spi and uart, and I lost my spi device,
root@pl16 ~$ find / -name "*spi*"
/proc/irq/98/mxs-spi.0
/proc/irq/84/mxs-spi.0
/root/qcaspi.ko
/sys/devices/platform/mxs-spi.0
/sys/devices/platform/mxs-spi.0/spi_master
/sys/devices/platform/mxs-spi.0/spi_master/spi1
/sys/devices/platform/mxs-spi.0/spi1.0
/sys/bus/platform/devices/mxs-spi.0
/sys/bus/platform/drivers/mxs-spi
/sys/bus/platform/drivers/mxs-spi/mxs-spi.0
/sys/bus/spi
/sys/bus/spi/devices/spi1.0
/sys/class/spi_master
/sys/class/spi_master/spi1
/sys/module/spi_mxs
/sys/module/qcaspi
root@pl16 ~$
In the sysconfig-mx.spec. I have
SLATTACH="slattach -s 115200 -p qca /dev/ttySP0"
So I have assumed the spi devices is /dev/ttySP0. And I try to do, the next command, but it doesn't work.
fd=open("/dev/ttySP0",O_RDWR);
unit16_t buf=0xDA00;
int res=write(fd, buf,2);
read(fd,buf,2);
if res==-1
printk("ERROR")
Hi Silvia,
the SPI is half duplex, so you need to write 4 bytes (2 bytes for your command and the other 2 bytes for the response). The same applies for reading. Another problem could be the endianess of your SPI command.
Stefan
Hello
Thanks, but I've already done, I have loaded drivers. But I want to make a little program to read and send package by spi, and I don't know how to start.
one can look below