2025-05-21 8:57 AM - edited 2025-05-21 9:00 AM
Hi all. I'm coding an app in C# that uses the ST25R3916DISCOComm.dll native methods to access a ST25DV04 tag. I have got many things working, including bing able to read the tag memory passively, and some complex protocols using the Mailbox mode. However, the one thing I can't get working is passive write to tag memory.
Below is a debug log of my process.
The command packet looks correct to me based on the data sheet and other commands in a similar format in the log, but I'm getting back no received data and a "No Memory" error code. Any ideas what I'm missing?
Debug log:
21/05/2025 15:30:04 [Info] Waiting for tag...
21/05/2025 15:30:06 [Info] Got tag UID=[E0,02,24,02,DA,28,8B,FA] BlockSize=4 Blocks=128 TotalMemory=512 Flags=00001111b 0x0F 15
21/05/2025 15:30:06 [Info] Reading tage memory 128 blocks x 4 bytes
21/05/2025 15:30:07 [Info] Read 512 bytes
21/05/2025 15:30:07 [Trace] Transceive 20 bytes, timeout 1, Normal mode
21/05/2025 15:30:07 [Trace] Transceive error code: NoError
21/05/2025 15:30:07 [Debug] NFC Transceive [20]: 22 b3 02 fa 8b 28 da 02 24 02 e0 01 30 63 65 61 6e 53 31 67 <=> [3]: 00 78 f0
21/05/2025 15:30:12 [Trace] Transceive 17 bytes, timeout 5000, Normal mode
21/05/2025 15:30:13 [Trace] Transceive error code: NoMemory
21/05/2025 15:30:13 [Debug] NFC Transceive [17]: 22 21 02 fa 8b 28 da 02 24 02 e0 4f 00 78 56 34 12 <=> [0]:
Solved! Go to Solution.
2025-05-22 2:29 AM
Hi,
iso15693WriteBlock() internally applies default timeouts for NFCV write commands. I believe 20ms.
Getting first No Memory and now Timeout may mean that you may have overdone with going to 1K of bytes. Not sure if some layers in between can handle 1K buffers. Better if you try with e.g. 20 bytes.
Fast mode may only speed up the sending of the write command. I expect a not so big effect.
BR, Ulysses
2025-05-21 11:29 PM
Hi,
No Memory typically happens if the provided reception buffer is too small. One peculiarity of ST25R39xx devices is that NFC-V framing happens inside MCU. So also CRC needs to be checked in MCU. For this purpose the provided reception buffer needs to be large enough to also hold the 2 bytes CRC (even if not requested).
BR, Ulysses
2025-05-22 2:07 AM
Understood - I set my rx buffer to a fixed size of 1024 bytes. When I do that and use iso15693WriteBlock to perform my write operation then I get a TIMEOUT error. Here's a screen shot of my debug session showing the actual code I'm using:
Questions:
Why would I get a timeout when there's nowhere to specify a timeout in that method?
I have assumed that writing a block is a slow mode command and have therefore not selected fast mode. Is that a correct assumption?
2025-05-22 2:29 AM
Hi,
iso15693WriteBlock() internally applies default timeouts for NFCV write commands. I believe 20ms.
Getting first No Memory and now Timeout may mean that you may have overdone with going to 1K of bytes. Not sure if some layers in between can handle 1K buffers. Better if you try with e.g. 20 bytes.
Fast mode may only speed up the sending of the write command. I expect a not so big effect.
BR, Ulysses
2025-05-22 5:13 AM
I have it working now. I used a brand new tag that was not password-protected to get it working without the added complication of having to unlock the tag, and then added back the unlocking code, and everything is working now.
I used the iso15693WriteBlock command, and that did actually appear to work with a 1024 byte rx buffer, nevertheless I trimmed the Rx buffer down to 32-bytes per your suggestion.
Thank you again for your help.