bouffalolab / bl_iot_sdk

BL602/BL702 SDK. Any technical topic, please access the following link.
http://bbs.bouffalolab.com
Apache License 2.0
265 stars 170 forks source link

LWIP sockets problem #79

Open potap104 opened 7 months ago

potap104 commented 7 months ago

I'm using the lwip socket library to send data to a server and found a problem. I'm sending data in 3200 byte chunks using lwip_write(). After sending each fragment I use lwip_read() to get the response from the server. After several reception and transmission cycles (about three), the bl602 freezes and stops transmitting data. I discovered that at some point the sys_arch_sem_wait(sem, 0) function is called, which blocks the TCPIP task from executing. What could be causing this blocking? Thanks!

yyipk commented 4 months ago

The interface is blocked when sending TCP data because TCP needs to wait for the ACK from the peer. Here, sys_arch_sem_wait is likely waiting for the ACK to be received.