Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suddenly stops receiving #4

Open
MicroKoder opened this issue Jan 11, 2022 · 6 comments
Open

Suddenly stops receiving #4

MicroKoder opened this issue Jan 11, 2022 · 6 comments

Comments

@MicroKoder
Copy link

Sometimes it stops receiving. Usually when I'm trying to access web page.
I added a LED flashing when RX PIO is working (on instruction address changing), and turned on all debug output. I started a ping task in background and tried to access to web page, after this pico stops answering for ping requests. I see in the serial output that pico is working, but PIO RX not flashing. I found the rx pio not always in work, sometimes there is commands to start or stop pio (I added in those places output to the log messages like "START PIO", "STOP PIO")
I see the last time the PIO is stopped but not restarted, after that it doesn't receive any packages. I've tried to add restarting PIO ("PIO RESET" in log) but it doesn't help me.
putty_1.log

@messani
Copy link
Owner

messani commented Jan 12, 2022

Hi,
try to increase MEMP_NUM_SYS_TIMEOUT.
Not tested, by you can add:
#define MEMP_NUM_SYS_TIMEOUT (LWIP_NUM_SYS_TIMEOUT_INTERNAL + 1)
to your lwipopts.h

@MicroKoder
Copy link
Author

MicroKoder commented Jan 13, 2022

unfortunately it didn't help me.
Looks like the lan8720_free_framedata didn't called, so RX PIO didn't start. As I see lan8720_free_pbuf should be called after every pbuf_free call, but it not always happen.

Also I see infinite loop:
etharp_timer
tcp_slowtmr: processing active pcb
tcp_slowtmr: polling application
tcp_slowtmr: processing active pcb
tcp_slowtmr: polling application
etharp_timer
tcp_slowtmr: processing active pcb
tcp_slowtmr: polling application
tcp_slowtmr: processing active pcb
tcp_slowtmr: polling application
etharp_timer
tcp_slowtmr: processing active pcb
tcp_slowtmr: polling application
tcp_slowtmr: processing active pcb
tcp_slowtmr: polling application
etharp_timer

what does it mean

@messani
Copy link
Owner

messani commented Jan 13, 2022

Unfortunatelly I do not have time to debug it. Try increase LAN8720_RX_FRAME_COUNT. Maybe it is necessary to receive more that two (current value) packets at one time.

@MicroKoder
Copy link
Author

Hi, I've added 1 ms timeout in line 210 lan8720.c (changed from 0 to 1). After that it's working stable

@messani
Copy link
Owner

messani commented Jan 14, 2022

If you added sleep() function there, it is not good idea, because it is called in the interrupt handler.
Does the changing value of LAN8720_RX_FRAME_COUNT work?

@MicroKoder
Copy link
Author

LAN8720_RX_FRAME_COUNT didn't give the result, but I left it =6 and also changed line 210
sys_timeout(0, lan8720_rx_process_frame..
changed from 0 to 1, hmm, here is line 194.

Now I've rewrited it so the "trystart" called before "process_frame"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants