Skip to content

Commit 31177da

Browse files
More debug, identified deadlock conditions
The CYW43 driver can come up and start processing data. Unfortunately when it needs to send data out through LWIP we have a deadlock. There is an CYW43 async_context semaphore owned by the calling task. In this case, the task is the periodic callback in "asyn_con" (i.e. the background timer). 1. When the timeout hits, the async context task is woken up and the first thing it does is take the async_context semaphore. 2. During background processing (sys_check_timeouts) an LWIP call is made. 3. The LWIP call sends a message to the LWIP task and wakes it up. The ASYN_CON task is now suspended waiting for the LWIP task done notification. It holds the ASYN_CON semaphore while asleep. 4. LWIP does a bunch of stuff and tries to do an ethernet_output to send bits over the wire (i.e. accept DHCP or something). 5. Eventually LWIP's netif call stack goes to the CYW43 object (while still in the LWIP task) who tries to acquire the CYW43 semaphore and fails (because it's already held by the async task that's sleeping). 6. There is no 6, it's deadlocked at this point.
1 parent e2f324e commit 31177da

File tree

12 files changed

+7
-6
lines changed

12 files changed

+7
-6
lines changed

lib/rp2040/liblwip-bt.a

588 Bytes
Binary file not shown.

lib/rp2040/liblwip.a

588 Bytes
Binary file not shown.

lib/rp2040/libpico.a

0 Bytes
Binary file not shown.

lib/rp2350-riscv/liblwip-bt.a

1.05 KB
Binary file not shown.

lib/rp2350-riscv/liblwip.a

1.05 KB
Binary file not shown.

lib/rp2350-riscv/libpico.a

0 Bytes
Binary file not shown.

lib/rp2350/liblwip-bt.a

520 Bytes
Binary file not shown.

lib/rp2350/liblwip.a

524 Bytes
Binary file not shown.

lib/rp2350/libpico.a

0 Bytes
Binary file not shown.

libraries/lwIP_CYW43/src/utility/CYW43shim.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ uint16_t CYW43::sendFrame(const uint8_t* data, uint16_t datalen) {
111111
if (0 == cyw43_send_ethernet(_self, _itf, datalen, data, false)) {
112112
return datalen;
113113
}
114-
printf("c++\n");
115114
fails++;
116115
return 0;
117116
}

0 commit comments

Comments
 (0)