We are using NFC module PN7120 on ComputeBoard with Intel Atom E3845 processor. Board runs on Ubuntu with Linux 4.18. Can I use the driver present in drivers/nfc/pn544/pn544_i2c.ko to drive this module and use the demo applications given in AN11697 PN71xx Linux Software Stack Integration Guidelines.
When I tried the same I am getting "NfcService Init Failed" message. Please guide me
Hi Binsy,
PN7150 / PN7120 are designed for embeded OS and embeded processors, for example, mcu / CPU with ARM core; Window IoT, Android and embeded Linux OS.
Using pn7150 / 20 on Linux OS, we need to modify device tree (DTS file) to load I2C driver and pn5xx driver , BUT in linux source code, x86 platform doesn't use device tree, we don't have no way to add correponding drivers to source code, even if you can add it, you also don't know which 2 pins of x86 CPU are multiplexed for the I2C port connected to PN7120.
FOR X86 Platform, your best choice for NFC application is PR533, which uses USB port to connect with PCB USB.
USB NFC integrated reader solution | NXP (PR533's Link)
You can get a USB stick of PR533 to do test on your ubuntu host.
Hope abvoe information is helpful for you.
Have a nice day!
BR,
Weidong
Can I use PN7120 on orangepi zero 3 (Orange Pi 1.0.0 Jammy with Linux 6.1.31-sun50iw9) I follow AN11697 PN71xx Linux Software Stack Integration Guidelines, but something went wrong:
orangepi@orangepizero3:~/linux_libnfc-nci$ sudo LIBNFC_LOG_LEVEL=3 nfc-scan-device -i -v
debug libnfc.config key: [device.name], value: [PN7120 board via I2C]
debug libnfc.config key: [allow_intrusive_scan], value: [true]
debug libnfc.config key: [device.connstring], value: [pn71xx:/dev/i2c-3]
debug libnfc.config Unable to open directory: /etc/nfc/devices.d
debug libnfc.general log_level is set to 3
debug libnfc.general allow_autoscan is set to true
debug libnfc.general allow_intrusive_scan is set to true
debug libnfc.general 1 device(s) defined by user
debug libnfc.general #0 name: "PN7120 board via I2C", connstring: "pn71xx:/dev/i2c-3"
nfc-scan-device uses libnfc 1.8.0
debug libnfc.driver.arygon Trying to find ARYGON device on serial port: /dev/ttyS0 at 9600 baud.
debug libnfc.bus.uart Serial port speed requested to be set to 9600 baud.
debug libnfc.bus.uart TX: 30 61 72
debug libnfc.bus.uart Timeout!
debug libnfc.driver.arygon No reply to 'reset TAMA' command.
debug libnfc.driver.arygon Trying to find ARYGON device on serial port: /dev/ttyS5 at 9600 baud.
debug libnfc.driver.arygon Trying to find ARYGON device on serial port: /dev/ttyS4 at 9600 baud.
debug libnfc.driver.arygon Trying to find ARYGON device on serial port: /dev/ttyS3 at 9600 baud.
debug libnfc.driver.arygon Trying to find ARYGON device on serial port: /dev/ttyS2 at 9600 baud.
debug libnfc.driver.arygon Trying to find ARYGON device on serial port: /dev/ttyS1 at 9600 baud.
debug libnfc.general 0 device(s) found using arygon driver
debug libnfc.driver.pn532_i2c Trying to find PN532 device on I2C bus /dev/i2c-3.
debug libnfc.chip.pn53x Diagnose
debug libnfc.chip.pn53x Timeout value: 500
debug libnfc.chip.pn53x SAMConfiguration
debug libnfc.chip.pn53x Timeout value: 1000
debug libnfc.bus.i2c TX: 00 00 ff 03 fd d4 14 01 17 00
error libnfc.bus.i2c Error: wrote only -1 bytes (10 expected) (No such device or address).
error libnfc.driver.pn532_i2c Failed to transmit data. Retries left: 2.
debug libnfc.bus.i2c TX: 00 00 ff 03 fd d4 14 01 17 00
error libnfc.bus.i2c Error: wrote only -1 bytes (10 expected) (No such device or address).
error libnfc.driver.pn532_i2c Failed to transmit data. Retries left: 1.
debug libnfc.bus.i2c TX: 00 00 ff 03 fd d4 14 01 17 00
error libnfc.bus.i2c Error: wrote only -1 bytes (10 expected) (No such device or address).
error libnfc.driver.pn532_i2c Failed to transmit data. Retries left: 0.
error libnfc.driver.pn532_i2c Unable to transmit data. (TX)
debug libnfc.driver.pn532_i2c Trying to find PN532 device on I2C bus /dev/i2c-5.
debug libnfc.chip.pn53x Diagnose
debug libnfc.chip.pn53x Timeout value: 500
debug libnfc.chip.pn53x SAMConfiguration
debug libnfc.chip.pn53x Timeout value: 1000
debug libnfc.bus.i2c TX: 00 00 ff 03 fd d4 14 01 17 00
error libnfc.bus.i2c Error: wrote only -1 bytes (10 expected) (Input/output error).
error libnfc.driver.pn532_i2c Failed to transmit data. Retries left: 2.
debug libnfc.bus.i2c TX: 00 00 ff 03 fd d4 14 01 17 00
error libnfc.bus.i2c Error: wrote only -1 bytes (10 expected) (Input/output error).
error libnfc.driver.pn532_i2c Failed to transmit data. Retries left: 1.
debug libnfc.bus.i2c TX: 00 00 ff 03 fd d4 14 01 17 00
error libnfc.bus.i2c Error: wrote only -1 bytes (10 expected) (Input/output error).
error libnfc.driver.pn532_i2c Failed to transmit data. Retries left: 0.
error libnfc.driver.pn532_i2c Unable to transmit data. (TX)
debug libnfc.driver.pn532_i2c Trying to find PN532 device on I2C bus /dev/i2c-4.
debug libnfc.chip.pn53x Diagnose
debug libnfc.chip.pn53x Timeout value: 500
debug libnfc.chip.pn53x SAMConfiguration
debug libnfc.chip.pn53x Timeout value: 1000
debug libnfc.bus.i2c TX: 00 00 ff 03 fd d4 14 01 17 00
error libnfc.bus.i2c Error: wrote only -1 bytes (10 expected) (No such device or address).
error libnfc.driver.pn532_i2c Failed to transmit data. Retries left: 2.
debug libnfc.bus.i2c TX: 00 00 ff 03 fd d4 14 01 17 00
error libnfc.bus.i2c Error: wrote only -1 bytes (10 expected) (No such device or address).
error libnfc.driver.pn532_i2c Failed to transmit data. Retries left: 1.
debug libnfc.bus.i2c TX: 00 00 ff 03 fd d4 14 01 17 00
error libnfc.bus.i2c Error: wrote only -1 bytes (10 expected) (No such device or address).
error libnfc.driver.pn532_i2c Failed to transmit data. Retries left: 0.
error libnfc.driver.pn532_i2c Unable to transmit data. (TX)
debug libnfc.general 0 device(s) found using pn532_i2c driver
debug libnfc.general 0 device(s) found using pn532_spi driver
debug libnfc.driver.pn532_uart Trying to find PN532 device on serial port: /dev/ttyS0 at 115200 baud.
debug libnfc.bus.uart Serial port speed requested to be set to 115200 baud.
debug libnfc.chip.pn53x Diagnose
debug libnfc.chip.pn53x Timeout value: 500
debug libnfc.bus.uart TX: 55 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00
debug libnfc.chip.pn53x SAMConfiguration
debug libnfc.chip.pn53x Timeout value: 1000
debug libnfc.bus.uart TX: 00 00 ff 03 fd d4 14 01 17 00
debug libnfc.bus.uart Timeout!
debug libnfc.driver.pn532_uart Unable to read ACK
debug libnfc.driver.pn532_uart Trying to find PN532 device on serial port: /dev/ttyS5 at 115200 baud.
debug libnfc.driver.pn532_uart Trying to find PN532 device on serial port: /dev/ttyS4 at 115200 baud.
debug libnfc.driver.pn532_uart Trying to find PN532 device on serial port: /dev/ttyS3 at 115200 baud.
debug libnfc.driver.pn532_uart Trying to find PN532 device on serial port: /dev/ttyS2 at 115200 baud.
debug libnfc.driver.pn532_uart Trying to find PN532 device on serial port: /dev/ttyS1 at 115200 baud.
debug libnfc.general 0 device(s) found using pn532_uart driver
debug libnfc.driver.acr122s Trying to find ACR122S device on serial port: /dev/ttyS0 at 9600 baud.
debug libnfc.bus.uart Serial port speed requested to be set to 9600 baud.
debug libnfc.driver.acr122s Trying to find ACR122S device on serial port: /dev/ttyS5 at 9600 baud.
debug libnfc.driver.acr122s Trying to find ACR122S device on serial port: /dev/ttyS4 at 9600 baud.
debug libnfc.driver.acr122s Trying to find ACR122S device on serial port: /dev/ttyS3 at 9600 baud.
debug libnfc.driver.acr122s Trying to find ACR122S device on serial port: /dev/ttyS2 at 9600 baud.
debug libnfc.driver.acr122s Trying to find ACR122S device on serial port: /dev/ttyS1 at 9600 baud.
debug libnfc.general 0 device(s) found using ACR122S driver
debug libnfc.general 0 device(s) found using acr122_usb driver
debug libnfc.general 0 device(s) found using pn53x_usb driver
1 NFC device(s) found:
debug libnfc.general No driver available to handle "pn71xx:/dev/i2c-3".
nfc_open failed for pn71xx:/dev/i2c-3
Hi Weidong,
Thanks for the reply.
We have connected PN7120 module to I2C -6 of the Intel atom E3845 processor.
As per the data sheet the address should be 0x28.
When I try to communicate, i2cdetect command is not showing this module on the bus.
The driver inserted is /driver/nfc/pn544_i2c.ko
And the application used is demoapp mentioned in AN11697 PN71xx Linux Software Stack Integration Guidelines
Your guidance will be of great help
Thanks,
Binsy M S
Hi Binsy,
According to the idea of embedded CPU platform, it is difficult for us to add pn7150 to the Linux kernel, because we also need I2C driver on the CPU side, and we need to add I2C driver and pn544 i2c.ko to the device tree. However, for x86 Linux platform, it is difficult for us to do this work. Therefore, it is recommended that you use pr533.
Because I am not familiar with X86 platform, I just check the Linux source code of X86 platform according to your problem. You can try this. First load the CPU I2C driver, then the NFC reader driver.
Maybe this method has a little hope for your purpose.
Have a nice day! BR, weidong
Hello Binsy M S,
I checked it, no issues were found.
Have a nice day!
BR,
Weidong