-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
extmod: Create a common cyw43 config header, apply mDNS fix in it. #17092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extmod: Create a common cyw43 config header, apply mDNS fix in it. #17092
Conversation
@dpgeorge BTW I haven't forgotten our discussion about |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #17092 +/- ##
=======================================
Coverage 98.54% 98.54%
=======================================
Files 169 169
Lines 21898 21898
=======================================
Hits 21580 21580
Misses 318 318 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Code size report:
|
83718b1
to
df7dfc0
Compare
Note that the old cywbt.c driver will be replaced with a new BTHCI Uart backend that's been recently added to cyw43 driver, which requires some additional config option (no big changes, see #16848). The new Alif port already uses the new BTHCI backend, and it could be switch to the common config: https://github.com/micropython/micropython/blob/master/ports/alif/cyw43_configport.h |
Sorry @projectgus but this now needs rebasing after merging #16848. |
12be4d6
to
09f64bb
Compare
I've rebased on top the BTHCI changes, and migrated the Alif port to the common cyw43 config. All ports build after updating, but I only have hardware to test stm32 PYBD_SF2 (confirmed Wi-Fi & BLE both work but didn't run complete tests). I think the BTHCI macros could also be put into the common config but have left it out of this PR for now, same as SDIO. |
I think some overlap, but as those changes are scoped to rp2 I think they're more or less a subset of these. EDIT: Oops it was a while since I looked, I think that change is mostly breaking out the mpconfig layer of CYW43 config. Whereas this change is refactoring the driver-facing layer of CYW43 config (i.e. the layer that translates the mpconfig settings to the driver). So mostly orthogonal. |
09f64bb
to
2e687fe
Compare
I checked all changes for all the ports that I care about (so all except rp2), and they all look good. Also, I tested Alif port, and stm32 and both WiFi/BT are still working. I can't test mimxrt any time soon, maybe @kwagyeman can test it. |
@iabdalkader - Pulled the latest of master of OpenMV, and then the micropython branched referenced, and applied the two commits and ran on the IMX. Bluetooth and WiFi both work. |
2e687fe
to
786c3a2
Compare
Thanks @iabdalkader and @kwagyeman for testing the other ports. Have removed the duplicate definition and rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the few comments above, the refactoring looks good to me. I tested it on PYBD-SF6 and don't see any regressions.
@@ -0,0 +1,143 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, but maybe this file should be extmod/cyw43-include/cyw43_config_common.h
or extmod/cyw43-driver-include/cyw43_config_common.h
?
There are other common include dirs with this naming scheme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other way we could do this is to move all three of extmod/network_cyw.*
and this file to a directory like extmod/cyw43/
. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave it where it is for now. Can move it later if needed (eg in conjunction with factoring this into SDIO/SPI parts).
This is only a surface level refactor, some deeper refactoring would be possible with (for example) the SDIO interface in mimxrt and stm32, or the BTHCI interface which is is similar on supported ports. But sticking to cases where the macros are the same across all ports. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
This means the fix from dd1465e will also apply to stm32 and mimxrt ports that use CYW43. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
786c3a2
to
d00eab4
Compare
Summary
extmod/cyw43_config_common.h
header with the common macros from ports which use CYW43 Wi-fi driver. There's more refactoring that could be done here (for example acyw43_sdio_common.h
header) but I've limited myself to macros that are the same, or that appear effectively the same, on every port.Testing
multi_wlan
tests with a RPI_PICO_W board and a PYBD_SF2 as the two nodes. This uncovered two pre-existing issues (not added in this PR):DHCPS:
updates when running as the AP, so the test fails on the additional output (at least easy to manually check for).Trade-offs and Alternatives