Code Monkey home page Code Monkey logo

pynrfjprog's Introduction

PyPI PyPI PyPI PyPI

pynrfjprog

Python wrapper around the nrfjprog dynamic link libraries (DLL). Use of this API allows developers to program/debug nRF SOC and SIP devices from the interpreter, write simple scripts for a more efficient development work flow, or write automated test frameworks. It can also be used to create applications in Python (i.e. command-line tools).

Use-cases

Dependencies

"""
Detailed below is how our software is stacked. Each layer depends on the layer below.
"""
pynrfjprog  # Imports and wraps the nrfjprog DLL in Python.
nrfjprogdll # A DLL that wraps SEGGER's JLink API for nRF5 devices.
JLinkARMDLL # A DLL provided by SEGGER that works with SEGGER debuggers. Performs all low level operations with target device.
  • J-Link Software and Documentation Pack will install the JLink libraries pynrfjprog depends on in the correct installation directory.
  • The nrfjprog libraries are installed with pynrfjprog and are included in pynrfjprog/OPERATING_SYSTEM/.

Structure

pynrfjprog
  ├── pynrfjprog
  │     ├──__init__.py    # Package marker to make pynrfjprog a module. Also defines the version number
  │     ├── API.py        # Legacy name of LowLevel.py. It's kept for backward support
  │     ├── APIError.py   # Wrapper for the error return codes of the DLL
  │     ├── Hex.py        # Hex parsing library
  │     ├── HighLevel.py  # Wrapper for the nrfjprog highlevel DLL
  │     ├── JLink.py      # Finds the JLinkARM DLL required by pynrfjprog
  │     ├── LowLevel.py   # Wrapper for the nrfjprog DLL, previously API.py
  │     ├── MultiAPI.py   # Allow multiple devices (up to 128) to be programmed simultaneously with a LowLevel API
  │     ├── lib_armhf
  │     │   └── # armhf nrfjprog libraries
  │     ├── lib_x64
  │     │   └── # 64-bit nrfjprog libraries
  │     ├── lib_x86
  │     │   └── # 32-bit nrfjprog libraries
  │     ├── docs
  │     │   └── # Header files of the nrfjprog DLL to provide in-depth documentation of the functions that are wrapped
  │     └── examples
  │         └── # Example scripts to show off the different APIs
  ├── LICENSE
  ├── README.md
  ├── requirements.txt
  └── pyproject.toml
  
  
    

Getting started

To install the latest release from PyPI:

pip install pynrfjprog

To install from source:

python -m pip install path_to_unzipped_pynrfjprog

Open the Python interpreter and connect nRF device to PC:

from pynrfjprog import LowLevel

with LowLevel.API('NRF52') as api:
    api.enum_emu_snr()
    api.connect_to_emu_without_snr()
    api.erase_all()
    api.write_u32(ADDRESS, DATA, IS_FLASH)
    api.disconnect_from_emu()

To work with multiple nRF devices at once:

import LowLevel

api = LowLevel.API('NRF52')
api.open()

api2 = LowLevel.API('NRF52')
api2.open()

api3 = LowLevel.API('NRF51')
api3.open()

api.close()
api2.close()
api3.close()

To program hex files using the HighLevel API:

from pynrfjprog import HighLevel

with HighLevel.API() as api:
    snrs = api.get_connected_probes()

    # To program J-Link probe at snr <snr>:
    with HighLevel.DebugProbe(api, <snr>) as probe:
        probe.program(<hex_file>)

    # To program MCUBoot target at serial port <serial>:
    with HighLevel.MCUBootDFUProbe(api, <serial>) as probe:
        probe.program(<hex_file>)

    # To update LTE modem connected to J-Link probe at snr <snr>:
    with HighLevel.IPCDFUProbe(api, <snr>, HighLevel.CoProcessor.CP_MODEM) as probe:
        probe.program(<zip_file>, HighLevel.ProgramOptions(verify = HighLevel.VerifyAction.VERIFY_HASH))

Note: Only one HighLevel API can be instantiated and opened at a time. Several HighLevel probes can be opened from the same API at the same time.

Contributing

Contributing is encouraged along with the following coding standards.

pynrfjprog's People

Contributors

akabraham avatar amarkevich avatar david-garcia-polo avatar epac-tom avatar mjdietzx avatar optdcw avatar python-journeyman avatar renovate-bot avatar simtind avatar skogseth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pynrfjprog's Issues

Issue installing pynrfjprog version 10.22.0 or 10.23.0. - Project name unknoown.

When trying to install version 10.22.0 or 10.23.0 with pip, i get the error

WARNING: Generating metadata for package pynrfjprog produced metadata for project name unknown. Fix your #egg=pynrfjprog fragments.
Discarding https://files.pythonhosted.org/packages/70/84/361f495b74018c3736ffc9d805030544e9312e74546dc8f79cbc5339feb9/pynrfjprog-10.22.0.tar.gz#sha256=b3dad4d3d35e16ca482efca87e9f8dd3e757c78b48aa999595013eb38610f11f (from https://pypi.org/simple/pynrfjprog/) (requires-python:>=3.7):
    Requested unknown from https://files.pythonhosted.org/packages/70/84/361f495b74018c3736ffc9d805030544e9312e74546dc8f79cbc5339feb9/pynrfjprog-10.22.0.tar.gz#sha256=b3dad4d3d35e16ca482efca87e9f8dd3e757c78b48aa999595013eb38610f11f has inconsistent name:
        filename has 'pynrfjprog', but metadata has 'unknown'

pip v22.02
python v3.10.12
OS Ubuntu 22.04

MultiAPI leaks threads

When using the MutliAPI, the close() doesn't clean up all threads.

Using the test code:

from pynrfjprog.MultiAPI import MultiAPI as API

import threading

for i in range(1000):
    print ""
    print "Iteration %d" % (i,)
    api = API('NRF52')
    api.open()
    api.close()
    api = None

    print "%d threads active" % (len(threading.enumerate()),)

Results in:


Iteration 0
2 threads active

Iteration 1
3 threads active

Iteration 2
4 threads active

Iteration 3
5 threads active

Iteration 4
6 threads active

Iteration 5
7 threads active

Iteration 6
8 threads active

Iteration 7
9 threads active

Iteration 8
10 threads active

Iteration 9
11 threads active

Iteration 10
12 threads active

Iteration 11
13 threads active

Iteration 12
14 threads active

Iteration 13
15 threads active

Iteration 14
16 threads active

Iteration 15
17 threads active

Iteration 16
18 threads active

Iteration 17
19 threads active

Iteration 18
20 threads active

Iteration 19
21 threads active

Iteration 20
22 threads active

Iteration 21
23 threads active

Iteration 22
24 threads active

Iteration 23
25 threads active

Iteration 24
26 threads active

Iteration 25
Traceback (most recent call last):
  File "testpynrfjprog.py", line 8, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pynrfjprog/MultiAPI.py", line 61, in __init__
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py", line 218, in Queue
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/queues.py", line 68, in __init__
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/synchronize.py", line 147, in __init__
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/synchronize.py", line 75, in __init__
OSError: [Errno 24] Too many open files
Exception AttributeError: AttributeError() in <bound method MultiAPI.__del__ of <pynrfjprog.MultiAPI.MultiAPI object at 0x103c5f850>> ignored

threading.enumerate() returns an increasing list of instances like: <Thread(QueueFeederThread, started daemon 123145431425024)>

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

pip_requirements
requirements.txt
setup-cfg
setup.cfg

  • Check this box to trigger a request for Renovate to run again on this repository

program modem firmware: reset always

pynrfjprog 10.12.0

I want to perform device provisioning in multiple steps. During Probe.program pass HighLevel.ResetAction.RESET_NONE but its ignored in case program modem firmware:

