cancel
Showing results for 
Search instead for 
Did you mean: 

ST25R3916irq error problem ?

superK
Associate II

We are communicating with the st25r3916 chip normally.

But after about 14 minutes,

The value of the IRQ pin is maintained at HIGH.

You fall into an infinite loop in the function st25r3916CheckForReceivedInterruptts().

What is the problem ?

please I'd appreciate it if you let me know.

Infinite loop.

while( platformGpioIsHigh( ST25R391X_INT_PORT, ST25R391X_INT_PIN ) )

  {

    st25r3916ReadMultipleRegisters( ST25R3916_REG_IRQ_MAIN, iregs, ST25R3916_INT_REGS_LEN );

    

    irqStatus |= (uint32_t)iregs[0];

    irqStatus |= (uint32_t)iregs[1]<<8;

    irqStatus |= (uint32_t)iregs[2]<<16;

    irqStatus |= (uint32_t)iregs[3]<<24;

  }

23 REPLIES 23

Hi,

just the initial issue, i'm in an infinite loop in this function:

void st25r3916CheckForReceivedInterrupts( void )
{
uint8_t iregs[ST25R3916_INT_REGS_LEN];
uint32_t irqStatus;

/* Initialize iregs */
irqStatus = ST25R3916_IRQ_MASK_NONE;
ST_MEMSET( iregs, (int32_t)(ST25R3916_IRQ_MASK_ALL & 0xFFU), ST25R3916_INT_REGS_LEN );


/* In case the IRQ is Edge (not Level) triggered read IRQs until done */
while( platformGpioIsHigh( ST25R391X_INT_PORT, ST25R391X_INT_PIN ) )
{
st25r3916ReadMultipleRegisters( ST25R3916_REG_IRQ_MAIN, iregs, ST25R3916_INT_REGS_LEN );

irqStatus |= (uint32_t)iregs[0];
irqStatus |= (uint32_t)iregs[1]<<8;
irqStatus |= (uint32_t)iregs[2]<<16;
irqStatus |= (uint32_t)iregs[3]<<24;
}

/* Forward all interrupts, even masked ones to application */
platformProtectST25R391xIrqStatus();
st25r3916interrupt.status |= irqStatus;
platformUnprotectST25R391xIrqStatus();

/* Send an IRQ event to LED handling */
st25r3916ledEvtIrq( st25r3916interrupt.status );
}

And there is a HAL tick management timeout in SPI function called, so it doesnt work but the IRQ will never switch to low state too...

SYSTICK priority is at 0.

Best regards.

 

Hi,

if that loop is executed repeatedly without IRQ going low I suspect an issue in SPI communication, e.g. bytes not going out or Chip select not driven correctly. Please do logic analyzer traces (SPI+CS+IRQ) pin and if unsure share them here for analysis.

BR, Ulysses

Hi,

But why this issue appears only after a while of execution and not immediatly ?

BR.

Hi,

there is a very good book on debugging rules. One of the nine is : "Quit thinking and look!". 

Once you looked it will most likely become obvious.

Regards, Ulysses