cancel
Showing results for 
Search instead for 
Did you mean: 

ST25R3911B : RFAL Library : st25r3911OscOn() giving Error=1 on Custom Board

vaibh_p
Associate II

Hi ,

We have done preliminary test on X-Nucleo-NFC05A1 and than made our custom board using the reference circuit provided.

We have followed the sequence for Card Detection:

Now the the function work as follows:

  • rfalInitialize() gives ERROR_NONE
  • st25r3911OscOn() which is giving the error =1(ERR_NOMEM).
  • rfalFieldOff() gives ERROR_NONE
  • rfalNfcvPollerInitialize() gives ERROR_NONE
  • rfalFieldOnAndStartGT() gives ERROR_NONE
  • rfalNfcvPollerCheckPresence() gives the error=4 (ERR_TIMEOUT)

So before and after this function st25r3911OscOn() , everything looks good , just we are not getting what causing the error in st25r3911OscOn().

We have connected the 27.12MHz Crystal.

Also we have noticed that frquency of 9MHz on CRO across the crystal, so it is Okay ?

Moreover need a review on Power Supply section of the schematic.

I am attaching the screenshot , and in this

we have kept R7 Open and +5V Not Connected.

So any guess what is causing the issue ?

1 ACCEPTED SOLUTION

Accepted Solutions
Travis Palmer
ST Employee

Hello Vaibh_p,

If components are missing in the matching circuit, you will most likely have problems detecting the tags. This can cause either a reduced detection range or no detection at all.

It seems, that there is something wrong with your crystal. It should either resonate at 13.56MHz or 27.12MHz. The bit "osc" in the IO Configuration Register 1 has to be set accordingly. Can you maybe populate the crystal of the ST25R3911B-DISCO or NFC05A1?

I just measured the XTI pin of the ST25R3911B-DISCO.

0693W000001sDSjQAM.png

BR Travis

View solution in original post

14 REPLIES 14
Travis Palmer
ST Employee

Hello,

Looking at your power circuit it looks good.

I assume R16 and R7 are not connected. Your MCU is connected (VDD_MCU) to "+3V3".

0693W000001sB9fQAE.jpg

The 9MHz at the crystal sounds very strange to me. At the time you enable the osc, a signal will be driven by the ST25R3911B on the XTO pin. This signal is causing the crystal to resonate. If you attach a scope you should see the following picture:

Green channel: VDD

Red channel: XTI

0693W000001sDTSQA2.png

around 874us (at my scope shot) the crystal is already resonating at 27.12MHz. The magnitude of the crystal signal should be around 0.7Vpp to 1Vpp at the end. Please ignore the shape past Marker X2 since it is related to the wake-up pulse and turning off the crystal.

please let me know, if you are seeing the same signals on your board.

BR Travis

Brian TIDAL
ST Employee

Hi Vaibhav,

Which version of RFAL are you using? (See #define RFAL_VERSION in rfal_rf.h).

In old version of RFAL, st25r3911OscOn does not return any error code. Since version 2.2.0, st25r3911OscOn returns a status but the return value cannot be ERR_NOMEM. Only 2 possible values:

  • ERR_NONE: No error
  • ERR_SYSTEM: Failure during Oscillator activation

I believe st25r3911OscOn likely returns ERR_SYSTEM in your case: as suggested by Travis, the 27.12MHz cristal should be checked

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 Brian for quick reply.

The RFAL Version is v2.0.10  and it is defined as "#define RFAL_VERSION   (uint32_t)0x02000aU "

Meanwhile I am checking out with things suggested by Travis for Crystal oscillations.

Brian TIDAL
ST Employee

Hi

in RFAL v2.0.10, st25r3911OscOn  does not return any status (void st25r3911OscOn( void )).

Here is an updated version of st25r3911OscOn that checks that the effective oscillator status (lines 21-25) and returns a status. This may help you during investigation.

ReturnCode st25r3911OscOn( void )
{
    /* Check if oscillator is already turned on and stable                                                */
    /* Use ST25R3911_REG_OP_CONTROL_en instead of ST25R3911_REG_AUX_DISPLAY_osc_ok to be on the safe side */
    if( !st25r3911CheckReg( ST25R3911_REG_OP_CONTROL, ST25R3911_REG_OP_CONTROL_en, ST25R3911_REG_OP_CONTROL_en ) )
    {
        /* Clear any eventual previous oscillator IRQ */
        st25r3911GetInterrupt( ST25R3911_IRQ_MASK_OSC );
 
        /* enable oscillator frequency stable interrupt */
        st25r3911EnableInterrupts(ST25R3911_IRQ_MASK_OSC);
 
        /* enable oscillator and regulator output */
        st25r3911ModifyRegister(ST25R3911_REG_OP_CONTROL, 0x00, ST25R3911_REG_OP_CONTROL_en);
 
        /* wait for the oscillator interrupt */
        st25r3911WaitForInterruptsTimed(ST25R3911_IRQ_MASK_OSC, ST25R3911_OSC_STABLE_TIMEOUT);
        st25r3911DisableInterrupts(ST25R3911_IRQ_MASK_OSC);
    }
    
    /* Double check that OSC_OK signal is set */
    if( !st25r3911CheckReg( ST25R3911_REG_AUX_DISPLAY, ST25R3911_REG_AUX_DISPLAY_osc_ok, ST25R3911_REG_AUX_DISPLAY_osc_ok ) )
    {
        return ERR_SYSTEM;
    }
    
    return ERR_NONE;
}

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 Travis, Thanks for the reply.

As mentioned in my query , we have not connected "+5V" in the circuit.

Everything is powered with "+3.3V", so we have connected "R16 and R6" and "R7" was left open. The "+5V" is kept for future use and not connected as of now.

Yes correct MCU is connected to to same "+3.3V".

So do we need to provide "+5V" also ?

I am attaching entire schematic for reference, please have a look on it and do suggest us.

Also , will the problem in supply section cause the problem in oscillator frequency ?

Thank you.

Thanks Brian ,

So if I am correct , I can directly add this lines [Line 21 to 25] in existing code rather than porting to latest version of RFAL Library.

Hello,

VDD can be connected to +3V3 (same voltage as VDD_IO).

As long as VDD_IO and VDD are powered there should be no problem at all.

Can you confirm that the crystal is starting?

BR Travis

yes and make sure to modify the function prototype declaration in st25r3911.h.

You can also modify st25r3911Initialize to replace

st25r3911OscOn()

by

  ret = st25r3911OscOn();
  if( ret != ERR_NONE )
  {
    return ret;
  }

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.

Okay , Thank you so much Brian for the suggestions , I will implement that and let you know.