<?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>Kinetis Software Development KitのトピックRe: KSDK assertion failed clocking the SDHC at 20MHz</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-assertion-failed-clocking-the-SDHC-at-20MHz/m-p/824882#M7873</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simon:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please let me know your KSDK version?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Oct 2018 15:14:56 GMT</pubDate>
    <dc:creator>danielchen</dc:creator>
    <dc:date>2018-10-25T15:14:56Z</dc:date>
    <item>
      <title>KSDK assertion failed clocking the SDHC at 20MHz</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-assertion-failed-clocking-the-SDHC-at-20MHz/m-p/824881#M7872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if this is a bug, but in my MK64F project I clock the SDHC from a 20MHz oscillator (kCLOCK_OSC0ErClk). The SD_CardInit and SD_SelectBusTiming functions call SDHC_SetSdClock functions with parameters&amp;nbsp;like &lt;SPAN&gt;SD_CLOCK_25MHZ,&amp;nbsp;&lt;/SPAN&gt;SD_CLOCK_50MHZ and SD_CLOCK_100MHZ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the&amp;nbsp;SDHC_SetSdClock function there is&amp;nbsp;the assertion:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;assert((busClock_Hz != 0U) &amp;amp;&amp;amp; (busClock_Hz &amp;lt;= srcClock_Hz));&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This will assert because my source clock is 20MHz and the bus clock is greater. I have added the following line to SDHC_SetSdClock as a workaround.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;busClock_Hz = MIN(srcClock_Hz, busClock_Hz);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Is this an issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-335248"&gt;this document&lt;/A&gt;&amp;nbsp;indicates the maximum SDHC timing for K64 parts should be 40MHz, and not 50MHz as in the SDK... Does that advice still apply?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2018 04:35:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-assertion-failed-clocking-the-SDHC-at-20MHz/m-p/824881#M7872</guid>
      <dc:creator>simonhaines</dc:creator>
      <dc:date>2018-10-24T04:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: KSDK assertion failed clocking the SDHC at 20MHz</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-assertion-failed-clocking-the-SDHC-at-20MHz/m-p/824882#M7873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simon:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please let me know your KSDK version?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2018 15:14:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-assertion-failed-clocking-the-SDHC-at-20MHz/m-p/824882#M7873</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2018-10-25T15:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: KSDK assertion failed clocking the SDHC at 20MHz</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-assertion-failed-clocking-the-SDHC-at-20MHz/m-p/824883#M7874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simon:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer to the function parameters,&amp;nbsp;&amp;nbsp; busClock_Hz is SD bus clock frequency, not system bus clock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*!&lt;BR /&gt;&amp;nbsp;* @brief Sets the SD bus clock frequency.&lt;BR /&gt;&amp;nbsp;*&lt;BR /&gt;&amp;nbsp;* @param base SDHC peripheral base address.&lt;BR /&gt;&amp;nbsp;* @param srcClock_Hz SDHC source clock frequency united in Hz.&lt;BR /&gt;&amp;nbsp;* @param busClock_Hz SD bus clock frequency united in Hz.&lt;BR /&gt;&amp;nbsp;*&lt;BR /&gt;&amp;nbsp;* @return The nearest frequency of busClock_Hz configured to SD bus.&lt;BR /&gt;&amp;nbsp;*/&lt;BR /&gt;uint32_t SDHC_SetSdClock(SDHC_Type *base, uint32_t srcClock_Hz, uint32_t busClock_Hz);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 02:56:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-assertion-failed-clocking-the-SDHC-at-20MHz/m-p/824883#M7874</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2018-10-26T02:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: KSDK assertion failed clocking the SDHC at 20MHz</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-assertion-failed-clocking-the-SDHC-at-20MHz/m-p/824884#M7875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;Version is KSDK 2.4.2.&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Simon.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2018 00:13:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-assertion-failed-clocking-the-SDHC-at-20MHz/m-p/824884#M7875</guid>
      <dc:creator>simonhaines</dc:creator>
      <dc:date>2018-11-01T00:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: KSDK assertion failed clocking the SDHC at 20MHz</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-assertion-failed-clocking-the-SDHC-at-20MHz/m-p/824885#M7876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;It is perfectly OK to set &lt;STRONG&gt;SIM_SOPT2:SDHCSRC&lt;/STRONG&gt; to a 20MHz source clock. In this case the SD bus clock cannot be more than 20MHz of course, but this is&amp;nbsp;OK according to the SD Physical Specification Version 1.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However if you &lt;SPAN&gt;set&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;SIM_SOPT2:SDHCSRC&lt;/STRONG&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;0MHz source clock and then call the KSDK 2.4.2 function&amp;nbsp;&lt;STRONG&gt;SD_CardInit(sd_card_t *card)&lt;/STRONG&gt;, then that function will call&amp;nbsp;&lt;STRONG&gt;SDHC_SetSdClock(card-&amp;gt;host.base, card-&amp;gt;host.sourceClock_Hz, SD_CLOCK_25MHZ)&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As you can see, if the value of &lt;STRONG&gt;srcClock_Hz&lt;/STRONG&gt; is 20MHz and the value of&amp;nbsp;&lt;STRONG&gt;busClock_Hz&lt;/STRONG&gt; is 25MHz, then this line will not work:&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN&gt;assert((busClock_Hz != 0U) &amp;amp;&amp;amp; (busClock_Hz &amp;lt;= srcClock_Hz));&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is a bug. When the SDK tries to set the bus clock greater than the source clock, it should instead set the bus clock to be equal to the source clock (i.e. 20MHz). This is in KSDK 2.4.2, file fsl_sdhc.c, function SDHC_SetSdClock, line 891.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Simon.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2018 00:37:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-assertion-failed-clocking-the-SDHC-at-20MHz/m-p/824885#M7876</guid>
      <dc:creator>simonhaines</dc:creator>
      <dc:date>2018-11-01T00:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: KSDK assertion failed clocking the SDHC at 20MHz</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-assertion-failed-clocking-the-SDHC-at-20MHz/m-p/824886#M7877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have had the same issues - my workaround was slightly different, I just lie and tell the SDK that my srcClock_Hz matches the request bus clock, i.e. use a srcClock_Hz = 25MHz even though it is actually 20MHz.&amp;nbsp; It seems to work fine and since my actual srcClock is slower, I think that meets the spec.&amp;nbsp; I have been wondering if I'm doing something wrong, given Simon's comments it seems like this is another possible workaround, although his "fix" seems more correct.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2018 04:07:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-assertion-failed-clocking-the-SDHC-at-20MHz/m-p/824886#M7877</guid>
      <dc:creator>jeff_rosen</dc:creator>
      <dc:date>2018-12-04T04:07:30Z</dc:date>
    </item>
  </channel>
</rss>

