PN7150 and raspberry pi, strange behavior and segmentation fault

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PN7150 and raspberry pi, strange behavior and segmentation fault

Jump to solution
1,379 Views
CamelCaser
Contributor II

Hi,

I recently purchased a PN7150 chip from you and I was trying the guide on how to setup it with a raspberry pi using the Linux libnfc library, I tried both the pi 4 and the pi 3b, but on both on them I have the same problem. Also tried with 32 and 64 bit of the OS.

Problem is, when I use the nfcDemoApp poll or the read example from the examples collection from github, after 9/10 reads the program starts to behave incorrectly. It doesn't respect the tag removed event, and it doesn't stop printing tag found when a tag is there but not moved at all. And if I continue to make it read tags, it eventually end with a segmentation fault.

Strange thing is, that once it become bugged, even restarting the program won't solve the issue, I have to restart the raspberry to try again.

Any solution to this?

Thanks,

Nicholas

Labels (2)
1 Solution
1,069 Views
Tomas_Parizek
NXP Employee
NXP Employee

Hello, 

The issue is most probably caused by a noise on the Rx lines -> very high Rx Gain -> The noise generates "60 07 01 a1". 

The solution would be an adjustment of the CLIF_ANA_RX_ REG register -> PN7150 Antenna Design and Matching Guide -> 5.5.3

Tomas_Parizek_0-1684752268306.png

 

I would suggest decreasing Rx gain for ISO 15693. So, let's try 40dB (01) -> 0xA0, 0x0D, 0x04, 0x22, 0x44, 0x21, 0x00

Tomas_Parizek_1-1684752562903.png

Let us know if this helps, please. 

BR

Tomas 

 

View solution in original post

0 Kudos
9 Replies
1,070 Views
Tomas_Parizek
NXP Employee
NXP Employee

Hello, 

The issue is most probably caused by a noise on the Rx lines -> very high Rx Gain -> The noise generates "60 07 01 a1". 

The solution would be an adjustment of the CLIF_ANA_RX_ REG register -> PN7150 Antenna Design and Matching Guide -> 5.5.3

Tomas_Parizek_0-1684752268306.png

 

I would suggest decreasing Rx gain for ISO 15693. So, let's try 40dB (01) -> 0xA0, 0x0D, 0x04, 0x22, 0x44, 0x21, 0x00

Tomas_Parizek_1-1684752562903.png

Let us know if this helps, please. 

BR

Tomas 

 

0 Kudos
373 Views
nea
Contributor I

Hi,

we have a similar problem with a pn7120.

Our config is a PN7120 wired via I2C to a RPI CM4, using LIBNFC and NFCPOLL.

We used this NFC design before with an IM6 CPU. This design works very well for thousands of units.

We transferred this design to CM4, keep the NFC Part (Layout).

Now we have problems with units like descript here. We shipped about 500pcs in the last 12 month.

Mainly the units did not read or read delayed, sometime we got segfaults. This happen on read Mifare 144443.

It seems to be temperature depending. Mostly they did not work on cooldown the units. I know this looks like an manufacturing/soldering issue, but it could also happen if the antenna setup perhaps?

As far as we found out was that the I2C communication breaks. If the temperature rise the reader begins again to work.

We know there is an issue with RPI and I2C stretching vs IM6.

Do you have any suggestions for us?

0 Kudos
360 Views
Tomas_Parizek
NXP Employee
NXP Employee

Hello nea, 

 

It could be the same issue as here with PN7150. 

Can you check the RX gain for 14443 Type A? I would recommend decreasing it and checking the performance. It might be that the RX gain is too high and due to the noise the communication breaks down.

 

Please check this document -> https://www.nxp.com/docs/en/application-note/AN11564.pdf

Pages 47, 48 and 49. 

Tomas_Parizek_0-1705052711598.png

For the BBA Gain, are you using the default value or different one ? 

 

BR

Tomas 

0 Kudos
1,041 Views
mattiadorigo
Contributor I

Hi Tomas, could you be more specific on where I can find the file Nfc_settings.h? Because I can't find it both on the Linux libnfc library or the NfcFactoryTestApp, the same used by CamelCaser.

Thank you

0 Kudos
1,031 Views
Tomas_Parizek
NXP Employee
NXP Employee

Hello mattiandorigo, 

If you use MCUXpresso, you can find it here: 

Tomas_Parizek_0-1684830838078.png

For Linux (e.g. Raspberry Pi ), you can find the configuration file here -> "Your folder" ->linux_libnfc-nci/conf/libnfc-nxp.conf

Tomas_Parizek_1-1684831128154.png

BR

Tomas 

 

 

 

 

0 Kudos
1,141 Views
mselvazzano
Contributor I

I've had the same problem as I was trying to build a machine that uses raspberry pi and PN7150 to write 15693 and 14443 NFC tags.
My only advice is to don't use the NXP PN7150, use the TWN4 MultiTech 2 HF from ELATEC, their library actually work and the support is better.

0 Kudos
1,321 Views
Fabian_R
NXP TechSupport
NXP TechSupport

Hello sir,

Thank you for using our products.

My recommendation is to first check the HW by running the linux_NfcFactoryTestApp from the following link: https://github.com/NXPNFCLinux/linux_NfcFactoryTestApp. There's a set of examples that will let you test different options.

