How to fix "IRQ line not working" error in Initialization Selftest ?
Hi ST,
We bought a ST25RU3993-HEPV last year to evaluate the RFID chip and wanted to control it using SPI (see that question, where you already helped us). The master SPI is a Cortex A15.
We managed to set-up SPI communication and to implement spiTxRx() to read/write registers (single and continuous read/write).
We started to integrate others ST functions from the ST25RU3993 STUHFL SDK package v3-0-2-0 package, especially the st25RU3993Initialize function.
Before doing anything, this function runs a selftest to check three things:
- SPI communication works (write & read 4 bytes in Modulator control register 1 register)
- Check EN pin by calling st25RU3993ResetDoNotPreserveRegisters
- We did not connect EN pin to a GPIO for now, so the chip is always enabled. I replaced the OFF/ON of the EN pin by a Soft Init (83h) single command.
- Check that the IRQ line is working, by sending 24 bytes in FIFO register instead of the 48 announced, and waiting more than 40ms, to have a timeout triggered on ST25RU3993 side.
The first two steps are OK, but we are struggling with the last one: The Irq_fifo
(byte 5 of Interrupt register 1) doesn't trigger.
When reading the Interrupt register 2 (38h), bit 0 (Preamble detect error / FIFO overflow error) is high and bit 5 of FIFO status register too (More than 24 bytes were loaded to one of the FIFOs).
Can you help us with that ?
Here is the part of ST code that we are struggling on:
// set up 48Byte transmission, but we supply less, therefore a fifo underflow IRQ is produced
st25RU3993SingleWrite(spictx, ST25RU3993_REG_TXLENGTHUP, 0x03);
st25RU3993SingleCommand(spictx, ST25RU3993_CMD_TRANSMCRC);
st25RU3993ContinuousWrite(spictx, ST25RU3993_REG_FIFO, myBuf, 4);
st25RU3993ContinuousWrite(spictx, ST25RU3993_REG_FIFO, myBuf, 4);
st25RU3993ContinuousWrite(spictx, ST25RU3993_REG_FIFO, myBuf, 4);
st25RU3993ContinuousWrite(spictx, ST25RU3993_REG_FIFO, myBuf, 4);
st25RU3993ContinuousWrite(spictx, ST25RU3993_REG_FIFO, myBuf, 4);
st25RU3993ContinuousWrite(spictx, ST25RU3993_REG_FIFO, myBuf, 4);
st25RU3993WaitForResponse(spictx, RESP_FIFO);
if (!(st25RU3993GetResponse(spictx) & RESP_FIFO)) {
dev_err(&spictx->spidev->dev, "%s(%d): IRQ line not working\n", __FUNCTION__, __LINE__);
return 3;
}Here is our new implementation of st25RU3993ResetDoNotPreserveRegisters:
void st25RU3993ResetDoNotPreserveRegisters(struct st25ru3993_spi_context *spictx)
{
#if ST25RU3993_ENABLE_CONTROL
gpio_set_value(spictx->enable_gpio, LOW);
delay_ms(1);
gpio_set_value(spictx->enable_gpio, HIGH);
delay_us(10);
#else
st25RU3993SingleCommand(spictx, ST25RU3993_CMD_SOFT_INIT);
#endif
st25RU3993WaitForStartup(spictx);
}Regards,
Thomas.
