<?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>Wireless MCU中的主题 W41z boot time</title>
    <link>https://community.nxp.com/t5/Wireless-MCU/W41z-boot-time/m-p/658902#M2637</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have noticed the transceiver takes over 50ms to initialize, and with our startup requirements, I really need to be able to go to sleep after 10ms. &amp;nbsp;I have narrowed the vast majority of the time to the following function:&amp;nbsp;&lt;/P&gt;&lt;P&gt;rx_bba_dcoc_dac_trim_shortIQ() &amp;nbsp;which is the last call in&amp;nbsp;XCVR_Configure()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the&amp;nbsp;MKW41Z_ConnSw_1.0.2 package, and creating a project with genfsk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. What are the implications of just skipping the&amp;nbsp;&lt;SPAN&gt;rx_bba_dcoc_dac_trim_shortIQ function?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. if the function is needed, is it really necessary to be using floating point math on a cortex M0? &amp;nbsp;That is incredibly inefficient and time consuming. &amp;nbsp; I have narrowed most of the time from&amp;nbsp;rx_bba_dcoc_dac_trim_shortIQ be due to several calls to DC_Measure_short, which call&amp;nbsp;rx_dc_sample_average, which does a large loop operation with floating point divide (each of which consumes approximately 30us for each divide), called 256 times in this function, and this function is called 6 times during the radio initialization.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;&lt;SPAN&gt;num_iq_samples = 128&lt;/SPAN&gt;

&lt;SPAN&gt; for (i = 0; i &amp;lt; num_iq_samples*2; i+=2)
 {
 static int16_t i_value;
 static int16_t q_value;
 
 /* Average I &amp;amp; Q channels separately. */
 i_value = *(sample_ptr+i); /* Sign extend from 12 to 16 bits. */
 q_value = *(sample_ptr+i+1); /* Sign extend from 12 to 16 bits. */
 avg_i += ((float)i_value - avg_i) / (float)(i+1); /* Rolling average I */
 avg_q += ((float)q_value - avg_q) / (float)(i+1); /* Rolling average Q */
 }&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, In the process of trying to identify where the time was being spent, I've also noticed a bug in fsl_xcvr_trim.c in&amp;nbsp;XcvrCalDelay(). &amp;nbsp;This busy wait loop appears to be only half written. &amp;nbsp;In using timestamps, I measured this function to be off by an order of magnitude. &amp;nbsp;I fixed it by doing the following.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;void XcvrCalDelay(uint32_t time)
{
int32_t delay = time*32;
 while(delay &amp;gt; 0) /* Time delay is roughly in uSec. */
 { 
 delay-=10;
 }
}&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But with this fix, that begs the question, are the places this function and the parameter passed in for wait duration just empirically found? &amp;nbsp;In which case all delay parameters would need to be corrected&amp;nbsp;now that I have fixed the delay function to be more accurate. &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 May 2017 16:35:00 GMT</pubDate>
    <dc:creator>justinjansen</dc:creator>
    <dc:date>2017-05-02T16:35:00Z</dc:date>
    <item>
      <title>W41z boot time</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/W41z-boot-time/m-p/658902#M2637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have noticed the transceiver takes over 50ms to initialize, and with our startup requirements, I really need to be able to go to sleep after 10ms. &amp;nbsp;I have narrowed the vast majority of the time to the following function:&amp;nbsp;&lt;/P&gt;&lt;P&gt;rx_bba_dcoc_dac_trim_shortIQ() &amp;nbsp;which is the last call in&amp;nbsp;XCVR_Configure()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the&amp;nbsp;MKW41Z_ConnSw_1.0.2 package, and creating a project with genfsk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. What are the implications of just skipping the&amp;nbsp;&lt;SPAN&gt;rx_bba_dcoc_dac_trim_shortIQ function?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. if the function is needed, is it really necessary to be using floating point math on a cortex M0? &amp;nbsp;That is incredibly inefficient and time consuming. &amp;nbsp; I have narrowed most of the time from&amp;nbsp;rx_bba_dcoc_dac_trim_shortIQ be due to several calls to DC_Measure_short, which call&amp;nbsp;rx_dc_sample_average, which does a large loop operation with floating point divide (each of which consumes approximately 30us for each divide), called 256 times in this function, and this function is called 6 times during the radio initialization.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;&lt;SPAN&gt;num_iq_samples = 128&lt;/SPAN&gt;

