OM27160B1HN with SPI interface not working

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

OM27160B1HN with SPI interface not working

4,101件の閲覧回数
Dharmit_m
Contributor II

I have purchased a PN7160 based Evalution board  OM27160B1HN with SPI support. I have followed the instructions based on this AN12991 document and interfaced it with raspberry pi 4B, But getting a "NfcService init failed" error as shown in attached image. Please guide to solve this issue2023-06-13-123309_1920x1080_scrot.png

ラベル(2)
タグ(3)
0 件の賞賛
返信
14 返答(返信)

3,162件の閲覧回数
Dharmit_m
Contributor II

Hello @danielchen we have developed our own custom board based on PN7160 with SPI configuration and the board-bring up is successful but still its not detecting any tags. I am attaching the logs for the reference. Awaiting quick response. Thank you

regards,

Dharmit M

0 件の賞賛
返信

4,080件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi @Dharmit_m 

 I assume you are using 64-bit OS.  please apply the patch as attached. and try it again.

If you have other issues, please enable all logs and share log with us.

 

 

Regards

Daniel

0 件の賞賛
返信

4,072件の閲覧回数
Dharmit_m
Contributor II

@danielchen thanks for reply, I am using below version of OS and kindly explain how to enable logs in raspberry pi

Raspberry Pi OS with desktop

  • Release date: May 3rd 2023
  • System: 32-bit
  • Kernel version: 6.1
  • Debian version: 11 (bullseye)

Thanks

0 件の賞賛
返信

4,064件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi @Dharmit_m 

 

Please check the configuration file   libnfc-nxp.conf

 

###############################################################################
# Logging Levels. Suggested value for debugging is 0x03.
# NXPLOG_GLOBAL_LOGLEVEL - Configuration for Global logging level
# NXPLOG_EXTNS_LOGLEVEL - Configuration for extns logging level
# NXPLOG_NCIHAL_LOGLEVEL - Configuration for enabling logging of HAL
# NXPLOG_NCIX_LOGLEVEL - Configuration for enabling logging of NCI TX packets
# NXPLOG_NCIR_LOGLEVEL - Configuration for enabling logging of NCI RX packets
# NXPLOG_FWDNLD_LOGLEVEL - Configuration for enabling logging of FW download functionality
# NXPLOG_TML_LOGLEVEL - Configuration for enabling logging of TML
# Logging Levels
# NXPLOG_DEFAULT_LOGLEVEL 0x01
# NXPLOG_DEBUG_LOGLEVEL 0x03
# NXPLOG_WARN_LOGLEVEL 0x02
# NXPLOG_ERROR_LOGLEVEL 0x01
# NXPLOG_SILENT_LOGLEVEL 0x00
NXPLOG_EXTNS_LOGLEVEL=0x03
NXPLOG_NCIHAL_LOGLEVEL=0x03
NXPLOG_NCIX_LOGLEVEL=0x03
NXPLOG_NCIR_LOGLEVEL=0x03
NXPLOG_FWDNLD_LOGLEVEL=0x03
NXPLOG_TML_LOGLEVEL=0x03

 

configure them to 0x03 

 

Regards

Daniel

0 件の賞賛
返信

4,054件の閲覧回数
Dharmit_m
Contributor II

Find the attached log file as requested. Kindly guide the further step to test the nfc reader.

Thanks

Dharmit

 

0 件の賞賛
返信

3,990件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi

 

From your log message,  you can see you are using I2C , not SPI. I would suggest you check it.

danielchen_0-1687264127971.png

 

 

Regards

Daniel

 

タグ(1)
0 件の賞賛
返信

3,982件の閲覧回数
Dharmit_m
Contributor II

as shown in the same log it is trying to initialize SPI at dev/spidev0.0 and setting nxp transport at 0x03 which is SPI as per libnfc-nxp.conf file settings and also the physical hardware interface is SPI only and the Evalution board is OM27160B1HN which is SPI configured during chip manufacturing. please  provide the reference log with SPI if it is working properly to narrow down the issue.

 

Dharmit_m_0-1687266162570.png

 

0 件の賞賛
返信

3,931件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi @Dharmit_m 

 

Are you using the integrated driver or nxp driver?  can you share the configuration file ?

 

Regards

Daniel

0 件の賞賛
返信

3,925件の閲覧回数
Dharmit_m
Contributor II

@danielchen here is the attached libnfc-nxp.conf file.

0 件の賞賛
返信

3,913件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi @Dharmit_m 

 

Can you try to run NfcFactoryTest application?

Did you enabled the SPI in raspberry PI config?

 

Regards

Daniel

0 件の賞賛
返信

2,762件の閲覧回数
gaurav_sharma
NXP Employee
NXP Employee
I have been trying to interface the same PN7160 module with imx93evk, but somehow getting the same error message. " Error in I2C Write".
Why is it reporting I2C write when I am using SPI ?
I am using /dev/nxpnfc. My configs are as follows:-

