Skip to main content
Visitor II
February 5, 2020
Solved

ST25DV Append NDEF records

  • February 5, 2020
  • 4 replies
  • 3471 views

Has anyone implemented or does ST provides a library where the NDEF records can be appended or chained together for data logging such as long term sensor data etc without overwriting the old records?

Looking at the current NDEF library of the ST25DV it does not seem to do so.

Does anyone has any workaround or solution for this?

Thanks

    This topic has been closed for replies.
    Best answer by Rene Lenerve

    Hi @Rajeev Piyare​ ,

    Yes appending records can be done easily. But be aware that on smartphone side it would take some time if the memory is full of records to read the NDEF (data rate = 26kbits/s).

    This was a work to do, but not implemented in this library. The lib has been rewrite to be more efficient and more flexible to use with all our products reader and tags. In our readers package this new version is available. We need to propagate it in tags package too as the ST25DV.

    Regards.

    4 replies

    ST Employee
    February 6, 2020

    ​Hello Rajeev,

    what platform will your application run on ? PC, Android, STM32 ?

    Thanks,

    Damien

    Visitor II
    February 6, 2020

    Hi @Damien G._O​ ,

    The ST25DV04K NFC tag is connected to ARM-Cortex-M3 via I2C since we have a custom sensor device. However, for the low-level implementation, we are utilizing the same drivers and NDEF libraries provided by STM.

    It would be great if there is a library for appending the data via I2C with correctly updating the NDEF header (possibly NDEF TEXT format) until the memory gets full. Currently, this is the major hurdle we are facing before mass producing our sensors with NFC for long term data logging.

    Any form of support from ST and or community will be highly appreciated!

    Thanks so much.

    Rajeev

    ST Employee
    February 6, 2020

    Rajeev,

    ​You may find resources related to the STEVAL-SMARTAG1 to be of value for your project as it sounds very similar to your use case.

    Especially the page related to the STM32Cube function pack that contains firmware code examples.

    Best regards,

    Damien

    ST Employee
    February 7, 2020

    Hi @Rajeev Piyare​ ,

    In the NDEF lib provided with the ST25DV firmware, there is a function to append a record on an NDEF file. It is used with the NDEF AAR record type to append an AAR record in the memory, it can be adapted for the text record I think.

    Writing multiple records with the lib can generate memory issues or time consuming, as the whole NDEF file must be read, modified then rewrite into EEPROM.

    Is this the only way you can implement for your use case?

    Regards.

    Visitor II
    February 7, 2020

    Hi @Rene Lenerve​ ,

    Thanks for your feedback. I think, I may have figured out how to implement appending of text records without breaking the library.

    This will be very customized for my own application but the main parameters that I need to keep track are the TLV and the payload length together with block offsets to slot in new data.

    In this manner, I will not need to read the whole NDEF message (which after long term logging will be long), but to modify the above parameters accordingly and then write the new data to EEPROM.

    Thanks and I appreciate the feedback from the ST.

    *PS. Was there any particular reason as to why this was not initially implemented in the ST25DV library, especially for writing data via I2C?

    Regards

    Visitor II
    August 29, 2023

    how to you add text .I am working on same NFC and trying to add multiple text record

    ST Employee
    February 7, 2020

    Hi @Rajeev Piyare​ ,

    Yes appending records can be done easily. But be aware that on smartphone side it would take some time if the memory is full of records to read the NDEF (data rate = 26kbits/s).

    This was a work to do, but not implemented in this library. The lib has been rewrite to be more efficient and more flexible to use with all our products reader and tags. In our readers package this new version is available. We need to propagate it in tags package too as the ST25DV.

    Regards.

    Visitor II
    February 7, 2020

    @Rene Lenerve​ ,

    On my end, with the current RF data rate of 26kbits/s, I think it's not a problem for reading. We do not have any strict latency issue there.

    But good to know that the reader package contains this update.

    Looking forward to the updates on the ST25DV MCU library side.

    Thanks for the continuous feedback.

    Cheers

    Visitor II
    July 1, 2020

    Delete