Hi,
about two years ago I was running the old 3.* kernel and SPI worked fine for what I was doing.
I updated to Debian 8.6 / 4.4.40-ti-r80 but now the same unchanged code throws odd errors that I can't figure out on my own.
Here is how I'm writing out via SPI (16 bpw, mode 2)
struct spi_ioc_transfer info =
{
.tx_buf = (unsigned long)wbuf,
.len = length,
};
int ret = ioctl(fd, SPI_IOC_MESSAGE(1), &info);
if (ret < 1)
{
printf("error: %s\n", strerror(ret));
return 0;
}
The size of wbuf usually ranges from 10 bytes to 10000 bytes.
It will print "error: Unknown error -1" which does not leave me with much.
I also noticed that now (with the new kernel) I had to remove cs_change = 1 from the spi_ioc_transfer struct or else CS would stay low the whole time (between messages).
Anyway, should I revert to 3.* or does anyone know what's going on?