示例#1
0
 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
示例#2
0
 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
示例#3
0
 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
示例#4
0
 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
示例#5
0
 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
示例#6
0
 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
示例#7
0
 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
示例#8
0
 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
示例#9
0
文件: cmsis_dap.py 项目: ECNU3D/pyOCD
 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