Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
FFAT and BluetoothSerial conflict causing boot loop on ESP32 #3265
Board: Heltec ESP32 LoRa V2 Module
After a lot of hours spent to try to figure out what is wrong in my original source code, I've isolated the problem that causes the strange reboot.
I'm using esp32/1.0.3-rc3 - Heltec WiFi LoRa 32(v2) hardware board and I've edited the default partition table to simplify the tests:
I've the ESP32 64Mbit version and this is the partition table that I've used for 8MB version:
I've also created another partition table for 4MB version, but the result is the same:
This is my simple code extracted from FFAT example in esp32_fatfsimage-master library.
As you can see, the included library "BluetoothSerial.h" isn't really used in this example, but is sufficient include it to cause the issue.
Output copied from serial monitor when the software crashes:
Output from serial monitor when it works well without BluetoothSerial.h #include line:
This is the command line that I've used to clear and re-initialize the ESP32 flash:
This is the output of the decoder:
I hope that this can help you.
If it's useful, I have also tested the sketch with Heltec-ESP32 ver0.0.2-rc1 board distribution with edited partition map and this is the decoded stack result:
In the additional board manager field I've added this line:
This hardware library is also worst respect all the other and have a lot of other bugs already resolved.
The new ffat.cpp resolves the boot loop issue, but something still goes wrong if I want to format manually the fat partition. In particular, take a look to this output:
...why the partition is already mounted on startup? Why format() is telling me that is already mounted and don't format the partition? And also, why if I try to unmount it with end() method it fails?
...a new boot loop to resolve...
###Decoding stack results
Only one more question about this issue...why if I comment out the BluetoothSerial.h include all perfectly works without any crash also if the partition is unformatted and with original ffat .cpp & .h files?
And why if the FAT partition is formatted and BluetoothSerial.h included, all works perfectly except format that don't crashes, but do nothing?