2024-04-04 02:56 AM
Hello
I have been trying to develop a GUI App to communicate with STEVAL-25R3916BA to read & write ISO15693 Tag Type-V. So far with reference from similar other questions asked previously on this forum I have been able to connect to EVAL board and at least read UID of the tag. This I was able to achieve thanks to response from @Ulysses HERNIOSUS responses. To achieve this I have used the example application comes with ST25PC-NFC & ST25 SDK.
The example project from ST. for C# does not have read/write example, I have tried my best to perform read/write using APIs from ST25R3916DISCOComm DLL, but so far no success, APIs comes back with no error & no data, if there is no error then why no data?
I am trying to use iso15693ReadBlock & iso15693WriteBlock from DLL, and I have used ST25PC-NFC to write 0xFF to whole memory of Tag type-V, so I know what I'm reading is okay, as currently API for reading just reads 0 with no error! So I'm not sure if I'm doing anything wrong.
Based on another question (can't find the link), I have explored F/W code as well, dispatcher.c and en.steval-25r3916b-binary\STSW_ST25R018\Middlewares\ST\fw_3916\DISCO-STM32L4x6\Src\iso15693_3.c which defines
I feel like I'm lost in this development, any direction & help would much appreciated.
BR
JJ
Solved! Go to Solution.
2024-04-10 05:38 AM
Hi JJ,
With the API that you are using you should not use the CRC, it will be automatically generated inside firmware and appended. In your case you would end up with two extra data bytes followed by the real CRC.
AFAIK anyhow the firmware will adapt the Request Flag to fit the physical comm params - One subcarrier + high data rate, so your pre-calculated CRC would even be incorrect.
Only with the Physiscal variant (iso15693PhyTxRxNBytes) you need to supply a pre-calculated CRC.
BR, Ulysses
2024-04-04 05:41 AM
Hello _JJ_,
to my knowledge the ST25SDK is using only a very limited set of functions from the DLL. Mainly only a basic transceive functionality : txrxBytes() - building all the read block / write block, etc. by hand.
Read/write multiple commands in ISO15693 are optional and not supported by all tags.
I think for further being able to help you, you will need to share the sequence of executed DLL functions with all its parameters and also the returned data/status.
BR, Ulysses
2024-04-04 06:32 AM
Thank you Ulysses. I was expecting a response from you.
Sure I can share my sequence which I am executing in C# application for further discussion.
About ISO15693 tag type-V, I am using is ST25TV16K. As I can read/write on this tag using ST25PC-NFC, where from console logs I can see that it definitely supports Multiple block Read/Write, which I can also confirm from its Datasheet.
I think, if read can be corrected then I might be able to write easily, correct me if my thinking is wrong. I can bring write part once read is sorted.
@Ulysses HERNIOSUS I hope this will help you determine what could be wrong here.
BR
JJ
2024-04-04 08:34 AM
I was just playing around iso15693GetSystemInformation() function: and got this, comparing this output with F/W code, data mapping makes sense but the outcome of data does not make sense to me, any idea?
Received from Tag type-V: [HEX: 00 0B 92 D6 1C 62 03 48 02 E0 00 00 48 E4 43]
F/W Code Sys Info Structure:
Based on converting these values from signed bytes to HEX, I can see bytes[2:10] are UID, which makes byte-0 & 1 flag & infoflags respectively. Leaving last remaining 5 bytes as dsfid, afi, memblocks, memblockSize, icRef.
Where, Mem Blocks is 72, which does not look right, I would expect 512 blocks of size 4 bytes as per datasheet. This is off putting my understanding, I feel like a ***.
2024-04-05 12:43 AM
Hi JJ,
Reading the data sheet of ST25TV16K (6.4.22) the Get System Info is as expected: the info flag 0x0b means no block information provided, E4 43 I presume to be CRC16.
For the iso15693ReadBlock(): block_nr refers to the Block Number parameter of "6.4.6 Read Single Block". I don't see in your explanation the actual data fed in nor the return (status) code and data after execution. UID I think you could also leave at NULL - the function should then execute the Read Single Block without UID in broadcast mode.
Ulysses
2024-04-05 02:19 AM
Thank you Ulysses for looking into this.
About System Info of tag, your explanation make sense. I ignored the datasheet there because I was looking at F/W source code for ISO15693 for EVAL board, which seems to be misleading.
Coming back to ReadSingleBlock(), I tried supplying null for UID, but the function return back with Timeout error.
With UID supplied, function succeeds with NoError code but no data received.
Based on Datasheet, I expect 8 byte in return,
PS: In code snip, you see call to Select() as well, I thought (naively!) I may have to select a tag before this operation even though I knew ReadBlock() calls take UID as argument, as I was desperate to get a result I tried it but I commented the code as there was no improvement!
2024-04-05 02:34 AM
Hi JJ,
this is a C style interface. With data_len/sizeof_data you need to communicate the size of the buffer you provide to the DLL and after the function returns the data_len will be adapted to the actual returned size. You will need to feed in a pointer to a uint32_t with value of 8.
I suspect in your case the firmware was provided with a zero length buffer which it was not filling.
About UID, likely the story goes that the function with UID=0 goes then into using selected mode, likely in this case you will be needing the Select().
BR, Ulysses
2024-04-05 05:19 AM
Thank you so much Ulysses.
I got what you mean, I was supplying wrong data_len/sizeof_data, as I had an array declared but all with 0 data by default, as soon as I corrected that I am seeing data now. In my case as I have flashed whole tag memory with 0xFF pattern I see -1 as data which is 0xFF in HEX.
I tried WriteSingleBlock as well, and it is working now as expected. I am able to read/write single block at a time.
For WriteSingleBlock I had to call Select tag first, otherwise it does not work, on the other hand ReadSingleBlock seems to not have dependency on Select UID function. It also worked with UID as null as you suggested earlier.
Single Read & Write can only work up to 256 blocks, my tag has 512 blocks, looking at the remaining APIs from DLL it is not making any sense to me what I should use for extended Read & Write operation. Is there anyway I can achieve multi block read & write?
2024-04-05 05:24 AM
Hi,
for the other commands you need to build them on your own using iso15693TxRxNBytes() or txrxBytes(). I think the first one is easier to use for you. Please be cautious about allowing space for the CRC for these two functions - otherwise they may flag a CRC error (as not being able to check it).
BR, Ulysses
2024-04-05 05:28 AM
Thank you for all your guidance so far and heads up.
Really appreciate your support on this community.
Let me try building commands and see how it goes, if any further help needed will come back to annoy you again. :)