Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

projectgus
Copy link
Contributor

@projectgusprojectgus commentedApr 8, 2025
edited
Loading

Summary

  • First commit creates a newextmod/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.
  • Second commit moves the rp2 LWIP mDNS resolver fix added inports/rp2: Fix rp2 mDNS issue via new cyw43 driver hooks. #17057 into the new header, so it's now also applied on stm32 and mimxrt ports which use the CYW43 driver.

Testing

  • Connected a PYBD_SF2 to my local network, verified I could look up the host via mDNS.
  • Ran themulti_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):
    • The stm32 port logsDHCPS: updates when running as the AP, so the test fails on the additional output (at least easy to manually check for).
    • On both ports, the cyw43 driver doesn't like being a STA first and then switching to become an AP (even though the unit tests de-activate the unused interface). To run the two tests in sequence then I needed to trigger a hard reset in between. Will investigate more when time permits.
  • I have not been able to test mimxrt as I have no suitable hardware. If I understandports/mimxrt: Add CYW43 WiFi/BT support. #11397 correctly then no such widely available board exists, the only mimxrt+cyw43 users have added a CYW43 module to custom hardware or an eval board.

Trade-offs and Alternatives

  • Could keep the per-port config headers but it makes it harder to verify consistent behaviour between the different ports, and to apply non-port-specific changes like the mDNS resolver fix.

@projectgusprojectgus added port-stm32 extmodRelates to extmod/ directory in source port-mimxrt port-rp2 labelsApr 8, 2025
@projectgus
Copy link
ContributorAuthor

@dpgeorge BTW I haven't forgotten our discussion aboutnetwork_cyw43.h. I have a proposed refactor that covers this, but it turned out independent from this one.

@codecovCodecov
Copy link

codecovbot commentedApr 8, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.54%. Comparing base(45e4deb) to head(d00eab4).
Report is 2 commits behind head on master.

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.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actionsGitHub Actions
Copy link

Code size report:

   bare-arm:    +0 +0.000% minimal x86:    +0 +0.000%    unix x64:    +0 +0.000% standard      stm32:    +0 +0.000% PYBV10     mimxrt:    +0 +0.000% TEENSY40        rp2:    +0 +0.000% RPI_PICO_W       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS  qemu rv32:    +0 +0.000% VIRT_RV32

@projectgusprojectgus added this to therelease-1.26.0 milestoneApr 8, 2025
@projectgusprojectgusforce-pushed therefactor/cyw43_common_config branch from83718b1 todf7dfc0CompareApril 15, 2025 01:35
@iabdalkader
Copy link
Contributor

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

@dpgeorge
Copy link
Member

Sorry@projectgus but this now needs rebasing after merging#16848.

@Gadgetoid
Copy link
Contributor

Some possible overlap between this andd6cfdca from#16057 ?

@projectgusprojectgusforce-pushed therefactor/cyw43_common_config branch 2 times, most recently from12be4d6 to09f64bbCompareMay 1, 2025 02:24
@projectgus
Copy link
ContributorAuthor

The new Alif port already uses the new BTHCI backend, and it could be switch to the common config

Sorry@projectgus but this now needs rebasing after merging#16848.

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.

@projectgus
Copy link
ContributorAuthor

projectgus commentedMay 1, 2025
edited
Loading

Some possible overlap between this andd6cfdca from#16057 ?

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.

Gadgetoid reacted with thumbs up emoji

@projectgusprojectgus requested review fromiabdalkader anddpgeorge and removed request foriabdalkaderMay 1, 2025 06:33
@projectgusprojectgusforce-pushed therefactor/cyw43_common_config branch from09f64bb to2e687feCompareMay 2, 2025 02:33
@iabdalkader
Copy link
Contributor

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.

@kwagyeman
Copy link
Contributor

@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.

@projectgusprojectgusforce-pushed therefactor/cyw43_common_config branch from2e687fe to786c3a2CompareMay 7, 2025 23:28
@projectgus
Copy link
ContributorAuthor

Thanks@iabdalkader and@kwagyeman for testing the other ports. Have removed the duplicate definition and rebased.

Copy link
Member

@dpgeorgedpgeorge left a 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 @@
/*
Copy link
Member

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 beextmod/cyw43-include/cyw43_config_common.h orextmod/cyw43-driver-include/cyw43_config_common.h?

There are other common include dirs with this naming scheme.

Copy link
ContributorAuthor

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 ofextmod/network_cyw.* and this file to a directory likeextmod/cyw43/. What do you think?

Copy link
Member

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 bepossible with (for example) the SDIO interface in mimxrt and stm32, or theBTHCI interface which is is similar on supported ports. But sticking tocases where the macros are the same across all ports.This work was funded through GitHub Sponsors.Signed-off-by: Angus Gratton <angus@redyak.com.au>
This means the fix fromdd1465e will also apply to stm32 and mimxrt portsthat use CYW43.This work was funded through GitHub Sponsors.Signed-off-by: Angus Gratton <angus@redyak.com.au>
@projectgusprojectgusforce-pushed therefactor/cyw43_common_config branch from786c3a2 tod00eab4CompareMay 8, 2025 05:33
@dpgeorgedpgeorge merged commitd00eab4 intomicropython:masterMay 9, 2025
60 of 64 checks passed
@projectgusprojectgus deleted the refactor/cyw43_common_config branchMay 15, 2025 00:16
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@iabdalkaderiabdalkaderiabdalkader left review comments

@dpgeorgedpgeorgedpgeorge approved these changes

Assignees
No one assigned
Labels
extmodRelates to extmod/ directory in sourceport-mimxrtport-rp2port-stm32
Projects
None yet
Milestone
release-1.26.0
Development

Successfully merging this pull request may close these issues.

5 participants
@projectgus@iabdalkader@dpgeorge@Gadgetoid@kwagyeman

[8]ページ先頭

©2009-2025 Movatter.jp