Skip to main content
Visitor II
February 2, 2021
Solved

Problem with writing mailbox size/content

  • February 2, 2021
  • 1 reply
  • 683 views

I'm using ST25 android sdk. When sending data to nfc chip it sometimes fails to write data.

I can send 4 bytes with any content.

When sending 10 bytes then it fails with TAG_NOT_IN_FIELD depending on data.

This one succeeds:

 byte[] data = new byte[10];
 data[ 0 ] = 0;
 data[ 1 ] = 'A';
 mTag.writeMailboxMessage( 10, data );
 
2021-01-31 13:03:39.123 32184-32259/eu.fufla.nfccomm D/Iso15693CustomCommand: ==> Send writeMsg command: 22 aa 02 85 66 df f3 00 24 02 e0 09 00 41 00 00 00 00 00 00 00 00
2021-01-31 13:03:39.125 380-15695/? D/NfcHalCore: Tx 00 00 16 22 aa 02 85 66 df f3 00 24 02 e0 09 00 41 00 00 00 00 00 00 00 00 
2021-01-31 13:03:39.127 380-15696/? D/NfcHalCore: Rx 60 06 03 01 00 01 
2021-01-31 13:03:39.136 380-15696/? D/NfcHalCore: Rx 00 00 02 00 00 

And this one fails. The difference is just value

 byte[] data = new byte[10];
 data[ 0 ] = 0;
 data[ 1 ] = 'A';
 data[ 4 ] = 'B';
 mTag.writeMailboxMessage( 10, data );
 
2021-01-31 13:02:47.114 31992-32070/eu.fufla.nfccomm D/Iso15693CustomCommand: ==> Send writeMsg command: 22 aa 02 85 66 df f3 00 24 02 e0 09 00 41 00 00 42 00 00 00 00 00
2021-01-31 13:02:47.116 380-15695/? D/NfcHalCore: Tx 00 00 16 22 aa 02 85 66 df f3 00 24 02 e0 09 00 41 00 00 42 00 00 00 00 00 
2021-01-31 13:02:47.118 380-15696/? D/NfcHalCore: Rx 60 06 03 01 00 01 
2021-01-31 13:02:47.744 390-414/? I/BufferQueueProducer: [eu.fufla.nfccomm/eu.fufla.nfccomm.MainActivity#0](this:0x7bf1102800,id:6999,api:1,p:31992,c:390) queueBuffer: fps=55.46 dur=1009.68 max=34.73 min=13.88
2021-01-31 13:02:47.855 31992-31997/eu.fufla.nfccomm I/zygote64: Compiler allocated 10MB to compile void android.view.ViewRootImpl.performTraversals()
2021-01-31 13:02:48.116 1765-3957/? E/StNfcJni: nativeNfcTag_doTransceive: wait response timeout
2021-01-31 13:02:48.124 31992-32070/eu.fufla.nfccomm W/System.err: com.st.st25sdk.STException: Error TAG_NOT_IN_THE_FIELD
2021-01-31 13:02:48.125 31992-32070/eu.fufla.nfccomm W/System.err: at com.st.st25android.AndroidType5ReaderInterface.transceive(AndroidType5ReaderInterface.java:132)
2021-01-31 13:02:48.126 31992-32070/eu.fufla.nfccomm W/System.err: at com.st.st25sdk.command.Iso15693Protocol.transceive(Iso15693Protocol.java:322)
2021-01-31 13:02:48.127 31992-32070/eu.fufla.nfccomm W/System.err: at com.st.st25sdk.command.Iso15693CustomCommand.writeMsg(Iso15693CustomCommand.java:1816)
2021-01-31 13:02:48.127 31992-32070/eu.fufla.nfccomm W/System.err: at com.st.st25sdk.command.FastTransferModeCommand.writeMailboxMessage(FastTransferModeCommand.java:90)
2021-01-31 13:02:48.128 31992-32070/eu.fufla.nfccomm W/System.err: at com.st.st25sdk.command.FastTransferModeCommand.writeMailboxMessage(FastTransferModeCommand.java:74)
2021-01-31 13:02:48.129 31992-32070/eu.fufla.nfccomm W/System.err: at com.st.st25sdk.type5.st25dv.ST25DVTag.writeMailboxMessage(ST25DVTag.java:1050)
2021-01-31 13:02:48.129 31992-32070/eu.fufla.nfccomm W/System.err: at eu.fufla.nfccomm.MainActivity$5.run(MainActivity.java:246)
2021-01-31 13:02:48.130 31992-32070/eu.fufla.nfccomm W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
2021-01-31 13:02:48.131 31992-32070/eu.fufla.nfccomm W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
2021-01-31 13:02:48.131 31992-32070/eu.fufla.nfccomm W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
2021-01-31 13:02:48.132 31992-32070/eu.fufla.nfccomm W/System.err: at java.lang.Thread.run(Thread.java:764)

    This topic has been closed for replies.
    Best answer by ABank

    seems that this might be specific phone problem. the same code works on different manufacturer's phone.

    1 reply

    ABankAuthorAnswer
    Visitor II
    February 10, 2021

    seems that this might be specific phone problem. the same code works on different manufacturer's phone.