cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid command code error while performing Write operation from C# based PC software application

Nikhil D&K
Senior

Hello,

We currently have a desktop application based on C# for communicating between ST25R3911B-DISCO board and ST25DV dynamic tag. The application itself is similar to ST PC software for ST25R3911B-DISCO board but with limited functionalities as currently we only need Fast Transfer Mode for communication.

My PC software based on C# is able to perform inventory discovery successfully, and is also able to read the data from mailbox (verified by writing data to mailbox using ST software and reading data by using C# software). But issue arrives when i try to perform Mailbox write operation, the error returned is invalid command code for write operation. I looked at the ST25DV datasheet for RF commands and frame formats also the logs of the ST PC software to understand how the write operation data frame is transmiited but that's different from the data frame that's sent from my application. There are files in my project which adds the protocol header to data frame.

So can anyone please help me what could be the issue here. I have added the payload that sent from my application to ST25DV dynamic tag for both read and write operation below:

Here is the frame format that's sent for read operation which is working:

    READ:
    --------------------
     
    0F-15-00-44-00-10-04-40-DE-00-0C-22-AC-02-81-38-3F-05-00-25-02-E0-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
      
    1st byte is counter
    AC - read cmd

Here is the frame format that's sent for write operation which is not working and throwing error of invalid cmd:

    WRITE :
     --------------------
    01-18-00-44-00-13-04-40-DE-00-0C-22-AA-02-81-38-3F-05-00-25-02-E0-04-FF-FF-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00     
     
     
    1st byte is counter
    AA - write cmd
    04 - data length 
    FF-FF-FF-FF - data

 NOTES:

In both write and read packets, (4-5)bytes before CMD code is same (i.e "40-DE-00-0C-22") and bytes after CMD code is same (i.e "02-81-38-3F-05-00-25-02-E0")

So can you please let me know what could be the possible reason why i am getting this invalid command error, although my command is right.  

0693W00000QKMmVQAX.png0693W00000QKMmuQAH.png0693W00000QKMmpQAH.png0693W00000QKMmzQAH.png

This discussion is locked. Please start a new topic to ask your question.
16 REPLIES 16

okay thanks.

Hello,

when i send the corrected data frame    02-18-00-44-00-13-04-40-DE-00-0C-22-AA-02-81-38-3F-05-00-25-02-E0-03-FF-FF-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00

i still get the error but this time it says "ERROR NO_INFO".

I have also attached the image for the same : 0693W00000QKSBuQAP.png

When i modify the length of the data to 3 instead of 4, i get the error as "ERROR_NO_INFO".

Attached the image of the response received :

0693W00000QKSBuQAP.png

Hi Nikhil,

See 7.6.31 Write Message in the ST25DV datasheet:

"Write Message could be executed only when Mailbox is accessible by RF (fast transfer mode is enabled, previous RF message was read or time-out occurs, no I2C message to be read). User can check it by reading b1 of MB_CTRL_Dyn “HOST_PUT_MSG�? which must be reset to “0�?.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello Brian,

The FTM mailbox is enabled and also have read the MB_CTRL_Dyn register and HOST_PUT_MSG is 0.

I again try to transmit data but still the same error exist (i.e ERROR_NO_INFO).

I have attached the FTM configuration register read value:

0693W00000QKSQuQAP.png 

Hi,

see Table 19. MB_CTRL_Dyn and 5.1.2 Fast transfer mode usage in the ST25DV datasheet. There is already an existing message in your Mailbox. "Adding a message is only possible when fast transfer mode is enabled (MB_EN=1) and mailbox is free (HOST_PUT_MSG and RF_PUT_MSG cleared)." Make sure to empty the mailbox before writing a message. For your tests, you can use the ST25 tag editor GUI to reset the MB_CTRL_Dyn by writing 00 and then 01. You can also use the ST25 tag editor GUI to do some tests with the Write Message command.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Okay thanks. Got it working.