2019-12-23 01:26 AM
I have some problems in understanding the appropriate way to setup the ST25R3916 chip to being in sleep mode, wake up the Microcontroller from an interrupt and then read an NTAG type A message and finally putting the NFC Chip back to wakeup mode.
I am working with the NFC06A1 Example code, using a STM32-L476RG.
I would like some ideas of the functions that need to be called in order to properly work with the RFAL State machines.
Solved! Go to Solution.
2020-01-07 05:44 AM
Hi,
there are a few aspects to what you want to do:
For putting the MCU to some sleep/wait-for-interrupt mode you can place before the rfalWorker() the following pseudo-code:
if (RFAL_NFC_STATE_WAKEUP_MODE == rfalNfcGetState())
{
// Theoretically a race condition could occur but practially the time between starting and first interrupt is >10ms, default 500ms.
// ...... put MCU into some sleep mode
wfi();
// ...... put MCU back into normal mode
}
rfalWorker();
Such code would need to be added in both cases of swTagDetect =1 and =0 case. But the difference will be the expected time until wake-up event on the MCU and periodicity.
Regards, Ulysses
2020-01-07 05:44 AM
Hi,
there are a few aspects to what you want to do:
For putting the MCU to some sleep/wait-for-interrupt mode you can place before the rfalWorker() the following pseudo-code:
if (RFAL_NFC_STATE_WAKEUP_MODE == rfalNfcGetState())
{
// Theoretically a race condition could occur but practially the time between starting and first interrupt is >10ms, default 500ms.
// ...... put MCU into some sleep mode
wfi();
// ...... put MCU back into normal mode
}
rfalWorker();
Such code would need to be added in both cases of swTagDetect =1 and =0 case. But the difference will be the expected time until wake-up event on the MCU and periodicity.
Regards, Ulysses