with HighLevel.API() as api:
    snr = api.get_connected_probes()[0]
    print("snr: " + str(snr))

    # To update LTE modem connected to J-Link probe at snr <snr>:
    with HighLevel.IPCDFUProbe(api, snr, HighLevel.CoProcessor.CP_MODEM) as probe:
        probe.program(modem_fw,
            HighLevel.ProgramOptions(
                verify = HighLevel.VerifyAction.VERIFY_HASH,
                reset = HighLevel.ResetAction.RESET_NONE
            )
        )
    # -> !!! RESET !!! <-
    # To program J-Link probe at snr <snr>:
    with HighLevel.DebugProbe(api, snr) as probe:
        probe.program(board_fw,
            HighLevel.ProgramOptions(
                verify = HighLevel.VerifyAction.VERIFY_READ,
                reset = HighLevel.ResetAction.RESET_NONE,
                erase_action = HighLevel.EraseAction.ERASE_SECTOR
            )
        )

`with LowLevel.API("NRF91") as api` fails with internal error -254

Following the installation guide and installing the required JLink dlls, opening the api fails with the following error:

Traceback (most recent call last):
  File "./main.py", line 6, in <module>
    with LowLevel.API("NRF91") as api:
  File "/usr/local/lib/python3.8/dist-packages/pynrfjprog-10.14.0-py3.8.egg/pynrfjprog/LowLevel.py", line 1723, in __enter__
    self.open()
  File "/usr/local/lib/python3.8/dist-packages/pynrfjprog-10.14.0-py3.8.egg/pynrfjprog/LowLevel.py", line 177, in open
    raise APIError(result, error_data=self.get_errors())
pynrfjprog.APIError.APIError: An error was reported by NRFJPROG DLL: -254 INTERNAL_ERROR.

Same error occurs installing from the pip3 package and building from source.

System: Linux 5.11.0-41-generic, Ubuntu 20.04.2 LTS

python setup.py install error

While on OSX, run setup.py with python 2.7.10 or python 3.6.2 failed with below message
Does anything missed?

File "setup.py", line 19
    version = 0.0.1,
                  ^
SyntaxError: invalid syntax

NRFJPROG lib cannot find not erased error: "ERROR: The area to write is not erased."

on OSX
NRFJPROG lib won't pass "area is not erased error",

$ ./nrfjprog -f nrf52 --memwr 0x1000108c --val 0x12345678
Parsing parameters.
ERROR: The area to write is not erased.
def write(self, addr, data, control):
.......
    result = self._lib.NRFJPROG_write(addr, ctypes.byref(data), data_len, control)
    if result != NrfjprogdllErr.SUCCESS:
            raise APIError(result)

Install path is changed from v6.00

According to "Update notification: J-Link / Flasher" of v6.00

  • Software package (OS X): J-Link software is now installed to Applications/SEGGER/JLink_Vxyyz/.
    Previous versions were installed to Applications/SEGGER/JLink/ which is now a symlink that is updated on installation to point to the latest installed version
  • Software package (Linux): J-Link software is now installed to /opt/SEGGER/JLink_Vxyyz/.
    Previous versions were installed to /opt/SEGGER/JLink/ which is now a symlink that is updated on installation to point to the latest installed version.

So we need to change how to set _DEFAULT_SEGGER_ROOT_PATH.
the releated lines

When setting DEBUG, each debug str is printed twice

[NRFJPROG DLL LOG]: FUNCTION: rtt_read.
[NRFJPROG DLL LOG]: FUNCTION: rtt_read.

[NRFJPROG DLL LOG]: FUNCTION: rtt_stop.
[NRFJPROG DLL LOG]: FUNCTION: rtt_stop.
[NRFJPROG DLL LOG]: FUNCTION: disconnect_from_emu.
[NRFJPROG DLL LOG]: FUNCTION: disconnect_from_emu.
~~~    Disconnected from 680406895
[NRFJPROG DLL LOG]: FUNCTION: rtt_stop.
[NRFJPROG DLL LOG]: FUNCTION: rtt_stop.
[NRFJPROG DLL LOG]: FUNCTION: disconnect_from_emu.
[NRFJPROG DLL LOG]: FUNCTION: disconnect_from_emu.
[NRFJPROG DLL LOG]: FUNCTION: close_dll.
[NRFJPROG DLL LOG]: FUNCTION: close_dll.
end
[NRFJPROG DLL LOG]: FUNCTION: close_dll.
[NRFJPROG DLL LOG]: FUNCTION: close_dll.
end

There is a memory leak in the window system.

In the demo below, when multiple threads are started, the program becomes very unstable. It will crash. After the program crashes and restarts, the memory will increase after a burn operation is completed, and there is a memory leak.
Operating environment:
python3.8.3
window7/10

No exception handling:

import threading
from pynrfjprog import HighLevel
import time

class myThread (threading.Thread):
   def __init__(self, threadID, name, counter):
      threading.Thread.__init__(self)
      self.threadID = threadID
      self.name = name
      self.counter = counter
   def run(self):
      print ("Starting " + self.name)
      update_fw(self.name)
      program_app(self.name)
      print ("Exiting " + self.name)

def update_fw(snr):
    print("updating FW in {}".format(snr))
    probe = HighLevel.IPCDFUProbe(api, int(snr), HighLevel.CoProcessor.CP_MODEM)
    print("{} probe initialized". format(snr))
    probe.program("mfw_nrf9160_1.2.2.zip")
    print("{} programmed".format(snr))
    probe.verify("mfw_nrf9160_1.2.2.zip")
    print("{} Modem verified".format(snr))


def program_app(snr):
    app_probe = HighLevel.DebugProbe(api, int(snr) )

    program_options = HighLevel.ProgramOptions(
        erase_action=HighLevel.EraseAction.ERASE_ALL,
        reset = HighLevel.ResetAction.RESET_SYSTEM,
        verify = HighLevel.VerifyAction.VERIFY_READ
    )
    app_probe.program( "merged.hex" , program_options=program_options )
    
    app_probe.verify( "merged.hex" , HighLevel.VerifyAction.VERIFY_READ )
    print("{} Application verified".format(snr))

    app_probe.reset()

# Create new threads
while True:
    api = HighLevel.API()
    api.open()
    devices = api.get_connected_probes()
    threads = list()
    print(devices)
    for idx, device in enumerate(devices):
        threads.append(myThread(idx, device, idx))

    # Start new Threads
    for thread in threads:
        thread.start()

    print("waiting for all threads to complete")
    #wait for threads to finish
    for t in threads:
        t.join()

    api.close()
    time.sleep(5)    
print("Exiting Main Thread")

With exception handling:

import threading
import time
from pynrfjprog import HighLevel

thread_pool = []
lock = threading.Lock()

#Burn the thread
class operationThread (threading.Thread):
    def __init__(self, d_name, modem_file, app_file, burn_modem, burn_app):
        threading.Thread.__init__(self)
        self.d_name = d_name
        self.modem_file = modem_file
        self.app_file = app_file
        self.burn_modem = burn_modem
        self.burn_app = burn_app
    def run(self):
        err = 0
        if self.burn_modem:
            print(self.d_name,':Writing modem FW')
            err = update_fw(self.d_name, self.modem_file)
            if err:
                return
            print(self.d_name,':Successfully write modem FW')
        if self.burn_app:
            print(self.d_name,':Writing app FW')
            err = program_app(self.d_name, self.app_file)
            if err:
                return
            print(self.d_name,':Successfully write app FW')

def update_fw(snr, m_file):
    try:
        with HighLevel.IPCDFUProbe(api, int(snr), HighLevel.CoProcessor.CP_MODEM) as probe:
            try:
                probe.program(m_file)
            except Exception:
                print(snr,": Wrinting modem FW error!")
                return -1
            try:
                probe.verify(m_file)
            except Exception:
                print(snr,":Modem FW verification error")
                return -1
            return 0
    except Exception:
        print(snr,":Jlink initialization failed!")
        return -1

