cancel
Showing results for 
Search instead for 
Did you mean: 

X-CUBE-NFC6 Polling Demo on NUCLEO-L476 can't detect AP2P techs

dwagner4
Associate III

Hello,

This is sort of related to my earlier post, and is an effort to uncomplicate things a little.  I have configured a project using X-CUBE-NFC6 on a NUCLEO-L476 and NFC08A1 board.  The demo runs fine, and can detect the different technologies.

However, when I comment out the technologies in rfal_defConfig.h and rfal_features.h so that the only technologies used are RFAL_FEATURE_ISO_DEP and RFAL_SUPPORT_MODE_POLL_ACTIVE_P2P (and LISTEN), I cannot get two L476 boards with the same software to initiate a AP2P connection.

When I load one of the boards with the AP2P_PROP example from the ST25 Embedded Lib examples, however, I can get both boards to communicate.  Two boards with AP2P_PROP also will communicate.  It is only the X-CUBE projects that seem to have the issue.

I have spent many, many hours going through debugging both projects to see the difference, but there is none that I can tell.  Is there some analog config difference that would make this happen?

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Hi,

on my side,

  • I've removed existing X-CUBE-NFC6 packages and I've loaded the 3.1.0 from st.com to make sure to have a fresh package
  • I've generated a NUCLEO-L476RG + X-NUCLEO-NFC08A1 project from scratch (see attached ioc file) for MDK-ARM IDE
  • In the project:
    • I've removed rfal_cd.c (not needed and causing link error when RFAL_FEATURE_NFCA, RFAL_FEATURE_NFCF are disabled) 
    • In rfal_defConfig.h, all RFAL_FEATURE_xxx have been set to false except RFAL_FEATURE_LISTEN_MODE and RFAL_FEATURE_NFC_DEP that are true
    • in demoIni() I've commented line 300 and 309 to avoid having RFAL_NFC_LISTEN_TECH_A and RFAL_NFC_LISTEN_TECH_F in the tech2Find (i.e. tech2Find only contains RFAL_NFC_POLL_TECH_AP2P and RFAL_NFC_LISTEN_TECH_AP2P)
  • I've compiled/linked/flashed 2 NUCLEO-L476RG boards + X-NUCLEO-NFC08A1
  • I've connected the serial terminal and have pressed the reset button

When the 2 boards are close, I see the AP2P led and the following message:

Welcome to X-NUCLEO-NFC08A1
Initialization succeeded..
NFC Active P2P device found. NFCID3: 01FE030405060708090A
Initialize device .. succeeded.
Push NDEF Uri: www.st.com/st25-demo ... succeeded.
Device present, maintaining connection ............................
Device removed.

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.

View solution in original post

6 REPLIES 6
Brian TIDAL
ST Employee

Hi, 

make sure to use the latest X-CUBE-NFC6 package from st.com (currently 3.1.0).

The rfal_features.h file should not be modified. Make sure to revert any modification done inside this file.

In order to disable some technologies, modify only the RFAL_FEATURES_XXX flags in the rfal_DefConfig.h

For initiator and target AP2P, make sure to enable RFAL_FEATURE_NFC_DEP and RFAL_FEATURE_LISTEN_MODE.

For ISODEP, make sure to enable RFAL_NFC_POLL_TECH_A (optionally RFAL_NFC_POLL_TECH_B), RFAL_FEATURE_ISO_DEP, RFAL_FEATURE_ISO_DEP_POLL and RFAL_FEATURE_ISO_DEP_LISTEN

 

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.

Thank you for your reply.

I have reverted rfal_features.h to its default state.

In my rfal_defConfig.h I have

#define RFAL_FEATURE_LISTEN_MODE               true       
#define RFAL_FEATURE_WAKEUP_MODE               true       
#define RFAL_FEATURE_LOWPOWER_MODE             false     
#define RFAL_FEATURE_NFCA                      true       
#define RFAL_FEATURE_NFCB                      false       
#define RFAL_FEATURE_NFCF                      false       
#define RFAL_FEATURE_NFCV                      true       
#define RFAL_FEATURE_T1T                       false       
#define RFAL_FEATURE_T2T                       false       
#define RFAL_FEATURE_T4T                       false       
#define RFAL_FEATURE_ST25TB                    false       
#define RFAL_FEATURE_ST25xV                    false       
#define RFAL_FEATURE_DYNAMIC_ANALOG_CONFIG     true     
#define RFAL_FEATURE_DPO                       false      
#define RFAL_FEATURE_ISO_DEP                   true       
#define RFAL_FEATURE_ISO_DEP_POLL              true       
#define RFAL_FEATURE_ISO_DEP_LISTEN            true       
#define RFAL_FEATURE_NFC_DEP                   true  

 

 As for RFAL_NFC_POLL_TECH_A, is that for putting in techs2find?

discParam.techs2Find	|=	(RFAL_NFC_POLL_TECH_A);

 

I'm not quite getting the right response.  I have a board running just the stock PollingTagDetect demo, and another that I am adjusting the code so that it only does AP2P either polling/listening.

