• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 BLE Android Application – Control Outputs and Display Sensor Readings. SKETCH TOO BIG?

Q&A Forum › Category: ESP32 › ESP32 BLE Android Application – Control Outputs and Display Sensor Readings. SKETCH TOO BIG?
0 Vote Up Vote Down
James Schott asked 7 years ago

I am using a Adafruit ESP32 Huzzah Feather.
Get the following compile error from the Arduino IDE when compiling:
“Sketch uses 1437658 bytes (109%) of program storage space. Maximum is 1310720 bytes.”
Do we need all these libraries to support the BLE features in the sample project?
#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>
My sketch is not too large (~100 lines) – what is the overhead for these BLE libraries compared to the total 1310720 bytes available?
Only other libraries in my sketch are used to support Wi-Fi:
#include <WiFi.h>
#include <WiFiClient.h>
Any other ideas to reduce the size of this example project?
Thanks,
Jim

Question Tags: Random Nerd tutorial example project BLE library size maxing out ESP32 program storage space.
6 Answers
0 Vote Up Vote Down
James Schott answered 7 years ago

After testing a compile on just the BLE ESP32 Sketch example only the Program Memory Space goes to 86% of total in the ESP32: 
Sketch uses 1130093 bytes (86%) of program storage space. Maximum is 1310720 bytes.
Are there any good tricks to reduce the size of the BLE libraries used to free up more space for an application?
Thanks,
Jim

0 Vote Up Vote Down
James Schott answered 7 years ago

Another benchmark for BLE program memory size is the Example that comes standard in the Arduino IDE
Can be found in the Arduino IDE at File\Examples\ESP32 BLE Arduino\B:E-server
When compiling this code it is at 85% of available program memory: “Sketch uses 1126565 bytes (85%) of program storage space. Maximum is 1310720 bytes.”
If there is not a more compact solution for BLE then it is about worthless for provisioning the ESP32 when we still need program memory for the rest of the actual application to run the product/control system/features.
Any ideas/suggestions?

0 Vote Up Vote Down
Rui Santos Staff answered 7 years ago

Hello James, I agree with you… Unfortunately at the moment the Bluetooth Low Energy capabilities of the ESP32 with Arduino IDE are very power intensive and it uses a lot of resources.

If you want to lower the memory usage, the best way is to use a lower level programming language and program the ESP32 with ESP-IDF: https://github.com/espressif/esp-idf

That’s the best option right now…

0 Vote Up Vote Down
James Schott answered 7 years ago

Thanks for validating the current situation and alternative.  Understood.

0 Vote Up Vote Down
peppeg85 answered 5 years ago

Hello, i’m in the same situation, is there any solution or we have to use the esp-idf without the arduino system? thank you

0 Vote Up Vote Down
Rui Santos Staff answered 5 years ago

Unfortunately I think for such project that requires too much memory only using ESP-IDF will be a good solution

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.