The memory of ESP32S3 is too large when using microython
I use the board of the ESP32. When I turn on microython, there will be more than 100 k of internal memory consumption. I have other functions to add. This more than 100 k of memory will cause me to run out of memory. What can I do to reduce the memory consumption of esp32 when using microython
esp32/network_common: Raise a memory error on ESP_ERR_NO_MEM.
Summary
This PR changes the error handler for WiFi operations to recognise out of memory conditions reported by ESP-IDF functions, and report them as MemoryError exceptions rather than a generic "error 0x0101".
The error handler only provided a human-readable error description for WiFi-specific error codes (codes in the ESP_ERR_WIFI_BASE range), but WiFi functions are known to return other codes. Since an out of memory condition has a specific Python equivalent, using MemoryError in that case is a bit more user-friendly in exchange for a handful of extra code bytes used by the firmware.
Testing
The reproduction test case for #17027 was used to make sure an out of memory condition raised by the WiFi component was recognised as such.
Trade-offs and Alternatives
This change causes a minimal increase of the firmware size, which I believe is an acceptable trade-off from the user's point of view. After all, an out of memory error is not a "Wifi Unknown Error".