cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with detection NFC-V tags on ST25R3916 (X-NUXLEO-NFC06A1 board)

PHein.2
Associate II

In project based on exampleRfalPoller.c from library ST25NFC_Embedded_Lib_ST25R3916 and X-NUXLEO-NFC06A1 board I have problem with detection NFC-V tags.

After

 rfalNfcvPollerInitialize();                                        /* Initialize RFAL for NFC-V */

 rfalFieldOnAndStartGT();                                       /* As field is already On only starts GT timer */

 err = rfalNfcvPollerCheckPresence( &invRes );                                    /* Poll for NFC-V devices */

I always get err=4 (ERR_TIMEOUT)

Error is detected in file rfal_rfst25r3916.c, line 2190:

case RFAL_TXRX_STATE_RX_WAIT_RXS:

           irqs = st25r3916GetInterrupt( (ST25R3916_IRQ_MASK_RXS | ST25R3916_IRQ_MASK_NRE | ST25R3916_IRQ_MASK_EOF) );

           if( irqs == ST25R3916_IRQ_MASK_NONE )

           {

               break; /* No interrupt to process */

           }

           /* Only raise Timeout if NRE is detected with no Rx Start (NRT EMV mode) */

           if( ((irqs & ST25R3916_IRQ_MASK_NRE) != 0U) && ((irqs & ST25R3916_IRQ_MASK_RXS) == 0U) )

           {

//here this error is set               

               gRFAL.TxRx.status = ERR_TIMEOUT;

               gRFAL.TxRx.state = RFAL_TXRX_STATE_RX_FAIL;

               break;

           }

Tags NFC-A are detected correctly, so communication with ST25R3916 should be OK.

What can I do, to detect this tags correctly?

Sorry for may English - it's not my native language :)

1 ACCEPTED SOLUTION

Accepted Solutions
PHein.2
Associate II

Finally found the cause of the problem:

In rfal_iso15693_2.c compiler didn't initialize stream_config structure. I added few lines, and now NFC-V tags are recognizes correctly.

ReturnCode iso15693PhyConfigure(const iso15693PhyConfig_t* config, const struct iso15693StreamConfig ** needed_stream_config  )
{
    static struct iso15693StreamConfig stream_config = {                                       /* MISRA 8.9 */
        .useBPSK = 0,              /* 0: subcarrier, 1:BPSK */
        .din = 5,                  /* 2^5*fc = 423750 Hz: divider for the in subcarrier frequency */
        .dout = 7,                 /*!< 2^7*fc = 105937 : divider for the in subcarrier frequency */
        .report_period_length = 3, /*!< 8=2^3 the length of the reporting period */
    };
    
/* added lines:  */
    stream_config.useBPSK = 0;
    stream_config.din = 5;
    stream_config.dout = 7;
    stream_config.report_period_length = 3;
    
    /* make a copy of the configuration */
    ST_MEMCPY( (uint8_t*)&iso15693PhyConfig, (const uint8_t*)config, sizeof(iso15693PhyConfig_t));
    
    if ( config->speedMode <= 3U)
    { /* If valid speed mode adjust report period accordingly */
        stream_config.report_period_length = (3U - (uint8_t)config->speedMode);
    }
    else
    { /* If invalid default to normal (high) speed */
        stream_config.report_period_length = 3;
    }
 
    *needed_stream_config = &stream_config;
 
    return ERR_NONE;
}

Now I have to check in compiler manual why this behavior happen, and check if there are other places in code which can be affected by this problem.

Thank you for your help and commitment!

Regards,

Piotr

View solution in original post

17 REPLIES 17
Brian TIDAL
ST Employee

Hi,

can you give details about the NFC-V tag being used (manufacturer and model)? Can you also try to read this tag on an NFC Android phone in order to check that this tag has not been damaged?

The ST25 embedded NFC library comes with a polling demo in Projects\STM32L476RG-Nucleo\Applications\X-NUCLEO-NFC06A1\polling. Can you try to read this tag with this application?

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.
PHein.2
Associate II

Tags: ST25TV delivered with ST2R3916 Discovery Kit.

