Skip to main content
Visitor II
August 26, 2019
Solved

Interfacing ST25R3911B with STM32F072 using FreeRTOS

  • August 26, 2019
  • 6 replies
  • 4191 views

I am trying to interface ST25R3911B to an existing application that runs FreeRTOS. Is there any sample code available for ST25R3911B in a FreeRTOS setup?

I added RFAL to my project, created platform.h, with a mutex for platformProtectST25R391xComm. I am trying to read a ISP-15693 tag.

I am using rfalNfcvPollerCollisionResolution( RFAL_COMPLIANCE_MODE_NFC, 1, testNfcVdev, &testDevCnt) to get tag info.

I am pretty sure I am messing up calling the ISR from the IRQ callback. What is the best way to service the interrupt in a FreeRTOS environment?

    This topic has been closed for replies.
    Best answer by Grégoire Poulain

    Hi Neo,

    Yes, we have a sample project to interface with the ST25R3911B based on FreeRTOS.

    At the moment this package has not been officially published.

    The setup we have used is:

    • Thread(s) for application tasks with Normal priority
    • An NFC Thread with High priority to execute the ST25R3911B ISR and the RFAL worker/process
      • This thread makes use of the FreeRTOS Task Notification APIs and waits to be notified from the ISR - ulTaskNotifyTake()
    • ST25R3911B ISR
      • Notifies the NFC Thread to be executed - vTaskNotifyGiveFromISR()
      • Requests a context switch as soon as possible - portYIELD_FROM_ISR()

    Kind regards

    GP

    6 replies

    ST Employee
    August 28, 2019

    Hi Neo,

    Yes, we have a sample project to interface with the ST25R3911B based on FreeRTOS.

    At the moment this package has not been officially published.

    The setup we have used is:

    • Thread(s) for application tasks with Normal priority
    • An NFC Thread with High priority to execute the ST25R3911B ISR and the RFAL worker/process
      • This thread makes use of the FreeRTOS Task Notification APIs and waits to be notified from the ISR - ulTaskNotifyTake()
    • ST25R3911B ISR
      • Notifies the NFC Thread to be executed - vTaskNotifyGiveFromISR()
      • Requests a context switch as soon as possible - portYIELD_FROM_ISR()

    Kind regards

    GP

    Visitor II
    September 30, 2019

    Gregoire,

    Any news on this package?

    Also, besides the setup that you've detailed above, should we expect any changes to the RFAL library or the ST25R3911B support files?

    Thank you!

    Neo MAuthor
    Visitor II
    August 28, 2019

    Thanks Gregoire. I have a similar setup. Is it possible to get the sample code before it is published?

    ST Employee
    August 29, 2019

    Hi Neo,

    I have contacted you via PM.

    Please look into your Inbox.

    Best regards

    GP

    Neo MAuthor
    Visitor II
    August 29, 2019

    Thank you.

    Visitor II
    July 14, 2021

    Dear all,

    Do you know if this sample code is available?

    I have an issue whit my application code and I think the solution is this set up.

    When I have more than one freertos task, at some moment NFC remains in rfalTransceiveRunBlockingTx loop forever.

    Thank you all.

    Technical Moderator
    July 15, 2021

    Hi JMart.18,

    STSW-ST25R016 contains a FreeRTOS example. This example is for ST25R3916 + STM32L4 but could also be transferred to your setup.

    Please beware that ST25R3911B has some more real-time requirements compared to ST25R3916 (e.g. FIFO of 96 bytes which may not be enough to cope with all NFC frames unless you limit the application or guarantee filling/emptying the FIFO in-time.)

    Best Regards, Ulysses

    Visitor II
    July 15, 2021

    Dear Ulysses,

    Thank you for the information.

    Best Regards

    Technical Moderator
    June 28, 2023

    Hi

    I would suggest to creat a new Thread rather than adding a new post to a solved 2019 thread.

    A freeRTOS demo is provided in the STSW-ST25R-LIB (ST25 embedded NFC library) for ST25R3916. I would suggest to use this one and to port it to the ST25R3911B.

    Rgds

    BT

    Graduate II
    June 28, 2023

    Hi Brian, 

    Ok, if the implementation you suggest has some issues (which @Ulysses HERNIOSUS suggested a long time ago) then I'll open a new thread. 

    Thanks for your time

    Simone