`cyw43` panic and deadlocks
Hi! I've been having some issues with the cyw43 driver on a Pico 2W (rp2350). I'm working on a matter project using rs-matter-embassy over Wi-Fi, while also acting as a BLE central. To begin with I would see a panic within minutes after boot. After repeatedly asking Claude to "figure it out" it first found a few places with out-of-bounds index slices, which stopped the panics. Then I hit another issue where at some seemingly random point after minutes to 4+ hours all communication over both BLE and Wi-Fi would just stop. With very limited progress I had Claude reference other cyw43 drivers and it appears to have finally found the root of the issue, which is this single line:
From what I can tell, no other cyw43 drivers I've referenced enable this feature. I don't quite understand why this would cause this issue, but removing this line (plus the aforementioned safety checks) has fixed the issue for me at least. The change means that a status is not returned on each read/write, so I had Claude make some breaking changes to a few public methods on the SpiBusCyw43 trait to no longer return a status integer.
First of all I'm wondering if anyone else has seen any issues like this? For me the issue reproduces on multiple units, so I don't think there's anything wrong with my test units. I'm also wondering how to proceed here. Should I clean up the code and submit a PR with all of the fixes bundled up? Is it better to submit separate PRs for each fixed issue? And also, how are breaking API changes like this usually dealt with?
The full diff produced by Claude with minor input from me so far can be found here: https://github.com/embassy-rs/embassy/compare/main...ljodal:embassy:claude/cyw43-gspi-backplane-wedge To be clear, I'm not proposing to open a PR like this, I would manually clean it up beforehand.
Source: embassy-rs/embassy