pynrfjprog v10.x.x


This section shows some simple examples of a typical pynrfjprog use case.

To initialize the API module to work with nRF52 Series SoCs, establish a connection to a SEGGER debug emulator, erase all user flash of the nRF52 SoC, and finally disconnect the emulator and close the connection, type the following commands in a Python interpreter:

from pynrfjprog import HighLevel
api = HighLevel.API(‘NRF52’)

The API object includes enter and exit methods so the with construct can be used. When using with, then open() and close() are called automatically.

Pynrfjprog also allows you to work with multiple devices at once. To do this, type the following:

from pynrfjprog import MultiAPI
api = MultiAPI.MultiAPI(‘NRF52’)

api2 = MultiAPI.MultiAPI(‘NRF51’)


The two MultiAPI modules are initialized to work with different nRF families. Their APIs are initialized through .open(), and closed without calling any of the API functions.

Other examples on how to use pynrfjprog can be found in the examples module provided with the package. The examples can be found in the installed pynrfjprog directory/examples folder. These examples can be run either from within the folder, for example calling python, or they can be run from an interpreter by importing the examples module >>> import examples, and calling >>>