Hello,
I am setting to receive interrupts everytime a new frame is received on Socket 0 - MACRAW mode. When such interrupt happens, reading Sn_IR gives 0x04 .
In the main loop I do this
- Read from Socket 0 RX Buffer
- Write Sn_RX_RD with new read address
- Write RECV (0x40) to Sn_CR
- Read Sn_CR until it becomes 0x00
- Write 0xFF to Sn_IR to clear interrupts.
Immediately after that, I get interrupt with Sn_IR read value 0x40 . After that, further frame received interrupt has Sn_IR read value of 0x04 . Occasionally I get an interrupt where Sn_IR read 0xFF - after which the socket stops receiving further frames until I reopen the socket.
How do I prevent getting into this situation where Sn_IR read value of 0xFF ?