Hi,
I'm trying to port this library to ESP32. I'm using NxpNfcRdLib_05.07.00_20170824 version and latest esp-IDF.
First I try to compile and run MifareClassic example. I've added definitions for all GPIO, interupts, and SPI and timers and most of this seems to works now, but still cant run this example.
The problem now is that example pass initialization, and start to pool for tags but hangs when waits for IRQ:
function:
phhalHw_Pn5180_WaitIrq()
in line:
statusTmp = phOsal_EventPend((volatile phOsal_Event_t * )(&pDataParams->HwEventObj.EventHandle), E_OS_EVENT_OPT_PEND_SET_ANY, PHOSAL_MAX_DELAY,
(E_PH_OSAL_EVT_RF | E_PH_OSAL_EVT_ABORT), &tReceivedEvents);
I assume this function waits for event, and this event should come from IRQ. On the console (and logic analyzer) I see IRQ occurs but event probabily don't go to the function above. But I don't see any connection between IRQ and events, there is no callback to define for IRQ events in other implementation so I have no idea how to fix this.
But this problem can come from few things:
- if you run application on ESP32 + ESP-IDF you are using FreeRTOS build in this SDK, and it is different version (8.2) than FreeRTOS provided with NFC libs.
In phOsal_Freertos.c file I need to repleace:
portYIELD_FROM_ISR(HigherPriorityTaskWoken);
with:
portYIELD_FROM_ISR();
Because in thins version this function doesn't take any arguments.
- I also temporary define function xPortIsInsideInterrupt() because it was missing in portmacro.h and it always return 0 - I know it is wrong but I don't know it is source of this problems...
I will be grateful for any suggestions to this problem and how IRQ information is passed to the events.
Hi,
I am trying to port the NFC lib to my ESP32 and I would like to know if you found any guide to follow. It is not an esay task and not sure if it is feasible at the end.
Regards, Ramon.
Ok, I can answer my self - IRQ handled should call CLIF_IRQHandler() function.
This function is platform specific and I think library API should provide handler for IRQ when IRQ is initialized - this will be more clear for other people who want to port this driver to other platoforms.