def program_app(snr, a_file):
    try:
        with HighLevel.DebugProbe(api, int(snr)) as app_probe:
            program_options = HighLevel.ProgramOptions(
                erase_action=HighLevel.EraseAction.ERASE_ALL,
                reset = HighLevel.ResetAction.RESET_SYSTEM,
                verify = HighLevel.VerifyAction.VERIFY_READ
            )
            
            try:
                app_probe.program(a_file, program_options=program_options)
            except Exception: 
                print(snr,":Writing app FW error!")
                return -1


            try:
                app_probe.verify(a_file, HighLevel.VerifyAction.VERIFY_READ)
            except Exception:
                print(snr,":Application firmware verification error")      
                return -1        
            try:
                app_probe.reset()
            except Exception:
                return -1
            return 0
    except Exception:
        print(snr,":Jlink initialization failed!")
        return -1

if __name__ == '__main__':
    m_file ='./mfw_nrf9160_1.2.2.zip'
    a_file ='./merged.hex'
    while True:
        print(time.asctime(time.localtime(time.time()))) 
        time.sleep(5)
        with HighLevel.API() as api:
            # api.open()
            devices = api.get_connected_probes()
            for i in range(len(devices)):
                a = operationThread(devices[i], m_file, a_file, True, True)
                a.setDaemon(True)
                a.start()
                thread_pool.append(a)
            for t in thread_pool:
                t.join()
            thread_pool = []

Armhf libraries not installed

In v10.14.0, libraries for armhf targets are available but doing
pip install pynrfjprog
or
python setup.py install
doesn't install the armhf libraries on the target automatically. Manually copying the contents of pynrfjprog/lib_armhf to the python libraries folder solves this issue

HighLevel interface cannot erase multiple QSPI sectors

I'm trying to use the DebugProbe.erase() function to erase multiple QSPI sectors. What I'm seeing is only the first sector is erased.

Here is my example code:

#!/usr/bin/env python3

import logging

import pynrfjprog
from pynrfjprog import HighLevel, Parameters


api = pynrfjprog.HighLevel.API()
api.open()


serial_numbers = api.get_connected_probes()

nrfjprog = pynrfjprog.HighLevel.DebugProbe(api, serial_numbers[0], log=True)
nrfjprog.setup_qspi(64 * 1024 * 1024)

address1 = 0x12009000

print("Erasing sector at address {:#x}".format(address1))
nrfjprog.erase(
    erase_action=pynrfjprog.Parameters.EraseAction.ERASE_SECTOR,
    start_address=address1,
    end_address=address1 + 4096,
)

print("Writing word to address {:#x}".format(address1))
nrfjprog.write(address=address1, data=6)

address2 = address1 + (4096 * 2)

print("Erasing sector at address {:#x}".format(address2))
nrfjprog.erase(
    erase_action=pynrfjprog.Parameters.EraseAction.ERASE_SECTOR,
    start_address=address2,
    end_address=address2 + 4096,
)

print("Writing word to address {:#x}".format(address2))
nrfjprog.write(address=address2, data=6)


print("Erasing range with both sectors {:#x}:{:#x}".format(address1, address2 + 4096))
nrfjprog.erase(
    erase_action=pynrfjprog.Parameters.EraseAction.ERASE_SECTOR,
    start_address=address1,
    end_address=address2 + 4096,
)

I write a word to two different flash sectors, and then erase the entire range. Output:

./pynrfjprog_qspi_erase_sectors_test.py
Erasing sector at address 0x12009000
Writing word to address 0x12009000
Erasing sector at address 0x1200b000
Writing word to address 0x1200b000
Erasing range with both sectors 0x12009000:0x1200c000

However, when I read the contents back:

$ nrfjprog --memrd 0x12009000 --w 8 --n 16
0x12009000: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF   |................|
$ nrfjprog --memrd 0x1200b000 --w 8 --n 16
0x1200B000: 06 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF   |................|

Only the first sector is erased.

Is this expected? When I use an address in the onboard nRF52840 flash the multi-sector erase erases all of the sectors.

My Setup

  • MacOS
  • board: nrf52840dk
  • nrfjprog:
    $ nrfjprog --version
    nrfjprog version: 10.17.3 external
    JLinkARM.dll version: 7.80c
    
  • pynrfjprog 10.19.0

lowlevel api sector erase may fail silently

I have been using your low-level API to reflash devices for some time now, but recently found that sector erase + programming can fail if the device is not first reset and halted. Not sure if this is due to an update in pynrfjprog, jlink dll, or even the firmware running at the time of reprogramming.

The code below will raise pynrfjprog.APIError.APIError: An error was reported by NRFJPROG DLL: -102 JLINKARM_DLL_ERROR from program_file method

with pynrfjprog.LowLevel.API() as api:
    api.connect_to_emu_without_snr()
    #api.sys_reset()
    #api.halt()
    api.erase_file(img_path, pynrfjprog.LowLevel.EraseAction.ERASE_SECTOR)
    #api.sys_reset()
    #api.halt()
    api.program_file(img_path)
    api.disconnect_from_emu()

Uncommenting only the first set of sys_reset and halt commands will fix the issue and result in successful reflashing.

Uncommenting only the second set of sys_reset and halt commands will cause the reflashing to fail silently.

I assume this is due to failure to sector erase before programming, however I was not expecting the failure to be silent.

Post-reflashing verification with an api.verify_file(img_path) does of course catch the issue.

*pynrfjprog version 10.19.0
*jlink dll version V7.84a

error "\\\\"in win10 20H2

The following error occurred with this script in the windows system:

Windows 10
20H2
‎2020/‎11/‎16
19042.630

C:\Users\Peter\Desktop\modem>python update.py mfw_nrf9160_1.2.0.zip
INFO:modem_update:Modem firmware upgrade
ERROR:pynrfjprog.HighLevel:b'An error was reported by NRFJPROG DLL: -151 NRFJPROG_SUB_DLL_COULD_NOT_BE_OPENED. Got error FileNotFoundError("Could not find module 'C:\\Program Files\\Python38\\lib\\site-packages\\pynrfjprog\\lib_x64\\highlevelnrfjprog.dll'. Try using the full path with constructor syntax.") for library at C:\Program Files\Python38\lib\site-packages\pynrfjprog\lib_x64\highlevelnrfjprog.dll'
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\site-packages\pynrfjprog\HighLevel.py", line 77, in init
self.lib = ctypes.cdll.LoadLibrary(highlevel_nrfjprog_dll_path)
File "C:\Program Files\Python38\lib\ctypes_init_.py", line 451, in LoadLibrary
return self.dlltype(name)
File "C:\Program Files\Python38\lib\ctypes_init
.py", line 373, in init
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Program Files\Python38\lib\site-packages\pynrfjprog\lib_x64\highlevelnrfjprog.dll'. Try using the full path with constructor syntax.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "update.py", line 45, in
main()
File "update.py", line 42, in main
flash_modem_pkg(args.modem_pkg,True)
File "update.py", line 21, in flash_modem_pkg
with HighLevel.API(True) as api:
File "C:\Program Files\Python38\lib\site-packages\pynrfjprog\HighLevel.py", line 79, in init
raise APIError(NrfjprogdllErr.NRFJPROG_SUB_DLL_COULD_NOT_BE_OPENED, 'Got error {} for library at {}'.format(repr(ex), highlevel_nrfjprog_dll_path), log=self._logger.error)
pynrfjprog.APIError.APIError: An error was reported by NRFJPROG DLL: -151 NRFJPROG_SUB_DLL_COULD_NOT_BE_OPENED. Got error FileNotFoundError("Could not find module 'C:\Program Files\Python38\lib\site-packages\pynrfjprog\lib_x64\highlevelnrfjprog.dll'. Try using the full path with constructor syntax.") for library at C:\Program Files\Python38\lib\site-packages\pynrfjprog\lib_x64\highlevelnrfjprog.dll