With this Kit (software ST25R3916 v1.1.0B) tags are read correctly (NFC-V E0:02:23:00).

I can read this tags also with NFC Android phone: ID: E0:02:23:00:57:13:C8:8B.

Where can I find this demo application? What should i download?

Regards,

Piotr

Brian TIDAL
ST Employee

Hi,

The polling demo comes with the ST25 embedded NFC library (in folder  Projects\STM32L476RG-Nucleo\Applications\X-NUCLEO-NFC06A1\polling) or with the X-CUBE-NFC6. The polling demo runs on X-NUCLEO-NFC06 plugged on either a NUCLEO-L053R8 or a NUCLEO-L476RG.

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.
PHein.2
Associate II

Unfortunately, still no success - NFC-A tags are detected correctly and NFC-V not detected at all.

Brian TIDAL
ST Employee

Hi,

do you mean that you have compiled the polling demo from the ST25 embedded NFC library with no modification and downloaded the binary and that you cannot read ST25TV tags?

Can you share details about your HW setup:

  • X-NUXLEO-NFC06A1
  • MCU : nucleo board? which one?

What is the value of RFAL_FEATURE_NFCV in your platform.h and what is the value of discParam.techs2Find in demoIni()?

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.
PHein.2
Associate II

No, It's no so easy. I have my own board based on PIC32MX connected with X-NuCLEO-NFC06A1. For communication is used I2C bus.

#define RFAL_FEATURE_NFCV                     true      /*!< Enable/Disable RFAL support for NFC-V (ISO15693) */
 
discParam.techs2Find = ( RFAL_NFC_POLL_TECH_A | RFAL_NFC_POLL_TECH_B |  FAL_NFC_POLL_TECH_F | RFAL_NFC_POLL_TECH_V | RFAL_NFC_POLL_TECH_ST25TB );
discParam.techs2Find |= RFAL_NFC_POLL_TECH_AP2P;
discParam.techs2Find |= RFAL_NFC_LISTEN_TECH_A;
discParam.techs2Find |= RFAL_NFC_LISTEN_TECH_F;

Before using demo_ini() function there should be defined ST25R3916. Where is this defined? A added this definition to platform.h, but maybe there should be defined something esle?

The changes I have made in project files:

platform.h:

 - added #define ST25R3916

 - added #define RFAL_USE_I2C

 - removed all LED, BUTTON and GPIO definitions

 - adjusted I2C bus definitions

 - adjusted platformDelay and platformGetSysTick definitions

st25r3916_com.c - adjusted to use I2C bus from PIC32

st25r3916_irq.c - adjusted to use IRQ signal from PIC32

main.c is renamed and

 - removed HAL_Init(), SystemClock_Config(), Led_Init();

 - all initializations: interrupts, I2C bus and tickTimer are made in my main() function

 - main() function is renamed and called from my main() function

Reading NFC-A tags works properly, so communication works OK.

Do You have any step by step description how ST25R3916 registers should be set to obtain communication with NFC-V tags?

Hi Piotr,

Also X-CUBE-NFC6 supports I2C, please see the user manual for details. The steps you describe above sound right. You could for your cross-reference try this I2C on NUCLEO-L476 + X-NUCLEO-NFC06.

If NFC-A is working I don't see a reason why NFC-V is not working. It could be an issue which only appears when doing larger I2C transfers in your driver or something. I think you will need to look into the I2C stream. If you share logic analyzer traces (SDA,SCL + IRQ) we could have a look here.

Ulysses

Hi,

"Before using demo_ini() function there should be defined ST25R3916. Where is this defined? A added this definition to platform.h, but maybe there should be defined something esle?"

ST25R3916 and RFAL_USE_I2C defines are generally defined at project level (i.e. as -DST25R3916 -DRFAL_USE_I2C at compiler level).

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.
pagano.paganino
Associate III

I also have a similar problem, I use the spi version, with a custom board based on stm32wb55, I can find nfca, but nfcv are not found.

the same code works on a NUCLEO-WB55 + X-NUCLEO-NFC06.

are there any specific registry values i can try to change?