cancel
Showing results for 
Search instead for 
Did you mean: 

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

Mpraj.19
Associate II

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 ?

14 REPLIES 14
Mpraj.19
Associate II

Yes

JL. Lebon
ST Employee

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.

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.

JL. Lebon
ST Employee

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.19
Associate II

Thank you.

i have got the rf write interrupt on message get.