def __call__(self): try: if self.target.is_connected: self.target.execute('sync') except TargetError: pass with open_serial_connection(port=self.port, baudrate=self.baudrate, timeout=self.timeout, init_dtr=0, get_conn=True) as (_, conn): pulse_dtr(conn, state=True, duration=0.1) # TRM specifies a pulse of >=100ms