I can see this issue has been raised previously, but without a clear resolution. Over the last couple of months I have added Bluetooth Serial functionality to two of my existing projects. The modifications worked fine until yesterday with full functionality including Bluetooth. I am now unable to update either project as on uploading I get the error message saying my Sketch is 110% above the board storage space, see full error message below.
The changes I am trying to make a purely cosmetic and no way would push the storage space above 100%. And in the case of one project I made no changes and it still pushed me 10% over the allocated storage space.
Having seen comments about the size of the Bluetooth serial library I experimented and sure enough if I donot include the ‘BluetoothSerial SerialBT;’ statement my program loads fine and takes up only 55% of the allocated storage space.
This does not explain why both programs have worked fine with Bluetooth Classic functionality for the last 2 months. Immediately prior to this issue I did have a separate issue where user libraries I had added namely OneWire.h and DallasTemperature.h could not be found but this was a self-inflicted problem as I had moved the location where I stored the sketchs without telling the IDE where the files were stored. Although I can’t see how this would be related to the current problem.
Your assistance would be much appreciated.
p.s. the board I am using is a Firebettle2 ESP32-E
Error message: [Sketch uses 1450021 bytes (110%) of program storage space. Maximum is 1310720 bytes.
Global variables use 55624 bytes (16%) of dynamic memory, leaving 272056 bytes for local variables. Maximum is 327680 bytes.
Sketch too big; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing it.
text section exceeds available space in board
Compilation error: text section exceeds available space in board]
I hadn’t changed it so assume it was the default partition. I was trying to avoid this, I was trying to understand what had changed, the sketch had been working fine and suddenly came up with this error message, in one case with no changes.
To the best of my knowledge, I hadn’t updated any libraries or boards. The only thing that I mentioned in my original question was that I had moved all my sketches (and the two libraries (OneWire.h and DallaTemperature.h) from my C Drive to a OneDrive folder but left folder preferences in IDE set to the original C Drive folder which meant that IDE couldn’t find these 2 libraries during compilation.
One other thing I tried was uploading the Bluetooth Serial example sketch SerialtoSerialBT. This uploaded correctly but used 80% of storage capacity.
But why wouldn't you just try it to see if it makes a difference? It would provide another data point and it costs you nothing to try!
Perhaps not the problem here, but there were reports in the past of the Arduino IDE not playing well with OneDrive. That may have already been fixed. Regardless, OneDrive is evil, I would never use it voluntarily.
This means that compiled binary files may contain the path strings to your sketchbook folder, especially if you have debug information enabled.
(The above is an extraction result on MacOS, without debug information enabled)
As such, changes in the length of the path string may change the required storage size.