Skip to main content
Visitor II
April 19, 2020
Solved

Using X-CUBE-NFC3 with STM32L475 custom board and SPI2 instead of SPI1

  • April 19, 2020
  • 12 replies
  • 3153 views

For my first foray into the STM32 world I've been trying to get to read nfc tags with a STM32L475 and ST25R95 custom board. It is taking me a while to get used to the CUBE IDE, since including libraries many times results in errors, specially since I'm coming from the Arduino IDE.

As the title says I'm trying to adapt the included polling example(for the L476 board) to work with a custom board based on the STM32L475. I'm using the SPI2 port which I have inited in the main code, (pins PB12-PB15). I have made the changes in platform.h and st25r95_com.h to change hspi1 to hspi2. But still I always get initialization failed... any more places I should be changing SPI1 to SPI2?

Thank you for your time.

    This topic has been closed for replies.
    Best answer by Brian TIDAL

    Hi,

    Command >>>> 02*********** is a protocol Select. It used to configure ISO14443-A or B or Felica or ISO15693 protocols. it returns 0000 to inform that the command has been applied

    Command >>>> 09******** is a write register. it returns 0000 to inform that the register value has been updated

    Command >>>> 08******** is a read register. it returns 0001 + value of the register

    st25r95ReadReg: retCode: 00 or st25r95WriteReg: retCode: 00 are log for read or write register API. Therefore "retCode: 00" for those API just informs that the communication between the MCU and the ST25R95 is ok.

    The data exchanges with the tag are logged as:

    DATA >>>> 260100

    DATA <<<<(0x8700)  (retCode=4)

    As long as the respCode for data exchanges is different from 0x80 or 0x90 (e.g. 0x87), nothing has been received properly from the tag. In that case, it is likely an antenna issue.

    Rgds

    BT

    12 replies

    NFerr.1Author
    Visitor II
    May 11, 2020

    Thank you Brian, I'll order a nucleo nfc05a1 kit to try it out. But for now everything works under 200uA, which is not bad for a preliminary prototype. Do you have any idea of the absolute lowest consumption the ST25R95/CR95HF could get in wake up mode? I'll tweak with the parameters myself, but it would be nice to have a general idea.

    Thank you once again for the attention and support.

    Technical Moderator
    May 11, 2020

    Hi Nuno,

    I believe around 100µA is a good target for Tag Detect mode with the ST25R95/CR95HF. An hibernate mode (5µA according to the DS) is also available (currently not implement in current RFAL) but in that case, the whole system would need to be waken up on a regular basis to poll tags.

    Rgds

    BT