In case the issue persists, please share with us the debug's output.

Best Regards,
Fabian
0 Kudos
1,304 Views
CamelCaser
Contributor II

Hi, I tried the NfcFactoryTestApp, seems like I have the 15693 problem here too. First time I tried the functional test, at the beginning everything went smooth, it found the 15693 chip and 14443 chip without problems, but then, after some scans (> 10) I closed and started again the test, and the problem appeared, the 15693 chip is not getting recognized constantly like the 14443, as you can see on the log.
02 00 is the 1443, 06 06 is the 15693. As you can see after it found the 15693, it didn't found it again like it does with the 14443, it stucked on searching for it even tho I never moved the chip, I also tried moving it, nothing helps until the library decide it's time to show me it's still there.

Thanks,
Nicholas

----------------------------
NFC Factory Test Application
----------------------------
>> 20 00 01 01 
<< 40 00 03 00 11 01 
>> 20 00 01 01 
<< 40 00 03 00 11 01 
>> 20 01 00 
<< 40 01 19 00 03 1e 03 00 08 00 01 02 03 80 81 82 83 02 d0 02 ff 02 00 04 88 10 01 ae 
PN7150 NFC controller detected
>> 2f 00 01 00 
<< 4f 00 01 00 
Select the test to run:
	 1. Continuous RF ON mode
	 2. Functional mode
	 3. PRBS mode
	 4. Standby mode
	 5. Dump RF settings
	 6. Set RF setting
	 7. Get NCI parameter value
	 8. Set NCI parameter value
	 9. Get proprietary parameter value
	10. Set proprietary parameter value
enter 0 to leave the application
Your choice: 2
Functional test mode, starting discovery loop ...
>> 21 03 09 04 00 01 01 01 02 01 06 01 
<< 41 03 01 00 
NFC Controller is now in functional mode - Press Crtl^Z to stop
<< 60 07 01 a1 
<< 60 07 01 a1 
<< 60 07 01 a1 
<< 60 07 01 a1 
<< 60 07 01 a1 
<< 60 07 01 a1 
<< 60 07 01 a1 
<< 61 05 17 01 01 02 00 ff 01 0c 44 00 07 04 1c f0 02 74 11 91 01 00 00 00 00 00 
 - tag discovered, restarting discovery loop ...
>> 21 06 01 03 
<< 41 06 01 00 
<< 61 06 02 03 00 
<< 61 05 17 01 01 02 00 ff 01 0c 44 00 07 04 1c f0 02 74 11 91 01 00 00 00 00 00 
 - tag discovered, restarting discovery loop ...
>> 21 06 01 03 
<< 41 06 01 00 
<< 61 06 02 03 00 
<< 61 05 17 01 01 02 00 ff 01 0c 44 00 07 04 1c f0 02 74 11 91 01 00 00 00 00 00 
 - tag discovered, restarting discovery loop ...
>> 21 06 01 03 
<< 41 06 01 00 
<< 61 06 02 03 00 
<< 61 05 17 01 01 02 00 ff 01 0c 44 00 07 04 1c f0 02 74 11 91 01 00 00 00 00 00 
 - tag discovered, restarting discovery loop ...
>> 21 06 01 03 
<< 41 06 01 00 
<< 61 06 02 03 00 
<< 60 07 01 a1 
<< 60 07 01 a1 
<< 61 05 15 01 01 06 06 ff 01 0a 00 00 ff f5 0f 43 08 01 04 e0 06 80 80 00 
 - tag discovered, restarting discovery loop ...
>> 21 06 01 03 
<< 41 06 01 00 
<< 61 06 02 03 00 
<< 60 07 01 a1 
<< 60 07 01 a1 
<< 61 05 15 01 01 06 06 ff 01 0a 00 00 ff f5 0f 43 08 01 04 e0 06 80 80 00 
 - tag discovered, restarting discovery loop ...
>> 21 06 01 03 
<< 41 06 01 00 
<< 61 06 02 03 00 
<< 60 07 01 a1 
<< 60 07 01 a1 
<< 61 05 17 01 01 02 00 ff 01 0c 44 00 07 04 1c f0 02 74 11 91 01 00 00 00 00 00 
 - tag discovered, restarting discovery loop ...
>> 21 06 01 03 
<< 41 06 01 00 
<< 61 06 02 03 00 
<< 61 05 17 01 01 02 00 ff 01 0c 44 00 07 04 1c f0 02 74 11 91 01 00 00 00 00 00 
 - tag discovered, restarting discovery loop ...
>> 21 06 01 03 
<< 41 06 01 00 
<< 61 06 02 03 00 
<< 61 05 17 01 01 02 00 ff 01 0c 44 00 07 04 1c f0 02 74 11 91 01 00 00 00 00 00 
 - tag discovered, restarting discovery loop ...
>> 21 06 01 03 
<< 41 06 01 00 
<< 61 06 02 03 00 
<< 60 07 01 a1 
<< 60 07 01 a1 
<< 60 07 01 a1 
<< 60 07 01 a1

 

0 Kudos
1,152 Views
CamelCaser
Contributor II
Hello?
0 Kudos