-
Notifications
You must be signed in to change notification settings - Fork 7.6k
BluetoothSerial / esp_bt_mem_release / memory consumption in arduino api #6451
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
Comments
I have the same issue. I need ~50Ko more memory for my project, and I'm lock due to bluetooth ram usage. I'm not using BLE in project. For you're question : "Is there any reason why esp32-hal-bt.c is a .c, not .cpp file (I'm asking because overloading those functions would be more convinient)" Another possible optimization. Is to let the user choose what to use in the Bluetooth lib. For example, I only need Bluetooth spp, but bluedroid has Bluetooth HID, A2DP, HFP, ... |
@ferbar Thaks for contribution and your PR, let's wait till your proposed PR is reviewed. |
PR was merged. Edit: I just closed it but I now see it was something else. So the question is, are there any updates on this? |
@VojtechBartoska: Yes, this is still open, do you have any ideas / wishes how to implement disabling BTLE if it is not needed to save some kB ram? Thanks |
Hi to all,
Interestingly, reassemble_and_dispatch function doesn't have a buffer overflow check in the 2014 Bluedroid version used by ESP-IDF. This appears to be a newer version: https://android.googlesource.com/platform/system/bt/+/ea7ab70a711e642653dd5922b83aa04a53af9e0e/hci/src/packet_fragmenter.cc It appears to be significantly rewritten and with a comment " Anyway the ability to choose between BT Classic OR BLE would already solve many issues. Many thanks, |
With the patch above it is possible to save stunning 14kB free ram when BLE is not used. Unfortunately it seems that the current master takes 10kb more ram ..... -DCONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=y |
Hi @garageeks, I have the same error as you have. (failing in the packet_fragmenter.c) Any help would be much appreciated, thanks! |
@SimonPVS sorry for late reply. I simply gave up sending web requests while using Bluetooth A2DP. |
@VojtechBartoska I saw lots of changes with new 3.0.0 version, did you add a flag to disable BTLE and leave BT classic (or viceversa)? According to @ferbar , it is a matter of CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y Thank you |
Hello, Due to the overwhelming volume of issues currently being addressed, we have decided to close the previously received tickets. If you still require assistance or if the issue persists, please don't hesitate to reopen the ticket. Thanks. |
Related area
BT, BluetoothSerial
Hardware specification
any
Is your feature request related to a problem?
Using BluetoothSerial is taking about 140kB ram of the ESP32. That could be reduced by recompiling the arduino esp idf with a reduced set of options or by using esp_bt_mem_release(BTLE) for example if bluetooth LE isn't required. Since recompiling takes a lot of time I would suggest some options in the ESP32 arduino sdk.
Describe the solution you'd like
When
btInUse()
is returning true about 70kB ram are in use since boot. WhenbtStart()
is called additional 70kB are required. If BluetoothSerial is used, I don't think that BTLE will be used in general, so I suggest an option to BluetoothSerial or BluetoothSerial::begin to disable BTLE and BluetoothSerial::end to disable BT in general (and callesp_bt_mem_release()
)a)
btStart()
has to be changed because ofesp_bt_controller_config_t cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
.mode = ESP_BT_MODE_CLASSIC_BT,
b)
esp_bt_mem_release()
has to be called beforeesp_bt_controller_init()
and afterBluetoothSerial::end()
I already have those modifications and would file a PR when #6380 is merged.
@me-no-dev: what do you think about
Thanks!
Describe alternatives you've considered
No response
Additional context
No response
I have checked existing list of Feature requests and the Contribution Guide
The text was updated successfully, but these errors were encountered: