Spidev ch_change not working


#1

Hello all,

I am using the spidev_test example in order to send data with the spidev interface. I activated the spisvc in order to have /dev/spidev1.0 interface. After that I compiled the spidev_test under /usr/bin. Once every thing in place, I ran the spidev_test program, I got clk MOSI and Chip_select signal. The problem is with the chipselect which reamain 0 all over the transmission and not toggling every byte. I have seen that cs_change =1 (which is the default value) can hadle this. However the chipselect is not toggling with every byte. Does any one have an idea how to solve this issue. The attached picture give more details. Thank you.


#2

The SPI API in Linux has the concept of messages and transfers. A message may contain multiple transfers each of which may be of multiple bytes and may be transmit, receive or do both at the same time. The cs_change member of struct spi_ioc_transfer specifies whether the chip select will be deasserted following the completion of a transfer. The chip select will be asserted again before the subsequent transfer begins.

Do you still think there is a problem?


#3

Thank you for this response, however I think that by setting the value of the cs_change to 1, the chip select will be deasserted /asserted between each transfered word. In the case of setting its value to , the chip select will be will be deasserted following the completion of a hole transfer. Do you agree with this ?
Is there any way to control th cs_change from legato user space environement ?


#4

That’s not how I understand cs_change. Did you find some information that described it that way?


#5

Hello David,

Sorry for this delayed response, in fact I tested the spidev with the the spid_test.c program that I compiled and integate it in the /usr/bin folder. I made the necessary modifications in order to manage the cs_change attribute. So by tmaking the cs_change equal to 1 I got the next response


and when I test with cs_change equal to zero I got the next response .
As you can see, the chip select signal is deasserted /asserted between each transfered word (8bits the word).