cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing ST25R3911B with STM32F072 using FreeRTOS

Neo M
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Grégoire Poulain
ST Employee

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

View solution in original post

11 REPLIES 11
Grégoire Poulain
ST Employee

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

Neo M
Associate II

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

Grégoire Poulain
ST Employee

Hi Neo,

I have contacted you via PM.

Please look into your Inbox.

Best regards

GP

Neo M
Associate II

Thank you.

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!

JMart.18
Associate

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.

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

Dear Ulysses,

Thank you for the information.

Best Regards

Hi there, 

Is this project finally released? I tried to make the project work as you described but I'm facing some issues... If you can publish the code would be really helpful!

Thanks