JlinkStream

This allows for transferring binary data between a Python script and a JLink-enabled embedded device via the debug interface

See the source code on Github: yzlite/utils/jlink_stream

Properties

default_options

Default configuration options

is_connected

Return if the device is connected

Methods

__init__

close

Close a device data stream

connect

Open a connection to an embedded device via J-Link

disconnect

Close the connection to the embedded device

open

Open a data stream to the embedded device

process

Process the device data streams

read

Read data from a data stream opened for reading

write

Write data to a data stream opened from writing

Parameters:

options (Optional[JlinkStreamOptions]) –

Default configuration options

Return type:

JlinkStreamOptions

Return if the device is connected

Return type:

bool

Open a connection to an embedded device via J-Link

NOTE: The embedded device must be actively running the JLink library

Close the connection to the embedded device

Open a data stream to the embedded device

Return type:

JLinkDataStream

Parameters:

name (str) –

Close a device data stream

Parameters:

name (str) –

Read data from a data stream opened for reading

Return type:

bytes

Parameters:
  • name (str) –

  • max_size (Optional[int]) –

  • timeout (Optional[float]) –

Write data to a data stream opened from writing

Return type:

int

Parameters:
  • name (str) –

  • data (bytes) –

  • timeout (Optional[float]) –

Process the device data streams

This is periodically called in a separated thread if ‘threaded=True’ in the connect() API. Otherwise, this should be periodically called.