-->
Page 1 of 1

lmac.c 599

PostPosted: Sun Apr 19, 2015 7:03 am
by inx
under certain circumstance the esp8266 creashes.
the last line printed via serial is:
lmac.c 599

what does that mean?

thanks.

Re: lmac.c 599

PostPosted: Sat Jul 25, 2015 3:39 pm
by ernacktob
I am also getting this error sometimes.

From what I understand, the Espressif SDK blobs are riddled with code that checks for some errors and if they encounter one, they just go in an infinite loop while printing the filename + line number of the error. The watchdog timer will kick in after some time and the esp will restart.

In our case, the error occured somewhere in lmac.c (one of the files constituting the libpp.a library, the wifi drivers most likely) at line 599 (of the source code, supposedly). This specific error gets printed somewhere in lmacProcessTXStartData, which is called by wDev_ProcessFiq, the wireless driver's interrupt handler, I believe.

EDIT: In my case, the error seems to occur when I set up a TCP server with espconn, and later I call espconn_disconnect on the espconn struct that was used to create the server (in espconn_accept and all the regist_cb functions).

A typical snippet would be:
Code: Select allif (some_error_occured) {
     ets_printf("%s %u\n", "lmac.c", 599);
     while (1);
}

It would be good if Espressif could provide some more informative messages since the errors appear important enough to warrant a full system restart...

Re: lmac.c 599

PostPosted: Thu Aug 13, 2015 4:19 pm
by DanielC
After a lot of experimentation, I've found that I get occasional lmac.c (or just mac in the newest SDK) errors if interrupts are ever disabled for more than 10us or I have any interrupt handlers than run for more than 10us. The WiFi stack in the libraries relies on being able to service radio interrupts within 10us or it can run into trouble. The latest SDK documentation actually has a note about the 10us requirement.

It's a little tricky to keep all interrupt handlers under 10us since reading registers (like the UART fifo) is so slow but it has completely resolved the lmac issues for me.