def blockErase(self): blkSzStr = self.blockSize.get() if blkSzStr == 'Chip': print('Erasing entire chip') self.comm.send('6; 60; wait 0') print(self.comm.response()) print('Chip erase done.') else: # must be in else, otherwise it fails for 'Chip' block_size = int(blkSzStr) start_addr = int(self.startAddr.get(), 16) # # Calculating the actual start addresses: # mask = ~((block_size * 1024) - 1) # pay attention: tricky # actStartAddr = start_addr & mask print(f'Start address = {start_addr:x}') # print(f'Actual start address = {actStartAddr:x}') numm_blocks = int(self.numBlocks.get()) print(f'Erasing {numm_blocks} {block_size}kB block(s)') du.block_erase(self.comm, block_size=block_size, start_addr=start_addr, num_blocks=numm_blocks) print('Block erase done.') print('Elapsed time: {}ms')
def blockErase(self): serCom.checkConnection() # check if board is connected blkSzStr = self.blockSize.get().lower() start_addr = int(self.startAddr.get(), 16) num_blocks = int(self.numBlocks.get(), 16) if blkSzStr != 'chip': # if it is a '4','32' or '64 block_size = int(blkSzStr) blockSizeKB = block_size * 1024 startAddr = (start_addr // blockSizeKB) * blockSizeKB print( f'Erasing {num_blocks} {block_size}kB block(s) from address {startAddr:x}') t_erase = du.block_erase( self.comm, block_size, start_addr, num_blocks) else: print('Erasing chip') t_erase = du.block_erase(self.comm, blkSzStr) tprint(du.textToDisplay[:-1]) erase_time = du.time_conv_from_usec(t_erase) print(f'DONE. Elapsed time: {erase_time}')
def blockErase(self): serCom.checkConnection() # check if board is connected blkSzStr = self.blockSize.get() if blkSzStr == 'Chip': print('Erasing entire chip') erase_time = du.block_erase(self.comm, block_size='chip', echo=1) # self.comm.send('6; 60; wait 0') # print(self.comm.response()) print('Chip erase done.') else: # don't change it to hex int(blkSzStr, 16). Will fail! block_size = int(blkSzStr) start_addr = int(self.startAddr.get(), 16) num_blocks = int(self.numBlocks.get(), 16) blockSizeKB = block_size * 1024 startAddr = (start_addr // blockSizeKB) * blockSizeKB print( f'Erasing {num_blocks} {block_size}kB block(s) from address {startAddr:x}' ) t_erase = du.block_erase(self.comm, block_size, start_addr, num_blocks) erase_time = du.time_unit_conversion(t_erase) print(f'Elapsed time: {erase_time}')
comm = boardcom.BoardComm() # create an instance of class BoardComm portList = comm.findPorts() print(portList) connectedPort = portList[0] comm.connect(connectedPort) print('Connection established...') start_addr = 0x0 end_addr = start_addr + 0x1000 numbytes = end_addr - start_addr num_erase = 10 # number of times a block of memory is erased block_size = 4 # must be 4, 32 or 64 for i in range(num_erase): du.block_erase(comm, block_size=block_size, start_addr=start_addr, num_blocks=1, trig=False, echo=0) print(f'{block_size}kB memory block erased {num_erase} times') print(f'getting vt curves after {num_erase} Erase cycles') dbg.runfdma(comm=comm, addr=start_addr, numbytes=numbytes, prefix="", fast=True, nocpsum=False, minvdac=0, maxvdac=63, with_nbias=True, plot=True) print('painting memory 8 times with a pattern') for i in range(2): du.pattern_program(comm, start_addr=start_addr, end_addr=end_addr, pattern='55aa55aa', increment=0, echo=0) print('getting vt curves after painting memory') dbg.runfdma(comm=comm, addr=start_addr, numbytes=numbytes, prefix="", fast=True, nocpsum=False, minvdac=0, maxvdac=63, with_nbias=True, plot=True) delay = 0 # initial delay