import jlinkarm as jl def loaddll(dll_path): jl.loadJLinkARMdll(dll_path) jl.open() if jl.is_connected == 0: raise RuntimeError('Jlink not connected') jl.exec_command('device Cortex-M3', 0, 0) jl.exec_command('endian little', 0, 0) jl.tif_select(1) jl.set_speed(1000) jl.clear_RESET() jl.clear_TRST() time.sleep(0.01) jl.set_RESET() jl.set_TRST() jl.reset() jl.halt() jl.set_speed(3500) def ram_all(binfile, image1=True, image2=True): bin = None with file(binfile, 'rb') as f: bin = f.read() get_dword = lambda address: struct.unpack('