@@ -81,8 +81,8 @@ public byte[] ReadFlashId(bool isErrorExpected = false)
8181
8282 public bool Sync ( )
8383 {
84- var fid = ReadFlashId ( true ) ;
85- if ( fid != null )
84+ flashID = ReadFlashId ( true ) ;
85+ if ( flashID != null )
8686 {
8787 addLogLine ( "Stub is already uploaded!" ) ;
8888 return true ;
@@ -159,7 +159,7 @@ private bool UploadStub()
159159 }
160160 Thread . Sleep ( 10 ) ;
161161 serial . DiscardInBuffer ( ) ;
162- ReadFlashId ( ) ;
162+ flashID = ReadFlashId ( ) ;
163163 if ( tries == 0 || flashID == null )
164164 return false ;
165165 return true ;
@@ -432,8 +432,7 @@ public override void doRead(int startSector = 0x000, int sectors = 10, bool full
432432 {
433433 if ( fullRead )
434434 {
435- sectors = flashSizeMB / BK7231Flasher . SECTOR_SIZE ;
436- addLogLine ( $ "Detected flash size: { sectors / 256 } MB") ;
435+ sectors = flashSizeMB * 256 ;
437436 }
438437 byte [ ] res = InternalRead ( startSector , sectors ) ;
439438 if ( res != null )
@@ -502,8 +501,7 @@ public override void doReadAndWrite(int startSector, int sectors, string sourceF
502501 OBKConfig cfg = rwMode == WriteMode . OnlyOBKConfig ? logger . getConfig ( ) : logger . getConfigToWrite ( ) ;
503502 if ( rwMode == WriteMode . ReadAndWrite )
504503 {
505- sectors = flashSizeMB / BK7231Flasher . SECTOR_SIZE ;
506- addLogLine ( $ "Flash size detected: { sectors / 256 } MB") ;
504+ sectors = flashSizeMB * 256 ;
507505 byte [ ] res = InternalRead ( startSector , sectors ) ;
508506 if ( res != null )
509507 ms = new MemoryStream ( res ) ;
0 commit comments