Skip to main content
Visitor II
July 5, 2022
Solved

CR95HF Linux kernel driver

  • July 5, 2022
  • 11 replies
  • 5373 views

Hi,

I am working on linux kernel v4.19 to bring up the cr95hf via SPI, there is a existing driver called st95hf, I enabled it, and it can be probed. can get ECHO back.

when I used nfc neard to test the driver, it always gives errors like below:

[ 501.027260] spi_geni 988000.spi: Zero length transfer

[ 501.027307] st95hf spi1.0: SPI transfer failed: -22

[ 501.027393] spi_master spi1: failed to transfer one message from queue

[ 501.027436] st95hf spi1.0: spi_recv_resp, data read error = -22

[ 501.027471] st95hf spi1.0: spi error from st95hf_spi_recv_response(), err = 0xffffffea

[ 501.027506] nfc nfc0: protocol sel send field off, err = 0xffffffea

[ 501.036499] digital: digital_in_configure_hw: in_configure_hw failed: -22

[ 501.037971] spi_geni 988000.spi: Zero length transfer

[ 501.038042] st95hf spi1.0: SPI transfer failed: -22

[ 501.038181] spi_master spi1: failed to transfer one message from queue

[ 501.038246] st95hf spi1.0: spi_recv_resp, data read error = -22

[ 501.038298] st95hf spi1.0: spi error from st95hf_spi_recv_response(), err = 0xffffffea

[ 501.038351] nfc nfc0: protocol sel send field off, err = 0xffffffea

[ 501.048640] digital: digital_in_configure_hw: in_configure_hw failed: -22

[ 501.050030] spi_geni 988000.spi: Zero length transfer

[ 501.050090] st95hf spi1.0: SPI transfer failed: -22

I would like to know is there any verified cr95hf driver for linux kernel?

    This topic has been closed for replies.
    Best answer by Brian TIDAL

    Hi,

    I confirm that the package Linux_RFAL_st25r95_v2.0.4.tar.gz properly compiles and runs on RPi3.

    The SPI SS pin is managed by software as a GPIO. Make sure that the allocated pin is free to be used. If needed, reallocate the cs0_pin used by the HW to another pin (use dtoverlay spi0-1cs,cs0_pin=x in /boot/config.txt where x is an unused pin).

    Again, I would recommend to probe the SPI SPI CLK/MOSI/MISO/CS + SSI0 + SSI1 + IRQ_IN and IRQ_OUT with a logic analyzer to see what is going wrong.

    Note: st25r95_com_spi.c should not be modified (in particular, there should not be a dummy byte in the echo command).

    Rgds

    BT

    11 replies

    Technical Moderator
    July 22, 2022

    Hi,

    I confirm that the package Linux_RFAL_st25r95_v2.0.4.tar.gz properly compiles and runs on RPi3.

    The SPI SS pin is managed by software as a GPIO. Make sure that the allocated pin is free to be used. If needed, reallocate the cs0_pin used by the HW to another pin (use dtoverlay spi0-1cs,cs0_pin=x in /boot/config.txt where x is an unused pin).

    Again, I would recommend to probe the SPI SPI CLK/MOSI/MISO/CS + SSI0 + SSI1 + IRQ_IN and IRQ_OUT with a logic analyzer to see what is going wrong.

    Note: st25r95_com_spi.c should not be modified (in particular, there should not be a dummy byte in the echo command).

    Rgds

    BT