&lt;SPAN&gt; for (i = 0; i &amp;lt; num_iq_samples*2; i+=2)
 {
 static int16_t i_value;
 static int16_t q_value;
 
 /* Average I &amp;amp; Q channels separately. */
 i_value = *(sample_ptr+i); /* Sign extend from 12 to 16 bits. */
 q_value = *(sample_ptr+i+1); /* Sign extend from 12 to 16 bits. */
 avg_i += ((float)i_value - avg_i) / (float)(i+1); /* Rolling average I */
 avg_q += ((float)q_value - avg_q) / (float)(i+1); /* Rolling average Q */
 }&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, In the process of trying to identify where the time was being spent, I've also noticed a bug in fsl_xcvr_trim.c in&amp;nbsp;XcvrCalDelay(). &amp;nbsp;This busy wait loop appears to be only half written. &amp;nbsp;In using timestamps, I measured this function to be off by an order of magnitude. &amp;nbsp;I fixed it by doing the following.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;void XcvrCalDelay(uint32_t time)
{
int32_t delay = time*32;
 while(delay &amp;gt; 0) /* Time delay is roughly in uSec. */
 { 
 delay-=10;
 }
}&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But with this fix, that begs the question, are the places this function and the parameter passed in for wait duration just empirically found? &amp;nbsp;In which case all delay parameters would need to be corrected&amp;nbsp;now that I have fixed the delay function to be more accurate. &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 16:35:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/W41z-boot-time/m-p/658902#M2637</guid>
      <dc:creator>justinjansen</dc:creator>
      <dc:date>2017-05-02T16:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: W41z boot time</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/W41z-boot-time/m-p/658903#M2638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Justin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You CAN NOT skip the rx_bba_dcoc_dac_trim_shortIQ().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This procedure was optimized in the newer release. Instead of running the rx_bba_dcoc_dac_trim_shortIQ(), the newer release calls the rx_bba_dcoc_dac_trim_DCest().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked the "rx_bba_dcoc_dac_trim_DCest()" function, and it takes to run 409.9us&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding to the XcvrCalDelay().&amp;nbsp; The incorrect implementation was already identified. However, this does not impact the trimming procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Mario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 20:15:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/W41z-boot-time/m-p/658903#M2638</guid>
      <dc:creator>mario_castaneda</dc:creator>
      <dc:date>2017-05-25T20:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: W41z boot time</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/W41z-boot-time/m-p/658904#M2639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In case anyone finds this thread when investigating why there is floating point code in the radio driver:&lt;/P&gt;&lt;P&gt;I wrote an integer only version of the trimming procedure for use in the RIOT driver for the KW41Z radio.&lt;/P&gt;&lt;P&gt;The code from the pull request is available here: &lt;A class="link-titled" href="https://github.com/gebart/RIOT/blob/pr/kw41zrf/drivers/kw41zrf/kw41zrf_xcvr.c" title="https://github.com/gebart/RIOT/blob/pr/kw41zrf/drivers/kw41zrf/kw41zrf_xcvr.c"&gt;RIOT/kw41zrf_xcvr.c at pr/kw41zrf · gebart/RIOT · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The pull request thread can be found here: &lt;A class="link-titled" href="https://github.com/RIOT-OS/RIOT/pull/7107" title="https://github.com/RIOT-OS/RIOT/pull/7107"&gt;drivers: Add support for KW41Z builtin transceiver by gebart · Pull Request #7107 · RIOT-OS/RIOT · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some minor code typos were corrected in the rewrite as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2018 07:57:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/W41z-boot-time/m-p/658904#M2639</guid>
      <dc:creator>jneistec</dc:creator>
      <dc:date>2018-12-14T07:57:11Z</dc:date>
    </item>
  </channel>
</rss>

