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
emac_dm9051: no mem for receive buffer (IDFGH-4245) #6101
Comments
This is an "out of memory" error, according to code here: https://github.com/espressif/esp-idf/blob/master/components/esp_eth/src/esp_eth_mac_dm9051.c#L419 |
We are talking to Davicom about this too. We only need 1/2MB to get across it (is that even possible with SPI?). We did change the source file as you pointed out. Getting "wifi send packet failed" now. Which we also have gotten before, just eventually that DM9051 error you pointed to would throw. I know that issue is in reference to the macro "FLOW_CONTROL_WIFI_SEND_DELAY". I put that at 500ms which by any modern standard I think its getting too extreme. Would the LAN8270 work better? (RMI). We ordered one and if from the developers side that is better anyways we can just do that. Appreciate your time. |
I'd like to extend @pabs159's question by asking @suda-morris this: which Ethernet chip do you personally think pairs the most nicely with the ESP32? Currently I'm stuck with W5100, pabs159 is trying out a couple, but perhaps you got a personal recommendation (personal in bold in order make it clear you're not talking on behalf of espressif, if that matters). |
@pabs159 Yes, sure, this @KaeLL For ESP32, I would say, we'd better use its internal EMAC if the GPIO numbers are not limited in your project. Internal EMAC is much powerful than any SPI-Ethernet module. For other ESP chips which doesn't embedded with a EMAC IP, SPI-Ethernet module is a good choice. The problem is, it's not an easy task to support as many modules as possible, currently the DM9051 driver is a good begging, showing out esp-eth component has the possibility to support different kinds of Ethernet solution. BTW, We already have some work done for W5500 module, but still need some time before it's released to Github. |
LAN8270 with other 3 spi module. Having the same issue. dont know where to fix. E (177169) emac_esp32: no mem for receive buffer |
any update for this problem? I have the same problem with LAN8720 PHY |
Same problem here |
Duplicate of #9308 |
There is bunch of issue related to "no mem for receive buffer" for different supported chips already reported. The probability of its occurrence can be limited by allocating memory more accurately for incoming frames. Currently 1500B is always allocated even for short frames. I work on the fix. However note, the memory is limited resource and there will be always some probability it is exhausted. |
I have same problem. I used MicroPython. and create >3 udp thread, run a moment out error. |
@apple521 what IDF version do you use? Could you please try master and let me know if you still see the issue? The probability that this issue occurs was lowered by this commit. However, the memory is limited resource and you can always get into this situation when your application uses a lot of memory as mentioned in my previous comment. |
I used LAN8720 and IDF v4.4.3. Only 3 socket thread is fail . |
You can get fail with only one socket if there is high traffic and your application uses too much memory. Try the ESP-IDF master branch where more optimized approach to allocate memory for receive frames is introduced as I mentioned above. Or try to enable external SPI RAM if you have ESP32 module with PSRAM. Please also check what is memory footprint of your Micropython application. You might import some big library. You can try ti optimize or can switch to plain C.
Memory has been always limited resource. Please read or watch some documentary of how developers had to be smart during e.g. game development in old days to overcome such limitations. Please also understand that ESP32 is not (and it is not trying to be) PC with 128GB of memory. |
my app is very easy. i test micropyhon. |
I may have found the reason, Can I use wlan and lan at the same time? |
Yes, you can. The issue is gone because you disabled WLAN, i.e. you utilize less memory since you don't process WLAN traffic. It is still about overall memory utilization. Please try the first two tips from my previous comment. |
Thank you for your help. My app is working properly. I can do other functions now. |
Hello!
I am running the eth2ap example under the master branch using the esp32WROVER-E. I can get the "examples/ethernet/basic" to work with the DM9051 board. I get back a valid IP and my router shows the device as a listed device.
When using the eth2ap example I also can see the ESP on the network along with my phone once I connect to the ESP. but shortly after any service tries to phone home I get this error:
"emac_dm9051: no mem for receive buffer"
I have searched for this error code and have not found anything on it. I could easily be missing something since i dont see anyone else with this error. All I change in the example is the pins for the DM9051. Im using SPI host 2 (VSPI). This is my config example layout:
(2) SPI Host Number
(18) SPI SCLK GPIO number
(23) SPI MOSI GPIO number
(19) SPI MISO GPIO number
(5) SPI CS GPIO number
(20) SPI clock speed (MHz)
(4) Interrupt GPIO number
(15) PHY Reset GPIO number
(1) PHY Address
(eth2ap) Wi-Fi SSID
(password) Wi-Fi Password
(1) WiFi channel
(4) Maximum STA connections
Output after execution:
(13682) eth_example: Wi-Fi AP got a station connected
W (17012) wifi:idx:4 (ifx:1, 7a:e0:aa:d2:f5:3c), tid:0, ssn:2, winSize:64
E (26932) eth_example: WiFi send packet failed: 12309
E (28052) emac_dm9051: no mem for receive buffer
Any insight is much appreciated. Thank you for your time.
The text was updated successfully, but these errors were encountered: