Skip to content

BluetoothSerial uses 64% of available Flash #1712

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

Closed
StuartsProjects opened this issue Aug 2, 2018 · 4 comments
Closed

BluetoothSerial uses 64% of available Flash #1712

StuartsProjects opened this issue Aug 2, 2018 · 4 comments

Comments

@StuartsProjects
Copy link

StuartsProjects commented Aug 2, 2018

Please fill the info fields, it helps to get you faster support ;)

If you have a Guru Meditation Error, please decode it:
https://github.com/me-no-dev/EspExceptionDecoder

----------------------------- Remove above -----------------------------

Hardware:

Board: ESP32 Dev Module
Core Installation/update date: 08/jun/2016
IDE name: Arduino IDE
Flash Frequency: 40Mhz
Upload Speed: 115200

Description:

I wrote a simple 'Hello World' program to send out the text via Bluetooth Serial. The program works but uses rather a lot of memory;

Sketch uses 849303 bytes (64%) of program storage space. Maximum is 1310720 bytes.
Global variables use 74520 bytes (22%) of dynamic memory, leaving 253160 bytes for local variables. Maximum is 327680 bytes.

I have been converting a LoRa GPS tracker program across from Arduino Atmel code, adding the Bluetooth serial takes program flash size from around 17% to 70%

Is this expected behaviour ?

Using the libbt.a mod from 'BluetoothSerial silently drops bytes to be sent #1537'

Sketch:

//Change the code below by your sketch
#include <Arduino.h>
#include "BluetoothSerial.h"

BluetoothSerial SerialBT;

void setup() 
{ 
Serial.begin(115200);
SerialBT.begin("ESP32test"); //Bluetooth device name
Serial.println("The device started, now you can pair it with bluetooth!");
}

void loop()
{
SerialBT.println("Hello World");
delay(1000);
}

Debug Messages:

Enable Core debug level: Debug on tools menu of Arduino IDE, then put the serial output here 
@JamesGKent
Copy link

unfortunately the bluetooth protocol is horrifically complex, so the code required to implement it isn't small.
thats not saying this won't/can't be improved in future, but it is currently the state of things that adding in bluetooth functionality consumes large amounts of flash

@lbernstone
Copy link
Contributor

lbernstone commented Aug 2, 2018

There are partitioning schemes that support larger apps, and devices with 8MB and even 16MB flash are available. 640K of flash should be enough for anyone 😄

@StuartsProjects
Copy link
Author

OK thanks for the info.

@Lingaperumal
Copy link

Hello
I have a doubt....regarding serial bluetooth..
if the device is not connected to server bluetooth how we can display or to tell that your device is not connected in a serial communication...

thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants