def unlock_kinetis_read_until_ack(jlink, address):
    """Polls the device until the request is acknowledged.

    Sends a read request to the connected device to read the register at the
    given 'address'.  Polls indefinitely until either the request is ACK'd or
    the request ends in a fault.

    Args:
      jlink (JLink): the connected J-Link
      address (int) the address of the register to poll

    Returns:
      ``SWDResponse`` object on success.

    Raises:
      KinetisException: when read exits with non-ack or non-wait status.

    Note:
      This function is required in order to avoid reading corrupt or otherwise
      invalid data from registers when communicating over SWD.
    """
    request = swd.ReadRequest(address, ap=True)
    response = None
    while True:
        response = request.send(jlink)
        if response.ack():
            break
        elif response.wait():
            continue
        raise KinetisException('Read exited with status: %s', response.status)

    return response
Polls the device until the request is acknowledged.

    Sends a read request to the connected device to read the register at the
    given 'address'.  Polls indefinitely until either the request is ACK'd or
    the request ends in a fault.

    Args:
      jlink (JLink): the connected J-Link
      address (int) the address of the register to poll

    Returns:
      ``SWDResponse`` object on success.

    Raises:
      KinetisException: when read exits with non-ack or non-wait status.

    Note:
      This function is required in order to avoid reading corrupt or otherwise
      invalid data from registers when communicating over SWD.