def init(dev): i = dev.get_active_configuration()[(0,1)] i.set_altsetting() interface = pyocd_interface(i) board = Board('samd', 'samd', interface) board.init() return board
def get_lipicano_board(): lipicans = INTERFACE[usb_backend].getAllConnectedInterface(LIPICANO_VID, LIPICANO_PID) if ((lipicans == None) or (len(lipicans) == 0)) : print("No Lipicano found, sorry ...") return None lipicano = lipicans[0] print("\nLipicano found: %s, %s, VID/PID: %04X/%04X\n" % ( lipicano.vendor_name, lipicano.product_name, LIPICANO_VID, LIPICANO_PID)) board = Board(target = QRY_TARGET, flash = QRY_FLASH, interface = lipicano, transport = QRY_TRANSPORT, frequency = QRY_FREQ) board.init() target = board.target print_target_info(target) part_id = print_target_ids(target) if (part_id not in MODULES): print("Unsupported module found, sorry ...") return None module = MODULES[part_id] print("\nLipicano module found: %s\n" % (module.name)) return LipicanoBoard(lipicano, module)
while stepit : print("") reg_vals = print_regs(target) instr_code = target.read16(reg_vals[15]) print("Next instr: %04X" % (instr_code)) if (instr_code == 0xBE00): print("Breakpoint reached") stepit = False else: c = raw_input("Step? [y/n]") if c.upper() == 'N': print("User break") stepit = False else: target.step() if __name__ == '__main__': lipicano = get_lipicano() board = Board(target = "cortex_m", flash = "cortex_m", interface = lipicano, transport = "cmsis_dap", frequency = FREQ) board.init() target = board.target print_target_info(target) print_target_ids(target) # print_regs(target) # step_simple_code(target)