cancel
Showing results for 
Search instead for 
Did you mean: 

ST25R3911B + STM32L072 in Standby mode (Very low power)

MatthieuB
Associate III

Hi,

I'm working with a ST25R3911B RFID chip associated to a STM32L072 uC.

I use the "STM32CubeExpansion_NFC5_V1.2.0" project, ported from STM32F401 to STM32L072.

This project enables to set the ST25R3911B  in wake-up low power mode.

Now I'm trying to set the STM32L072 in standby mode with the ST25R3911B  using the IRQ.

I can wake-up the STM32 with IRQ generated by ST25R3911B  when a badge is passed but I cannot read the badge.

So my question is : is the "STM32CubeExpansion_NFC5_V1.2.0" project compliant with uC low power mode like standby ?

Regards,

Matthieu

1 ACCEPTED SOLUTION

Accepted Solutions
MatthieuB
Associate III

Hi Ulysses,

now it seems to be clean, I can wake-up the STM32 with ST25R3911B, read a badge and put the ST25R3911B in Wake-up mode again.

For that I have to :

  • read ISR (st25r3911Isr())
  • Clear ISR (st25r3911ClearInterrupts())
  • Reset ST25R3911_REG_OP_CONTROL to 0
  • Power Down the ST25R3911B (I have created a function for that)
  • Initialize RFal (rfalAnalogConfigInitialize())
  • Initialize the ST25R3911B st25r3911Initialize()
  • Put the ST25R3911B in Wake-up mode (rfalWakeUpModeStart)

So now the ST25R3911B can detect again badges and generate IRQ on dedicated pin.

But how to read again badges using your ST functions when an IRQ is catched ?

Regards,

Matthieu

PS : I just have an oscilloscope at office, it will be great to have a logic analyzer...

View solution in original post

25 REPLIES 25
Ulysses HERNIOSUS
ST Employee

Hi Matthieu,

I assume you mean "compatible" or even "able to make use of the Standby mode of L0".

As I understand on exit of Standby mode all SRAM is erased and all registers are erased - just as after a hard reset.

As our demo is not built for such a use case it will start normally and enter ST25R3911B's wakeup mode again.

So if you want to build something using the L0 Standby mode you will need to change the application to remember where it is coming from. E.g. using external memory or reading ST25R3911B regs before initializing the chip (initalization will also reset its registers) to see ST25R3911B has triggered a wakeup.

Regards, Ulysses

MatthieuB
Associate III

Hi Ulysses,

indeed I mean able to make use the Standby mode of STM32L0 with IRQ of ST25R3911B.

I'm not sure to understand clearly what you explain : if the L0 is reseted from Standby mode I have to read registers of the ST25R3911B (st25r3911ReadRegister() function ?) then re-initialize it (st25r3911Initialize() function ?) in order to make it work ?

Thank you for your help !

Regards,

Matthieu

Ulysses HERNIOSUS
ST Employee

Hi Mathieu,

when L0 exits from Standby the whole program restarts at main(). All information you stored inside L0 (SRAM and registers) will be gone. ST25R3911B registers will of course stay.

If you want to make use of the Standby mode and afterwards not do exactly the same as in the previous program execution you need to have some information where you are coming from.

One possibility I see is:

  1. Initialize SPI
  2. Read Interrupt status of ST25R3911B.
  3. Depending on the signaled wakeup interrupt jump to the proper code block/states inside the FW to read a card. Probably only then call st25r3911Initialize(), .....

Regards, Ulysses

MatthieuB
Associate III

Hi Ulysse,

indeed I try to differentiate a normal start of the L0 and a restart from Standby mode.

For that I use the function "__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET" but seems to not work fine in my case.

So when the uC starts :

  • init SPI (SPI2 in my case)
  • call st25r3911Isr() to read IRQ
  • call rfalWorker()
  • call demoCycle() in Wake-up mode
  • call st25r3911Initialize() inside
  • go in Standby mode

I don't really know where I have to go inside ST code, what do you mean by FW ?

Regards,

Matthieu

Ulysses HERNIOSUS
ST Employee

Hi Mathieu,

FW: firmware.

not sure if internal interrupt status variable will be initialized to a meaningful value. Better not to use at this stage the normal functions like st25r3911Isr(), rfalWorker(), etc. but go more low level:

Please issue something like:

  • st25r3911ReadMultipleRegisters(ST25R3911_REG_IRQ_MAIN, iregs, 3);
  • Compare iregs[2] if it contains I_wam/I_wph/I_wcap bits (depending which wakeup mode you are using).
  • If one of the wakeup bits is set then go inside the demo app into a state where the demo polls. E.g. set state = DEMO_ST_POLL_ACTIVE_TECH; But this is all just demo code, please change it to your needs.

Regards, Ulysses

MatthieuB
Associate III

Hi Ulysse,

I may have found a way to wake-up the STM32 with ST25R3911B:

  • set the ST25R3911B in wake-up mode (rfalWakeUpModeStart(NULL))
  • Standby mode activated.
  • Test "__HAL_PWR_GET_FLAG(PWR_FLAG_WU) != RESET" to detect a wake-up from ST25R3911B. Seems to work fine (__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET doesn't work for me).
  • check the received ISR (st25r3911Isr())
  • st25r3911Initialize();

For the moment I have interesting results regarding the current consumption.

Do you know how to desactivate the STANDBY mode ?

Regards,

Matthieu

Ulysses HERNIOSUS
ST Employee

Hi Matthieu,

my assumption would be that by the time your program gets restarted you are out of STANDBY mode. But I am not an expert on this. Please consult the DS or address this in a proper Forum.

Regards, Ulysses

MatthieuB
Associate III

Hi Ulysse,

if the uC restart itself out of the STANDBY mode it is not dramatic.

Indeed I will add an alarm wake-up in the future (to wake-up the uC each morning for ex).

Or the manual possibility is to wake up again with the RFID part.

But I think I make something wrong.

I can wake-up the uC with an interrupt of the ST25R3911B but after I cannot read again a RFID badge.

At the same time I have a lot of interruptions generated by the ST25R3911B chip (I can see them with the oscilloscope).

I'm trying to clear interrupts, initialize the ST25R3911B but doesnt work.

Do you have an idea ?

Regards,

Matthieu

Ulysses HERNIOSUS
ST Employee

Hi Matthieu,

I think what will happen is that after STANDBY the ST25R3911B is still in wakeup mode. I think SET_DEFAULT command will not clear 'wu' bit. And wakeup mode then interferes with card reading. Best if you set OP_CONTROL register to 0x00 after having read the interrupt status regs.

If that does not help, then I think it would be best if you provide a logic analyzer trace of your SPI communication.

Regards, Ulysses