nrf/bluetooth: Add support for nimble based ubluetooth.#8318
nrf/bluetooth: Add support for nimble based ubluetooth.#8318andrewleech wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8318 +/- ##
=======================================
Coverage 98.46% 98.46%
=======================================
Files 176 176
Lines 22784 22784
=======================================
Hits 22435 22435
Misses 349 349 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Now tested on nrf52840 dongle with the Adafruit UF2 bootloader: https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/download/0.6.3/pca10059_bootloader-0.6.3_s140_6.1.1.zip Flashed that on with nrfutil following adafruit instructions It reboots in mass storage mode. While this bootloader comes with a copy of the softdevice bundled, micropython will happily flash over the top of that. Apparently the adafruit uf2 bootloader live checks if SD is installed and can work with/without it just fine - however no BLE OTA updates without it. I compiled this current commit (fea9f0d) again with DFU=1 then converted the hex to uf2 nrf52840_micropython_ubluetooth_fea9f0d0.uf2.zip Then drag and drop the uf2 onto the board bootloader. double click the reset switch to get back into bootloader. |
|
Note that there is a copy of |
fea9f0d to
364d085
Compare
|
Ok, I've tried running the ble multitests... it didn't go great. Initially they all failed, found a few issues, fixed a few issues. I haven't looked into these failures specifically yet, other than the |
364d085 to
6e8cd9a
Compare
|
So coming back to this, for some reason the previous approach to flashing adafruit uf2 bootloader on the nordic nrf52840 dongle won't work for me anymore. Pressing the right-angle button on the dongle puts it into bootloader mode, at which point I try: Same deal running in linux, no change with newer So downloaded the hex of the bootloader instead and convert it: Then try to flash it So yeah, I gave up on adafruit and uf2 bootloader. that works! ok, back to testing multi_bluetooth tests... |
remove last uses of 'u' prefix
6e8cd9a to
11d9121
Compare
|
Code size report: |
11d9121 to
21f123c
Compare
21f123c to
6eb6155
Compare
|
This is an automated heads-up that we've just merged a Pull Request See #13763 A search suggests this PR might apply the STATIC macro to some C code. If it Although this is an automated message, feel free to @-reply to me directly if |
a5516fa to
11c6b03
Compare
|
It seems most multitests are unreliable, occasionally failing with a timeout. |
I had noticed that when adapting the NINAW10 package for the SAMD and MIMXRT port. Some tests fail always, some tests fail never, some sometimes. Using the ESP_HOSTED package is much more reliable, even if both rely on nimble. With ESP_HOSTED still some tests fail nearly always (like deepsleep and stress_log_filesystem, but the other tests pass fine. The list below shows the success rate with the NINAW10 package of 100 attempts. |
|
That's really interesting. The tests I was having issues with seemed fine going from pyb-d to stm32wb55 so it's definitely the nrf that's got issues compared to them. I did some more testing and suspect my soft timer integration might not be working, I'll want to get a debugger connected to check what it's actually doing. |
|
For me, the BLE multitests are very robust when testing using PYBD-SFx and ESP32 boards, which use NimBLE. Maybe occasionally one of them will fail, but it's not often. |
|
There are no problems in testing with PYBD or ESP32. Since both NINAW10 and ESP_HOSTED use the ESP32 implementation of BLE, but with a different version of the ESP_IDF (3.x vs. 5.x), it looks like that make the difference. |
0b200ce to
5c7d598
Compare
5c7d598 to
971407a
Compare
|
I've rebased this to current master but haven't yet re-tested anything |
63a3a9d to
db0ea97
Compare
Signed-off-by: Andrew Leech <[email protected]>
Add NimBLE bluetooth stack support for the nrf port, enabling the ubluetooth module on nrf52 boards. This includes: - NimBLE HCI transport and OS abstraction layer for nrf - Soft timer and PendSV support required by the BLE stack - HCI polling scheduled via eventq_put for efficient operation - Board-level configuration for enabling bluetooth - Random number generator integration for BLE security Signed-off-by: Andrew Leech <[email protected]>
db0ea97 to
9c4e84f
Compare
Initial support for nimble based
ubluetoothsupport on nrf port. Using this replaces any need for the softdevice.Has only been tested on nrf52840 dongle.
TODO:
make DEBUG=1 DFU=0firmware with jlink.