cancel
Showing results for 
Search instead for 
Did you mean: 

NDEF writing/reading via I2C in X-Nucleo- NFC04A1(ST25DV)

NewOne
Associate

Hi I'm trying to write text via NDEF library to be available to read from EEPROM by phone nfc aplication. Also I want to read text send by phone directly to EEPROM. I tried to change NDEF_URI example method to implement NDEF_WriteText and NDEF_ReadText method and write some text into ST25DV EEPROM and read from but honestly I have no idea what's wrong with my conception. Could you show me some code where you are using these methods?

35 REPLIES 35
Schuyler
Senior

Hi,@Rene Lenerve​ ​

If I erase the tag memory with the NFC Tap App before run this code the NDEF, so I will achieve this function?

Rene Lenerve
ST Employee

Hi @帅罗.1 (Community Member)​,

I suggest you to erase the tag memory because if the CC file is already written it will not be updated with the code used above, and it is probably why you are not seeing the NDEF Text message in ST25 NFC App. By erasing the tag memory and use the code above it will automatically rewrite the CC file and the NDEF Text message. You are free to manage this part as you want.

Kind Regards

Schuyler
Senior

Hi,

This is shown below after I erase the tap memory through the application,so I will get the message by “NDEF editor�? or “read memory�?

0693W00000aJZxyQAG.png0693W00000aJZywQAG.png

Rene Lenerve
ST Employee

Hi @帅罗.1 (Community Member)​,

Your screenshots are not displaying same tag content ST25DV vs ST25TA02K-P.

For the ST25DV the CCFile has been correctly filled with expected values, the rest of the memory indicates that an empty message is stored. So now the NDEF Text message can be correctly written and then you should see it on the App.

Kind Regards.

Schuyler
Senior

Hi @Rene Lenerve​ 

I see what you mean,as for me,I think the first step is to clear the information in the memory,so the app's read memory will show 00. Then run the above code, can you read the NDEF message correctly by“read memory�? or "NDEF editor’?

Schuyler
Senior

Hi,@Rene Lenerve​ 

I used the sample code called “NDEF_URI�? in X-CUBE-NFC7. But the phone still hasn't read the URL in the code, what should I do? 0693W00000aJr14QAC.png0693W00000aJr1JQAS.jpg

Schuyler
Senior

 I have changed “MemorySize = 0x00�? to “CCFileStruct.MemorySize = (ST25DVXXKC_MAX_SIZE / 8) & 0xFF;�?

Rene Lenerve
ST Employee

Hi @帅罗.1 (Community Member)​,

I'm sorry, I'm not able to translate your screenshot.

But the memory seems to be empty, if you have played the firmware it should have filled it with CCFile and NDEF message. This may be an issue with the NFC07A1_NFCTAG_Init function which checks that the connected component is an ST25DVxxKC. Are you sure that the chip is a ST25DVxxKC and not a ST25DVxxK?

Kind Regards,

Schuyler
Senior

Hi,@Rene Lenerve​ 

Yes,  the memory is empty, I can write to and read from memory from my phone,but the above code does not display the information correctly. I have checked ST25DVXXKC according to your prompt and found no problem,The memory read by the phone is always empty. Do you have a better suggestion0693W00000aJrmeQAC.png

Rene Lenerve
ST Employee

Hi @帅罗.1 (Community Member)​,

On my side the NFC7 code is working correctly and the update for the Text message too. I suggest that you run the code in debugging and check step by step to see where the error is.

Kind regards.