Acceptable performance of the W5500
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: Acceptable performance of the W5500
by Eugeny ·
Interrupts for socket 0 and interrupt status is SEND_OK and RECV. You have got the data you probably did not read.
You wrote a lot of text which originally confused me, but after reading it several times and writing nonsense I see that your real problem is that you most probably did not get RECV interrupt on INT pin. It happens intermittently and it explains why you do not have a pattern to catch it.
I propose to revise the ISR code and especially interrupt flag management logic. When you enter the ISR, you must clear the flag you are about to process and not touch it anymore until you exit the ISR and it will be called again if flag got set during your previous ISR processing. You should start with it because there’re more advanced techniques, but they bear some more processing power and more risks.
RE: Acceptable performance of the W5500
by hzrnbgy ·
I did not realize I can clear the Sn_IR_RECV bit before doing all the READ_RECEIVE_DATA routine
I currently have it after updating the RD0 and RD1 read pointer registers. I move the clearing of Sn_IR_RECV now right after reading the Sn_IR register. That should clear the bit earlier before proceeding to retrieve the received data from the W5500 which can take some time in computer terms.
I really don’t have anything in my ISR, most of the processing is in the loop. Its pretty straight-forward
RE: RE: Acceptable performance of the W5500
by Eugeny ·
Then stop using interrupts at all. Perform polling of the interrupt register or receive size register. This way you will save on interrupt management times.
but anyway the main point here is you clear interrupt condition before working on its consequences. simply because when you are finished with current interrupt and clear the flag, you risk to clear new interrupt and get stuck with it.
RE: Acceptable performance of the W5500
by hzrnbgy ·
I did make a few changes on my routines and that greatly improved the stability of the program
I’m keeping the INT in case I want to put the MCU to sleep and just wake it to feed the watchdog or a signal from W5500 to receive/transmit data
So far from my testing, the only “crashes” I’m seeing now is triggered by the MCU watchdog. But I have a feeling that has something to do for using an AliExpress W5500 module. I’m ordering a couple of WIZ850io from Mouser shortly.
RE: RE: Acceptable performance of the W5500
by Eugeny ·
If IRQ is active, the ISR will be automatically called again. What is the reason spending time reading it?
Should you set up MCU to get from sleep when it gets interrupt?
RE: Acceptable performance of the W5500
by hzrnbgy ·
The STM32 is setup to detect the falling edge of the W5500 IRQ pin. The ISR is just to set a flag true
Most of the work is done in the state machine loop
all of the W5500 INT flags are handled (cleared) pretty much after querying the Sn_IR register. The last query of the W5500_int_pin is there to detect if the INT pin went low again after the flags are cleared but before the state machine is finished
But I have bigger issue to fix. I did a true loopback test from the Linux client and check the received data from the W5500
Linux → send 1460 bytes → received by W5500
W5500 replies with same 1460 bytes → Linux compares rx data with tx data
and it turns out I’m getting corrupted (mismatched) data every now and then
RE: Acceptable performance of the W5500
by hzrnbgy ·
I’m planning to put the STM32 to sleep and have the W5500 INT pin wake it up if there is some W5500 related tasks to attend to