Hi,
i am playing with maixduino board and trying to find why i cant run stable read socket on it. To do this i imported whole esp32 library to standalone-sdk and i found small issue in it.
When we run socket_read in loop and at some point there is nothing to read from esp32, brcause data buffer is empty, esp32 on this request e0 45 02 00 01 00 00 02 a0 0f ee 00 returns something like that e0 c5 01 00 00 ee and it is valid response, but k210 does not recognize there is empty buffer and is trying to read data which is causing unexpected behavior on esp32.
Hi, i am playing with maixduino board and trying to find why i cant run stable read socket on it. To do this i imported whole esp32 library to standalone-sdk and i found small issue in it. When we run socket_read in loop and at some point there is nothing to read from esp32, brcause data buffer is empty, esp32 on this request
e0 45 02 00 01 00 00 02 a0 0f ee 00
returns something like thate0 c5 01 00 00 ee
and it is valid response, but k210 does not recognize there is empty buffer and is trying to read data which is causing unexpected behavior on esp32.At first i thought it may be issue in nina-fw, but after further studying code i found the issue here: https://github.com/sipeed/MaixPy/blob/master/components/micropython/port/src/standard_lib/network/esp32/esp32_spi.c#L402
Temporarily i fixed it like this, but maybe there is better way to do it:
https://github.com/sipeed/MaixPy/blob/master/components/micropython/port/src/standard_lib/network/esp32/esp32_spi.c#L251