WR with different field sessions for Tag-V (ISO15693) using ST25R3916 (RFAL v4.0.2)
In my application, for different operations I am turning off/on the RF field, it’s like need basis, my RF filed does not stay on all the time to conserve the energy/power.
With my current implementation sequence (which I have defined below), 99% of the time everything works fine, as in I can do tag discovery in one session, in another session for the discovered tag I can Read data, in one another session I can write data, and yet another session I can even lock a block using BSS as well. (In this context the session mean, turning on the field → do the thing → turn off the field).
As I mentioned everything works nicely 99% of the time, but for the 1% failures, which is very random, I have not found a way to reproduce this! Either discovery or read operation fails with Error Code 33 (aka RFAL_ERR_WRONG_STATE).
High Level Design
- Initialization - one time only per power cycle of the device
rfalNfcInitializerfalNfcvPollerInitialize
- Tag Discovery - per Tag-V operation
rfalFieldOnAndStartGTrfalNfcvPollerCheckPresencerfalNfcvPollerExtendedGetSystemInformationusingRFAL_NFCV_REQ_FLAG_ADDRESSrfalFieldOff
- Read Memory - per Tag-V operation
rfalFieldOnAndStartGTrfalNfcvPollerExtendedReadMultipleBlocksusingRFAL_NFCV_REQ_FLAG_DEFAULTrfalFieldOff
- Write Memory - per Tag-V operation
rfalFieldOnAndStartGTrfalNfcvPollerWriteMultipleBlocksusingRFAL_NFCV_REQ_FLAG_DEFAULTrfalFieldOff
- Lock Block - per Tag-V operation
rfalFieldOnAndStartGTrfalNfcvPollerWriteMultipleBlocksusingRFAL_NFCV_REQ_FLAG_DEFAULTrfalFieldOff
One thing to note, my application deals with a Tag-V at a time, so there is absolutely no chance of collision, also once a tag is discovered WR and Lock operation everything is done before another Tag-V is scanned, hence not using any collision related APIs from the RFAL lib.
So the first question is, with multiple RF turn ON/OFF sessions with the same Tag-V (UID), without RFAL_NFCV_REQ_FLAG_ADDRESS works for me most of the time, even without using the rfalNfcvPollerSelect API for selecting the tag with help of it’s UID; is this approach alright?
I am trying to find a reference or a document which can guide me, which is the best way? I have already referred to UM2890 and demo codes from the library but most of them turn ON the field one time and after all the translation are done, turns off the field. Without any proper documentation I am unable to decide that this is the correct way, as in, in my case do I have keep the RF field on while I am interacting with an unique Tag-V (UID)?
What am I missing here which is causing out of the blue RFAL_ERR_WRONG_STATE error for me?
