Skip to main content
Visitor II
December 20, 2022
Solved

ST25DV-i2c energy harvesting and GPO with stm32l031k6

  • December 20, 2022
  • 14 replies
  • 6102 views

Hello, I am trying to open a project that can turn on the low power MCU stm32l031 with ANT7-T-25DV64KC while turning high and low periodically for GPO pin of the MCU. I tried many different ways but still not done with any of them (steval code and using NFC4 and 7 provided by stm32cubeide).

Would you please suggest me for any reference or sample for St25DV-i2c?

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

    Hi @WPARK.1​,

    Great that you solved your issue, Happy for you.

    • For EH, if you have set the register to the value ST25DVXXKC_EH_ACTIVE_AFTER_BOOT, EH will be always active (when a field is present) until you modify this register. (please read the DataSheet of the ST25DV64KC to have more information on it and other features).

    • For NDEF, NDEF is a file format message described by the standard from NFC Forum specifications, it describes how data are organized in the memory. There are multiple formats defined by NFC Forum, URI is one to store URI information as for this example an URL (could be also phone number, email, ftp, ...). The field information is just additional information used for smart poster (it is an extended format that contains more fields not mandatory to store only an URL). For NDEF Text format you need to use another format than the URI, in the ndef lib you have a file named lib_NDEF_Text that allow you to build such messages. But it is recommended to read the standard or find some resources on google to learn more about NDEF format (This standard is used for applications with NFC but are not NFC spec).

    I hope this can help you.

    Kind Regards.

    14 replies

    ST Employee
    January 24, 2023

    Hi @WPARK.1​,

    Starting from the EH example is fine. When connecting I2C from ANT7-T-25DV64KC to STMF4 nucleo, you also need to connect pull-up resistors to this bus otherwise it will not be able to communicate with the tag.

    When you say the code was stuck, can you give more details on where it is stuck?

    For the EH feature you need to activate it only once and it will be available each time an RF reader approach the antenna.

    Kind Regards.

    WPARK.1Author
    Visitor II
    January 24, 2023

    Hello,

    I found out that my STMF4 board is based on STM32F407VET6. Therefore, the sample codes are not very fit to me in this moment. So, as currently, I don't have suitable pull up resistors at home, I would like to use FLEX-ST25DV64KC. I tried to check the pin diagram of FLEX-ST25DV64KC but I could not find any reference.

    Therefore, can I have any references?

    Thank you for reading.

    ST Employee
    January 26, 2023

    Hi @WPARK.1​,

    It seems that there is a missing document for the ST25DV64KC-DISCO, we will check to fix this point.

    For information the pin of the Flex antenna is as follows:

    pin 1 : VCC

    pin 2 : Ground

    pin 3 : I²C SDA

    pin 4 : I²C SCL

    pin 5 : GPO

    pin 6 : Ground

    pin 7 : Energy Harvesting

    pin 8 :Not Connected

    Hope this can help.

    Kind Regards.

    WPARK.1Author
    Visitor II
    January 30, 2023

    Hello,

    Now I received NUCLEO-L053R8 and X-NUCLEO-NFC07A1 and operating EH example provided by STM32CubeIde. However, there is a problem in MX_NFC7_EH_Init.

    On debug mode, if I "Step Into"  while( NFC07A1_NFCTAG_Init(NFC07A1_NFCTAG_INSTANCE) != NFCTAG_OK );, it is not stuck but on running mode and if I do "Step Over", the whole section of firmware is stuck.

    0693W00000Y9S8vQAF.pngThank you for reading.

    WPARK.1Author
    Visitor II
    January 30, 2023

    Same thing happens for NDEF example.

    I think

    while( NFC07A1_NFCTAG_Init(NFC07A1_NFCTAG_INSTANCE) != NFCTAG_OK );

    while( NfcType5_TT5Init( ) != NFCTAG_OK );

    These lines having some problem as it cannot return NFCTAG_OK without manually "Step Into" in the debug mode. (Running mode stuck after LEDs are turned on).

    Thank you for reading.

    ST Employee
    January 30, 2023

    Hi @WPARK.1​,

    I have downloaded NFC7 v1.0.0 package on st.com, and I tried both projects, it was working fine in debug and running mode for me. I tried with STM32CubeIDE and Keil and same behavior with debug and running mode.

    Can you get the value returned by nfctag_id in the function ST25DVxxKC_Init from st25dvxxKC.c file (both in debug and running mode) to see if the program read the correct value (for NFC7 should be 0x50 or 0x51).

    Kind Regards.

    WPARK.1Author
    Visitor II
    January 30, 2023

    Hello,

    It is good news that after updating my cubeIde to 1.11.2. It is working now. Therefore, I modified EH project code to detach the BSP button and LEDs while it is always working in EH mode (Active boot).

    For EH project, I have one more question. As you told me EH_mode is nonvolatile, if I already set ST25DVxxKC_EN_STATUS_E = ST25DVXXKC_ENABLE and ST25DVxxKC_EH_MODE_STATUS_E = ST25DVXXKC_EH_ACTIVE_AFTER_BOOT for my extension board ST25 chip, can I remove MX_NFC7_EH_Process (as in my case, I will not turn off EH function).

    And for NDEF example, I have some questions.

    0693W00000Y9VSAQA3.pngIt is very interesting that by this strcpy function, can directly change the payload length and set other headers. What is the URI_ID for MME (Text, in my RF430 code, I use 0x02, // URI header identifier). And furthermore, what is the difference between URI_Message and Information. It is a bit confused as I originally used TI chip for NFC.

    In my case, I want to send ADC sensor values in TEXT format when I put my mobile phone to my ST25.

    I will attach my RF430 NDEF format.

    const u08_t NFC_NDEF_Message[57] = {

    // Block 0

    0xE1, // NDEF Magic Number

    0x40, // Version Number, read/write access conditions

    0x79, //0x7E, // 1008 bytes / 8 = 126 blocks

    0x00,//0x04,//8 byte extended memory //0x00, // does not support read multiple blocks (limited to only 3 blocks)

    // Block 1

    0x03, // NDEF Message present

    0x34, // Length , 17 bytes

    0x91, // Record header

    0x01, // type length

    // Block 2

    0x0E, // Payload length 14

    0x54, // Record Type T (Text)

    0x02, // URI header identifier

    0x65, // 'e'

    // Block 3

    0x6E, // 'n'

    0x54, // 'T'

    0x65, // 'e'

    0x6D, // 'm'

    // Block 4

    0x70, // 'p'

    0x74, // 't'

    0x75, // 'u'

    0x72, // 'r'

    // Block 5

    0x65,    // 'e'

    0x3A,    // ':'

    0x00,

    0x00,

    // Block 6

        0x51,    // Record header

        0x01,    // type length

        0x0B,    // Payload length 11

        0x54,    // Record Type T (Text)

        // Block 7

        0x02,    // URI header identifier

        0x65,    // 'e'

        0x6E,    // 'n'

        0x4E,    // 'N'

        // Block 8

        0x48,    // 'H'

        0x34,    // '4'

        0x2B,    // '+'

        0x3A,    // ':'

        // Block 9

        0x00,    //

        0x00,    //

        0x00,

        0x51,    // Record header

        // Block 10

        0x01,    // type length

        0x0A,    // Payload length

        0x54,    // Record Type T (Text)

        0x02,    // URI header identifier

        // Block 11

        0x65,    // 'e'

        0x6E,    // 'n'

        0x43,    // 'C'

        0x6C,    // 'l'

        // Block 12

        0x2D,    // '-'

        0x3A,    // ':'

        0x00,    //

        0x00,    //

        // Block 13

        0x00,    //

        0xFE,    // TLV terminator

        0x00,    // Empty don't care

        0x00    // Empty don't care

    };

    Thank you for reading.

    WPARK.1Author
    Visitor II
    January 30, 2023

    The problem is solved but, I still want your answers for the questions.

    For EH project, I have one more question. As you told me EH_mode is nonvolatile, if I already set ST25DVxxKC_EN_STATUS_E = ST25DVXXKC_ENABLE and ST25DVxxKC_EH_MODE_STATUS_E = ST25DVXXKC_EH_ACTIVE_AFTER_BOOT for my extension board ST25 chip, can I remove MX_NFC7_EH_Process (as in my case, I will not turn off EH function).

    And for NDEF example, I have some questions.

    0693W00000Y9VSAQA3.pngAnd furthermore, what is the difference between URI_Message and Information. It is a bit confused as I originally used TI chip for NFC.

    ST Employee
    January 30, 2023

    Hi @WPARK.1​,

    Great that you solved your issue, Happy for you.

    • For EH, if you have set the register to the value ST25DVXXKC_EH_ACTIVE_AFTER_BOOT, EH will be always active (when a field is present) until you modify this register. (please read the DataSheet of the ST25DV64KC to have more information on it and other features).

    • For NDEF, NDEF is a file format message described by the standard from NFC Forum specifications, it describes how data are organized in the memory. There are multiple formats defined by NFC Forum, URI is one to store URI information as for this example an URL (could be also phone number, email, ftp, ...). The field information is just additional information used for smart poster (it is an extended format that contains more fields not mandatory to store only an URL). For NDEF Text format you need to use another format than the URI, in the ndef lib you have a file named lib_NDEF_Text that allow you to build such messages. But it is recommended to read the standard or find some resources on google to learn more about NDEF format (This standard is used for applications with NFC but are not NFC spec).

    I hope this can help you.

    Kind Regards.