cancel
Showing results for 
Search instead for 
Did you mean: 

ST25R3911 Detects NFCV Tag Got ERR_RF_COLLISION Return Code

WWang.8
Associate II

Hey,

I'm using ST25R3911 and ST RFAL Lib, and a 15693 tag on my customized board.

I was using an iPhone to detect the tag and it works. And I was using NFCA tag, the ST25R3911 and the Lib work good.

But as I move on to the NRFV tag, the board can detect the exist of the tag by rfalNfcPollTechDetetection. But once I'm trying to get the count of the tag, using rfalNfcPollCollResolution. The count is always 0. While I debug into the function and it's returning ERR_RF_COLLISION on rfalNfcvPollerInventory.

I have my code of using the RFAL below and can anybody help to see or give some advice to me. Thank you so much.

  • Variables
#define EXAMPLE_NFC_DEVICES 1
 
static rfalNfcDevice *nfcDevice;
static rfalNfcDiscoverParam discParam =
	{
		.compMode = RFAL_COMPLIANCE_MODE_NFC,
		.devLimit = EXAMPLE_NFC_DEVICES,
		.nfcfBR = RFAL_BR_212,
		.ap2pBR = RFAL_BR_424,
		.nfcid3 = NULL,
		.GB = NULL,
		.GBLen = 0,
		.notifyCb = NULL,
		.totalDuration = 10U,
		.wakeupEnabled = false,
		.wakeupConfigDefault = true,
		.techs2Find = (RFAL_NFC_POLL_TECH_A | RFAL_NFC_POLL_TECH_V)};

  • Initialize

rfalNfcInitialize();
rfalNfcDeactivate(false);
rfalNfcDiscover(&discParam);

  • Polling
{
 
		rfalNfcWorker();
 
		if (rfalNfcIsDevActivated(rfalNfcGetState()))
		{
			/*
             * Retrieve NFC device
             */
			rfalNfcGetActiveDevice(&nfcDevice);
 
			rfalNfcDeactivate(false);
 
			rfalNfcDiscover(&discParam);
		}
	}

If using NFCA tag, it can make rfalNfcIsDevActivated return true.

If using NFCV tag, it can never call rfalNfcIsDevActivated true branch.

Thank you all!

1 ACCEPTED SOLUTION

Accepted Solutions
Ulysses HERNIOSUS
ST Employee

Hi WWang.8,

it sounds like you have an issue with one of matching, noise or saturation issue.

Please carefully inspect your board to not overstress the RFIs: measure the amplitude on RFI and make sure that it stays within limits (adapt voltage divider if necessary). Then using the analog observation modes you could look if you see major noise on the receiver.

From chip perspective you could go and lower the gain (actually increase gain reduction) using analog configs.

The collision resolution in NFC-A and NFC-V is furthermore critical as we are disabling AGC for better detecting collisions. Thus you could experiment with changing inside rfalISO15693TransceiveAnticollisionFrame the RFAL_TXRX_FLAGS_AGC_OFF to RFAL_TXRX_FLAGS_AGC_ON.

Best Regards, Ulysses

View solution in original post

5 REPLIES 5
Ulysses HERNIOSUS
ST Employee

Hi WWang.8,

it sounds like you have an issue with one of matching, noise or saturation issue.

Please carefully inspect your board to not overstress the RFIs: measure the amplitude on RFI and make sure that it stays within limits (adapt voltage divider if necessary). Then using the analog observation modes you could look if you see major noise on the receiver.

From chip perspective you could go and lower the gain (actually increase gain reduction) using analog configs.

The collision resolution in NFC-A and NFC-V is furthermore critical as we are disabling AGC for better detecting collisions. Thus you could experiment with changing inside rfalISO15693TransceiveAnticollisionFrame the RFAL_TXRX_FLAGS_AGC_OFF to RFAL_TXRX_FLAGS_AGC_ON.

Best Regards, Ulysses

WWang.8
Associate II

Hi Ulysses,

I appreciate your fast response at your weekend.

According your instruction, I found out my resister between RFI and the antenna is 0R, while the ST official EVB is 3.9R or 5.6R. I guess this will make the amplitude beyond the threshold. But I don't have an oscilloscope and the resisters on hand, and will verify that tomorrow.

I also tried to reduce the gain to minimum(0Ah is set to the AM channel Gain Control) and enable the AGC, but nothing is changed on the detecting of NFCV tag. I'm changing the gain reduction by changing below code. Can you help to take a look if I'm doing the right thing?

rfal_analogConfigTbl.h

