2024-10-16 11:51 PM
I'm working on a Flutter project where I need to enable a security session with an ST25DV04K NFC tag by using the Present Password command. However, when I send the command, I receive an unexpected response that suggests the command is failing. Specifically, the command I am sending is 02 b3 01 00 00 00 00 00 00 00 00 00 da 4e, and the response I get back is 01 02. Based on the ST25DV04K datasheet, I believe the 01 response code indicates an error, and 02 might represent a specific failure, but I can't pinpoint the exact issue. I am using 00 00 00 00 00 00 00 00 as the password for testing, and the CRC value da 4e was calculated based on the command, though I’m unsure if it's correct.
I'm trying to determine whether the issue lies in the password, the CRC, or the command structure itself. My questions are: Is 00 00 00 00 00 00 00 00 a valid default password for the tag, or should I use something else? What does the 01 02 response indicate specifically, and how can I calculate the CRC properly to ensure the command is accepted? Any guidance on these points or other suggestions on how to troubleshoot this would be much appreciated.
Solved! Go to Solution.
2024-11-15 12:55 AM
Hello,
What value do you use for "registerAddress"? RFA1SS address is 04h.
Best regards.
2024-11-19 10:47 PM
The error [1, 18] indicates a failure when attempting to update the protection settings for RFAxSS registers on the NFC chip, likely due to mismatches between the command format and the chip's expected protocol. Possible causes include invalid register addresses (0x04) or values (0x0A), access restrictions (e.g., write-protection or authentication requirements), or incorrect command structure. This could also stem from environmental issues, such as weak NFC communication, or limitations in the FlutterNfcKit library. To resolve this, verify the chip’s datasheet for correct register and command specifications, ensure proper access permissions, and confirm the NFC environment is stable. Additionally, consult the chip’s documentation for the error code [1, 18] for specific guidance.
2024-11-19 10:47 PM
Uint8List command = Uint8List.fromList([
0x02, // Flags
0xA1, // Write Configuration command
0x02, // Manufacturer code for ST
registerAddress, // Address of RFAxSS register (e.g., 0x04)
protectionValue // Protection setting (e.g., 0x0A)
]);
2024-12-01 10:58 PM
Hello,
I am currently working on setting a password for specific areas of an NFC tag and sending commands to the tag. While the tag responds with a "00" response, indicating success, the issue arises when I attempt to write data to the protected area. The tag does not prompt for a password and allows writing without any authentication.
Below are the relevant console logs showing the process of setting the password:
Despite receiving a successful response when setting the password, the expected password enforcement during write operations is not functioning as intended. I would appreciate any insights or suggestions to resolve this issue.
2024-12-02 01:06 AM
Hello,
It looks like the value you are writing in RFA1SS is 0x01. This sets the field PWD_CTRL_A1=01b and say to the ST25DV to protect the area1 with password 1.
But you didn't put the right value in the other fields of RFA1SS.
With RFA1SS=0x01, the field RW_PROTECTION_A1=00b, which means "Area 1 RF access: Read always allowed / Write always allowed" (please see table 45 in the datasheet).
So, you set up a password, but no protection, which means that it is still possible to write into area1 without any authentication.
If you want to write-protect area1 with password 1, you should set PWD_CTRL_A1=01b and RW_PROTECTION_A1=01b, which is RFA1SS=0x05.
Best regards.