Skip to main content
Graduate
November 13, 2023
Solved

Block Read/Write for X-NUCLEO-NFC03A1 Module: Which STM32CubemxIDE Middleware?

  • November 13, 2023
  • 5 replies
  • 3349 views

Hello,

Using the X-NUCLEO-NFC03A1 module and ST25DV02K-W1R8S3 or M24SR64-YMN6T/2' IC. I want to do block reading and block writing. Is there a middleware and software package that supports X-NUCLEO-NFC03A1 like x-cube-nfc4, x-cube-nfc6 and x-cube-nfc7 middleware and software packages in STM32CubemxIDE, if there is, how can I add it to STM32CubemxIDE? I have it here. "https://www.st.com/en/embedded-software/stsw-st25r-lib.html" how can I add this to STM32CubemxIDE?
Best regards

KU

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

    Hi,

    the expansion package for the X-NUCLEO-NFC03A1 is a standalone package and is not integrated with STM32CubeMX. The ST25 embedded NFC library (STSW-ST25R017 package) provides ready to use STM32CubeIDE demos for the NUCLEO-L476RG MCU board + NUCLEO-NFC03A1 NFC reader expansion board.

    If your application is based on another MCU board, you can use STM32CubeMX to generate the initialization of the various interfaces (SPI, LEDs, ST25R95 IRQ_IN and IRQ_OUT) and the main.c skeleton. Then merge the main.c from the demo to your main.c and and the various middleware files from the demo to your project.

    The demo_polling.c file contains an example of T5T tag block read/write (see demoNfcv function) that can be used with ST25DV02K-W1R8S3.

    The M24SR64 is a T4T tag and therefore its memory layout is not block based but application and file based. The communication is done through APDU. demoAPDU function provides an example of how to read the CC file.

    Rgds

    BT

     

    5 replies

    Technical Moderator
    November 13, 2023

    A software pack called X-CUBE-NFC3 also exists for the X-NUCLEO-NFC03A1. However, the X-NUCLEO-NFC03A1 is already quite old, so that nobody bothers to integrate it into STM32CubeMX or STM32CubeIDE anymore.

    But that doesn't matter, because you can simply add it manually to your project, as has already been suggested here for another, older package.

    Hope that helps?

    Good luck!
    /Peter

    Technical Moderator
    November 13, 2023

    Hi,

    the expansion package for the X-NUCLEO-NFC03A1 is a standalone package and is not integrated with STM32CubeMX. The ST25 embedded NFC library (STSW-ST25R017 package) provides ready to use STM32CubeIDE demos for the NUCLEO-L476RG MCU board + NUCLEO-NFC03A1 NFC reader expansion board.

    If your application is based on another MCU board, you can use STM32CubeMX to generate the initialization of the various interfaces (SPI, LEDs, ST25R95 IRQ_IN and IRQ_OUT) and the main.c skeleton. Then merge the main.c from the demo to your main.c and and the various middleware files from the demo to your project.

    The demo_polling.c file contains an example of T5T tag block read/write (see demoNfcv function) that can be used with ST25DV02K-W1R8S3.

    The M24SR64 is a T4T tag and therefore its memory layout is not block based but application and file based. The communication is done through APDU. demoAPDU function provides an example of how to read the CC file.

    Rgds

    BT

     

    Graduate
    November 13, 2023

    Thank you for the detailed information about the X-NUCLEO-NFC03A1 expansion package. Your explanation provided a clear understanding of the ST25 embedded NFC library and application guidelines. The guidance you offered in explaining the initial steps for different MCU boards is extremely valuable for the integration of our projects.

    Graduate
    November 13, 2023

    I needed a module to read and write for NFC. I found the X-CUBE-NFC3 module. I didn't think I would have a problem since STMicroelectronics supports it in software. Thank you for your feedback.

    Technical Moderator
    November 13, 2023

    Hi,

    X-CUBE-NFC3 is fine as well but has not been updated recently.  ST25 embedded NFC library provides the same demos that X-CUBE-NFC3 but is more up to date and has additional demos. Both are supported by ST. 

    Rgds

    BT

    Technical Moderator
    November 14, 2023

    Hi,

    as long as the license terms are respected, you are free to reuse the various files provided in the firmware package. The files from Common should be able to run on STM32C031. As your application will not use NFC-B nor NFC-F, make sure to turn RFAL_FEATURE_NFCB and RFAL_FEATURE_NFCF to false in platform.h to reduce the memory footprint and fit in 32kBytes flash and 12kBytes RAM.

    Rgds

    BT

    Graduate
    November 14, 2023

    Thank you for your return.

    Best regards,

    KU

    Technical Moderator
    November 14, 2023

    Hi,

    the RFAL API supports the various Read/Write single/Multiple blocks commands in a clear way (i.e. without encryption). This can be found in rfal_nfcv.c/.h. As far as I know ST25DV02K-W1 does include ciphering/encryption features. 

    Can you elaborate on your ISO-15693 ciphering/encryption needs? Which tag do you plan to use?

    Rgds

    BT

    Graduate
    November 14, 2023

    Hi,

    We are planning to use ST25DV64KC-IE8T3 as a change in IC. We will use tag 5 as tag. rfal_nfcv.c/.h has a function declaration like this. "ReturnCode rfalNfcvPollerLockBlock( uint8_t flags, const uint8_t* uid, uint8_t blockNum );" Where do I enter the password information I will use here? The rfalNfcvPollerLockBlock function returns the NFC communication status information. The part I don't understand is that when I read/write to the part I encrypted as a block, I need to enter the password value first. rfalNfcvPollerLockBlock does not send this function password value? I don't understand here.

    Best regards,

    KU

    Technical Moderator
    November 14, 2023

    Hi,

    rfalNfcvPollerLockBlock API sends an ISO15693 Lock Block command to the tag. This protects a given block from new writings. 

    As far as I remember, when using an ST25DV64KC device, the Lock Block command is only applicable for the blocks 0 and 1 and an RF user needs no password to lock blocks 0 and/or 1.

    If I am not wrong, the ST25DV64KC device does not support encryption feature but area protection feature. See Data protection in §5.6 inside the ST25DV64KC datasheet. If you plan to use ST25DV64KC data protection feature and need to send the Present Password command, you can use rfalST25xVPollerPresentPassword API from rfal_st25xv.c Then I guess your next question will be related to Read Configuration and Write Configuration commands: this is supported through rfalST25xVPollerReadConfiguration, rfalST25xVPollerWriteConfiguration, rfalST25xVPollerReadDynamicConfiguration, rfalST25xVPollerWriteDynamicConfiguration APIs.

    Rgds

    BT