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

    ST Employee
    September 25, 2018

    Dear Even,

    First of all, thank you for considering the ST25DV-I2C.

    The Fast transfer mode buffer is indeed not using EEPROM technology, as the rest of the user and system memory of the tag.

    I cannot disclose the exact type of memory it is made of, but you can consider it as RAM type of memory. It is volatile memory, on the contrary of EEPROM.

    The Fast transfer mode buffer is not subject to any wear levelling. ​This is the reason why there is no indication about maximum write cycles for this particular memory in the datasheet.

    Furthermore, the two dynamic registers that are used to control the Fast transfer mode (MB_CTRL_Dyn and MB_LEN_Dyn) which are updated each time you read/write in the mailbox, are also standard "latch" type registers (volatile memory), and are not subject to wear levelling as well (on contrary to static registers, which are made of EEPROM memory.

    I think Fast transfer mode perfectly match what you intend to do: you can read and write in this buffer to transfer data between I2C host and RF reader, with no limit on the write cycles.

    (You also benefit of a write cycle time which is much faster than writing into the EEPROM).

    Hope this clarify your point and help you in your project.

    Best regards.

    EGiffAuthor
    Visitor II
    September 25, 2018

    Hello M. Lebon,

    I choose the ST25DV over NXP and TI (I previously evaluated an RF430) - because of the Auto tuning (my application has metal nearby) - and available eval tools (I'm using SMARTAG, ANT1-6 and ST25R Disco).

    Thank you for your clear response, this is what I was hoping for - confirmation that the memory for the FTM mailbox is volatile and does not have the same write cycle limits as EEPROM.

    SMARTAG FP-SNS-SMARTAG1 does not seem to support for the FTM, do you know where I can find some code examples of using this FTM mailbox?

    From the datasheet:

    "The access by I2C can be done by dedicated address mapping to mailbox (2008h to 2107h) with device identifier E2 = 0."

    So, assuming GPO is available, is it as simple as enabling FTM mode, making sure the mailbox is available, then writing to those dedicated addresses?

    ST Employee
    October 8, 2018

    Dear Evan,

    I’m glad you are satisfied with ST products :)

    About SMARTAG, you are right, it doesn’t use the FTM.

    If you want to see source code, there is two part of it: code for the I2C host and code for the reader.

    For the I2C host, source code is available for the  ST25DV-DISCOVERY kit. This is a demonstration kit to evaluate ST25DV-I2C features.

    The source code is for an STM32 microcontroller.

    You can find it at https://www.st.com/content/st_com/en/products/embedded-software/st25-nfc-rfid-software/stsw-st25dv001.html

    The demo FW includes code for 2 demos for FTM: a firmware upgrade demo, and a file transfer demo.

    Main page for the St25DV-Discovery kit is: https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/st25-nfc-rfid-eval-tools/st25-nfc-rfid-eval-boards/st25dv-discovery.html

     For the reader source code, you can find FTM example code for different readers:

    For Android smartphones: https://www.st.com/content/st_com/en/products/embedded-software/st25-nfc-rfid-software/stsw-st25002.html

    For ST CR95HF reader https://www.st.com/content/st_com/en/products/embedded-software/st25-nfc-rfid-software/stsw-95hf002.html

    All those codes is to be used with the FTM demo of the ST25DV-DISCOVERY (I2C host part of the demo).

    The source code for ST25R-Disco (ST25R3911B) is currently not available (only executable through the PC SW). I will check how to provide you with the source code and come back to you.

    The source code of all those demo is using the base level FTM functions + an additional protocol to handle long transfer (framing of data + crc checks etc.)

    Additionally, there is an application note AN4910 explaining how to use FTM in ST25DV.

     

    Basically to access FTM you need:

    From RF side:

    • Use of Read Message/Write message commands.
    • FTM shall be enabled through MB_EN and MB_CTRL_Dyn registers.
    • Mailbox shall be free to be writable (no message inside or message already read by I2C host)
    • VCC power must be present.

    From I2C side:

    • I2C Read/Write at addresses 2008h to 2107h (E2=0)
    • FTM shall be enabled through MB_EN and MB_CTRL_Dyn registers.
    • Mailbox shall be free to be writable (no message inside or message already read by RF host)
    • VCC power must be present.

     

    Best regards,

    JL.

    EGiffAuthor
    Visitor II
    October 17, 2018

    Excellent, thank you for providing this information - I am very much in active development on the ST25DV/R and am currently tasked to add FTM code to the SMARTAG1.

    I will post back with any issues I encounter or additional information which could be useful to others.

    EGiffAuthor
    Visitor II
    October 17, 2018

    According to the datasheet - but I'd like to confirm with you - 

    To use FTM mode - VCC_ON must be 1 indicating VCC supply is present and Low Power Down mode is not forced (LPD is low)

    I'm using the SMARTAG1 in passive (EH) mode - I.E. no battery.

    The STEVAL-SMARTAG1 is using the STLQ015M18R linear regulator to provide VCC from either HARV or Batt

    0690X000006CCf3QAG.png

    Which is then fed into the ST25DV VCC FROM PA15 of the STM32L0

    0690X000006CCfNQAW.png

    0690X000006CCf8QAG.png

    Am I correct in assuming that if I drive PA15 high - this will provide the VCC required to set VCC_ON and satisfy the requirements to use the FTM in battery less mode?

    Thank you!

    EGiffAuthorAnswer
    Visitor II
    October 17, 2018

    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.

    Visitor II
    November 21, 2019

    Hi JL. Lebon:

    I also use STEVAL-SMARTAG1 to send out temperature sensor value via FTM mode.

    I try to port codes of St25DV-Discovery  to STEVAL-SMARTAG1.

    But it doesn't work well.

    EGiffAuthor
    Visitor II
    November 21, 2019

    I assure you it does work - I've been working with this principal for over 6 months now. What kind of issues are you having?

    Visitor II
    November 21, 2019

    Hello Evan:

    Thanks for your reply.

    My scenario is the same with you: use  STEVAL-SMARTAG1 in EH mode without battery.

    For the initiation phase, just follow the steps in  St25DV-Discovery?

    EGiffAuthor
    Visitor II
    November 21, 2019

    Ok, in SmarTagNFC.c (and .h), you need to add this:

    //EMG ported from ST25-DISCOVERY

    NFCTAG_StatusTypeDef InitMailBoxMode( void )

    {

     NFCTAG_StatusTypeDef ret = NFCTAG_OK;

     //Changing system registers from I2C and RF side both require a password

     //default password is 00 00 00 00 00 00 00 00

     ST25DV_PASSWD passwd;

     passwd.MsbPasswd = 0;

     passwd.LsbPasswd = 0;

     /* Present password to open session */

     ret = St25Dv_i2c_ExtDrv.PresentI2CPassword( passwd );

     if ( ret != NFCTAG_OK) return ret; //password failed, can't go any further

     //Configure GPO as RF_ACTIVITY interrupt

     //Since this is a real-time system, we only want fresh data

     //so we use RF_ACTIVITY instead of RF_GET_MSG_EN

     //and accept data loss if sample time is too slow

     //This exists but is not used by the driver

     //ST25DV_GPO gpo;

     //gpo.GPO_Enable = 1;

     //gpo.GPO_RFActivity_en = 1;

     //so we use hex

     uint16_t gpo = 0x82;

     ret = St25Dv_i2c_Drv.ConfigIT( gpo );

     if ( ret != NFCTAG_OK) return ret; //password failed, can't go any further

     //Should be A0 for RF_GET_MSG_EN

     /* If not activated, activate Energy Harvesting */

     ST25DV_EH_MODE_STATUS EH_mode = ST25DV_EH_ON_DEMAND;

     St25Dv_i2c_ExtDrv.ReadEHMode( &EH_mode);

     if( EH_mode != ST25DV_EH_ACTIVE_AFTER_BOOT )

     {

     /*

     EH_MODE, default: 1 (meaning only energy harvesting upon demand)

     0 (ST25DV_EH_ACTIVE_AFTER_BOOT): EH forced after boot

     1 (ST25DV_EH_ON_DEMAND): EH on demand only

     Set EH_MODE TO 0 to always start energy harvesting on boot (when a field is strong enough)

     "Writing 0 in EH_MODE at any time after boot will automatically set EH_EN bit to 1,

     and thus activate energy harvesting"

     Note: This should only ever happen after initial flash of firmware

     it can also be manually set from RF side

     */

     EH_mode = ST25DV_EH_ACTIVE_AFTER_BOOT;

     ret = St25Dv_i2c_ExtDrv.WriteEHMode( EH_mode );

     }

     if ( ret != NFCTAG_OK) return ret; //can't go any further

     ST25DV_EN_STATUS MB_mode = ST25DV_DISABLE;

     /* If not activated, activate Mailbox */

     St25Dv_i2c_ExtDrv.ReadMBMode( &MB_mode);

     if( MB_mode == ST25DV_DISABLE )

     {

    MB_mode = ST25DV_ENABLE;

      ret =St25Dv_i2c_ExtDrv.WriteMBMode( MB_mode );

     }

     else

     {

      /* if already activated Clear MB content and flag */

      ret =St25Dv_i2c_ExtDrv.ResetMBEN_Dyn( );

      ret |=St25Dv_i2c_ExtDrv.SetMBEN_Dyn( );

     }

     /* Disable MB watchdog feature */

     ret |= St25Dv_i2c_ExtDrv.WriteMBWDG( 1 ); //Watch dog duration = 2(MB_WDG-1)x30ms±6, 4 = ~240ms, 1 = 60ms

     //ret |= St25Dv_i2c_ExtDrv.WriteMBWDG( 0 ); //Disable MB Watch Dog

     /* present wrong password for closing the session */

     passwd.MsbPasswd = ~passwd.MsbPasswd;

     passwd.LsbPasswd = ~passwd.LsbPasswd;

     St25Dv_i2c_ExtDrv.PresentI2CPassword( passwd );

     return ret;

    }

    /**

     * @brief DeInitializes the Mailbox mode, disables mailbox mode.

     * @param None No parameters.

     * @return NFCTAG_StatusTypeDef status.

     */

    NFCTAG_StatusTypeDef DeInitMailBoxMode( void )

    {

     return St25Dv_i2c_ExtDrv.ResetMBEN_Dyn( );

    }

    Visitor II
    April 14, 2020
    Hi: if I set gpo to 0xA0 to enable RF_GET_MSG, then i don't get any gpo interrupt. Do you get similar phenomena? Thanks�? At 2019-11-21 17:15:02, "ST Community" wrote: Ok, in SmarTagNFC.c (and .h), you need to add this: //EMG ported from ST25-DISCOVERY NFCTAG_StatusTypeDef InitMailBoxMode( void ) { NFCTAG_StatusTypeDef ret = NFCTAG_OK; //Changing system registers from I2C and RF side both require a password //default password is 00 00 00 00 00 00 00 00 ST25DV_PASSWD passwd; passwd.MsbPasswd = 0; passwd.LsbPasswd = 0; /* Present password to open session */ ret = St25Dv_i2c_ExtDrv.PresentI2CPassword( passwd ); if ( ret != NFCTAG_OK) return ret; //password failed, can't go any further //Configure GPO as RF_ACTIVITY interrupt //Since this is a real-time system, we only want fresh data //so we use RF_ACTIVITY instead of RF_GET_MSG_EN //and accept data loss if sample time is too slow //This exists but is not used by the driver //ST25DV_GPO gpo; //gpo.GPO_Enable = 1; //gpo.GPO_RFActivity_en = 1; //so we use hex uint16_t gpo = 0x82; ret = St25Dv_i2c_Drv.ConfigIT( gpo ); if ( ret != NFCTAG_OK) return ret; //password failed, can't go any further //Should be A0 for RF_GET_MSG_EN /* If not activated, activate Energy Harvesting */ ST25DV_EH_MODE_STATUS EH_mode = ST25DV_EH_ON_DEMAND; St25Dv_i2c_ExtDrv.ReadEHMode( &EH_mode); if( EH_mode != ST25DV_EH_ACTIVE_AFTER_BOOT ) { /* EH_MODE, default: 1 (meaning only energy harvesting upon demand) 0 (ST25DV_EH_ACTIVE_AFTER_BOOT): EH forced after boot 1 (ST25DV_EH_ON_DEMAND): EH on demand only Set EH_MODE TO 0 to always start energy harvesting on boot (when a field is strong enough) "Writing 0 in EH_MODE at any time after boot will automatically set EH_EN bit to 1, and thus activate energy harvesting" Note: This should only ever happen after initial flash of firmware it can also be manually set from RF side */ EH_mode = ST25DV_EH_ACTIVE_AFTER_BOOT; ret = St25Dv_i2c_ExtDrv.WriteEHMode( EH_mode ); } if ( ret != NFCTAG_OK) return ret; //can't go any further ST25DV_EN_STATUS MB_mode = ST25DV_DISABLE; /* If not activated, activate Mailbox */ St25Dv_i2c_ExtDrv.ReadMBMode( &MB_mode); if( MB_mode == ST25DV_DISABLE ) { MB_mode = ST25DV_ENABLE; ret =St25Dv_i2c_ExtDrv.WriteMBMode( MB_mode ); } else { /* if already activated Clear MB content and flag */ ret =St25Dv_i2c_ExtDrv.ResetMBEN_Dyn( ); ret |=St25Dv_i2c_ExtDrv.SetMBEN_Dyn( ); } /* Disable MB watchdog feature */ ret |= St25Dv_i2c_ExtDrv.WriteMBWDG( 1 ); //Watch dog duration = 2(MB_WDG-1)x30ms±6, 4 = ~240ms, 1 = 60ms //ret |= St25Dv_i2c_ExtDrv.WriteMBWDG( 0 ); //Disable MB Watch Dog /* present wrong password for closing the session */ passwd.MsbPasswd = ~passwd.MsbPasswd; passwd.LsbPasswd = ~passwd.LsbPasswd; St25Dv_i2c_ExtDrv.PresentI2CPassword( passwd ); return ret; } /** * @brief DeInitializes the Mailbox mode, disables mailbox mode. * @param None No parameters. * @return NFCTAG_StatusTypeDef status. */ NFCTAG_StatusTypeDef DeInitMailBoxMode( void ) { return St25Dv_i2c_ExtDrv.ResetMBEN_Dyn( ); } evan.gifford1.5377818004144224E12 (Community Member) Ok, in SmarTagNFC.c (and .h), you need to add this: //EMG ported from ST25-DISCOVERY NFCTAG_StatusTypeDef InitMailBoxMode( void ) { NFCTAG_StatusTypeDef ret = NFCTAG_OK; //Changing system registers from I2C and RF side both require a password //default password is 00 00 00 00 00 00 00 00 ST25DV_PASSWD passwd; passwd.MsbPasswd = 0; passwd.LsbPasswd = 0; /* Present password to open session */ ret = St25Dv_i2c_ExtDrv.PresentI2CPassword( passwd ); if ( ret != NFCTAG_OK) return ret; //password failed, can't go any further //Configure GPO as RF_ACTIVITY interrupt //Since this is a real-time system, we only want fresh data //so we use RF_ACTIVITY instead of RF_GET_MSG_EN //and accept data loss if sample time is too slow //This exists but is not used by the driver //ST25DV_GPO gpo; //gpo.GPO_Enable = 1; //gpo.GPO_RFActivity_en = 1; //so we use hex uint16_t gpo = 0x82; ret = St25Dv_i2c_Drv.ConfigIT( gpo ); if ( ret != NFCTAG_OK) return ret; //password failed, can't go any further //Should be A0 for RF_GET_MSG_EN /* If not activated, activate Energy Harvesting */ ST25DV_EH_MODE_STATUS EH_mode = ST25DV_EH_ON_DEMAND; St25Dv_i2c_ExtDrv.ReadEHMode( &EH_mode); if( EH_mode != ST25DV_EH_ACTIVE_AFTER_BOOT ) { /* EH_MODE, default: 1 (meaning only energy harvesting upon demand) 0 (ST25DV_EH_ACTIVE_AFTER_BOOT): EH forced after boot 1 (ST25DV_EH_ON_DEMAND): EH on demand only Set EH_MODE TO 0 to always start energy harvesting on boot (when a field is strong enough) "Writing 0 in EH_MODE at any time after boot will automatically set EH_EN bit to 1, and thus activate energy harvesting" Note: This should only ever happen after initial flash of firmware it can also be manually set from RF side */ EH_mode = ST25DV_EH_ACTIVE_AFTER_BOOT; ret = St25Dv_i2c_ExtDrv.WriteEHMode( EH_mode ); } if ( ret != NFCTAG_OK) return ret; //can't go any further ST25DV_EN_STATUS MB_mode = ST25DV_DISABLE; /* If not activated, activate Mailbox */ St25Dv_i2c_ExtDrv.ReadMBMode( &MB_mode); if( MB_mode == ST25DV_DISABLE ) { MB_mode = ST25DV_ENABLE; ret =St25Dv_i2c_ExtDrv.WriteMBMode( MB_mode ); } else { /* if already activated Clear MB content and flag */ ret =St25Dv_i2c_ExtDrv.ResetMBEN_Dyn( ); ret |=St25Dv_i2c_ExtDrv.SetMBEN_Dyn( ); } /* Disable MB watchdog feature */ ret |= St25Dv_i2c_ExtDrv.WriteMBWDG( 1 ); //Watch dog duration = 2(MB_WDG-1)x30ms±6, 4 = ~240ms, 1 = 60ms //ret |= St25Dv_i2c_ExtDrv.WriteMBWDG( 0 ); //Disable MB Watch Dog /* present wrong password for closing the session */ passwd.MsbPasswd = ~passwd.MsbPasswd; passwd.LsbPasswd = ~passwd.LsbPasswd; St25Dv_i2c_ExtDrv.PresentI2CPassword( passwd ); return ret; } /** * @brief DeInitializes the Mailbox mode, disables mailbox mode. * @param None No parameters. * @return NFCTAG_StatusTypeDef status. */ NFCTAG_StatusTypeDef DeInitMailBoxMode( void ) { return St25Dv_i2c_ExtDrv.ResetMBEN_Dyn( ); } or reply to this email Replying to evan.gifford1.5377818004144224E12 (Community Member) asked a question. Monday, September 24, 2018 3:00 AM Fast transfer mode mailbox - how many write cycles can it handle? 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 evan.gifford1.5377818004144224E12 (Community Member) Ok, in SmarTagNFC.c (and .h), you need to add this: //EMG ported from ST25-DISCOVERY NFCTAG_StatusTypeDef InitMailBoxMode( void ) { NFCTAG_StatusTypeDef ret = NFCTAG_OK; //Changing system registers from I2C and RF side both require a password //default password is 00 00 00 00 00 00 00 00 ST25DV_PASSWD passwd; passwd.MsbPasswd = 0; passwd.LsbPasswd = 0; /* Present password to open session */ ret = St25Dv_i2c_ExtDrv.PresentI2CPassword( passwd ); if ( ret != NFCTAG_OK) return ret; //password failed, can't go any further //Configure GPO as RF_ACTIVITY interrupt //Since this is a real-time system, we only want fresh data //so we use RF_ACTIVITY instead of RF_GET_MSG_EN //and accept data loss if sample time is too slow //This exists but is not used by the driver //ST25DV_GPO gpo; //gpo.GPO_Enable = 1; //gpo.GPO_RFActivity_en = 1; //so we use hex uint16_t gpo = 0x82; ret = St25Dv_i2c_Drv.ConfigIT( gpo ); if ( ret != NFCTAG_OK) return ret; //password failed, can't go any further //Should be A0 for RF_GET_MSG_EN /* If not activated, activate Energy Harvesting */ ST25DV_EH_MODE_STATUS EH_mode = ST25DV_EH_ON_DEMAND; St25Dv_i2c_ExtDrv.ReadEHMode( &EH_mode); if( EH_mode != ST25DV_EH_ACTIVE_AFTER_BOOT ) { /* EH_MODE, default: 1 (meaning only energy harvesting upon demand) 0 (ST25DV_EH_ACTIVE_AFTER_BOOT): EH forced after boot 1 (ST25DV_EH_ON_DEMAND): EH on demand only Set EH_MODE TO 0 to always start energy harvesting on boot (when a field is strong enough) "Writing 0 in EH_MODE at any time after boot will automatically set EH_EN bit to 1, and thus activate energy harvesting" Note: This should only ever happen after initial flash of firmware it can also be manually set from RF side */ EH_mode = ST25DV_EH_ACTIVE_AFTER_BOOT; ret = St25Dv_i2c_ExtDrv.WriteEHMode( EH_mode ); } if ( ret != NFCTAG_OK) return ret; //can't go any further ST25DV_EN_STATUS MB_mode = ST25DV_DISABLE; /* If not activated, activate Mailbox */ St25Dv_i2c_ExtDrv.ReadMBMode( &MB_mode); if( MB_mode == ST25DV_DISABLE ) { MB_mode = ST25DV_ENABLE; ret =St25Dv_i2c_ExtDrv.WriteMBMode( MB_mode ); } else { /* if already activated Clear MB content and flag */ ret =St25Dv_i2c_ExtDrv.ResetMBEN_Dyn( ); ret |=St25Dv_i2c_ExtDrv.SetMBEN_Dyn( ); } /* Disable MB watchdog feature */ ret |= St25Dv_i2c_ExtDrv.WriteMBWDG( 1 ); //Watch dog duration = 2(MB_WDG-1)x30ms±6, 4 = ~240ms, 1 = 60ms //ret |= St25Dv_i2c_ExtDrv.WriteMBWDG( 0 ); //Disable MB Watch Dog /* present wrong password for closing the session */ passwd.MsbPasswd = ~passwd.MsbPasswd; passwd.LsbPasswd = ~passwd.LsbPasswd; St25Dv_i2c_ExtDrv.PresentI2CPassword( passwd ); return ret; } /** * @brief DeInitializes the Mailbox mode, disables mailbox mode. * @param None No parameters. * @return NFCTAG_StatusTyp
    EGiffAuthor
    Visitor II
    November 21, 2019

    And in main.c,

    // this will also set EH_EN to 1

    NFCTAG_StatusTypeDef ret = NFCTAG_OK;

    ret = InitMailBoxMode(); // enable FTM

    EGiffAuthor
    Visitor II
    November 21, 2019

    Then you will need to watch interrupt on the GPO pin - which will be triggered when a mailbox message has been successfully read - meaning you can go ahead and write the next message