C:\Users\Peter\Desktop\modem>pause

0
1

macOS ARM libraries missing and x64 throw an error on ARM

Hi,

I recently tested the tool on macOS with an M1 ARM chip.
It defaults back to x64, which throws an error:

with LowLevel.API(
File "/private/var/folders/dw/679j8kp90psgk8pxq06vmnzc0000gp/T/OpenHaystack/venv/lib/python3.8/site-packages/pynrfjprog/LowLevel.py", line 1798, in __enter__
self.open()
File "/private/var/folders/dw/679j8kp90psgk8pxq06vmnzc0000gp/T/OpenHaystack/venv/lib/python3.8/site-packages/pynrfjprog/LowLevel.py", line 177, in open
raise APIError(result, error_data=self.get_errors())
pynrfjprog.APIError.APIError: An error was reported by NRFJPROG DLL: -254 INTERNAL_ERROR.

Since the error occurs in the NRFJPROG DLL I cannot really find out where it occurs. I guess that a recompile for ARM64 with the libraries could solve the issue.

Program crash

I started ten threads, burned ten jlinks, and repeatedly tested them.

if __name__ == '__main__':
    m_file = './mfw_nrf9160_1.2.2.zip'
    a_file = './merged.hex'
    with HighLevel.API() as api:
        devices = api.get_connected_probes()
        while True:
            thread_pool = []
            for i in range(len(devices)):
                a = operationThread(devices[i], m_file, a_file, True, True)
                a.setDaemon(True)
                a.start()
                thread_pool.append(a)
            for t in thread_pool:
                t.join()
            time.sleep(5)

in operationThread:

    def run(self):
        if self.burn_modem:
            lock.acquire()
            try:
                modem_probe = HighLevel.IPCDFUProbe(api, int(self.d_name), HighLevel.CoProcessor.CP_MODEM)
            except:
                print(self.d_name, ":init modem_Jlink error")
                return
            finally:
                lock.release()
            try:
                print(self.d_name, ':Burning modem firmware ')
                err = update_fw(self.d_name, self.modem_file, modem_probe)
                if err:
                    return
                print(self.d_name, ':Burning modem firmware completed ')
                modem_probe.close()
            except:
                print(self.d_name, ":Burning modem firmware error ")
                return

        if self.burn_app:
            lock.acquire()
            try:
                app_probe = HighLevel.DebugProbe(api, int(self.d_name))
            except:
                print(self.d_name, ":init app_Jlink error")
                return
            finally:
                lock.release()
            try:
                print(self.d_name, ':Burning app firmware')
                err = program_app(self.d_name, self.app_file, app_probe)
                if err:
                    return
                print(self.d_name, ':Burning app firmware completed')
                app_probe.close()
            except:
                print(self.d_name, ":Burning app firmware error ")

After a period of time, the program would crash. There was only one log in PyCharm:
process finished with exit code 134 (interrupted by signal 6: sigabrt)

But Mac will pop up a dialog, part of which is shown as follows

Process:               Python [74270]
Path:                  /usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
Identifier:            Python
Version:               3.7.4 (3.7.4)
Code Type:             X86-64 (Native)
Parent Process:        pycharm [57298]
Responsible:           pycharm [57298]
User ID:               501

Date/Time:             2020-12-31 11:47:45.374 +0800
OS Version:            macOS 11.0.1 (20B29)
Report Version:        12
Anonymous UUID:        F911E537-4603-F972-966E-023BD9E059BD

Sleep/Wake UUID:       EC69EBF0-BFC7-4F64-91AB-E803D5EB5AD2

Time Awake Since Boot: 320000 seconds
Time Since Wake:       8600 seconds

System Integrity Protection: disabled

Crashed Thread:        6

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
dyld: in dlopen()
abort() called

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fff203098e2 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff2033be6f _pthread_cond_wait + 1254
2   org.python.python             	0x00000001064f11ec PyThread_acquire_lock_timed + 401
3   org.python.python             	0x0000000106529b3e acquire_timed + 104
4   org.python.python             	0x000000010652990a lock_PyThread_acquire_lock + 44
5   org.python.python             	0x000000010642e560 _PyMethodDef_RawFastCallKeywords + 544
6   org.python.python             	0x0000000106432dd1 _PyMethodDescr_FastCallKeywords + 81
7   org.python.python             	0x00000001064c2f27 call_function + 801
8   org.python.python             	0x00000001064bbc57 _PyEval_EvalFrameDefault + 6396
9   org.python.python             	0x00000001064c37a6 _PyEval_EvalCodeWithName + 1870
10  org.python.python             	0x000000010642da77 _PyFunction_FastCallKeywords + 225
11  org.python.python             	0x00000001064c2ef7 call_function + 753
12  org.python.python             	0x00000001064bbc57 _PyEval_EvalFrameDefault + 6396
13  org.python.python             	0x00000001064c37a6 _PyEval_EvalCodeWithName + 1870
14  org.python.python             	0x000000010642da77 _PyFunction_FastCallKeywords + 225
15  org.python.python             	0x00000001064c2ef7 call_function + 753
16  org.python.python             	0x00000001064bbc57 _PyEval_EvalFrameDefault + 6396
17  org.python.python             	0x00000001064c37a6 _PyEval_EvalCodeWithName + 1870
18  org.python.python             	0x00000001064ba2b8 PyEval_EvalCode + 51
19  org.python.python             	0x00000001064e894b run_mod + 54
20  org.python.python             	0x00000001064e7975 PyRun_FileExFlags + 163
21  org.python.python             	0x00000001064e701b PyRun_SimpleFileExFlags + 263
22  org.python.python             	0x00000001064ff89e pymain_main + 5389
23  org.python.python             	0x00000001064fff80 _Py_UnixMain + 56
24  libdyld.dylib                 	0x00007fff20356631 start + 1

Thread 1:
0   libsystem_kernel.dylib        	0x00007fff20306e7e mach_msg_trap + 10
1   libsystem_kernel.dylib        	0x00007fff203071f0 mach_msg + 60
2   com.apple.CoreFoundation      	0x00007fff20433be7 __CFRunLoopServiceMachPort + 316
3   com.apple.CoreFoundation      	0x00007fff204322ba __CFRunLoopRun + 1315
4   com.apple.CoreFoundation      	0x00007fff204316be CFRunLoopRunSpecific + 563
5   com.apple.CoreFoundation      	0x00007fff204b7cc9 CFRunLoopRun + 40
6   libhighlevelnrfjprog.dylib    	0x0000000106bb815a NRFDL::Apple::AppleHotplugWorker::threadFunction() + 74
7   libhighlevelnrfjprog.dylib    	0x0000000106bb937e void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (NRFDL::Apple::AppleHotplugWorker::*)(), NRFDL::Apple::AppleHotplugWorker*> >(void*) + 62
8   libsystem_pthread.dylib       	0x00007fff2033b950 _pthread_start + 224
9   libsystem_pthread.dylib       	0x00007fff2033747b thread_start + 15

Thread 2:
0   libsystem_pthread.dylib       	0x00007fff20337458 start_wqthread + 0

Thread 3:
0   libsystem_kernel.dylib        	0x00007fff20306e7e mach_msg_trap + 10
1   libsystem_kernel.dylib        	0x00007fff203071f0 mach_msg + 60
2   com.apple.framework.IOKit     	0x00007fff22b08b88 io_connect_method + 383
3   com.apple.framework.IOKit     	0x00007fff22b089d9 IOConnectCallMethod + 244
4   com.apple.iokit.IOUSBLib      	0x0000000106d0026f IOUSBInterfaceClass::ReadPipe(unsigned char, void*, unsigned int*, unsigned int, unsigned int) + 189
5   libjlinkarm.6.80.4.dylib      	0x00000001290af805 0x128e8a000 + 2250757
6   libjlinkarm.6.80.4.dylib      	0x00000001290af051 0x128e8a000 + 2248785
7   libjlinkarm.6.80.4.dylib      	0x0000000128fe49b7 0x128e8a000 + 1419703
8   libjlinkarm.6.80.4.dylib      	0x0000000128f79dea 0x128e8a000 + 982506
9   libjlinkarm.6.80.4.dylib      	0x0000000128ec1fe7 0x128e8a000 + 229351
10  libjlinkarm.6.80.4.dylib      	0x0000000128f99947 JLINKARM_CORESIGHT_ReadAPDPReg + 103
11  libjlinkarm_nrf91_nrfjprogdll.dylib	0x00000001289d080b SeggerBackend::just_read_debug_port_register(unsigned char, unsigned int*) + 139
12  libjlinkarm_nrf91_nrfjprogdll.dylib	0x00000001289d071d SeggerBackend::just_is_debug_region_powered(bool&) + 157
13  libjlinkarm_nrf91_nrfjprogdll.dylib	0x00000001289d0b5d SeggerBackend::just_power_debug_region() + 45
14  libjlinkarm_nrf91_nrfjprogdll.dylib	0x00000001289d66e5 SeggerBackend::just_is_connected_to_device(bool&) + 229
15  libjlinkarm_nrf91_nrfjprogdll.dylib	0x00000001289d6ee7 SeggerBackend::just_connect_to_device() + 71
16  libjlinkarm_nrf91_nrfjprogdll.dylib	0x00000001289d8e9d SeggerBackend::read_u32(unsigned int, unsigned int*, bool) + 381
17  libjlinkarm_nrf91_nrfjprogdll.dylib	0x00000001289c38e7 nRF::just_read_u32(unsigned int, unsigned int*) + 87
18  libjlinkarm_nrf91_nrfjprogdll.dylib	0x00000001289c079e nRF::read_u32(unsigned int, unsigned int*) + 174
19  libjlinkarm_nrf91_nrfjprogdll.dylib	0x00000001289bd4c9 NRFJPROG_read_u32 + 41
20  libnrfdfu.dylib               	0x0000000106e3f90b IPCHandler::just_ipc_wait_for_event_and_ack() + 347
21  libnrfdfu.dylib               	0x0000000106e43212 IPCHandler::program_file(std::__1::__fs::filesystem::path) + 2706
22  libnrfdfu.dylib               	0x0000000106e40f67 IPCHandler::program_files(std::__1::vector<std::__1::__fs::filesystem::path, std::__1::allocator<std::__1::__fs::filesystem::path> >) + 2775
23  libnrfdfu.dylib               	0x0000000106e1941f NRFDFU_program_package + 1199
24  libhighlevelnrfjprog.dylib    	0x0000000106b8587e DFUProbe::program(std::__1::__fs::filesystem::path const&, program_options_t) + 190
25  libhighlevelnrfjprog.dylib    	0x0000000106b53a7d NRFJPROG_program + 269
26  _ctypes.cpython-37m-darwin.so 	0x000000010695736f ffi_call_unix64 + 79
27  _ctypes.cpython-37m-darwin.so 	0x0000000106957b35 ffi_call + 713
28  _ctypes.cpython-37m-darwin.so 	0x0000000106957b35 ffi_call + 713

The complete log is as follows
pynrfjprog_log.txt

I don't know if I'm not using it right or if there's something wrong with this library.
Now our burning software can't run stably for a long time (sometimes it will crash soon). I hope to get your help.

Disk write cache file problem.

The multi-threaded burning program is packaged into an application with pyinstaller.After the program is running, during the burning process, Jlink_x64.dll and cache files are continuously written to the folder C:\Users\Administrator\AppData\Local\Temp, and will not be recycled.Cause the storage of C drive to be filled.
image
image

Code:

import threading
from pynrfjprog import HighLevel
import time

class myThread (threading.Thread):
   def __init__(self, threadID, name, counter):
      threading.Thread.__init__(self)
      self.threadID = threadID
      self.name = name
      self.counter = counter
   def run(self):
      print ("Starting " + self.name)
      update_fw(self.name)
      program_app(self.name)
      print ("Exiting " + self.name)

def update_fw(snr):
    print("updating FW in {}".format(snr))
    probe = HighLevel.IPCDFUProbe(api, int(snr), HighLevel.CoProcessor.CP_MODEM)
    print("{} probe initialized". format(snr))
    probe.program("mfw_nrf9160_1.2.2.zip")
    print("{} programmed".format(snr))
    probe.verify("mfw_nrf9160_1.2.2.zip")
    print("{} Modem verified".format(snr))


def program_app(snr):
    app_probe = HighLevel.DebugProbe(api, int(snr) )

    program_options = HighLevel.ProgramOptions(
        erase_action=HighLevel.EraseAction.ERASE_ALL,
        reset = HighLevel.ResetAction.RESET_SYSTEM,
        verify = HighLevel.VerifyAction.VERIFY_READ
    )
    app_probe.program( "merged.hex" , program_options=program_options )
    
    app_probe.verify( "merged.hex" , HighLevel.VerifyAction.VERIFY_READ )
    print("{} Application verified".format(snr))

    app_probe.reset()

# Create new threads
while True:
    api = HighLevel.API()
    api.open()
    devices = api.get_connected_probes()
    threads = list()
    print(devices)
    for idx, device in enumerate(devices):
        threads.append(myThread(idx, device, idx))

    # Start new Threads
    for thread in threads:
        thread.start()

    print("waiting for all threads to complete")
    #wait for threads to finish
    for t in threads:
        t.join()

    api.close()
    time.sleep(5)    
print("Exiting Main Thread")

MSVCP140.dll runtime dependency is not provided on Windows

nrfjprog.dll has dependency on MSVCP140.dll which is not part of the package. On clean Win10 it gives the following error:

(venv) PS C:\Users\novelda> pip install pynrfjprog
....
(venv) PS C:\Users\novelda> pip show pynrfjprog
Name: pynrfjprog
Version: 10.24.0
...
(venv) PS C:\Users\novelda> python
...
>>> from pynrfjprog import LowLevel
>>> LowLevel.API()
Traceback (most recent call last):
  File "C:\Users\novelda\venv\lib\site-packages\pynrfjprog\LowLevel.py", line 132, in __init__
    self._lib = ctypes.cdll.LoadLibrary(nrfjprog_dll_path)
  File "C:\Users\novelda\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "C:\Users\novelda\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\novelda\venv\lib\site-packages\pynrfjprog\lib_x64\nrfjprog.dll' (or one of its dependencies). Try using the full path with constructor syntax.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\novelda\venv\lib\site-packages\pynrfjprog\LowLevel.py", line 134, in __init__
    raise RuntimeError(f"Could not load the NRFJPROG DLL: '{error}'.")
RuntimeError: Could not load the NRFJPROG DLL: 'Could not find module 'C:\Users\novelda\venv\lib\site-packages\pynrfjprog\lib_x64\nrfjprog.dll' (or one of its dependencies). Try using the full path with constructor syntax.'.

Dependency Walker:

Screenshot from 2024-02-02 13-52-29

EXC_BAD_INSTRUCTION in libjlinkarm. Internal tracking number MDK-1227

Versions: pynrfjprog==9.0.0, 9.2.1

Occasionally, when flashing our board, pynrfjprog crashes with the error below. We're not really sure how to debug this issue, and may have to consider switching back to JLinkExe :( Do you have any suggestions on how to proceed here? Thank you for your help!

Process:               Python [82805]
Path:                  /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Identifier:            Python
Version:               2.7.12 (2.7.12)
Code Type:             X86-64 (Native)
Parent Process:        ??? [82804]
Responsible:           Python [82805]
User ID:               504

Date/Time:             2016-12-20 21:39:41.232 -0800
OS Version:            Mac OS X 10.12.1 (16B2555)
Report Version:        12
Anonymous UUID:        02C22CBB-2A78-DFBE-5EF9-44CD25C3F931

Sleep/Wake UUID:       DC025556-78F7-4277-B1AD-B4E2A7F58660

Time Awake Since Boot: 120000 seconds
Time Since Wake:       6800 seconds

System Integrity Protection: enabled

Crashed Thread:        2

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x000000000000000c, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [0]

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fffd750e1d2 __bsdthread_create + 10
1   libsystem_pthread.dylib       	0x00007fffd75faa86 _pthread_create + 249
2   libjlinkarm.dylib             	0x0000000110164703 0x10fffb000 + 1480451
3   libjlinkarm.dylib             	0x0000000110158d9c 0x10fffb000 + 1432988
4   libjlinkarm.dylib             	0x0000000110137b5d 0x10fffb000 + 1297245
5   libjlinkarm.dylib             	0x00000001100ca61d 0x10fffb000 + 849437
6   libjlinkarm.dylib             	0x00000001100ca4c5 0x10fffb000 + 849093
7   libjlinkarm.dylib             	0x00000001101118d8 0x10fffb000 + 1140952
8   libjlinkarm.dylib             	0x00000001101119e7 JLINKARM_OpenEx + 55
9   libjlinkarm_nrf52_nrfjprogdll.dylib	0x000000010ffe17a1 NRFJPROG_connect_to_emu_without_snr + 465
10  libjlinkarm_nrf52_nrfjprogdll.dylib	0x000000010ffe1572 NRFJPROG_connect_to_emu_with_snr + 354
11  _ctypes.so                    	0x000000010ff7a7e7 ffi_call_unix64 + 79
12  _ctypes.so                    	0x000000010ff7b020 ffi_call + 836
13  _ctypes.so                    	0x000000010ff76367 _ctypes_callproc + 592
14  _ctypes.so                    	0x000000010ff706c3 PyCFuncPtr_call + 1087
15  org.python.python             	0x000000010f618874 PyObject_Call + 100
16  org.python.python             	0x000000010f69b8c6 PyEval_EvalFrameEx + 27928
17  org.python.python             	0x000000010f6949a1 PyEval_EvalCodeEx + 1676
18  org.python.python             	0x000000010f69fcbc fast_function + 117
19  org.python.python             	0x000000010f69b999 PyEval_EvalFrameEx + 28139
20  org.python.python             	0x000000010f69fd50 fast_function + 265
21  org.python.python             	0x000000010f69b999 PyEval_EvalFrameEx + 28139
22  org.python.python             	0x000000010f6949a1 PyEval_EvalCodeEx + 1676
23  org.python.python             	0x000000010f69430f PyEval_EvalCode + 48
24  org.python.python             	0x000000010f6b9313 run_mod + 53
25  org.python.python             	0x000000010f6b93bd PyRun_FileExFlags + 133
26  org.python.python             	0x000000010f6b8eb4 PyRun_SimpleFileExFlags + 692
27  org.python.python             	0x000000010f6ca8f0 Py_Main + 3120
28  libdyld.dylib                 	0x00007fffd73e0255 start + 1

Thread 1:
0   libsystem_kernel.dylib        	0x00007fffd750ec8a __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fffd75f896a _pthread_cond_wait + 712
2   libjlinkarm.dylib             	0x0000000110164adb 0x10fffb000 + 1481435
3   libjlinkarm.dylib             	0x000000011016d416 0x10fffb000 + 1516566
4   libjlinkarm.dylib             	0x0000000110164736 0x10fffb000 + 1480502
5   libsystem_pthread.dylib       	0x00007fffd75f7aab _pthread_body + 180
6   libsystem_pthread.dylib       	0x00007fffd75f79f7 _pthread_start + 286
7   libsystem_pthread.dylib       	0x00007fffd75f7221 thread_start + 13

Thread 2 Crashed:
0   libjlinkarm.dylib             	0x0000000110162cea 0x10fffb000 + 1473770
1   libjlinkarm.dylib             	0x000000011015a282 0x10fffb000 + 1438338
2   libjlinkarm.dylib             	0x0000000110164736 0x10fffb000 + 1480502
3   libsystem_pthread.dylib       	0x00007fffd75f7aab _pthread_body + 180
4   libsystem_pthread.dylib       	0x00007fffd75f79f7 _pthread_start + 286
5   libsystem_pthread.dylib       	0x00007fffd75f7221 thread_start + 13

Thread 2 crashed with X86 Thread State (64-bit):
  rax: 0x0000000080000000  rbx: 0x00000000ffffffff  rcx: 0xffffffffffffffff  rdx: 0x07ffffffffffffff
  rdi: 0x00000000ffffffff  rsi: 0x000000000000000a  rbp: 0x0000700001c67d70  rsp: 0x0000700001c67cd0
   r8: 0x0000700001be7000   r9: 0x0000000000083000  r10: 0x0000000000000001  r11: 0x0000000000000206
  r12: 0x0000000110164730  r13: 0x000000000000112f  r14: 0x000000001c0008ff  r15: 0x000000011015a250
  rip: 0x0000000110162cea  rfl: 0x0000000000010a07  cr2: 0x000000011015a250
  
Logical CPU:     2
Error Code:      0x00000000
Trap Number:     12


Binary Images:
       0x10f606000 -        0x10f607fff +org.python.python (2.7.12 - 2.7.12) <5383D86E-6C3F-3581-9CD7-DF81FA0F2529> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
       0x10f60e000 -        0x10f708ff7 +org.python.python (2.7.12, [c] 2001-2016 Python Software Foundation. - 2.7.12) <0A176B7F-15AC-3D6B-8DD8-16D04635958F> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/Python
       0x10f93a000 -        0x10f93cfff +_locale.so (0) <9C44439A-75D7-3D53-B914-8347E4F5E339> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so
       0x10f97f000 -        0x10f982ff7 +_collections.so (0) <340151E5-8EB6-3EA5-AE3D-6F1DDC0F82E4> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_collections.so
       0x10f987000 -        0x10f98afff +operator.so (0) <5ABD4DF6-4AE6-34A8-9029-DC9528A2A460> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/operator.so
       0x10f990000 -        0x10f995fff +itertools.so (0) <4CAE100B-E895-3A9C-8934-F471A674CDD7> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/itertools.so
       0x10f99e000 -        0x10f99ffff +_heapq.so (0) <F4EAC90B-CC7E-386C-B0B8-4BFF40AF30EB> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_heapq.so
       0x10f9e3000 -        0x10f9e6fff +strop.so (0) <B4BB0760-1E58-3CE2-9047-D7AEEC817AF5> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/strop.so
       0x10fa2a000 -        0x10fa2bfff +_functools.so (0) <7A3C1375-600F-33F7-9708-068E46FBF879> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_functools.so
       0x10fa2e000 -        0x10fa31ffb +_struct.so (0) <DC43AB84-474D-321F-873F-DDF97A55DDFD> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_struct.so
       0x10fbb7000 -        0x10fbb8ffb +time.so (0) <C2D12187-4172-348C-87B5-78637B91BF53> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/time.so
       0x10fbbe000 -        0x10fbbffff +cStringIO.so (0) <F1F28242-C626-3A86-832E-6FFC1BB22E38> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/cStringIO.so
       0x10fc04000 -        0x10fc06ffb +select.so (0) <853F024D-026E-31EA-B929-5F9EA44015A5> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/select.so
       0x10fc0b000 -        0x10fc0cfff +fcntl.so (0) <13A5D03C-DAD5-3987-9510-721FCC325621> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/fcntl.so
       0x10fc0f000 -        0x10fc12ff3 +binascii.so (0) <63323838-7CAA-3228-867B-2C72C9A04BF1> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/binascii.so
       0x10fc15000 -        0x10fc18ff7 +math.so (0) <39537599-2121-3706-9824-20C30239BEA6> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/math.so
       0x10fc1d000 -        0x10fc24ff7 +_socket.so (0) <CD911ADB-8972-3FFD-8038-FDFE4D9A3D0F> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_socket.so
       0x10fc2e000 -        0x10fc39ffb +_ssl.so (0) <1B37E584-4079-3201-AB3F-81092F7D42B3> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so
       0x10fc43000 -        0x10fc82ff7 +libssl.1.0.0.dylib (0) <E53E5937-3FD6-3678-B8FC-7B00E4432765> /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
       0x10fc9f000 -        0x10fe11af7 +libcrypto.1.0.0.dylib (0) <B456196C-5315-37C6-93FA-FF73E85AA50B> /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
       0x10fec9000 -        0x10fed8fff +_io.so (0) <790FFD82-D53E-358B-853A-70A3E05A3D60> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
       0x10feea000 -        0x10feeafff +future_builtins.so (0) <F61AF10C-80AE-307D-82D9-7DDB83515671> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/future_builtins.so
       0x10ff6d000 -        0x10ff7dfff +_ctypes.so (0) <1548EDC7-BA86-3207-8F12-690F40533B24> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ctypes.so
       0x10ffc9000 -        0x10ffcdfff +array.so (0) <DABD32C6-58B0-3810-9D5B-55B668851A25> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/array.so
       0x10ffd3000 -        0x10ffd3fff +_bisect.so (0) <BDA9729E-BFE5-3449-849C-90FE8D8A409D> /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_bisect.so
       0x10ffd6000 -        0x10ffdbfff +libnrfjprogdll.dylib (0) <132DE2D4-8F99-32E3-A28C-DC4D2E6CE011> /usr/local/lib/python2.7/site-packages/pynrfjprog/osx_dylib/libnrfjprogdll.dylib
       0x10ffdf000 -        0x10fff5fff +libjlinkarm_nrf52_nrfjprogdll.dylib (0) <A41058CD-EEB6-35FC-AA13-44F407FAA5E6> /usr/local/lib/python2.7/site-packages/pynrfjprog/osx_dylib/libjlinkarm_nrf52_nrfjprogdll.dylib
       0x10fffb000 -        0x11036cfff +libjlinkarm.dylib (6.10.9) <FD81BD33-9BE4-3FB1-884C-F7DA5703495C> /Applications/SEGGER/*/libjlinkarm.dylib
       0x11a402000 -        0x11a43f287  dyld (421.2) <13A9466A-2576-3ABB-AD9D-D6BC16439B8F> /usr/lib/dyld
    0x7fffc228e000 -     0x7fffc2727ff7  com.apple.CoreFoundation (6.9 - 1348.15) <C25C6FB8-E934-349C-952C-26CF913BAC33> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fffc424c000 -     0x7fffc42e1ff7  com.apple.framework.IOKit (2.0.2 - 1324.21.1) <EEFE7FF0-CE41-326A-A571-8AA0B2E89271> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    0x7fffd5c0b000 -     0x7fffd5c0cff3  libDiagnosticMessagesClient.dylib (102) <422911A4-E273-3E88-BFC4-DF6470E48242> /usr/lib/libDiagnosticMessagesClient.dylib
    0x7fffd5e49000 -     0x7fffd5e4aff3  libSystem.B.dylib (1238) <CFC3669C-FB44-3A51-8815-1E84A168F3C5> /usr/lib/libSystem.B.dylib
    0x7fffd5f5a000 -     0x7fffd5f5aff3  libauto.dylib (187) <5BBF6A00-CC76-389D-84E7-CA88EDADE683> /usr/lib/libauto.dylib
    0x7fffd5f5b000 -     0x7fffd5f6bff3  libbsm.0.dylib (34) <20084796-B04D-3B35-A003-EA11459557A9> /usr/lib/libbsm.0.dylib
    0x7fffd5f7b000 -     0x7fffd5fd1ff7  libc++.1.dylib (307.4) <BEE86868-F831-384C-919E-2B286ACFE87C> /usr/lib/libc++.1.dylib
    0x7fffd5fd2000 -     0x7fffd5ffcfff  libc++abi.dylib (307.2) <1CEF8ABB-7E6D-3C2F-8E0A-E7884478DD23> /usr/lib/libc++abi.dylib
    0x7fffd6410000 -     0x7fffd642eff3  libedit.3.dylib (48) <2D3593DF-8DF9-3813-B0C2-6938BC77FC79> /usr/lib/libedit.3.dylib
    0x7fffd642f000 -     0x7fffd642ffff  libenergytrace.dylib (15) <A1B040A2-7977-3097-9ADF-34FF181EB970> /usr/lib/libenergytrace.dylib
    0x7fffd6538000 -     0x7fffd675dfff  libicucore.A.dylib (57132.0.1) <C8176937-9271-3F0E-829D-F3BBB9DD44B5> /usr/lib/libicucore.A.dylib
    0x7fffd6a41000 -     0x7fffd6a72ff3  libncurses.5.4.dylib (51) <6B88562D-86DB-3EFA-8C55-0148C30DC642> /usr/lib/libncurses.5.4.dylib
    0x7fffd6aed000 -     0x7fffd6ebdd97  libobjc.A.dylib (706) <F9AFE665-A3A2-3285-9495-19803A565861> /usr/lib/libobjc.A.dylib
    0x7fffd72e4000 -     0x7fffd72f5ff3  libz.1.dylib (67) <46E3FFA2-4328-327A-8D34-A03E20BFFB8E> /usr/lib/libz.1.dylib
    0x7fffd7304000 -     0x7fffd7308ff7  libcache.dylib (79) <84E55656-FDA9-3B29-9E4F-BE31B2C0AA3C> /usr/lib/system/libcache.dylib
    0x7fffd7309000 -     0x7fffd7313fff  libcommonCrypto.dylib (60092.20.1) <31040F10-5E57-3B9C-8D5B-33AD87D1BEE8> /usr/lib/system/libcommonCrypto.dylib
    0x7fffd7314000 -     0x7fffd731bfff  libcompiler_rt.dylib (62) <486BDE52-81B4-3446-BD72-23977CAE556F> /usr/lib/system/libcompiler_rt.dylib
    0x7fffd731c000 -     0x7fffd7324fff  libcopyfile.dylib (138) <0DA49B77-56EC-362D-98FF-FA78CFD986D6> /usr/lib/system/libcopyfile.dylib
    0x7fffd7325000 -     0x7fffd73a7fdb  libcorecrypto.dylib (442.20.2) <2684CC01-087E-33E2-8219-AAA3BBD9BFD7> /usr/lib/system/libcorecrypto.dylib
    0x7fffd73a8000 -     0x7fffd73dafff  libdispatch.dylib (703.20.1) <877B505D-826C-3246-84F7-0F850636039E> /usr/lib/system/libdispatch.dylib
    0x7fffd73db000 -     0x7fffd73e0ff3  libdyld.dylib (421.2) <7BFA3476-6210-3BCB-8CE8-9B952F87BD84> /usr/lib/system/libdyld.dylib
    0x7fffd73e1000 -     0x7fffd73e1ffb  libkeymgr.dylib (28) <09CD7CA6-46D2-3A9F-B9F1-7C4CA5CA0D68> /usr/lib/system/libkeymgr.dylib
    0x7fffd73e2000 -     0x7fffd73eeffb  libkxld.dylib (3789.21.3) <F12B5274-44AD-3268-A793-31EF351A4BD9> /usr/lib/system/libkxld.dylib
    0x7fffd73ef000 -     0x7fffd73effff  liblaunch.dylib (972.20.3) <7AB2E2EA-8B47-3420-87CE-5EE18A4EEE49> /usr/lib/system/liblaunch.dylib
    0x7fffd73f0000 -     0x7fffd73f5fff  libmacho.dylib (894) <1EAE5ADD-490C-3B1F-9F97-447BA8E0E90F> /usr/lib/system/libmacho.dylib
    0x7fffd73f6000 -     0x7fffd73f8ff3  libquarantine.dylib (85) <F3E47D7C-8776-327C-9426-DD7DEB30DBDD> /usr/lib/system/libquarantine.dylib
    0x7fffd73f9000 -     0x7fffd73faffb  libremovefile.dylib (45) <C4FC07FF-ED86-382E-B06F-33C34718080C> /usr/lib/system/libremovefile.dylib
    0x7fffd73fb000 -     0x7fffd7413ff7  libsystem_asl.dylib (349.1.1) <F0987490-8427-367F-B302-A05A7D61FEBF> /usr/lib/system/libsystem_asl.dylib
    0x7fffd7414000 -     0x7fffd7414ff7  libsystem_blocks.dylib (67) <B8C3701D-5A91-3D35-999D-2DC8D5393525> /usr/lib/system/libsystem_blocks.dylib
    0x7fffd7415000 -     0x7fffd74a2fef  libsystem_c.dylib (1158.20.4) <5F9531F5-EDA3-3D25-A827-3E0FD6B392BA> /usr/lib/system/libsystem_c.dylib
    0x7fffd74a3000 -     0x7fffd74a6ffb  libsystem_configuration.dylib (888.20.5) <CDC55FCB-C1FC-350D-A919-5DBCFC835B63> /usr/lib/system/libsystem_configuration.dylib
    0x7fffd74a7000 -     0x7fffd74aafff  libsystem_coreservices.dylib (41.2) <5DE691C6-7EE6-3210-895D-9EA3ECBC09B4> /usr/lib/system/libsystem_coreservices.dylib
    0x7fffd74ab000 -     0x7fffd74c3ffb  libsystem_coretls.dylib (121.1.1) <8F7E9B12-400D-3276-A9C5-4546B0258554> /usr/lib/system/libsystem_coretls.dylib
    0x7fffd74c4000 -     0x7fffd74cafff  libsystem_dnssd.dylib (765.20.4) <28E52C39-DF10-340F-A3EC-C0119AF6361F> /usr/lib/system/libsystem_dnssd.dylib
    0x7fffd74cb000 -     0x7fffd74f4fff  libsystem_info.dylib (503) <C686B834-5E7D-382C-AF6E-44AB78EE83E2> /usr/lib/system/libsystem_info.dylib
    0x7fffd74f5000 -     0x7fffd7517ff7  libsystem_kernel.dylib (3789.21.3) <EC53F92A-0DFA-3027-A220-414A01F17B2E> /usr/lib/system/libsystem_kernel.dylib
    0x7fffd7518000 -     0x7fffd755ffe7  libsystem_m.dylib (3121.4) <7F86C291-B105-31C1-9923-90EBAB22B73F> /usr/lib/system/libsystem_m.dylib
    0x7fffd7560000 -     0x7fffd757eff7  libsystem_malloc.dylib (116) <F9840080-4C2C-3F3B-8087-7C738F12A1C7> /usr/lib/system/libsystem_malloc.dylib
    0x7fffd757f000 -     0x7fffd75d6ff3  libsystem_network.dylib (856.20.4) <2BAFB24F-999C-3148-BDD8-F28E05F716F7> /usr/lib/system/libsystem_network.dylib
    0x7fffd75d7000 -     0x7fffd75e0ff3  libsystem_networkextension.dylib (563.20.3) <971DD3AD-D17A-32FF-95DE-0A5A979E68AE> /usr/lib/system/libsystem_networkextension.dylib
    0x7fffd75e1000 -     0x7fffd75eaff3  libsystem_notify.dylib (165.20.1) <EAD023A2-AD3F-31C8-9489-274B9A42DA61> /usr/lib/system/libsystem_notify.dylib
    0x7fffd75eb000 -     0x7fffd75f3fe7  libsystem_platform.dylib (126.1.2) <2F2D6A81-C36C-353D-B27B-A6643A32375E> /usr/lib/system/libsystem_platform.dylib
    0x7fffd75f4000 -     0x7fffd75feff7  libsystem_pthread.dylib (218.20.1) <46375095-4731-3034-9D87-396DE95FC697> /usr/lib/system/libsystem_pthread.dylib
    0x7fffd75ff000 -     0x7fffd7602ff7  libsystem_sandbox.dylib (592.21.2) <2D42A2BF-A7AF-352A-A821-D8F6E85A63AC> /usr/lib/system/libsystem_sandbox.dylib
    0x7fffd7603000 -     0x7fffd7604fff  libsystem_secinit.dylib (24) <A54B8FEF-E792-3C54-8E0B-E80A376662F2> /usr/lib/system/libsystem_secinit.dylib
    0x7fffd7605000 -     0x7fffd760cfff  libsystem_symptoms.dylib (532.1.1) <8FB7CA37-79EF-3651-B5B9-B5E1E0947067> /usr/lib/system/libsystem_symptoms.dylib
    0x7fffd760d000 -     0x7fffd762dff7  libsystem_trace.dylib (518.20.8) <C029B910-A65F-35F6-B194-B933B454EAB4> /usr/lib/system/libsystem_trace.dylib
    0x7fffd762e000 -     0x7fffd7633ffb  libunwind.dylib (35.3) <9F7C2AD8-A9A7-3DE4-828D-B0F0F166AAA0> /usr/lib/system/libunwind.dylib
    0x7fffd7634000 -     0x7fffd765dff7  libxpc.dylib (972.20.3) <85EB25FD-218F-38EE-9E69-391CC8EBE6C5> /usr/lib/system/libxpc.dylib

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 283797
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=135.1M resident=0K(0%) swapped_out_or_unallocated=135.1M(100%)
Writable regions: Total=108.7M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=108.7M(100%)
 
                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Kernel Alloc Once                    8K        2 
MALLOC                            37.1M       10 
MALLOC guard page                   16K        4 
STACK GUARD                         12K        4 
Stack                             65.0M        4 
VM_ALLOCATE                       4104K       14 
__DATA                            13.0M       85 
__LINKEDIT                       112.7M       31 
__TEXT                            22.4M       79 
__UNICODE                          556K        2 
shared memory                       12K        4 
===========                     =======  ======= 
TOTAL                            254.8M      228 

Model: MacBookPro12,1, BootROM MBP121.0167.B17, 2 processors, Intel Core i5, 2.7 GHz, 16 GB, SMC 2.28f7
Graphics: Intel Iris Graphics 6100, Intel Iris Graphics 6100, Built-In
Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1867 MHz, 0x80CE, 0x4B3445424533303445422D45474346202020
Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1867 MHz, 0x80CE, 0x4B3445424533303445422D45474346202020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x133), Broadcom BCM43xx 1.0 (7.21.171.47.1a8)
Bluetooth: Version 5.0.1f7, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM0256G, 251 GB
USB Device: USB 3.0 Bus
USB Device: Bluetooth USB Host Controller
USB Device: J-Link
Thunderbolt Bus: MacBook Pro, Apple Inc., 27.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.