This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

pynrfjprog verify

Greetings,

I am using pynrfjprog (9.0.0) to write a HEX file to an nRF52 device on the nRF52 DK. I am wondering if there is an easy way to verify the write using API.py, similar to how the in-line command "nrfjprog ... --verify" does so.

Some details about my setup:

  • Windows 10
  • nRF52 DK PC10040
  • Python 2.7 Win32
  • nrfjprog 9.0.0
  • JLinkARM.dll 5.12g

Many thanks.

Parents
  • Hi,

    There is no "nrfjprog.exe" functionality directly implemented in pynrfjprog, such as --program or --verify.

    To do this, the following should work for the nRF52-DK:

    from pynrfjprog import API, Hex
    
    api = API.API('NRF52')
    api.open()
    api.connect_to_emu_without_snr()
    
    test_program = Hex.Hex('blinky.hex')
    
    for segment in test_program:
        content = api.read(segment.address, len(segment.data))
        if not segment.data == content:
            print "Segment data mismatch starting at address: {}, segment length: {}".format(hex(segment.address), hex(len(segment.data)))
    
    api.close()
    
Reply
  • Hi,

    There is no "nrfjprog.exe" functionality directly implemented in pynrfjprog, such as --program or --verify.

    To do this, the following should work for the nRF52-DK:

    from pynrfjprog import API, Hex
    
    api = API.API('NRF52')
    api.open()
    api.connect_to_emu_without_snr()
    
    test_program = Hex.Hex('blinky.hex')
    
    for segment in test_program:
        content = api.read(segment.address, len(segment.data))
        if not segment.data == content:
            print "Segment data mismatch starting at address: {}, segment length: {}".format(hex(segment.address), hex(len(segment.data)))
    
    api.close()
    
Children
No Data
Related