I am communicating my Jetson TX2 to a DRV8305 driver board via SPI.
In order to do that, I am using “ioctl”. The thing is that even if I set the value of SPI_IOC_WR_MAX_SPEED_HZ to 400.000 (400kHz), when I measure it I just get a 10 times slower Clock Frequency.
So, I tried rising it to 4.000.000 Hz (4MHz) and, following the previous attempt, it provided 400kHz, again, 10 times slower. (Measured using an osciloscope).
I can’t find a reason on why this happens. Does anyone have an answer to this?
ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed);
if (ret == -1)
pabort("can't set max speed hz");
ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed);
if (ret == -1)
pabort("can't get max speed hz");
printf("spi mode: 0x%x\n", mode);
printf("bits per word: %d\n", bits);
printf("max speed: %d Hz (%d KHz)\n", speed, speed/1000);