, ST25R3911_REG_RX_CONF4,               ST25R3911_REG_RX_CONF4_mask_rg2_am, 0xAU<<ST25R3911_REG_RX_CONF4_shift_rg2_am /* increase digitizer window for AM */

is part of below,

    //****** Default Analog Configuration for Poll NFC-V Common bitrate Rx ******/
    , MODE_ENTRY_4_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_COMMON | RFAL_ANALOG_CONFIG_RX)
                      , ST25R3911_REG_RX_CONF1, 0x7f, 0x0c /* use filter settings from table 9: "Recommended for 424/484 kHz sub-carrier" */
                      , ST25R3911_REG_RX_CONF3, 0xff, 0x18
                      , ST25R3911_REG_RX_CONF4,               ST25R3911_REG_RX_CONF4_mask_rg2_am, 0xAU<<ST25R3911_REG_RX_CONF4_shift_rg2_am /* increase digitizer window for AM */
                      , ST25R3911_REG_AUX,                    ST25R3911_REG_AUX_rx_tol, ST25R3911_REG_AUX_rx_tol                           /* rx_tol On as default */
                      )

For the AGC enabling, changing to RFAL_TXRX_FLAGS_AGC_ON in below code,

    ctx.flags     = ((txBufLen==0U)?(uint32_t)RFAL_TXRX_FLAGS_CRC_TX_MANUAL:(uint32_t)RFAL_TXRX_FLAGS_CRC_TX_AUTO) | (uint32_t)RFAL_TXRX_FLAGS_CRC_RX_KEEP | (uint32_t)RFAL_TXRX_FLAGS_AGC_ON | ((txBufLen==0U)?(uint32_t)RFAL_TXRX_FLAGS_NFCV_FLAG_MANUAL:(uint32_t)RFAL_TXRX_FLAGS_NFCV_FLAG_AUTO); /* Disable Automatic Gain Control (AGC) for better detection of collision */

For the analog observation modes you mentioned, I'm still working reading the specifications and trying to figure it out.

Thanks again!

Hey Ulysses,

I just got a 3rd party EVB, and it works using it's own code. Just I change the code to the method I mentioned in my 1st post, it's still not working.

Then I change my code to the 3rd party EVB's method(Actually it's just using the old version

lib and old interfaces.), it works.

The code I'm using now is,

Initialize,

rfalInitialize();

Polling,

/* Run RFAL Worker */
	rfalWorker();
 
	{
		ReturnCode err;
		rfalNfcvListenDevice nfcvDev;
		bool found = false;
		uint8_t devCnt = 0;
		/*******************************************************************************/
		/* ISO15693/NFC_V_PASSIVE_POLL_MODE                                            */
		/*******************************************************************************/
 
		rfalNfcvPollerInitialize(); /* Initialize for NFC-F */
		rfalFieldOnAndStartGT();	/* Turns the Field On if not already and start GT timer */
 
		err = rfalNfcvPollerCollisionResolution(RFAL_COMPLIANCE_MODE_NFC, 1, &nfcvDev, &devCnt);
		if ((err == ERR_NONE) && (devCnt > 0))
		{
			/******************************************************/
			/* NFC-V card found                                   */
			/* NFCID/UID is contained in: invRes.UID */
			
			REVERSE_BYTES(nfcvDev.InvRes.UID, RFAL_NFCV_UID_LEN);
 
			found = true;
			//printf("ISO15693/NFC-V card found. UID: %s\r\n", hex2Str(nfcvDev.InvRes.UID, RFAL_NFCV_UID_LEN));
		}
	}

I'm using the new lib, but calling the old nfc interfaces. I read the source code but it seems the old and new interface they are using the same working flow. Just the new one is more convenient to use. But there must be something different and I will take a look at the detail once I get a chance.

Thank you.

Hi WWang.8,

the "new lib" provides a RF Higher Layer (inside rfal_nfc.c) on top of RF AL technology modules (e.g rfal_nfcv.c). You can use either this convenient higher layer (recommended) or you can deal with the technology modules.

What is the error code returned by rfalNfcvPollerCollisionResolution?

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi WWang.8,

your changes look correct in the sense that you figured the right bits.

However changing the gain will not change the amplitude. Gains are affecting the demodulated signal. Amplitude is before that. You can use the chip internal function to measure the amplitude. Please refer to API rfalChipMeasureAmplitude().

If this still does not lead you anywhere then I suggest to cross-connect boards (e.g. use your MCU to control the NFC05, verifying your software is fine and also the other way around to see if your analog is fine.) If still lost you can also share logic analyzer traces (SPI+IRQ) with us for inspection.

BR, Ulysses