Guard 2M PHY mode for NimBLE#8890
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new NIMBLE_ENABLE_2M_PHY macro guard to disable the 2M PHY mode feature by default in NimBLE, addressing Bluetooth regression issues reported with desktop PC and Mac connections. Users can opt-in to the 2M PHY mode by adding -DNIMBLE_ENABLE_2M_PHY=1 to their build flags.
Key Changes:
- Added
NIMBLE_ENABLE_2M_PHYguard to conditional compilation blocks controlling 2M PHY preference and MTU settings - Modified guards in both
onConnect()callback andsetup()function to require explicit opt-in for 2M PHY mode
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Just FYI - this is 99% caused by buggy ESP-IDF version as we are using Arduino 2.x and ESP-IDF V4.X I advocate for some plan to move to pioarduino based on ESP-IDF V5.5 which has a ton of bugs fixed, both for BT and power management. Example: #8876 There is also suspicion (by me) that some NRF52 boards with external LF crystal (for example T114) have faulty crystals throwing off bluetooth connections on some faster timings. This was reported already by several Nordic customers. So there is mess to manage on both platforms :/ |
Would you mind propoosing that PR separately @phaseloop. I'm sure @caveman99 has thoughts as well :-) |
I created a GH issue to discuss it along with migration plan. AFAIK this aligns well with idea to move ADC and power management functions to each |
* Guard 2M PHY mode for NimBLE * Update src/nimble/NimbleBluetooth.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Another #endif snuck in there * Move endif --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Guard 2M PHY mode for NimBLE * Update src/nimble/NimbleBluetooth.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Another #endif snuck in there * Move endif --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Original change introduced by #8261
We have seen a number of reports of issues with particularly desktop PC / Mac bluetooth regressions due to the PHY increase. This change macro-guards that mode.
If someone wishes to use the 2M PHY mode for NimBLE, they can add
-DNIMBLE_ENABLE_2M_PHY=1to their PIO ini environment build flags.