<?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>Failing to build latest OpenThread library</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21839/failing-to-build-latest-openthread-library</link><description>Hi all,
I tried to build the latest OpenThread libraries but after copying the library files in the SDK, I fail to compile the examples. Everything was fine when building with the OpenThread libraries files provided in the Nordic SDK. So, I maybe do</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 10 May 2017 13:11:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21839/failing-to-build-latest-openthread-library" /><item><title>RE: Failing to build latest OpenThread library</title><link>https://devzone.nordicsemi.com/thread/85763?ContentTypeID=1</link><pubDate>Wed, 10 May 2017 13:11:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0325be17-f0cd-489d-bf03-6c46b58236da</guid><dc:creator>Marco Russi</dc:creator><description>&lt;p&gt;Thank you very much for your detailed answer. I&amp;#39;m out of office at the moment for a few days but I&amp;#39;ll try your suggested solution asap and I&amp;#39;ll let you know. Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failing to build latest OpenThread library</title><link>https://devzone.nordicsemi.com/thread/85762?ContentTypeID=1</link><pubDate>Mon, 08 May 2017 08:25:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09ab057c-caf4-4ea4-98ef-b4030e3714a4</guid><dc:creator>Lukasz Duda</dc:creator><description>&lt;p&gt;Hello Marco!&lt;/p&gt;
&lt;p&gt;Thanks for raising this issue!&lt;/p&gt;
&lt;p&gt;As you probably guess, there were quite a lot of changes in OpenThread repository since our last release. Based on your output i see two problems:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;libopenthread-cli.a&lt;/strong&gt; - OpenThread has deprecated a usage of this library,
and instead introduced two new ones:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;libopenthread-cli-ftd.a   &lt;em&gt;(for Full Thread Device)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;libopenthread-cli-mtd.a  &lt;em&gt;(for Minimal Thread Device)&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And since you probably only replaced all old libraries, you still try to link examples with old
version of libopenthread-cli.&lt;/p&gt;
&lt;p&gt;To fix that, you need to correct the name of the library in the proper Makefile of the example.
E.g. &lt;code&gt;$(SDK_ROOT)/external/openthread/lib/gcc/libopenthread-cli.a&lt;/code&gt; to &lt;code&gt;$(SDK_ROOT)/external/openthread/lib/gcc/libopenthread-cli-ftd.a&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The second problem that you have expirienced
&lt;code&gt;hardware_entropy.c:37: undefined reference to &amp;quot;otPlatRandomSecureGet&amp;quot;&lt;/code&gt; is caused by the new API introduced &lt;a href="https://github.com/openthread/openthread/commit/115b52e6c49d3da4e05cf74c4b5f9aa59183315e"&gt;here&lt;/a&gt; and to fix it, you have two ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;use &lt;strong&gt;libmbedcrypto.a&lt;/strong&gt; library from the OpenThread repository &lt;em&gt;(without hardware acceleration)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;recompile &lt;strong&gt;libmbedcrypto.a&lt;/strong&gt; with a hardware acceleration as it is explained &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.threadsdk.v0.8.0%2Fthread_intro.html&amp;amp;cp=4_1_0_1_3&amp;amp;anchor=thread_qsg_mbedtls"&gt;here&lt;/a&gt;. Note that you need to align API with the new OpenThread in &lt;code&gt;components/thread/experimental/crypto/hardware_entropy.c&lt;/code&gt; file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In the &lt;code&gt;mbedtls_hardware_poll&lt;/code&gt; function you should replace the usage of &lt;code&gt;otPlatRandomSecureGet&lt;/code&gt; with &lt;code&gt;otPlatRandomGetTrue&lt;/code&gt; with appropriate function parameters.&lt;/p&gt;
&lt;p&gt;e.g. (not tested)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;int mbedtls_hardware_poll(void *data, unsigned char *output, size_t len, size_t *olen)
{
    ThreadError error;

    (void)data;

    error = otPlatRandomGetTrue((uint8_t *)output, len);

    if (error == kThreadError_None)
    {
        *olen = len;
    }
    else
    {
        return MBEDTLS_ERR_ENTROPY_SOURCE_FAILED;
    }

    return 0;
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>