<?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>SES / DFU / Dependency confusion</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70765/ses-dfu-dependency-confusion</link><description>I continue to be confused by the Nordic setup of projects. There are a bunch of different demos, but what if you want to compile features from different ones? 
 Specifically, I have an existing Thread application based on the thread CLI. I now want to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Jan 2021 10:44:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70765/ses-dfu-dependency-confusion" /><item><title>RE: SES / DFU / Dependency confusion</title><link>https://devzone.nordicsemi.com/thread/290983?ContentTypeID=1</link><pubDate>Mon, 25 Jan 2021 10:44:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20181ef2-8cdd-423f-ad64-49ebee600f42</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I&amp;#39;m afraid trial and error may be needed.&amp;nbsp;&lt;br /&gt;If you plan to use Oberon, you just need to to follow the guide that I pointed to, quoted here:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Porting from &amp;#181;ECC to nrf_oberon
In sdk_config.h, set the following defines:
NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED to 0
NRF_CRYPTO_BACKEND_NRF_SW_ENABLED to 0
NRF_CRYPTO_BACKEND_OBERON_ENABLED to 1
NRF_CRYPTO_BACKEND_OBERON_ECC_SECP256R1_ENABLED to 1
NRF_CRYPTO_BACKEND_OBERON_HASH_SHA256_ENABLED to 1
The rest of NRF_CRYPTO_BACKEND_OBERON_* to 0
Remove these files from the build:
nrf_sw_backend_hash.c
micro_ecc_backend_ecc.c
micro_ecc_backend_ecdh.c
micro_ecc_backend_ecdsa.c
sha256.c
micro_ecc_lib_nrf52.a
Add these files to the build:
external\nrf_oberon\lib\nrf52\liboberon_2.0.4.a or external\nrf_oberon\lib\nrf52\oberon_short_wchar_2.0.4.lib
components\libraries\crypto\backend\oberon\oberon_backend_ecc.c
components\libraries\crypto\backend\oberon\oberon_backend_ecdsa.c
components\libraries\crypto\backend\oberon\oberon_backend_hash.c
Add these paths to the include paths:
external\nrf_oberon\include
external\nrf_cc310\include
In dfu_public_key.c:
Remove &amp;#39;const&amp;#39; from the declaration of &amp;#39;pk&amp;#39;.
In nrf_dfu_validation.c:
Add #include &amp;quot;nrf_crypto_shared.h&amp;quot;
Remove &amp;#39;const&amp;#39; from the extern declaration of &amp;#39;pk&amp;#39;.
Add function calls to swap the endianness of the public key and signature.
nrf_crypto_internal_double_swap_endian_in_place(pk, sizeof(pk) / 2);
,immediately before the call to nrf_crypto_ecc_public_key_from_raw(),
nrf_crypto_internal_double_swap_endian_in_place(m_signature, sizeof(m_signature) / 2); , immediately before the call to nrf_crypto_ecdsa_verify().
If necessary, move the start address of the bootloader to accomodate the increase in size. Typically 1 or 2 extra pages are needed (pages are 0x1000 long).&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The draw back is that you would need to have larger flash space.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t tried to test on the Thread DFU example, but as far as I know there shouldn&amp;#39;t be an issue switch to Oberon on this example.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SES / DFU / Dependency confusion</title><link>https://devzone.nordicsemi.com/thread/290797?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 15:02:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffb4b003-9e48-467c-a913-33d990d310dd</guid><dc:creator>krbvroc1</dc:creator><description>&lt;p&gt;Thank you for the response. The SES project for Thread Secure DFU appears to include both micro-ecc and Oberon.&lt;/p&gt;
&lt;p&gt;From the SDK 4.1.0 documentation it makes it sound like the micro-ecc MUST be used and MUST be compiled with an old armgcc compiler. Is this still accurate? Can I ditch micro-ecc altogether and use this new Oberon crypto ... I was trying to follow the Thread Secure DFU example and there is no mention of this. See &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/thread_example_dfu.html"&gt;infocenter.nordicsemi.com/.../thread_example_dfu.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Are far as figuring out which files are need, I guess it is just trial and error / comparing emProject XML files? Is there any other way? And I need to manually compare the thousands of lines of sdk_config.h between projects to merge those in too?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SES / DFU / Dependency confusion</title><link>https://devzone.nordicsemi.com/thread/290791?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 14:47:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28288e8b-2433-4a77-86ee-762a78f32059</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry that we have some lack of detailed documentation on how to implement DFU feature in a thread application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For now the only documentation we have for this is the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/thread_ot_secure_dfu.html?cp=7_3_2_8"&gt;Thread Secure DFU protocol documentation&lt;/a&gt; and the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/thread_example_dfu.html?cp=7_3_2_10_4_0"&gt;DFU example documentation.&amp;nbsp;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You would need to look into the code, study and port that into your current application.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regarding the files needed, if you use the backend micro-ecc (used by default), you don&amp;#39;t need to include Oberon crypto backend files, including both&amp;nbsp;&lt;span&gt;nRF_Crypto backend Oberon and&amp;nbsp;&lt;/span&gt;nRF_Oberon_Crypto.&lt;/p&gt;
&lt;p&gt;If you use Oberon crypto instead of micro-ecc you need to follow &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/migration.html?cp=7_5_3_1_9"&gt;this guide.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This crypto library is needed for secure DFU bootloader where we check the signature and hash to verify the integrity and the origin of the image.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;libmbedtls needed in any thread projects, it&amp;#39;s not related to the DFU but to openthread itself.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>