NXPLOG_EXTNS_LOGLEVEL=0x03
NXPLOG_NCIHAL_LOGLEVEL=0x03
NXPLOG_NCIX_LOGLEVEL=0x03
NXPLOG_NCIR_LOGLEVEL=0x03
NXPLOG_FWDNLD_LOGLEVEL=0x03
NXPLOG_TML_LOGLEVEL=0x03
###############################################################################
# TRANSPORT Type
# 0x00 - I2C /SPI for noraml nxpnfc driver
# 0x01 - Not Used, kept to align with Android code
# 0x02 - ALT_I2C
# 0x03 - ALT_SPI
NXP_TRANSPORT=0x00

###############################################################################
# Nfc Device Node name
NXP_NFC_DEV_NODE="/dev/nxpnfc"

###############################################################################
# Extension for Mifare reader enable
MIFARE_READER_ENABLE=0x01

###############################################################################
# Firmware file type
#.so file 0x01
#.bin file 0x02
NXP_FW_TYPE=0x01

###############################################################################
# System clock source selection configuration
#define CLK_SRC_XTAL 1
#define CLK_SRC_PLL 2
NXP_SYS_CLK_SRC_SEL=0x01

Can you please help in resolving this?

Error logs:-

2023:03:03-11:51:36.531 find found MIFARE_READER_ENABLE=(0x1)
2023:03:03-11:51:36.531 GetNxpNumValue: NXP Config Parameter : MIFARE_READER_ENABLE=(0x1)
2023:03:03-11:51:36.532 Entering phNxpNciHal_init_monitor
2023:03:03-11:51:36.532 Returning with SUCCESS
2023:03:03-11:51:36.532 find found NXP_NFC_DEV_NODE
2023:03:03-11:51:36.532 GetNxpStrValue: NXP Config Parameter : NXP_NFC_DEV_NODE
2023:03:03-11:51:36.532 phTmlNfc_Init Entry......
2023:03:03-11:51:36.532 find found NXP_TRANSPORT=(0x0)
2023:03:03-11:51:36.532 GetNxpNumValue: NXP Config Parameter : NXP_TRANSPORT=(0x0)
2023:03:03-11:51:36.532 getTransport Requested transportType: 0
2023:03:03-11:51:36.532 OpenAndConfigure Opening port=/dev/nxpnfc
2023:03:03-11:51:36.542 NfccReset, VEN eType 0
2023:03:03-11:51:36.562 NfccReset, VEN eType 1
2023:03:03-11:51:36.583 PN54X - Tml Reader Thread Started................
2023:03:03-11:51:36.583 phTmlNfc_Init exit wInitStatus=0
2023:03:03-11:51:36.583 PN54X - Tml Writer Thread Started................
2023:03:03-11:51:36.583 PN54X - Tml Writer Thread Running................
2023:03:03-11:51:36.583 PN54X - Read requested.....
2023:03:03-11:51:36.583 PN54X - Invoking I2C Read.....
2023:03:03-11:51:36.583 thread started
2023:03:03-11:51:36.583 PN54X - Write requested.....
2023:03:03-11:51:36.584 PN54X - Invoking I2C Write.....
2023:03:03-11:51:36.584 Write EOF
2023:03:03-11:51:36.584 PN54X - Error in I2C Write.....
2023:03:03-11:51:36.584 PN54X - Posting Fresh Write message.....
2023:03:03-11:51:36.584 PN54X - Tml Writer Thread Running................
2023:03:03-11:51:36.584 write error status = 0x1ff
2023:03:03-11:51:36.584 write_unlocked failed - PN54X Maybe in Standby Mode - Retry
2023:03:03-11:51:36.594 PN54X - Write requested.....
2023:03:03-11:51:36.594 PN54X - Invoking I2C Write.....
2023:03:03-11:51:36.594 Write EOF
2023:03:03-11:51:36.594 PN54X - Error in I2C Write.....
0 件の賞賛
返信

2,745件の閲覧回数
gaurav_sharma
NXP Employee
NXP Employee

Got to know that the Nfcc Transport is common code for both nxpnfc I2C and SPI driver so that answers my question "Why is it reporting I2C write when I am using SPI ?"

However the issue is still there. Getting Write errors.

0 件の賞賛
返信

3,897件の閲覧回数
Dharmit_m
Contributor II

@danielchen here is a attached screenshot containing factory test application log, and spi configuration of raspberry pi.

2023-06-27-115338_1920x1080_scrot.png

0 件の賞賛
返信

2,763件の閲覧回数
gaurav_sharma
NXP Employee
NXP Employee

 @Dharmit_m, is it working for you now ?

0 件の賞賛
返信