This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TRF7970A: Porting NFC stack to STM32 - ISR

Part Number: TRF7970A

Dear Supporters !

I'm porting your NFC full stack from sloa192a to our system. We use peer-to-peer configuration to communicate between 2 board using 2 STM32f0xx microcontroller.

I'm confusing about Interrupt service routine (ISR) to process event when TRF7970 raises IRQ line.

You have 2 ISRs: (in TRF79x0.c file)

tTRF79x0_IRQFlag TRF79x0_irqHandler(uint16_t ui16TimeOut)

and 

#ifdef MSP432P401R_LAUNCHPAD_ENABLED
void TRF79x0_isrHandler(void)
{
uint32_t status;

status = GPIO_getEnabledInterruptStatus(TRF_IRQ_PORT);
GPIO_clearInterruptFlag(TRF_IRQ_PORT, status);

if(status & TRF_IRQ)
{
g_ui8IrqFlag = 0x01;
}
}
#endif

I don't see the void TRF79x0_isrHandler(void) call tTRF79x0_IRQFlag TRF79x0_irqHandler(uint16_t ui16TimeOut) any where 

so how tTRF79x0_IRQFlag TRF79x0_irqHandler(uint16_t ui16TimeOut) is call acoording to and interrupt event ?

  • Hello Quang,

    The TRF79x0_irqHandler API is not an ISR.

    The TRF79x0_irqHandler is called to provide time for an IRQ event to occur. If an IRQ event occurs, it will report back the event, and if no IRQ event occurs within the allotted time then the API reports a timeout. This is API is used within the TRF79x0_writeFIFO API in trf79x0.c and the NFC_waitForCommand API in nfc_controller.c.
  • Thanks for your supports.
    So the ISR is void TRF79x0_isrHandler(void) and all it does is set flag "g_ui8IrqFlag = 0x01" and tTRF79x0_IRQFlag TRF79x0_irqHandler(uint16_t ui16TimeOut) will check interrupt status through this flag ?

    About porting nfc stack to stm32f0xx mcu. Do you have any notice about compatibility ?
  • Hello Quang,

    The TRF79x0_isrHandler does so for the MSP432 devices. For the MSP430 devices, the ISR handler for the IRQ pin is in the lp_buttons.c file as the same port for the IRQ pin is also needed for application specific LaunchPad buttons, and since MSP430's ISR structure requires a single ISR for that PORT, we had to have the TRF79x0_isrHandler functionally in the lp_buttons.c file under a general PORT ISR.

    Correct that the TRF79x0_irqHandler checks the interrupt status through that flag. It also checks the timeout status from the MCU Timer peripheral with another flag. If the timeout occurs before the IRQ, then it will report the timeout. This functionality was tested against NFC standards to ensure proper operation per timing standards.

    We have no experience with STM microcontrollers and cannot speak to compatibility. I wouldn't imagine there would be issues. Though be aware that if you do run into issues, it may be difficult for us to offer support due to lack of knowledge.