How to correctly use rfalST25xVPollerReadConfiguration and WriteConfiguration with ST25TV02KC?
Hi everyone,
I’m currently working with ST25TV02KC NFC tags and the ST25R3916B reader, using the RFAL library.
I’m trying to access the configuration registers via the following functions:
rfalST25xVPollerReadConfiguration(...)
rfalST25xVPollerWriteConfiguration(...)
I’ve already opened the CONFIG security session successfully using PresentPassword with PWD_CFG, so write access should be allowed.
What I’m trying to do:
Read and write configuration registers like:
RW_PROTECTION_A1 → FID: 0x00, PID: 0x00
END_A1 → FID: 0x00, PID: 0x01
According to the datasheet (Table 4), these are valid config registers in group FID 0x00.
Here is how I call the read function:
uint8_t regVal = 0;
ReturnCode err = rfalST25xVPollerReadConfiguration(RFAL_NFCV_REQ_FLAG_DEFAULT, uid, 0x01, ®Val); // PID = 0x01 for END_A1
And the write function:
uint8_t newVal = 0x20; // Example: change END_A1 to enable dual-area mode
ReturnCode err = rfalST25xVPollerWriteConfiguration(RFAL_NFCV_REQ_FLAG_DEFAULT, uid, 0x01, newVal);
Problem: I always receive an error code (5) from both functions.
I verified the UID is correct and tried different register addresses (PIDs), but the behavior remains inconsistent.
My questions:
1. Are FID and PID handled internally by these functions, or do I need to somehow pass FID explicitly?
2. Is there anything else that needs to be done before calling ReadConfiguration / WriteConfiguration — e.g., some init command or delay after opening the CONFIG session?
3. Could this be related to timing issues or session closing too quickly?
Any help or working examples would be really appreciated. Thanks in advance!
