Posts: 2
Joined: Mon Jun 10, 2019 10:58 am

can not change mode to SPI_MODE_1 or SPI_MODE_3 on spidev2.0 of CM3!

Wed Jul 17, 2019 9:36 am

Dear Everyone,
I must change the SPI mode to SPI_MODE_1 or SPI_MODE_3.
If it's mode chage to SPI_MODE_1 /SPI_MODE_3 on spidev2.0 of CM3, returned error.

my code is follwing,

Code: Select all

    spi_mode = SPI_MODE_1;
    status_value = ioctl(spi_cs_fd, SPI_IOC_WR_MODE, &spi_mode);
    if(status_value < 0)
        perror("Could not set SPIMode (WR)...ioctl fail");
but always return -1.

and dmesg is as following :
[12055.027796] spidev spi2.0: setup: unsupported mode bits 1

SPI_MODE_0 or SPI_MODE_2 is well done,
but SPI_MODE_1 or SPI_MODE_3 make error.
SPI_MODE_1 or SPI_MODE_3 is SPI_CPHA set 1 that data is clocked in on falling edge.

How can I fix this problem?

Return to “Compute Module”