You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SPIdev works just with max. 511 bytes per transfer #714
The SPIdev driver just works with transfer length limited to 511 byte. If you want to transfer more than 512 byte per transfer the driver sends nothing and returned without any error response.
I believe the char in #define line you quoted is defining an array of SPI_MSGSIZE(N) chars as the buffer to transfer. It is not passing the size in a char variable.
If that's not what you mean, can you provide a diff that shows exactly what change you are suggesting?
Sorry, I was completely wrong:
The problem with SPI-Transfers over a C program is in this define:
#define SPI_MSGSIZE(N)
((((N)_(sizeof (struct spi_ioc_transfer))) < (1 << IOC_SIZEBITS))
? ((N)(sizeof (struct spi_ioc_transfer))) : 0)
If you now want to transfer perhaps 600 Byte over SPI, the "real" size is generated as 600 * struct spi_ioc_transfer, and the results in 600_32Byte. But that’s bigger than the 14 allowed _IOC_SIZEBITS and the define above makes it to 0 (no error message!!).
For me it's not clear how to fix this (otherwise I would do it). My only idea is it to write an own UIO spi driver without the ioctl interface.
Or is there anything I do wrong? I use the system call "retVal = ioctl(_spi_fd, SPI_IOC_MESSAGE(length), &spi) ;" to transfer data over spi. As I said, I am new with using linux.
Activity
popcornmix commentedon Oct 25, 2014
I believe the char in #define line you quoted is defining an array of SPI_MSGSIZE(N) chars as the buffer to transfer. It is not passing the size in a char variable.
If that's not what you mean, can you provide a diff that shows exactly what change you are suggesting?
SICKUser commentedon Oct 27, 2014
Sorry, I was completely wrong:
The problem with SPI-Transfers over a C program is in this define:
#define SPI_MSGSIZE(N)
((((N)_(sizeof (struct spi_ioc_transfer))) < (1 << IOC_SIZEBITS))
? ((N)(sizeof (struct spi_ioc_transfer))) : 0)
If you now want to transfer perhaps 600 Byte over SPI, the "real" size is generated as 600 * struct spi_ioc_transfer, and the results in 600_32Byte. But that’s bigger than the 14 allowed _IOC_SIZEBITS and the define above makes it to 0 (no error message!!).
For me it's not clear how to fix this (otherwise I would do it). My only idea is it to write an own UIO spi driver without the ioctl interface.
Or is there anything I do wrong? I use the system call "retVal = ioctl(_spi_fd, SPI_IOC_MESSAGE(length), &spi) ;" to transfer data over spi. As I said, I am new with using linux.
SICKUser commentedon Oct 27, 2014
ok, was my mistake, If you understand the ioctl call right and increase the SPI-Buffer over a config file all works fine....
blk-mq: quiesce queue before freeing queue
blk-mq: quiesce queue before freeing queue
Merge pull request raspberrypi#714 from ojeda/Makefile
ceph: always call ceph_shift_unused_folios_left()
ceph: always call ceph_shift_unused_folios_left()
ceph: always call ceph_shift_unused_folios_left()