cancel
Showing results for 
Search instead for 
Did you mean: 

Odd errors when using mailbox mode with a ST25DV04K tag

TimLong
Associate II

attn @Brian TIDAL et al

I have yet another issue I don't understand. I have code that I have run against two similar products using the same ST25DV04K tag. The products differ in that one has a slower CPU clock. On the product with the faster clock, my code works and produces the expected result, but on the other product I get the output below. I am transferring messages in mailbox mode. I have successfully sent my message, and I need to wait for the remote host to send back an acknowledgement message containing a 32-bit CRC. I start to poll the mailbox control register to see if the message is ready, but the command results in error code "No Memory". The error code doesn't appear to make much sense in this context, but it's repeatable and happens every time. Can anyone shed any light on how to interpret this?

 

NFC|INFO |                | Mailbox/"ConnectState".Run
NFC|TRACE|                | Present password {passwordNumber} as 0000000b 00x 0d
NFC|TRACE|                | Transceive 20 bytes, timeout 1000
NFC|TRACE|                | Transceive error code: NoError
NFC|DEBUG|                | NFC Transceive "[20]: 22 b3 02 68 66 0c f6 01 24 02 e0 00 00 00 00 00 00 00 00 00" <=> "[3]: 00 78 f0"
NFC|DEBUG|                | Disable Mailbox Mode
NFC|TRACE|                | Disable Mailbox
NFC|TRACE|                | Write Dynamic Config 0000110b 0Dx 13d
NFC|TRACE|                | Transceive 13 bytes, timeout 1000
NFC|TRACE|                | Transceive error code: NoError
NFC|DEBUG|                | NFC Transceive "[13]: 22 ae 02 68 66 0c f6 01 24 02 e0 0d 00" <=> "[3]: 00 78 f0"
NFC|DEBUG|                | Enable Mailbox Mode
NFC|TRACE|                | Enable Mailbox
NFC|TRACE|                | Write Dynamic Config 0000110b 0Dx 13d
NFC|TRACE|                | Transceive 13 bytes, timeout 1000
NFC|TRACE|                | Transceive error code: NoError
NFC|DEBUG|                | NFC Transceive "[13]: 22 ae 02 68 66 0c f6 01 24 02 e0 0d 01" <=> "[3]: 00 78 f0"
NFC|TRACE|                | Read Mailbox Control
NFC|TRACE|                | Read Dynamic Config 0000110b 0Dx 13d
NFC|TRACE|                | Transceive 12 bytes, timeout 1000
NFC|TRACE|                | Transceive error code: NoError
NFC|DEBUG|                | NFC Transceive "[12]: 22 ad 02 68 66 0c f6 01 24 02 e0 0d" <=> "[4]: 00 01 ce 1e"
NFC|INFO |                | NFC Entered mailbox mode
NFC|INFO |                | Mailbox/"ConnectState".OnExit
NFC|INFO |                | Mailbox/"ReadyState".OnEnter
NFC|INFO |                | Mailbox/"ReadyState".Run
NFC|INFO |                | Mailbox/"ReadyState".BeginMailboxExchange: "[11]: 03 00 00 00 06 26 30 30 3a 0d 0a"
NFC|TRACE|                | Write Mailbox Message "[11]: 03 00 00 00 06 26 30 30 3a 0d 0a"
NFC|TRACE|                | Transceive 23 bytes, timeout 1000
NFC|TRACE|                | Transceive error code: NoError
NFC|DEBUG|                | NFC Transceive "[23]: 22 aa 02 68 66 0c f6 01 24 02 e0 0a 03 00 00 00 06 26 30 30 3a 0d 0a" <=> "[3]: 00 78 f0"
NFC|INFO |                | Mailbox/"ReadyState".OnExit
NFC|INFO |                | Mailbox/"ReceiveCrcState".OnEnter
NFC|INFO |                | Mailbox/"ReceiveCrcState".Run
NFC|DEBUG|                | Switching to fast mode Tx=26Kbps Rx=53Kbps
NFC|TRACE|                | Fast Read Mailbox Control
NFC|TRACE|                | Fast Read Dynamic Config 0000110b 0Dx 13d
NFC|TRACE|                | Transceive 12 bytes, timeout 1000
NFC|TRACE|                | Transceive error code: NoMemory
NFC|DEBUG|                | NFC Transceive "[12]: 22 cd 02 68 66 0c f6 01 24 02 e0 0d" <=> "[0]:"
NFC|ERROR|                | NFC error: "NFC: no memory"
NFC|INFO |                | Mailbox/"ReceiveCrcState".OnExit
NFC|INFO |                | Mailbox/"StoppedState".OnEnter
NFC|INFO |                | Mailbox/"StoppedState".Run

 When I run the same code against another product with the same tag, everything works and I don't get the error. The firmware is similar but obviously different, and there are a lot of factors that could result in different behaviour. A colleague was able to get some code working by introducing lots of delays so there might be some timing condition in the firmware, but my feeling is that delays shouldn't be necessary because of all the handshaking in place.

I would welcome any suggestions.

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions

Hi TimLong,

with reading a full mailbox you will need even more than 256 bytes. You will also need space for flags, CRC, etc.

So I would start with providing 270 bytes (theoretically 260 should be sufficient but always reserve something for the unexpected).

If I read your logs correctly then it already fails at the "Fast Read Dynamic Configuration" which should get only 4 bytes or so. I am not sure why it would here fail with a No Memory error code. Maybe you can trace all the calls to the DLL with all provided parameters?

BR, Ulysses

 

View solution in original post

3 REPLIES 3
Ulysses HERNIOSUS
ST Employee

Hi TimLong,

Please clarify where the traces come from?

I assume from code running an NFC reader. Which one? Which code basis was used?

Where does this NoMemory come from? Is it from our RFAL for ST25R3916? If so best debug into the code where this NoMemory error code gets created.

Recalling your other posts you are on the DLL layer of ST25R3916B Discovery Kit. In this case I presume that you are not providing a sufficiently large buffer to your transceive operations. Maybe on the slow CPU clock the other side (I2C) of the ST25DV has more time to fill in data into the mailbox.

BR, Ulysses

 

 

First, apologies for my lack of information.You have presumed correctly. I am developing a Windows app in C# and using the DLL supplied with the ST25R3916B Discovery Kit.

That's an interesting thought. So if I understand correctly, you think my receive buffer might be too small. I believe I always use a 256 byte receive buffer but I will certainly check into it and since I appear to have been using a 256-byte buffer which I think should be enough for all situations.

Hi TimLong,

with reading a full mailbox you will need even more than 256 bytes. You will also need space for flags, CRC, etc.

So I would start with providing 270 bytes (theoretically 260 should be sufficient but always reserve something for the unexpected).

If I read your logs correctly then it already fails at the "Fast Read Dynamic Configuration" which should get only 4 bytes or so. I am not sure why it would here fail with a No Memory error code. Maybe you can trace all the calls to the DLL with all provided parameters?

BR, Ulysses