-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
samd: Support WiFi using external esp32 based modules. #12464
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
Conversation
Code size report:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12464 +/- ##
==========================================
- Coverage 98.39% 98.39% -0.01%
==========================================
Files 161 158 -3
Lines 21204 20938 -266
==========================================
- Hits 20864 20601 -263
+ Misses 340 337 -3 ☔ View full report in Codecov by Sentry. |
0e46cdf
to
8020518
Compare
@dpgeorge The PR is simplified, in that the additional network.NINAW10 interface is dropped. So only the choice of using the Pin assignments of the board definition files is available. That seems acceptable, since most likely with the SAMD boards the matching NINAW10 boards are used. As a result of that change, there are no changes to the network_ninaw10.c file any more, and the changes to the drivers/nina*.c are mostly for supporting a port-specific variant of the wifi_nina_bsp.c file, like it's done for the esp_hosted driver of the Portenta C33 port. |
Support for BLE is prepared as well, but since ATM Jimmo is digging up BLE support in #8945, I'll wait a little bit. B.t.w.: Jimmo is working on other round-kick style PRs as well, like #12211 or #12443. Are these to be merged soon? Since they affect almost all ports, keeping WIP PRs in sync is a constant challenge. |
f8be723
to
a3d5687
Compare
a3d5687
to
e26eef3
Compare
Rebased & conflicts resolved. @jimmo Is it possible to access the value of BOARD_VARIANT in manifest.py scripts? |
e26eef3
to
be90e87
Compare
Added build variants WLAN and WLAN_BLE. The latter supports WiFi and BLE. There is another variant for WiFi and BLE support available based on the esp_hosted firmware for the ESP32. That one has a slightly better WiFi performance and much better BLE reliability, but the code size is ~70k larger, filling completely up the 512k code space of SAMD51x19 devices. The only devices that could comfortably support it are the Sparkfun SAMD51 and the no-yet-merged Adafruit Grand Central M4 device using the SAMD51x20 MCU with 1 M flash. The plus side of the NINA solution, that it would even fit on a SAMD21 (useful or not) or SAMD51 w/o external flash, if SSL support is omitted. That's already foreseen in the build script. |
a205c40
to
8688f6f
Compare
4986249
to
ca5eac2
Compare
0dca340
to
9ad47f5
Compare
9ad47f5
to
9fb3687
Compare
259f7da
to
981732a
Compare
981732a
to
531632f
Compare
2b2e6ed
to
e1ac779
Compare
Using the network.WLAN module with Pin settings defined in mpconfigboard.h. To allow for port specific WiFi configurations, the functions in drivers/ninaw10/nina_wifi_bsp.c are declared as MP_WEAK. Signed-off-by: robert-hh <robert@hammelrath.com>
Including: ADAFRUIT_FEATHER_M4_EXPRESS ADAFRUIT_ITSYBITSY_M4_EXPRESS SPARKFUN_SAMD51_THING_PLUS ADAFRUIT_METRO_M4_EXPRESS Always build the Metro M4 board with WLAN, drop the variant for this board. Pin definitions are added as well for: ADAFRUIT_FEATHER_M0_EXPRESS ADAFRUIT_ITSYBITSY_M0_EXPRESS which can support basic WLAN. Signed-off-by: robert-hh <robert@hammelrath.com>
These were not covered yet and the mcu scheme can be useful for other ports as well. Alternatively, the second rule could just be refer to "**/manifest_*.py" instead of "ports/**/boards/**/manifest_*.py". Signed-off-by: robert-hh <robert@hammelrath.com>
Use MICROPY_HW_NINA_CS instead of MICROPY_HW_NINA_GPIO1 in nina_bt_hci.c and set RTS and CTS, if defined. Signed-off-by: robert-hh <robert@hammelrath.com>
Signed-off-by: robert-hh <robert@hammelrath.com>
Signed-off-by: robert-hh <robert@hammelrath.com>
Variant WLAN: Support for WiFi. For the Adafruit Metro M4 board, this is the default. At boards with small available flash, SSL is not supported. Variant WLAN_BLE: Support for WiFi and BLE. Signed-off-by: robert-hh <robert@hammelrath.com>
Signed-off-by: robert-hh <robert@hammelrath.com>
Signed-off-by: robert-hh <robert@hammelrath.com>
Telling how to update the firmware of the WiFi/BLE module. Signed-off-by: robert-hh <robert@hammelrath.com>
c2e9019
to
8cc39d5
Compare
Closing in favor of supporting instead PPP. Then the user can go for a communication suitable method. |
Such like the u.blox W102, Adafruit Airlift products or just any ESP32 based hardware. The ESP32-WROOM with at least 2MB flash module is sufficient. The actual firmware support full WiFi with SSL on boards with a SAMD51x19 MCU external flash and basic WiFi without SSL for SAMD51x19 boards with the file system in internal flash. SAMD21x18 boards with external flash could as well provide basic WiFi.
The build was tested using the test script and performs identical to the Arduino Nano 2040 connect, which is not a surprise. The PR includes documentation.
For providing the firmware binaries requires required for the ESP32 modules I have made PR to micropython-lib in the espflash path. It seemed to be the best place for it.
This extension is based on the great work of @iabdalkader with the network_ninaw10 package and his support during the implementation.
This is a re-submit of PR #11219, which was closed since I renamed the branches. There is also a branch based on the esp-hosted firmware, which is similar for WiFi, but performs much better with BLE. See the notes down in PR #11219.