i download the sample code (\examples\nfc\record_text) to pca10040,it can be detected by NFC reader,the serial number is 5f:46:ac:eb:75:a7:ea,if i want to change this number ,what can i do?
i download the sample code (\examples\nfc\record_text) to pca10040,it can be detected by NFC reader,the serial number is 5f:46:ac:eb:75:a7:ea,if i want to change this number ,what can i do?
The first answer is correct, but it needs clarification where to set up these registers. When running on nRF52832 device, remember that the NFC HAL module (hal_nfc_t2t) needs to implement workarounds for NFCT HW errata. One of the workarounds is re-initialization of the NFCT registers after NFC field is lost. So the right place to update is hal_nfc_common_hw_setup()
static function which is called not only when calling nfc_t2t_setup()
, but also in the re-intialization procedure. Otherwise your settings may be overwritten.
By default the UID is fetched from the FICR registers, but it can be changed. As written in the first answer you can change the NFCID1 size in SENSRES register. The NFCID1 naming is taken from the NFC Forum Digital Protocol specification.
Important: remember that setting the NFCID1 registers just sets up the data used in Automatic Collision Resolution Process (ISO 14443-3 protocol). But the UID bytes are also part of the Type 2 Tag memory - these are set through the T2T library API nfc_t2t_internal_set()
and must be consistent with the NFCID1 setting. If you set the internal bytes in hal_nfc_common_hw_setup()
(as described above) you will be OK because it sets up both NFCID1 and the T2T memory UID bytes (in nfc_t2t_setup()
).
And BTW we may consider providing a simpler way to modify the UID bytes. Just a question: would a dynamic runtime update be required, or would static (compile-time) configuration be enough?
And BTW we may consider providing a simpler way to modify the UID bytes. Just a question: would a dynamic runtime update be required, or would static (compile-time) configuration be enough?