@@ -38,14 +38,14 @@ void UpdaterClass::_reset() {
3838bool UpdaterClass::begin (size_t size, int command) {
3939 if (_size > 0 ){
4040#ifdef DEBUG_UPDATER
41- DEBUG_UPDATER .println (" already running" );
41+ DEBUG_UPDATER .println (" [begin] already running" );
4242#endif
4343 return false ;
4444 }
4545
4646#ifdef DEBUG_UPDATER
4747 if (command == U_SPIFFS ) {
48- DEBUG_UPDATER .println (" Update SPIFFS." );
48+ DEBUG_UPDATER .println (" [begin] Update SPIFFS." );
4949 }
5050#endif
5151
@@ -73,6 +73,12 @@ bool UpdaterClass::begin(size_t size, int command) {
7373 // address where we will start writing the update
7474 updateStartAddress = updateEndAddress - roundedSize;
7575
76+ #ifdef DEBUG_UPDATER
77+ DEBUG_UPDATER .printf (" [begin] roundedSize: 0x%08X (%d)\n " , roundedSize, roundedSize);
78+ DEBUG_UPDATER .printf (" [begin] updateEndAddress: 0x%08X (%d)\n " , updateEndAddress, updateEndAddress);
79+ DEBUG_UPDATER .printf (" [begin] currentSketchSize: 0x%08X (%d)\n " , currentSketchSize, currentSketchSize);
80+ #endif
81+
7682 // make sure that the size of both sketches is less than the total space (updateEndAddress)
7783 if (updateStartAddress < currentSketchSize) {
7884 _error = UPDATE_ERROR_SPACE ;
@@ -88,7 +94,7 @@ bool UpdaterClass::begin(size_t size, int command) {
8894 else {
8995 // unknown command
9096#ifdef DEBUG_UPDATER
91- DEBUG_UPDATER .println (" Unknown update command." );
97+ DEBUG_UPDATER .println (" [begin] Unknown update command." );
9298#endif
9399 return false ;
94100 }
@@ -100,6 +106,12 @@ bool UpdaterClass::begin(size_t size, int command) {
100106 _buffer = new uint8_t [FLASH_SECTOR_SIZE ];
101107 _command = command;
102108
109+ #ifdef DEBUG_UPDATER
110+ DEBUG_UPDATER .printf (" [begin] _startAddress: 0x%08X (%d)\n " , _startAddress, _startAddress);
111+ DEBUG_UPDATER .printf (" [begin] _currentAddress: 0x%08X (%d)\n " , _currentAddress, _currentAddress);
112+ DEBUG_UPDATER .printf (" [begin] _size: 0x%08X (%d)\n " , _size, _size);
113+ #endif
114+
103115 _md5.begin ();
104116 return true ;
105117}
0 commit comments