@@ -31,7 +31,8 @@ def doTesting(self):
3131 return
3232
3333 #Loop through flashes and erase
34- eraseTried = []
34+ eraseTried = [0 ]* self .nFlashes
35+ flashToSkip = [False ]* self .nFlashes
3536 for iFlash in range (self .nFlashes ):
3637 #Erase Flash
3738 self .femb_config .eraseFlash (iFlash )
@@ -45,8 +46,8 @@ def doTesting(self):
4546 eraseTried [iFlash ] = iTries
4647
4748 if (iTries > 5 ):
48- print ("Flash %s has a problem. Please check and retry again! \n Exiting !\n " % (iFlash ))
49- return
49+ print ("Flash %s has a problem. Will skip this flash !\n " % (iFlash ))
50+ flashToSkip [ iFlash ] = True
5051
5152 #Check a page (page 5 here) to make sure if things make sense; memory should be erased to 0xFFFFFFFF
5253 outputData = self .femb_config .readFlash (iFlash , 5 )
@@ -57,10 +58,12 @@ def doTesting(self):
5758 print ("\n Done erasing flashes! Begining the tests.\n " )
5859
5960 #Loop over flashes and pages
60- flashSuccess = [True ]* self .nFlashes
6161 failedPages = [0 ]* self .nFlashes
6262 programTried = [[0 for iP in range (0 , self .nPages )] for iF in range (0 , self .nFlashes )]
6363 for iFlash in range (self .nFlashes ):
64+ if flashToSkip [iFlash ]:
65+ failedPages [iFlash ] = 9999999
66+ continue
6467 for iPage in range (self .nPages ):
6568 inputData = []
6669 for iNum in range (0 , 64 ):
@@ -101,7 +104,6 @@ def doTesting(self):
101104 print ("*" * 75 )
102105 print ("Writing to flash %s, page %s failed!" % (iFlash , iPage ))
103106 print ("*" * 75 )
104- flashSuccess [iFlash ]= False
105107 failedPages [iFlash ] += 1
106108 else :
107109 print ("*" * 75 )
@@ -117,10 +119,12 @@ def doTesting(self):
117119 for iFlash in range (self .nFlashes ):
118120 print ("\n No. of tries to erase flash %s was %s" % (iFlash , eraseTried [iFlash ]))
119121
122+ flashSuccess = [False ]* self .nFlashes
120123 print ("\n Info on Write: " )
121124 print ("Note: Will print no. of write tries if > 1 for a page" )
122125 for iFlash in range (self .nFlashes ):
123- if (flashSuccess [iFlash ]):
126+ if (failedPages [iFlash ] == 0 ):
127+ flashSuccess [iFlash ] = True
124128 print ("\n Flash %s passed!!" % (iFlash ))
125129 for iPage in range (self .nPages ):
126130 if (programTried [iFlash ][iPage ] > 1 ):
0 commit comments