@@ -28,6 +28,7 @@ bool FlashFormatterQSPI::checkPartition()
2828 if (_wifiData.init () != BD_ERROR_OK || _wifiFS.mount (&_wifiData) != 0 ) {
2929 return false ;
3030 }
31+ Serial.println (" WiFi partition size: " + String ((unsigned int )_wifiData.size ()));
3132
3233 if (!checkWiFiData ()) {
3334 return false ;
@@ -43,6 +44,7 @@ bool FlashFormatterQSPI::checkPartition()
4344 if (_otaData.size () < 5 * 1024 * 1024 ) {
4445 return false ;
4546 }
47+ Serial.println (" OTA partition size: " + String ((unsigned int )_otaData.size ()));
4648
4749 _otaFS.unmount ();
4850 _otaData.deinit ();
@@ -54,6 +56,7 @@ bool FlashFormatterQSPI::checkPartition()
5456 if (_kvstoreData.size () < 1 * 1024 * 1024 ) {
5557 return false ;
5658 }
59+ Serial.println (" KVStore partition size: " + String ((unsigned int )_kvstoreData.size ()));
5760
5861 _kvstoreData.deinit ();
5962 _root->deinit ();
@@ -89,6 +92,7 @@ bool FlashFormatterQSPI::checkFile(const char* partition, const char* filename)
8992{
9093 DIR *dir;
9194 struct dirent *ent;
95+ Serial.println (" Checking for file: " + String (filename));
9296
9397 if ((dir = opendir (partition)) == NULL ) {
9498 return false ;
@@ -102,12 +106,14 @@ bool FlashFormatterQSPI::checkFile(const char* partition, const char* filename)
102106 break ;
103107 }
104108 }
109+ Serial.println (" Found file: " + String (ent->d_name ));
105110 closedir (dir);
106111 return foundFile;
107112}
108113
109114bool FlashFormatterQSPI::writeFile (const char * partition, const char * filename, const uint8_t * data, size_t size, size_t maxChunkSize)
110115{
116+ Serial.println (" Writing file: " + String (filename));
111117 String fullname = String (partition) + " /" + String (filename);
112118 FILE* fp = fopen (fullname.c_str (), " wb" );
113119 if (!fp) {
@@ -129,11 +135,13 @@ bool FlashFormatterQSPI::writeFile(const char* partition, const char* filename,
129135 size_t written = ftell (fp);
130136 fclose (fp);
131137
138+ Serial.println (" Wrote file: " + String (filename) + " size: " + String (written));
132139 return written == size;
133140}
134141
135142bool FlashFormatterQSPI::writeFlash (const uint8_t * data, size_t size, size_t offset, size_t maxChunkSize)
136143{
144+ Serial.println (" Writing flash data" );
137145 size_t chunkSize = maxChunkSize;
138146 size_t byteCount = 0 ;
139147 while (byteCount < size) {
@@ -145,6 +153,7 @@ bool FlashFormatterQSPI::writeFlash(const uint8_t* data, size_t size, size_t off
145153 }
146154 byteCount += chunkSize;
147155 }
156+ Serial.println (" Wrote flash data: " + String (byteCount));
148157 return true ;
149158}
150159
0 commit comments