<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>MCUXpresso GeneralのトピックRe: K81 - TRNG_GetRandomData hanging</title>
    <link>https://community.nxp.com/t5/MCUXpresso-General/K81-TRNG-GetRandomData-hanging/m-p/1020689#M3124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;I can't reproduce you problem at my board. Did you try the trng example in the SDK?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jing&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jan 2020 08:37:51 GMT</pubDate>
    <dc:creator>jingpan</dc:creator>
    <dc:date>2020-01-17T08:37:51Z</dc:date>
    <item>
      <title>K81 - TRNG_GetRandomData hanging</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/K81-TRNG-GetRandomData-hanging/m-p/1020688#M3123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to get some random data from K81 hardware and I'm using&amp;nbsp;TRNG_GetRandomData from fsl_trng.c.&lt;/P&gt;&lt;P&gt;I'm using it in connection with :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//***********************************************************************************************************&lt;/P&gt;&lt;P&gt;return_code = mbedtls_rsa_rsaes_pkcs1_v15_encrypt(key, trng_ctr_drbg_random, NULL, MBEDTLS_RSA_PUBLIC, sizeof(_pers_kbpk), (const uint8_t*)&amp;amp;_pers_kbpk.data, enc_pers_kbpk_ptr);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static int trng_ctr_drbg_random(void* notused, unsigned char* output, size_t output_len)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return ( TRNG_GetRandomData(TRNG0, output, output_len) );&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;//***********************************************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In&amp;nbsp;&lt;SPAN&gt;TRNG_GetRandomData&lt;/SPAN&gt;&amp;nbsp;it hangs in the check while loop:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while ((TRNG_RD_MCTL_ENT_VAL(base) == 0) &amp;amp;&amp;amp; (TRNG_RD_MCTL_ERR(base) == 0))&lt;BR /&gt; {&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;and never gets out.&lt;BR /&gt;If I run debug one step at a time it works perfect but if it runs normal it hangs.&lt;BR /&gt; Is there a workaround for this issue ?&lt;/P&gt;&lt;P&gt;It is configured with&amp;nbsp;TRNG_Init and default config.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint32_t trng_enable()&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;trng_config_t trngConfig;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;TRNG_GetDefaultConfig(&amp;amp;trngConfig);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;trngConfig.sampleMode = kTRNG_SampleModeVonNeumann;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;return (TRNG_Init(TRNG0, &amp;amp;trngConfig));&lt;BR /&gt; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2020 07:57:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/K81-TRNG-GetRandomData-hanging/m-p/1020688#M3123</guid>
      <dc:creator>christian_niels</dc:creator>
      <dc:date>2020-01-16T07:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: K81 - TRNG_GetRandomData hanging</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/K81-TRNG-GetRandomData-hanging/m-p/1020689#M3124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;I can't reproduce you problem at my board. Did you try the trng example in the SDK?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jing&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2020 08:37:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/K81-TRNG-GetRandomData-hanging/m-p/1020689#M3124</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2020-01-17T08:37:51Z</dc:date>
    </item>
  </channel>
</rss>

