Open MicroKoder opened 2 years ago
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
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
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.
Hi, I've added 1 ms timeout in line 210 lan8720.c (changed from 0 to 1). After that it's working stable
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?
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"
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