ST25R3916B with Antenna Multiplexer – RFAL_worker() timing and FreeRTOS task separation?
Hi everyone,
I’m currently working with the ST25R3916B NFC reader and controlling up to 6 external antennas via a multiplexer. The antennas are activated sequentially, i.e., I switch between them one after another in a polling loop.
However, I’m experiencing an issue where not all antennas work reliably in every cycle. Sometimes an antenna seems unresponsive or is not detected by a test card, even though it worked in earlier cycles.
I suspect that the problem might be related to RFAL_worker() not being called frequently enough.
Could that be the root cause?
My current architecture is based on FreeRTOS, and I’m considering the following approach:
Run RFAL_worker() continuously in a dedicated FreeRTOS task, perhaps at a high frequency or short interval.
Run the other NFC logic (polling, tag handling, antenna switching, etc.) in the main task or another thread.
My questions:
1. Is it safe and recommended to call RFAL_worker() in a separate FreeRTOS task while performing the rest of the NFC logic in another task?
2. Do I need to use mutexes or other synchronization mechanisms to protect access to shared RFAL state?
3. Has anyone successfully implemented a similar architecture with the ST25R3916 and multiple antennas?
Any input, guidance, or example setups would be greatly appreciated!
Thanks in advance
