Skip to main content
Visitor II
September 24, 2018
Solved

Fast transfer mode mailbox - how many write cycles can it handle?

  • September 24, 2018
  • 25 replies
  • 7296 views

I have an application which must send > 100KB/day to an RFID/NFC reader (I'm using the STM25R Disco) - for days and years on end.

Looking at the EEPROM spec, it's good for 600k write cycles at 85 °C

(That means even at 64Kbit EEPROM, wear leveling would be critical for long life.)

The Fast Transfer Mode buffer / mailbox is intriguing (256 Bytes) - it seems perfect for my use case - (mainly polling data) - however I cannot find any information about the type of memory used for this or number of write cycles it supports in the datasheet.

So, what type memory is used for this FTM mailbox? How many write cycles can it handle?

Thank you very much

    This topic has been closed for replies.
    Best answer by EGiff

    Answering my own question - I can write and read the FTM mailbox from the ST25 Tag Editor in batteryless mode using the following script (in the script tool):

    REM,PRESENT PASSWORD

    ST25R3911B_SENDRECEIVE, 02B302000000000000000000

    REM,WRITE CONFIG GPO = B0

    ST25R3911B_SENDRECEIVE, 02A10200B0

    REM,WRITE CONFIG MB_EN = 01

    ST25R3911B_SENDRECEIVE, 02A1020D01

    REM,WRITE CONFIG MB_WDG = 00

    ST25R3911B_SENDRECEIVE, 02A1020E00

    REM,WRITE DYN REGISTER @00

    ST25R3911B_SENDRECEIVE, 02AE020D00

    REM,WRITE DYN REGISTER @01

    ST25R3911B_SENDRECEIVE, 02AE020D01

    ST25R3911B_SENDRECEIVE, 02AA02FF030000010000200000220001F3E2400001000003FF03FF00FF440E000000EB73742E636F6D3A736D6172746167010100020500013FEEEEEEEE41403228544B3804000100000500220032082200050022000A00220041412F2E0A0022000500220019002200143661040200700005002200C42B38610A002200842B48610F00220004CB872A1400220004CBB72A19002200C4EA97631E002200C4EA9763230022008429A85528002200842918552D00220084297855708F0000842918553700220084292855400022008429F85445002200842918554A002200842928554F0022008429C854540022008429185559002200842918555E0022008429B854630022

    This causes the STM32L0 to go into error (NFC_READING_ERROR) because FTM is not implemented on the SMARTAG1 firmware - (the main loop attempts to write EEPROM after mode has been set to FTM by the RF side)

    ST25DV is ok and the FTM mailbox can be written and read back in batteryless mode.

    25 replies

    EGiffAuthor
    Visitor II
    November 21, 2019

    In main.c

    /* USER CODE BEGIN 0 */

    // Interrupt callback for ST25_GPO_Pin, indicating a message was read on RF side

    // This assumes the GPO register is set correctly on the ST25DV

    void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)

    {

    if (GPIO_Pin == ST25_GPO_Pin) {

    GPO_Triggered = 1;

    }

    }

    Visitor II
    November 22, 2019

    Hello evan:

    Thanks! The codes you provide can work now.

    Visitor II
    November 22, 2019

    Hi Evan:

    Do you mean when i got GPO_Triggered, then i send one mailbox message?

    like this:

    [

    if(GPO_Triggered) {

    GPO_Triggered = 0;

    NFCTAG_StatusTypeDef ret = NFCTAG_OK;

    ST25DV_MB_CTRL_DYN_STATUS data = {0};

    uint8_t send_data[4] ={'a','b','c','d'};

    uint16_t len_send_data = 4;

    /* Check if Mailbox is available */

    ret = BSP_NFCTAG_GetExtended_Drv()->ReadMBctrl_Dyn( &data );

    if( ret != NFCTAG_OK )

    {

    HAL_Delay(2);

    return ret;

    }

      

        ret = BSP_NFCTAG_GetExtended_Drv()->WriteMailboxData( send_data, len_send_data );

        if( ret != NFCTAG_OK )

    {

    HAL_Delay(2);

    return ret;

    }

      }

    ]

    How can i trigeger it with the simplest way

    EGiffAuthor
    Visitor II
    November 25, 2019

    If you look in the WriteMailboxData, it already checkes the registrer - and returns BUSY error if it's not available (which should never be the case since we got GPO interrpt).

    I do it like this:

    if (GPO_Triggered) { // interrupt from ST25DV indicating the mailbox is free

    GPO_Triggered = 0; // handled

    ///some code

    NFCTAG_StatusTypeDef status = St25Dv_i2c_ExtDrv.WriteMailboxData(txBuf, NFC_TX_BUFFER_LEN);

    switch (status) {

    case NFCTAG_OK:

    // HAL_WWDG_Refresh(&hwwdg);

    break;

    case NFCTAG_BUSY:

    // Reset RF missed message bit

    status = St25Dv_i2c_ExtDrv.ResetMBEN_Dyn();

    status |= St25Dv_i2c_ExtDrv.SetMBEN_Dyn();

    // should not happen since we read the MB mode before attempting to write

    break;

    default:

    // Perhaps time for a reset

    break;

    }

    }

    Visitor II
    November 26, 2019

    Hello evan:

    Yes, got it.

    Hi Lebon:

    ​I face another issue, by using ST25R-Disco (ST25R3911B) , how to set it work as long distance mode. 

    Now the distance between ST25R-Disco (ST25R3911B) and STEVAL-SMARTAG1 is about 12cm. Can the distance be set longer, for example 30cm or 40 cm?

    Thanks a lot!

    ST Employee
    November 26, 2019

    Hello,

    The 12cm distance you can reach seems normal to me. with the reader and tag antenna size you got​ It will be difficult to reach higher distance without modifying one or the other

    One solution to increase read range would be to increase the SMARTAG antenna size. With a class 1 size antenna (Credit card size) and the ST25R-Disco , you can hope 16cm.

    If you want to reach higher distances, a more powerful reader is required.

    To answer to the initial question "how many cycles can FTM handles": the FTM is using an SRAM buffer to read/write data, not the EEPROM memory. So there is no cycling limit as in an EEPROM for the FTM, you don't have to worry about this.

    Best regards.

    EGiffAuthor
    Visitor II
    November 26, 2019

    On some tags you can also get an extra centimeter by adding a tuning capacitor tag - currently nm. The value of that would vary from 0pf (nm) to maybe 3-4pf - this is due to the variation of the on-chip tuning capacitor on the ST25DV - and so will change from chip-to-chip.

    EGiffAuthor
    Visitor II
    November 26, 2019

    Doing that would take some experimentation - each tag will be different. The footprint is C14. Try with 0.5pf - I mounted by tag to a delta robot for precise, repeatable positioning to determine the best tag antenna tuning capacitor value.

    Visitor II
    November 29, 2019

    Hello evan and Lebon:

    Thanks for your advice. I did an experiment: replace the orignial antenna with 30*30 cm square antenna in ST25R-Disco (ST25R3911B).

    And also change the capacitor value of C401 and C412 from 82PF to 180PF, adjust the matching resistance in the ST25R-Disco (ST25R3911B) board.

    Now the distance is about 22cm.

    But my target distance is 40cm.

    Any other optimization actions should i take to reach 40 cm.

    Any suggestions? Thanks a lot!

    EGiffAuthor
    Visitor II
    December 2, 2019

    Well - that's a good distance with 1.4W TX. Are you reading in FTM mailbox mode at that distance?

    To go farther, you can try:

    Verify alignment of antennas - orientation and position.

    Reduce metal near both antenna and tag.

    Reduce power usage on the tag - shutdown the uC as ST25DV between readings - allowing the STM32L0 to live with a lower power budget.

    Shut down (or de-solder) unneeded sensors, pull-ups/pull-downs, etc on the Tag.

    Assuming you have only one Tag, make sure RFAL_TXRX_FLAGS_AGC_ON flag is set.

    Try tuning for amplitude instead of phase using manual tuning.

    Check rfalAnalogConfigDefaultSettings (rfal_analogConfigTbl.h), perhaps you can tweak some values there - you can even use the PC software to generate a new analog config header file.

    You can look at the ST25R3916 - it has most of the same features as R3911, but with 1.6W output power along with more fine tuning of antenna.

    You are already well beyond the typical distance for ISO15693 - other standards and custom solutions can allow for further distances - like what these guys do:

    https://www.phaseivengr.com/solutions-demos/rotating-equipment-sensors/

    Visitor II
    December 4, 2019

    Hello evan:

    Yes, my plan is to read in FTM mode.

    Yes, only one tag and now the tag power consumption is minimum.

    I will try set RFAL_TXRX_FLAGS_AGC_ON flag.

    "Try tuning for amplitude instead of phase using manual tuning." Do you mean changing ST25R3911 firmware(in rfal_analogConfigTbl.h) or others?

    Yes, i plan to try ST25R3916 next step.

    Thanks very much!

    EGiffAuthor
    Visitor II
    December 4, 2019

    Another thing to try is a larger antenna for the tag - https://www.st.com/en/evaluation-tools/ant-1-6-st25dv.html contains 3 different antennas - one which is larger and contains the ST25DV - but not the STM32L0 - so you could re-work the tag to put the on-board ST25DV NM and jump the I2C to the external ST25DV - or perhaps keep it and use just he antenna on the ANT_C1 daughter board.

    Creating a custom antenna isn't too difficult, ST provides a tool for designing antennas - you can have them fabricated externally on FR4 or flex - just make sure to plan for a couple footprints for tuning capacitors.

    https://my.st.com/analogsimulator/html_app/antenna/#/