-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
mimxrt: Provide WiFi and BLE support for MIMXRT boards. #12937
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
235bff0 to
1f69e92
Compare
|
I think you may have some really outdated changes, I didn't look at the whole PR but note that |
|
Thanks for the hint and maybe it's the case. The history of this PR starts earlier than the inclusion of the cyw43 support. Since you looked at it already, can you be specific about the places were things are duplicated? Edit: I see the duplicate of deinit. And I used already earlier the mpbthciport.c file introduced with the cyw43 support. |
ports/mimxrt/main.c
Outdated
| #if MICROPY_PY_BLUETOOTH | ||
| #include "extmod/modbluetooth.h" | ||
| #include "mpbthciport.h" | ||
| #endif |
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.
| #if MICROPY_PY_BLUETOOTH | |
| #include "extmod/modbluetooth.h" | |
| #include "mpbthciport.h" | |
| #endif |
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.
Removed.
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.
This still needs to be removed.
| #if MICROPY_PY_BLUETOOTH | ||
| mp_bluetooth_hci_init(); | ||
| #endif |
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.
| #if MICROPY_PY_BLUETOOTH | |
| mp_bluetooth_hci_init(); | |
| #endif |
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.
removed,
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 think this still needs to be moved back up outside the soft reset loop, where it used to be.
I left a quick review, anything removed I think is duplicated.
I understand, but what I meant is: there's already working support for |
|
Thanks for the review. I was a little bit overwhelmed by the fact that git managed to merge 3 branches with almost no conflict. But I did not check for duplicated. Still CI reports a build error: |
1f69e92 to
db843d7
Compare
Yes it looked like a bad git merge. Anyway, I can take another look tomorrow.
You must |
|
About Proto-c: It works locally. And when I do the make BOARD=xxx submodules and try to push it, there is no change to push. |
db843d7 to
514267a
Compare
|
Code size report: |
I'm not sure why boards are built twice, but I think you need to add submodules to every build. |
|
Oh okay first line checks out the submodules, in that case I'm not sure why it's failing. |
|
Proto-c was not installed. See a few lines up. The error about proto-c is now gone, only I have to clean up the manifest.py files. But maybe not today anymore. |
8e93e0c to
669c652
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #12937 +/- ##
=======================================
Coverage 98.38% 98.38%
=======================================
Files 171 171
Lines 22300 22300
=======================================
Hits 21939 21939
Misses 361 361 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
84d2805 to
ac1a591
Compare
ac1a591 to
e6f1364
Compare
e6f1364 to
c6336e4
Compare
c6336e4 to
ce107f6
Compare
ce107f6 to
6b72cd3
Compare
6b72cd3 to
c0e9b76
Compare
Change Makefile and mpconfigport.h. Add a port specific nina_wifi_bsp.c file, which just increases the poll rate. The flag for enabling NinaW10 is MICROPY_PY_NETWORK_NINAW10. Signed-off-by: robert-hh <robert@hammelrath.com>
- MIMXRT1010_EVK - MIMXRT1015_EVK - ADAFRUIT Metro M7 For the *_EVK boards the pins are those used by the Adafruit Airlift shield. Signed-off-by: robert-hh <robert@hammelrath.com>
RTS must be low for operation. Allow CS as alias for GPIO1. Signed-off-by: robert-hh <robert@hammelrath.com>
And reduce the stack size for BLE. Nibmle uses 13k of static data, increasing the .bss section. Moving the stack or bss to OCRM is possible, but reduces the Python heap size. Signed-off-by: robert-hh <robert@hammelrath.com>
For: MIMXRT1010_EVK MIMXRT1015_EVK ADAFRUIT Metro M7 OLIMEX RT1010 Adafruit Metro M7 board: Add the SD variant of the Adafruit Metro M7 board. It supports WIFI/BLE as well, but at pins matching the Airlift UNO breakout. Olimex 1010 board: The pins are selected in a way that they are accessible at the UEXT1 connector of the Dev board. There is no free Pin for GPIO0. So GPIO0 must be connected with a resistor to a Pin which is not used for FW upload and is used as output during normal operation, e.g. SPI SCL. The NINA FW configures GPIO0 as output during normal operation. Signed-off-by: robert-hh <robert@hammelrath.com>
At first with the board files for MIMXRT1020 only. MIMXRT1010 and MIMXRT1015 do not build due to insufficient RAM size. Signed-off-by: robert-hh <robert@hammelrath.com>
- Teensy 4.0 - Teensy 4.1 - MIMXRT1050_EVK - SEEED Arch Mix WiFi & BLE work for Teensy 4.x and SEEED Arch Mix with the given wiring. The Teensy 4.x wiring matches the combination of a Adafruit Feather Airlift module with Teensy - Feather adapter. Limited activity for MIMXRT1050, since the SPI wires are not connected. BLE on MIMXRT1050EVK worked, with CS and MOSI of the airlift shield hardwired to GND. Signed-off-by: robert-hh <robert@hammelrath.com>
Instead of waiting a fixed long time for absorbing ESP32 boot messages, just wait a shorter time for no more data to arrive Signed-off-by: robert-hh <robert@hammelrath.com>
Inluding instructions for connecting external modules and uploading the WLAN/BLE firmware. Signed-off-by: robert-hh <robert@hammelrath.com>
- Makefile, main.c: Remove duplicated code and settings, which were added through combining several branches. - Install the proto-c compiler in ci.sh. - Move _dcd_data to the start of the .bss segment. This data item has to be 2k aligned. Moving it to the start of the segment avoids wasting memory. - Remove the board's manifest.py, now that many boards support networking. - Remove obsolete settings from mpconfigboard.mk files. Signed-off-by: robert-hh <robert@hammelrath.com>
And remove the MP_WEAK modifiers from that file, as suggested in the review. Signed-off-by: robert-hh <robert@hammelrath.com>
Mostly removing duplicate or obsolete settings. Signed-off-by: robert-hh <robert@hammelrath.com>
Allowing to disable WiFi and BLE by the value of MICROPY_PY_NETWORK_ESP_HOSTED in a board's mpconfigboard.mk. Remove duplicate lines from Makefile. Signed-off-by: robert-hh <robert@hammelrath.com>
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
docs/mimxrt/wlan_pinout.rst: Refer to NINA_FW version 2.0 ports/mimxrt/Makefile: Move config lines back to where they were. side change: Fix two comments at Teensy mpconfigboard.h and change the initial baudrate for MIMXRT1050_EVK. Signed-off-by: robert-hh <robert@hammelrath.com>
d3b5b06 to
7d4177f
Compare
|
Micropython esp-hosted works with the v1.0.0.0.0 driver. The module used for esphosted has to provide at least 4MB flash. Therefore it does not work with the uBlox NINA-W102 modules with 2MB flash per se. The esp-hosted configuration is for a 4MB flash, including a second firmware partition for OTA. That would not fit into 2MB. |
Good to know! Thanks @robert-hh |
|
@iabdalkader There is a startup problem with esp_hosted V1.0.0.0: After calling Edit: The same happens if a static IP is set before calling wlan.conenct() with every port, even for esp_hosted v0.0.5. wlan.isconnected() never returns True, but the device IS connected. |
|
@iabdalkader @dpgeorge After testing with esp_hosted v1.0.0.0 for a few days, I consider it as not ready for use, at least in the configuration I have determined. Besides the start-up problem noted above, it works reliably only with fast MCU's like Teensy 4.x, with slower ones and smaller RAM it locks up quite often, almost all the time when trying TCP transfer. UDP works mostly. So there is a problem in the interaction between esp module and MCU. |
|
Not 100% sure, but it might have something to do with the changes ESP made to the ABI/protocol after v0.0.5. We could probably support both firmwares via a config option. I'll see if we can allocate some time for this. |
|
@iabdalkader Thanks. Attached are the sdkconfig files which I used for V1.x. The SPI Pin config is for Airlift boards. But that is easy changeable. |
|
@dpgeorge I'm closing this PR. After a bit of consideration, it looks more like a source of continuous irritation than a benefit. There is no board or an add-on, where it would work off-the-shelf. In any case, the WiFi module has to be updated first, which is not a very simple step. And for both the NINA and the esp_hosted firmware the firmware versions are old. Newer firmware versions are either not available or do not work properly. So we have two components - Micropython and the Wifi module firmware - which must be kept in sync, and that will probably fail sooner that later. @iabdalkader It may still be interesting to tell, why the v1.0.0.0 version of esp_hosted behaves strange. There are a few boards which use esp_hosted of-the-shelf, and for these it may be interesting to have an upgrade path. |
|
@robert-hh thanks for your persistence with this and your executive decision to stop working on it. I agree that it's pretty hard to maintain drivers (both the host and controller drivers) for a WiFi coprocessor. The required bandwidth and low latency of WiFi, along with the complexity of the protocol, makes it pretty tricky to line up all the pieces. If it were a major feature for a commercial board (eg pyboard) then we could spend time on it. But having it as an optional bonus feature for mimxrt, no one has the time for that right now. Eventually things might improve. Eg the ESP32-P4 needs the [Side note: this is why I like the cyw43xx, because its patch firmware is relatively small and stable, is included on the host side and downloaded each time it's powered on. That makes it much easier to use and more reliable.] |
|
The esp_hosted firmware is currently used by two MP boards, the ESP32_P4 and the Arduino Nano 33 BLE. For that reason I left PR micropython/micropython-lib#642 open. There is OTA support for updating the esp_hosted firmware, but I did not try that. B.t.w.: My P4 board complains that the esp_hosted firmware needs an upgrade, but works otherwise. |
I will get around to working on this, maybe a few days next week. It's a work thing so will be on work hours. |
|
I just found a different way to get a start point, which may be more recent and seems more straightforward.
I did not check yet whether it is all one needs, but it looks more consistent. |
This support uses ESP32 modules with either NINAW10 firmware or esp-hosted firmware. For MIXRT101x devices, the NINAW10 firmware is expected. For MIMXRT102x, MIMXRT105x and MIMXRT106x the esp_hosted firmware has to be used. The esp_hosted firmware is faster and has a more robust BLE support, but the MIMXRT to support it gets too larger for MIMXRT101x devices. This PR includes Pin definitions and enables WiFI and BLE for:
As ESP32 device, e.g. Adafruit Airlift modules, Nina W10 modules or any generic ESP32 breakout can be used. The NINAW10 or esp_hosted firmware has to be installed to that device. Therefore there are dependencies of this device to a few other PR's to micropython-lib, especially micropython/micropython-lib#642 and micropython/micropython-lib#654. The PR micropython/mynewt-nimble#2 prevents a rare lock-up situation in the ble-nimble stack, which occurred during testing with the BLE test suite.