Skip to content

Commit f8c041d

Browse files
committed
temp: debug prints
1 parent 42732ee commit f8c041d

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/flashFormatter/FlashFormatterBase.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ class FlashFormatterBase {
1212
public:
1313
virtual ~FlashFormatterBase() = default;
1414
virtual bool checkAndFormatPartition() {
15+
Serial.println("checkPartition");
1516
if(checkPartition()){
1617
return true;
1718
}
18-
19+
Serial.println("formatPartition");
1920
if(!formatPartition()){
2021
return false;
2122
}
22-
23+
Serial.println("checkPartition");
2324
return checkPartition();
2425
}
2526

src/flashFormatter/FlashFormatterQSPI.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,25 @@ bool FlashFormatterQSPI::checkPartition()
3434
*/
3535
_runtimeFormat = false;
3636
if (_runtimeData.init() != BD_ERROR_OK) {
37+
Serial.println("Failed to init optData");
3738
_runtimeFormat = true;
3839
return false;
3940
}
41+
Serial.println("Runtime partition size: " + String((unsigned int)_runtimeData.size()));
42+
4043
_runtimeData.deinit();
4144

4245
/* check WiFi partition */
4346
if (_wifiData.init() != BD_ERROR_OK || _wifiFS.mount(&_wifiData) != 0) {
47+
Serial.println("Failed to mount wifiFS");
4448
return false;
4549
}
4650

4751
if (!checkWiFiData()) {
52+
Serial.println("Failed to check wifi data");
4853
return false;
4954
}
55+
Serial.println("WiFi partition size: " + String((unsigned int)_wifiData.size()));
5056

5157
_wifiFS.unmount();
5258
_wifiData.deinit();
@@ -59,6 +65,7 @@ bool FlashFormatterQSPI::checkPartition()
5965
if (_otaData.size() < 5 * 1024 * 1024) {
6066
return false;
6167
}
68+
Serial.println("OTA partition size: " + String((unsigned int)_otaData.size()));
6269

6370
_otaFS.unmount();
6471
_otaData.deinit();
@@ -71,6 +78,7 @@ bool FlashFormatterQSPI::checkPartition()
7178
if (_kvstoreData.size() < 1 * 1024 * 1024) {
7279
return false;
7380
}
81+
Serial.println("KVStore partition size: " + String((unsigned int)_kvstoreData.size()));
7482
_kvstoreData.deinit();
7583

7684
_root->deinit();
@@ -80,25 +88,30 @@ bool FlashFormatterQSPI::checkPartition()
8088
bool FlashFormatterQSPI::formatPartition() {
8189

8290
if (_root->init() != BD_ERROR_OK) {
91+
Serial.println("Failed to init root");
8392
return false;
8493
}
8594

8695
if (_root->erase(0x0, _root->get_erase_size()) != BD_ERROR_OK) {
96+
Serial.println("Failed to erase root");
8797
return false;
8898
}
8999

90100
MBRBlockDevice::partition(_root, 1, 0x0B, 0, 1 * 1024 * 1024);
91101
if (_wifiFS.reformat(&_wifiData) != 0) {
102+
Serial.println("Failed to format wifiFS");
92103
return false;
93104
}
94105

95106
if (!restoreWifiData()) {
107+
Serial.println("Failed to restore wifi data");
96108
return false;
97109
}
98110
_wifiFS.unmount();
99111

100112
MBRBlockDevice::partition(_root, 2, 0x0B, 1 * 1024 * 1024, 6 * 1024 * 1024);
101113
if (_otaFS.reformat(&_otaData) != 0) {
114+
Serial.println("Failed to format otaFS");
102115
return false;
103116
}
104117
_otaFS.unmount();
@@ -108,6 +121,7 @@ bool FlashFormatterQSPI::formatPartition() {
108121
if (_runtimeFormat) {
109122
MBRBlockDevice::partition(_root, 4, 0x0B, 7 * 1024 * 1024, 14 * 1024 * 1024);
110123
if (_runtimeFS.reformat(&_runtimeData) != 0) {
124+
Serial.println("Failed to format optFS");
111125
return false;
112126
}
113127
_runtimeFS.unmount();

0 commit comments

Comments
 (0)