WIZnet Developer Forum

RCV interrupt high but buffer len is 0

I am getting interrupt status for socket that bytes are received, but when I try to read sockets receive size register, its value is 0.
Do I need to send command Receive before reading the register or this register will have size immediately after getting interrupt ?

Thanks

Don’t you forget to reset this interrupt flag bit in your ISR? If you will not reset it manually W5100 will continue holding interrupt line active.

So, I am polling the value of interrupt on common Reg Address (0x0015) and checking which socket received interrupt.
Then I read value of interrupt on socket reg address, and checking if RECV bit is set. if it is set, I am clearing a bit by writing (1<<2) on interrupt register.
And after that I read rx received size register 0x0*26 (0x0426 for socket 0). But I always read 0, even though I sent the character. I dont have pending interrupt after that, cause recv bit is reset, until next char of course. So, apart from actual reading of buffer, interrupts are working properly :frowning:

Edit
Found the bug … totally retarded one. I was actually reading socket1 instead of socket0 :blush:
It is working now, at least the size of buffer, now I need to do the actual reading, but I have feeling it should be the same as sending something …

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.