<?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>signing zephyr images - west sign</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61048/signing-zephyr-images---west-sign</link><description>Currently, I am following guide of zephyr sample: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/README.html But when I build an app with: west build -b nrf52_pca10040 and then try to sign the build</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Jul 2022 06:31:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61048/signing-zephyr-images---west-sign" /><item><title>RE: signing zephyr images - west sign</title><link>https://devzone.nordicsemi.com/thread/376708?ContentTypeID=1</link><pubDate>Wed, 13 Jul 2022 06:31:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f7cecc4-70b4-44dc-89e5-aaee59fa3283</guid><dc:creator>CW</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&amp;nbsp; I have another question about signing a large zephyr.bin failed.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;Why can&amp;#39;t we sign successfully? but the signed-file app_update.bin will be generated successfully instead.&lt;br /&gt;&lt;br /&gt;&amp;nbsp; And we do DFU app_update.bin successfully, that doesn&amp;#39;t make sense.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Very confused.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;Please any&amp;nbsp;master tell me, thank you so much.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Jason&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: signing zephyr images - west sign</title><link>https://devzone.nordicsemi.com/thread/249636?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 09:22:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3fd80b8-15df-4fa8-a0eb-d68e0873e8c5</guid><dc:creator>Vojislav</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;shibshab,&lt;br /&gt;&lt;br /&gt;Thank you for clearing all up. Now it is much more clear how everything fits together.&amp;nbsp;&lt;br /&gt;I was able to do all of this with try/fail methodology on nrf52832 and with your explanation and ref links, it is all much clearer.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Unfortunately, it seems that I can not fit everything on nrf52811 which is my preferred platform at the moment.&lt;br /&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/61313/nrf52811-zephyr-with-mcuboot"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/61313/nrf52811-zephyr-with-mcuboot&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Vojislav&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: signing zephyr images - west sign</title><link>https://devzone.nordicsemi.com/thread/249628?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 09:11:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a91f44f7-3f43-4642-af2a-712bfea27018</guid><dc:creator>shibshab</dc:creator><description>[quote userid="80703" url="~/f/nordic-q-a/61048/signing-zephyr-images---west-sign/248923"]Also, I would like to know more about what each bin and hex means:&lt;br /&gt;app_signed.hex (signed application ready for update)&lt;br /&gt;app_test_update.hex&lt;br /&gt;app_to_sign.bin&lt;br /&gt;app_update.bin&lt;br /&gt;app_moved_test_update.hex[/quote]
&lt;p&gt;These are all described here:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/readme-ncs.html#mcuboot-ncs"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/readme-ncs.html#mcuboot-ncs&lt;/a&gt;&amp;nbsp;&lt;br /&gt;Most importantly, app_update.bin is the signed version of the application that should be used for DFU/FOTA purposes.&lt;br /&gt;&lt;br /&gt;&amp;quot;&lt;span&gt;My next question is with which key (.pem) file is this app file signed?&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The pem file used is the file configured in mcuboot. This file is specified by the kconfig option BOOT_SIGNATURE_KEY_FILE in the mcuboot image (note that you have to invoke &amp;quot;ninja mcuboot_menuconfig&amp;quot; to reach the configuration of the mcuboot image instead of your normal application menuconfig.&lt;br /&gt;&lt;br /&gt;&amp;quot;&lt;span&gt;And if I flash merged.hex using jLink is that also signed with the same key?&amp;quot;&lt;br /&gt;&lt;br /&gt;Yes, all bootable images (only the app in your case) inside merged.hex are signed with that key. MCUBoot only support one key.&lt;br /&gt;&lt;br /&gt;&amp;quot;Can you recommend me a please where I can read more about this?&amp;quot;&lt;br /&gt;&lt;br /&gt;As already mentioned -&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/readme-ncs.html#mcuboot-ncs"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/readme-ncs.html#mcuboot-ncs&lt;/a&gt;&lt;br /&gt;Also you have&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#hex-files"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#hex-files&lt;/a&gt;&amp;nbsp;explaining how merging of files work.&lt;br /&gt;&lt;br /&gt;&amp;quot;For me problem with the current build is that I can not use app_signed.hex with nRF Connect Android App because this app requires .bin format. I am able to do an update using app_update.bin file, but I cannot use app_signed.hex&amp;quot;&lt;br /&gt;&lt;br /&gt;As stated above, the slightly badly named app_update.bin is the correct signed version.&lt;br /&gt;&lt;br /&gt;To avoid problems you should stick to using the automatically signed binaries/hexes and avoid using the west sign command as this is only useful for non-NCS users which does not have the benefit of automatic signing.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: signing zephyr images - west sign</title><link>https://devzone.nordicsemi.com/thread/248931?ContentTypeID=1</link><pubDate>Fri, 08 May 2020 12:11:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4972b9ed-be11-4b78-8594-8a0ef10bd50a</guid><dc:creator>Vojislav</dc:creator><description>&lt;p&gt;And regarding&amp;nbsp;&lt;strong&gt;west sign&lt;/strong&gt; command you recommended this is the output I get:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;=== image configuration:
partition offset: 49152 (0xc000)
partition size: 204800 (0x32000)
text section offset: 0 (0x0)
=== signed binaries:
bin: /home/voja/Documents/irnas/zephyr_tests/peripheral_uart/build/zephyr/zephyr.signed.bin
Usage: imgtool sign [OPTIONS] INFILE OUTFILE