Discovery parameters are

discParam.techs2Find 	= (RFAL_NFC_POLL_TECH_AP2P | RFAL_NFC_LISTEN_TECH_AP2P);
        discParam.techs2Find    |= RFAL_NFC_POLL_TECH_V;
        discParam.techs2Find	|=	(RFAL_NFC_POLL_TECH_A);

And I have modified the demo_polling.c for this board so that in the demoCycle() switch statement in DEMO_ST_DISCOVERY there is only these cases:

case RFAL_NFC_LISTEN_TYPE_AP2P:
case RFAL_NFC_POLL_TYPE_AP2P:
                        
    platformLedOn(PLATFORM_LED_AP2P_PORT, PLATFORM_LED_AP2P_PIN);
    platformLog("NFC Active P2P device found. NFCID3: %s\r\n", hex2Str(nfcDevice->nfcid, nfcDevice->nfcidLen));
    demoP2P( nfcDevice );
    break;
                    
 default:
    break;

Still can't get either AP2P LISTEN/POLL to work, but it is disovering NFC-A on the other board (though it does nothing since I've modified demoCycle() ).

Brian TIDAL
ST Employee

Hi,

I am not sure to understand what is needed by your application. Can you describe your use cases?

If your application needs only AP2P communication, the tech2Find should be:

discParam.techs2Find 	= (RFAL_NFC_POLL_TECH_AP2P | RFAL_NFC_LISTEN_TECH_AP2P);

The tech2Find  contains the technologies your application wants to discover. Those technologies have to be enabled in the RFAL code (this is achieved thanks  to the  RFAL_FEATURE_XXX flags that help to remove unused features from the code).

For initiator and target AP2P,  RFAL_FEATURE_NFC_DEP and RFAL_FEATURE_LISTEN_MODE have to be set to true. You can keep other RFAL_FEATURE_xxx flags to true or not (this will simply keep or remove unused code as the technologies are not part of tech2Find).

Also, can you confirm X-CUBE-NFC6 v3.1.0 is being used?

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.

Hello,

Thank you for your reply.  I can confirm X-CUBE-NFC6 3.1.0 is being used.

The use case right now is that we are just trying to run the same two copies of the demo code modified slightly so that when they are in proximity, they will only be time-multiplexing between RFAL_NFC_POLL_TECH_AP2P and RFAL_NFC_LISTEN_TECH_AP2P and will run the code in demoP2P() inside demo_polling.c when they have discovered each other.

The steps to get to this have been to load the unmodified demo code onto two NUCLEO-L476RG boards and verify code was running.  Could never observe the AP2P mode between the two boards, but did observe NFCA and NFCF, and a 3rd-party NFCV tag (NXP NTAG).

Next step was to modify the code so that only the AP2P modes are detected (by modifying rfal_defConfig.h inside X-CUBE-NFC6/Target).  The two boards do not detect each other and the Tx LED blinks every 1s as it does when no techs have been found. Have run through debug many hours, but not been able to pinpoint why they do not  both eventually multiplex in to the Target/Initiator or Initiator/Target roles.

Have also tried running this code on NUCLEO-F072RB with same result.

Would there be configuration issues somewhere else with the board setup, like clocking or NVIC/IRQ? 

 

Brian TIDAL
ST Employee

Hi,

on my side,

  • I've removed existing X-CUBE-NFC6 packages and I've loaded the 3.1.0 from st.com to make sure to have a fresh package
  • I've generated a NUCLEO-L476RG + X-NUCLEO-NFC08A1 project from scratch (see attached ioc file) for MDK-ARM IDE
  • In the project:
    • I've removed rfal_cd.c (not needed and causing link error when RFAL_FEATURE_NFCA, RFAL_FEATURE_NFCF are disabled) 
    • In rfal_defConfig.h, all RFAL_FEATURE_xxx have been set to false except RFAL_FEATURE_LISTEN_MODE and RFAL_FEATURE_NFC_DEP that are true
    • in demoIni() I've commented line 300 and 309 to avoid having RFAL_NFC_LISTEN_TECH_A and RFAL_NFC_LISTEN_TECH_F in the tech2Find (i.e. tech2Find only contains RFAL_NFC_POLL_TECH_AP2P and RFAL_NFC_LISTEN_TECH_AP2P)
  • I've compiled/linked/flashed 2 NUCLEO-L476RG boards + X-NUCLEO-NFC08A1
  • I've connected the serial terminal and have pressed the reset button

When the 2 boards are close, I see the AP2P led and the following message:

Welcome to X-NUCLEO-NFC08A1
Initialization succeeded..
NFC Active P2P device found. NFCID3: 01FE030405060708090A
Initialize device .. succeeded.
Push NDEF Uri: www.st.com/st25-demo ... succeeded.
Device present, maintaining connection ............................
Device removed.

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.

Thank you.  I'm not sure why I was having such a hard go at getting this set up correctly the first time, but your solution works.