<?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>NRF52840DK:use nrfjprog write a font bin file to external flash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98845/nrf52840dk-use-nrfjprog-write-a-font-bin-file-to-external-flash</link><description>Hi, sir 
 I have a bin font file for LVGL to display Chinese, I want to burn this file to the external flash of nrf52840DK by nrfjprog, how should I do it? I have tried nrfjprog -f NRF52 --program myFont.bin --qspichiperase --verify, but it returns 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Apr 2023 12:15:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98845/nrf52840dk-use-nrfjprog-write-a-font-bin-file-to-external-flash" /><item><title>RE: NRF52840DK:use nrfjprog write a font bin file to external flash</title><link>https://devzone.nordicsemi.com/thread/421019?ContentTypeID=1</link><pubDate>Tue, 18 Apr 2023 12:15:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e927bc6-8f0a-427f-88e2-b48825398198</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Programming .bin files using nrfjprog is a bit limited, since .bin files doesn&amp;#39;t have any means of addressing. Hence it is only possible to write .bin files to address 0x00000000 (the start of the flash on the nRF), so that will not work. I see you added the --qspieraseall, so that will erase the QSPI flash, but not write to it.&lt;/p&gt;
&lt;p&gt;Since there is currently no option to write a .bin file with an offset, I suggest you download bin2hex.py (pip install bin2hex), and use the following method:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;bin2hex.py --offset 0x12000000 bin_file.bin hex_file.hex
nrfjprog --qspieraseall
nrfjprog --program hex_file.hex --verify
nrfjprog --verify hex_file.hex&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This will convert the content of bin_file.bin to a hex_file.hex, and all the data is offset with 0x12000000, which is the start address of the QSPI flash. After that you can program it as if it was an ordinary hex file, and nrfjprog will program it into the external QSPI.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Give it a go and let me know if it doesn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>