<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pynrfjprog verify</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15348/pynrfjprog-verify</link><description>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 &amp;quot;nrfjprog ... --verify&amp;quot; does so. 
 Some details</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Nov 2016 13:28:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15348/pynrfjprog-verify" /><item><title>RE: pynrfjprog verify</title><link>https://devzone.nordicsemi.com/thread/58654?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2016 13:28:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a99768d-bf32-4dd9-be43-675dd7697aff</guid><dc:creator>gamnes</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is no &amp;quot;nrfjprog.exe&amp;quot; functionality directly implemented in pynrfjprog, such as --program or --verify.&lt;/p&gt;
&lt;p&gt;To do this, the following should work for the nRF52-DK:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;from pynrfjprog import API, Hex

api = API.API(&amp;#39;NRF52&amp;#39;)
api.open()
api.connect_to_emu_without_snr()

test_program = Hex.Hex(&amp;#39;blinky.hex&amp;#39;)

for segment in test_program:
    content = api.read(segment.address, len(segment.data))
    if not segment.data == content:
        print &amp;quot;Segment data mismatch starting at address: {}, segment length: {}&amp;quot;.format(hex(segment.address), hex(len(segment.data)))

api.close()
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>