Bluetooth doesn't work / flash_erase

Hi!

I've been having issues with my ESP32 which I think are flash memory issues. In my ESP32 there was data in SPIFFS, EEPROM and wifi chip. I recently erased all flash memory with esptools and the erase_flash command. Thus, it erased both the saved information from wifi, data in EEPROM and data from SPIFFS. However, I went to test the bluetooth and it no longer connects to any device and before I erased the flash, it worked. The same sketch worked on another ESP32. It's the actual example sketch:


#include "BluetoothSerial.h"

#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif

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() {
  if (Serial.available()) {
    SerialBT.write(Serial.read());
  }
  if (SerialBT.available()) {
    Serial.write(SerialBT.read());
  }
  delay(20);
}

I would also like to know if all these SPIFFS, EEPROM and WIFI data writes are written in the same place. I'm new to Arduino and C++, but if they are saved in the same location, is there a chance that one EEPROM write and another SPIFFS write overlap, or some other information overlap? Is it correct or smart to use both SPIFFS and EEPROM in the same sketch?

But that's it, I started having problems with ESP32 after I made EEPROM writes and after I decided to erase the entire flash memory and now I don't know if there are any solutions.

Thank you!

Yeah, I am having the same issue. My ESP32 (when uploading through Arduino IDE) says it has ran out of storage to upload the program correctly, even though I have uploaded the Bluetooth sketch three-four times and that it has way more memory than my Arduino

Here loads the normal sketch, successfully, without showing error. The problem is that no device can connect to ESP32. And this happened after I wrote data to EEPROM and then erased all flash memory.

Anybody know?

Hi @filipekerplunk
When using SPIFFS and EEPROM in ESP32, data overlap may occur.
To avoid this instead of using the EEPROM.h library, use the Preferences.h library.
Ref: ESP32 Save Data Permanently using Preferences Library | Random Nerd Tutorials

@geniusified
To increase the APP memory, (where the compiled sketch is located) select another APP memory size as shown in the screen below:

RV mineirin

I will definitely try this out, thank you!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.