2020-01-09 07:20 AM
Hi there,
we are using ST25R3911B in combination with STM32F303CCTX. Also we are using the "NFC_V_ISO15693" and also the sourcecode from ST to handle the complete communication between ST25R3911B, STM32F303CCTX and also the RFID Tag.
But there seems to be a problem when writing to "large" RFID Tags (size = 2048Bytes).
So when writing a complete Array of 2048 Bytes to an 2048Byte sized Tag, the for loop takes 3200ms. --> 2048Byte /3200ms = 640Byte/s which seems to be very slow / bad.
By ST, there is only one function to write to an RFID-Tag, called "rfalNfvWriteSingleBlock".
enableRfidField(selectedRfidStandard);
uint8_t writePackage[8];
errorCode = rfalNfcvPollerInitialize();
errorCode = rfalNfvSelect(RFAL_NFCV_REQ_FLAG_DEFAULT, tagUID);
for(int j=0;j<writeBlockConfig.blockNr;j++){
// copy buffered array to writePackage
memcpy(&writePackage[0], &dataBuffer[j * 8], sizeof(writePackage));
// device is in write mode, so all received data will be written into RFID tag
errorCode = rfalNfvWriteSingleBlock(RFAL_NFCV_REQ_FLAG_DEFAULT, 0, j, writePackage, 8);
}
I also checked the SPI Interface configuration, because of possible slow SPI Communication while writing to RFID Tag:
Frame Format: Motorola
Data Size : 8Bits
First Bit: MSB First
Prescaler :2
Baudrate : 4.0 MBits/s
Clock Phase : 2 Edge
CRC Calculation : disabled
NSS Signal Type : Software
Do you have some ideas for the slow communication?
Thanks in advance.
Regards
Martin
Solved! Go to Solution.
2020-01-14 01:17 AM
Hey Martin,
what you calculate is the time to transmit these 2K bytes. Write time is something different and as far as I can see not detailed too much in the tags data sheet.
What I find is a block size of 8 bytes. Write multiple can support writing two blocks.
These commands are required to produce a response(write acknowledge) within max 20ms.
I assume that write multiple is implemented in a way to still meet the 20ms when performing sequential writes on the EEPROM/FRAM. Thus I think that writing 3 blocks was not possible within 20ms and thus writing one block takes > 6.7ms but < 10ms.
Assuming for now 8ms as it makes the math easy this means ~1ms write time per byte => 2secs for 2K of write time. With the transfer time: 2.3secs.
Additionally you have times for the responses, guard times, etc. which I assume add up to your >3secs.
Regards, Ulysses
2020-01-10 06:25 AM
Hi Martin,
I would assume the write speed is limited by the EEPROM. Which tag do you use? What is its write block size? And what is the typical write block time?
Regards, Ulysses
2020-01-13 02:02 AM
Hi Martin,
"By ST, there is only one function to write to an RFID-Tag, called "rfalNfvWriteSingleBlock"." The latest RFAL includes the support of WRITE MULTIPLE BLOCKS and EXTENDED WRITE MULTIPLE BLOCKS commands (see rfalNfcvPollerWriteMultipleBlocks and rfalNfcvPollerExtendedWriteMultipleBlocks functions). This can be used with tags supporting those command such as ST25TV and ST25DV tags.
Rgds
BT
2020-01-14 12:52 AM
Hey Brian, Ulysses,
thanks for your informations.
We are using the "MB89R118C" Tag from Fujitsu. Link: https://www.fujitsu.com/global/documents/products/devices/semiconductor/fram/lineup/MB89R118C-DS411-00001-5v0-E.pdf
In the manual, Section "2-5. Write Multiple Blocks Command": There is also a support for write multiple blocks, so I ll try the new function in the new rfal firmware.
in manual, section "2. Communication from Transponder to Reader/Writer":
"In low data rate mode, the data rate is 6.62 kbps (fc/2048); in high data rate mode, it is 26.48 kbps (fc/512)."
So even with low data rate of 6.62kbps, the tag (2048Bit) should be written in 2048Bit/6620Bit/s = 300ms, right ?!
Regards
Martin
2020-01-14 01:17 AM
Hey Martin,
what you calculate is the time to transmit these 2K bytes. Write time is something different and as far as I can see not detailed too much in the tags data sheet.
What I find is a block size of 8 bytes. Write multiple can support writing two blocks.
These commands are required to produce a response(write acknowledge) within max 20ms.
I assume that write multiple is implemented in a way to still meet the 20ms when performing sequential writes on the EEPROM/FRAM. Thus I think that writing 3 blocks was not possible within 20ms and thus writing one block takes > 6.7ms but < 10ms.
Assuming for now 8ms as it makes the math easy this means ~1ms write time per byte => 2secs for 2K of write time. With the transfer time: 2.3secs.
Additionally you have times for the responses, guard times, etc. which I assume add up to your >3secs.
Regards, Ulysses
2020-01-14 06:31 AM
Hey Ulysses, thank you for your explanation, that helps.
Regards
Martin