def program(self): serCom.checkConnection() # check if board is connected self.get_states() if self.progModeVar.get() == 'pattern': print( f'startAddr: {startAddr:X}, dataLen: {dataLen:x}, pattn: {pattn}, incr: {incr}' ) print('Programming...') t_prog = du.pattern_program(self.comm, startAddr, dataLen, pattn, incr) else: # if programming a content of a file dsize = len(self.progData) print('Downloading data...') du.write_buf_write(comm, self.progData, dsize) print('Programming...') t_prog = du.data_program(comm, self.progData, startAddr) prog_time = du.time_unit_conversion(t_prog) print(f'Actual programming time: {prog_time}')
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 dly_step = 2 # [ms] print("\n*****************\nSuspend Erase:") if block_size == 4: cmdstr = f'06; 20 {start_addr}; delay {delay*1000}; b0; wait 0' elif block_size == 32: cmdstr = f'06; 53 {start_addr}; delay {delay*1000}; b0; wait 0' elif block_size == 64: cmdstr = f'06; d8 {start_addr}; delay {delay*1000}; b0; wait 0'
# ***** CONNECT ***** comm = boardcom.BoardComm() # create an instance of class BoardComm connectedPort = comm.find_and_connect(echo=1) config = du.get_config(comm) print(config) partNumber = du.get_part_number(comm) print(partNumber) # ADD YOUR CODE HERE # comm.send('b 0 100') # print(comm.response()) # erase_time = du.block_erase(comm, block_size=64, start_addr=0x10000, echo=0) # print(f'Erase time: {erase_time}') t_wait = du.pattern_program(comm, start_addr=0x10025, length=0x100, increment=1, echo=1) print(t_wait) du.read(comm, start_addr=0x10000, length=0x200, dispmode='w', echo=0) # ***** DISCONNECT ***** comm.disconnect(connectedPort, echo=1)
def program(self): self.get_states() print('startAddr: %x, dataLen: %x, pattn: %s, incr: %s' % (startAddr, dataLen, pattn, incr)) du.pattern_program(self.comm, startAddr, dataLen, pattn, incr) print('programming done.')