def writeBlock32(self, addr, data): # put address in TAR self.writeAP(AP_REG['CSW'], CSW_VALUE | CSW_SIZE32) self.writeAP(AP_REG['TAR'], addr) dapTransferBlock(self.interface, len(data), WRITE | AP_ACC | AP_REG['DRW'], data) return
def writeBlock32(self, addr, data): # put address in TAR self.writeAP(AP_REG['CSW'], CSW_VALUE | CSW_SIZE32) self.writeAP(AP_REG['TAR'], addr) try: dapTransferBlock(self.interface, len(data), WRITE | AP_ACC | AP_REG['DRW'], data) except TransferError: self.clearStickyErr() raise return
def writeBlock32(self, addr, data): # put address in TAR self.writeAP(AP_REG['CSW'], CSW_VALUE | CSW_SIZE32) self.writeAP(AP_REG['TAR'], addr) try: dapTransferBlock(self.interface, len(data), WRITE | AP_ACC | AP_REG['DRW'], data) except TransferError: # Clear STICKYERR flag self.writeDP(0x0, (1 << 2)) raise return
def readBlock32(self, addr, size): # put address in TAR self.writeAP(AP_REG["CSW"], CSW_VALUE | CSW_SIZE32) self.writeAP(AP_REG["TAR"], addr) data = [] resp = dapTransferBlock(self.interface, size, READ | AP_ACC | AP_REG["DRW"]) for i in range(len(resp) / 4): data.append( (resp[i * 4 + 0] << 0) | (resp[i * 4 + 1] << 8) | (resp[i * 4 + 2] << 16) | (resp[i * 4 + 3] << 24) ) return data
def readBlock32(self, addr, size): # put address in TAR self.writeAP(AP_REG['CSW'], CSW_VALUE | CSW_SIZE32) self.writeAP(AP_REG['TAR'], addr) data = [] resp = dapTransferBlock(self.interface, size, READ | AP_ACC | AP_REG['DRW']) for i in range(len(resp)/4): data.append( (resp[i*4 + 0] << 0) | \ (resp[i*4 + 1] << 8) | \ (resp[i*4 + 2] << 16) | \ (resp[i*4 + 3] << 24)) return data
def readBlock32(self, addr, size): # put address in TAR self.writeAP(AP_REG['CSW'], CSW_VALUE | CSW_SIZE32) self.writeAP(AP_REG['TAR'], addr) data = [] try: resp = dapTransferBlock(self.interface, size, READ | AP_ACC | AP_REG['DRW']) except TransferError: self.clearStickyErr() raise for i in range(len(resp)/4): data.append( (resp[i*4 + 0] << 0) | \ (resp[i*4 + 1] << 8) | \ (resp[i*4 + 2] << 16) | \ (resp[i*4 + 3] << 24)) return data
def readBlock32(self, addr, size): # put address in TAR self.writeAP(AP_REG['CSW'], CSW_VALUE | CSW_SIZE32) self.writeAP(AP_REG['TAR'], addr) data = [] try: resp = dapTransferBlock(self.interface, size, READ | AP_ACC | AP_REG['DRW']) except TransferError: # Clear STICKYERR flag self.writeDP(0x0, (1 << 2)) raise for i in range(len(resp) / 4): data.append( (resp[i*4 + 0] << 0) | \ (resp[i*4 + 1] << 8) | \ (resp[i*4 + 2] << 16) | \ (resp[i*4 + 3] << 24)) return data