Error: Header padding was not requested and image does not start with zeros
FATAL ERROR: command exited with status 2: /home/voja/.virtualenvs/zephyenv/bin/imgtool sign --version 0.0.0+0 --align 4 --header-size 0 --slot-size 204800 --key root-rsa-2048.pem -H 32 /home/voja/Documents/irnas/zephyr_tests/peripheral_uart/build/zephyr/zephyr.bin /home/voja/Documents/irnas/zephyr_tests/peripheral_uart/build/zephyr/zephyr.signed.bin&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Aldo this is not that important if it is done automatically as you explained.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Vojislav.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: signing zephyr images - west sign</title><link>https://devzone.nordicsemi.com/thread/248923?ContentTypeID=1</link><pubDate>Fri, 08 May 2020 12:04:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:318880f8-e7af-4977-99d5-9a0a88b36855</guid><dc:creator>Vojislav</dc:creator><description>&lt;p&gt;Also, I would like to know more about what each bin and hex means:&lt;br /&gt;app_signed.hex (signed application ready for update)&lt;br /&gt;app_test_update.hex&lt;br /&gt;app_to_sign.bin&lt;br /&gt;app_update.bin&lt;br /&gt;app_moved_test_update.hex&lt;br /&gt;&lt;br /&gt;For me problem with the current build is that I can not use app_signed.hex with nRF Connect Android App because this app requires .bin format. I am able to do an update using app_update.bin file, but I cannot use app_signed.hex&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: signing zephyr images - west sign</title><link>https://devzone.nordicsemi.com/thread/248917?ContentTypeID=1</link><pubDate>Fri, 08 May 2020 11:57:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b55211f2-3751-4e10-b2a8-730a65a94adf</guid><dc:creator>Vojislav</dc:creator><description>&lt;p&gt;Hi Einar,&lt;br /&gt;&lt;br /&gt;Thank you for the answer. I see the app_signed.hex in the build folder. I did not know it is done automatically.&amp;nbsp;&lt;br /&gt;My next question is with which key (.pem) file is this app file signed?&amp;nbsp;&lt;br /&gt;And if I flash merged.hex using jLink is that also signed with the same key?&lt;br /&gt;Can you recommend me a please where I can read more about this?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: signing zephyr images - west sign</title><link>https://devzone.nordicsemi.com/thread/248864?ContentTypeID=1</link><pubDate>Fri, 08 May 2020 08:53:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bebcf730-89bd-46b4-aca3-7e187dde4f9f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Vojislav,&lt;/p&gt;
&lt;p&gt;First of all, you should not need to do this manually, since the partition manager should sign the application automatically when you have used&amp;nbsp;CONFIG_BOOTLOADER_MCUBOOT and generates the app_signed.hex. That said, it looks like you need to specify the header size, so you could try:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;west sign -t imgtool -- --key root-rsa-2048.pem -H 32&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>