Skip to main content
Visitor II
April 17, 2023
Solved

ST25DV64K - Custom Command To Read Mailbox Buffer?

  • April 17, 2023
  • 2 replies
  • 1077 views

In follow up to my earlier question on reading Mailbox Memory from our iOS app, we are trying to pass the Read Msg command, but looks like this needs address flag set and UID needs to be passed. But when we try to pass the address flag and UID along with "AC" read command code, we get Stack Error along with Invalid Parameters error.

  1. The most recently released ST ios App seems to work fine with same Custom command. The source code in your site is not updated to reflect the latest changes you have made. So, we would like to get the latest source code and the code implementation specifically for Reading mailbox buffer
  2. Should we always check Message Buffer Length before calling ReadMsg (or) we can always 256 bytes of memory with null data returned for empty buffer
  3. Could you please also point to the section in the Data sheet to refer the different mailbox command implementations to understand which commands would need .address request flags along with UID
    This topic has been closed for replies.
    Best answer by victor laraison

    Hi Rjaya2,

    Thx for your feedback.

    This is a minor bug into our UI for custom command. It is quite confusing, but when toggling the Address mode to "ON" in the UI, we force the non-addressed mode anyway.

    In our code, we always assume that commands coming from user or ST25SDK stack are formated with the UID (addressed mode). And, when using the customCommand from iOS coreNFC, we remove the UID from data passed.

    Ex :

    UI custom command 22 AC 02 <UID> 02 00 02 => iOS Reader Interface remove UID => iOS coreNFC call custom command with code 0xAC and Data = 0x02 00 02

    If the UID is not passed in the iOS ReaderInterface funtion, command is not formated well.

    So consider, that in every case, we use the "non adressed mode". We must correct this behavior into our code. this is not your fault.

    Carry on using addressed mode in custom command UI, and keep in mind that custom command will be executed in non-adressed in low level layer.

    sorry for misunderstanding. Hope it clarifies a bit.

    We are working on new release for fixing it.

    Thx and br,

    2 replies

    ST Employee
    April 18, 2023

    hi Rjaya2,

    1- in iOScoreNFC, the custom command does not work in addressed mode. You have to remove the flag .address when calling customCommand function.

    Issue is well known and raised to apple since many years....nothing done for correction so far.

    2- I'm delivering a new source code in coming days in st.com web site. Stay tuned...It should contains latest changes.

    3- in DS, please have a look in section 7.6.31 Write Message and Section

    5.1: Fast transfer mode (FTM)

    Hope it helps.

    BR

    RJaya.2Author
    Visitor II
    April 18, 2023

    Hi Victor,

    Thanks for the response.

    For item #1, in your latest version of iOS ST App, we are passing "AC" ReadMsg command to read the mailbox buffer. When we toggle the Address Mode to "ON", the command is successful (we can see the command includes the UID in your UI). When we toggle the Address Mode to "OFF", we see that your command does not include the UID and the response is also command not successful. In our case, when we pass the command both ways, we are seeing "Stack Error" from our custom command. So, would like to know how do you pass the "AC" command in your ST app in Custom Command section.

    Scenarios:

    22 AC 02 <UID> 02 00 02 - This command is successful in your ST App with addressed flag turned ON

    02 AC 02 02 00 02 - This command returns failure in your ST app with address mode turned OFF

    ST Employee
    April 21, 2023

    Hi Rjaya2,

    Thx for your feedback.

    This is a minor bug into our UI for custom command. It is quite confusing, but when toggling the Address mode to "ON" in the UI, we force the non-addressed mode anyway.

    In our code, we always assume that commands coming from user or ST25SDK stack are formated with the UID (addressed mode). And, when using the customCommand from iOS coreNFC, we remove the UID from data passed.

    Ex :

    UI custom command 22 AC 02 <UID> 02 00 02 => iOS Reader Interface remove UID => iOS coreNFC call custom command with code 0xAC and Data = 0x02 00 02

    If the UID is not passed in the iOS ReaderInterface funtion, command is not formated well.

    So consider, that in every case, we use the "non adressed mode". We must correct this behavior into our code. this is not your fault.

    Carry on using addressed mode in custom command UI, and keep in mind that custom command will be executed in non-adressed in low level layer.

    sorry for misunderstanding. Hope it clarifies a bit.

    We are working on new release for fixing it.

    Thx and br,