This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How can i change NFC T4T library timeout variable

Hi to all,

i am developing a device based on nordic nrf52840 soc and i want use NFC tag type4 peripheral to implement a specific protocol. in normal condition all thing work well but in special condition when i need to done some process on the received command, before that my process was done an automatic reply from the device send to host, the response is "0x63 0x00" that ISO7816-4 specified this status word meaning as " state of the non-volatile memory is changed ". i can see that this automatic response received in computer side app 200ms after sending the apdu command, although the protocol that i am trying to implement specified that i can send the response up to 800ms  after the request has been sent. so i think that there is a mechanism in the nordic nfc tag type4 implementation that send this data automatically. now i want to know that there is any specific API or anything like that that i can change this behaviour ?? 

in the documentation i saw nfc_t4t_parameter_set function that accept NFC_T4T_PARAM_FWI parameter, i think that this may solve my problem but there is not any reference that show how can i use this function to change timeout variable. 

now can anyone give me a advice to solve this problem??

thanks for your attention 

Parents
  • Hi,

    We do not have an example.

    The FWI value is of type uint8_t, has a default value of 4, and a maximum value of either 4 or 7 depending on the SoC. Trying to set a too high value will give NRF_ERROR_INVALID_PARAM. You can see how FWI is converted to period here:

    #define NFC_T4T_FWI_TO_FWT(FWI)      (256u * 16u * (1 << (FWI)))                /**< Macro for calculating FWT (in number of NFC carrier periods) from FWI parameter. */

    I.e. the period will double for each FWI increment of one, and it will halve for each decrement of one. By that logic, a value of 6 would give 800 ms (if a value of 4 gives 200 ms).

    That means you should do something along the lines of:

    uint8_t new_FWI = 6;
    ret_code_t err_code = nfc_t4t_parameter_set(NFC_T4T_PARAM_FWI, (void *) &new_FWI, sizeof(new_FWI));
    app_error_check(err_code);

    Regards,
    Terje

  • Hi and thanks for your response,

    i had set the FWI as you advised but it dose not has any impact on the nfc stack behaviour and again i receive 0x63 0x00 after 200ms in computer side. i am beginner in NFC and i want to know that this is standard behaviour? and there is any other option that i can try to solve the problem?? 

Reply Children
No Data
Related