ST25DV64KC NDEF text reading via I2C error
Hello,
I am trying to build a NFC project that receives 3 different ADC data from the MCU side (stm32l031k5) to the mobile phone.
However, there is a critical problem that:
- NFC reading is too slow. There is a term like few seconds to read new text tag.
- The values for the ADCs are not renewed and the text tag stays same. (not always but most time, it happens)
I am sharing my NFC code here.
void MX_NFC7_NDEF_URI_Process(void) {
char s1[200];
sprintf(s1, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", vol1[0], vol2[0], vol3[0], vol1[1], vol2[1], vol3[1], vol1[2], vol2[2], vol3[2], vol1[3], vol2[3], vol3[3], vol1[4], vol2[4], vol3[4]);
/* Init ST25DVXXKC driver */
while (NFC07A1_NFCTAG_Init(NFC07A1_NFCTAG_INSTANCE) != NFCTAG_OK);
/* Reset Mailbox enable to allow write to EEPROM */
NFC07A1_NFCTAG_ResetMBEN_Dyn(NFC07A1_NFCTAG_INSTANCE);
NfcTag_SelectProtocol(NFCTAG_TYPE5);
/* Check if no NDEF detected, init mem in Tag Type 5 */
if (NfcType5_NDEFDetection() != NDEF_OK) {
CCFileStruct.MagicNumber = NFCT5_MAGICNUMBER_E1_CCFILE;
CCFileStruct.Version = NFCT5_VERSION_V1_0;
CCFileStruct.MemorySize = ( ST25DVXXKC_MAX_SIZE / 8) & 0xFF;
CCFileStruct.TT5Tag = 0x01; //0x05 originally
/* Init of the Type Tag 5 component (M24LR) */
while (NfcType5_TT5Init() != NFCTAG_OK)
;
}
/* write text message to EEPROM */
while (NDEF_WriteText(s1) != NDEF_OK)
;
NDEF_Text_info_t Text;
sRecordInfo_t record;
uint8_t p_ndef_buffer[200];
/* read NDEF file */
NDEF_ReadNDEF(p_ndef_buffer);
/* Extract record info */
NDEF_IdentifyBuffer(&record, p_ndef_buffer);
/* Read Text in record */
NDEF_ReadText(&record, &Text);
}
