Skip to main content
Visitor II
June 22, 2021
Solved

How to get memory write GPO interrupt using st25dv04k ? Is there any interrupt is there to check user success fully read tag data ?

  • June 22, 2021
  • 13 replies
  • 3456 views

i am successfully write message to my type 5 tag and it get read by user.

I have seen that there is different interrupt we can get on gpo pin.

But i don't know which interrupt i need to use when message successfully read by user ?

i want to start Bluetooth advertisement on nfc tag read by user. so please let me know how to do this thing on interrupt ?

    This topic has been closed for replies.
    Best answer by JL. Lebon

    Hello,

    To generate an interrupt when receiving an RF command, you should enable the RF_ACTIVITY interrupt.

    This is done by setting bit 1 (RF_ACTIVITY_EN) of the GPO configuration register (system address 0000h).

    The RF_ACTIVITY interrupt will be generated at each RF command received. The pulse of interruption starts at end of frame of the RF request, and stops at end of frame of the RF response.

    You can activate several interrupts at the same time, meaning that both field detection and RF command detection can be activated at the same time.

    Best regards.

    13 replies

    ST Employee
    July 6, 2021

    Ok, then I can imagine several ways of doing this.

    The CR95HF can, for example, write a special value in a specific address in ST25DV04K memory when it has read the message. The instrument A then need to regularly read this address (polling) to check if its value has been modified.

    Another method would be to use the St25DV04K's GPO pin to generate an interrupt. Once the CR95HF has read the message, it can signal it to instrument A by trigging a pulse on the GPO pin of ST25DV04K by using the ManageGPO command. The GPO pin should be connected to an interrupt pin of instrument A MCU. Please refer to the datasheet chapter about GPO feature for more details.

    Best regards.

    Mpraj.19Author
    Visitor II
    July 6, 2021

    I have used interrupt method. so once the Cr95hf has read message it send the message over air to to instrument A .

    Will this received message from cr95hf, give rf write interrupt on GPO pin of st25dv04k ?

    Will this interrupt change value of ST25DV_ITSTS_DYN_REG ? i want to monitor this interrupt by this monitoring register value in interrupt handler.

    I have implemented interrupt handler like below.

    /* Exported macro ------------------------------------------------------------*/
    #define ST25_RETRY_NB ((uint8_t) 15)
    #define ST25_RETRY_DELAY ((uint8_t) 40)
     
    /**
     * @brief Iterate ST25DV command depending on the command return status.
     * @param cmd A ST25DV function returning a NFCTAG_StatusTypeDef status.
     */
    #define ST25_RETRY(cmd) do { \
     int st25_retry = ST25_RETRY_NB; \
     int st25_status = NFCTAG_ERROR; \
     while(st25_status != NFCTAG_OK) \
     { \
     st25_status = cmd; \
     if(st25_status != NFCTAG_OK) \
     usleep(ST25_RETRY_DELAY*1000); \
     if(st25_retry-- <= 0) \
     { \
     st25_retry = ST25_RETRY_NB; \
     } \
     } \
     } while(0)
     
     
     
    static int count = 0;
     
    void gpo_handler(void)
    {
     uint8_t itstatus;
     ST25_RETRY(BSP_NFCTAG_ReadITSTStatus_Dyn(0, &itstatus ));
     
     if( (itstatus & ST25DV_ITSTS_DYN_RFWRITE_MASK) == ST25DV_ITSTS_DYN_RFWRITE_MASK )
     {
     printf("RF write");
     }
    }

    Thanks for reply.

    ST Employee
    July 6, 2021

    Yes, the RF_WRITE interrupt on GPO will change the corresponding bit in the IT_STS_Dyn register when triggered, so you should be able to monitor it.

    Best regards.

    Mpraj.19Author
    Visitor II
    July 7, 2021

    Thank you.

    i have got the rf write interrupt on message get.