<?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>i.MX ProcessorsのトピックRe: MX53 FlexCAN bitrate is incorrect?</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/MX53-FlexCAN-bitrate-is-incorrect/m-p/232893#M17898</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexander,&lt;/P&gt;&lt;P&gt;Your patch fixes the bitrate issue. Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 27 Oct 2013 11:58:01 GMT</pubDate>
    <dc:creator>frankchenmh</dc:creator>
    <dc:date>2013-10-27T11:58:01Z</dc:date>
    <item>
      <title>MX53 FlexCAN bitrate is incorrect?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MX53-FlexCAN-bitrate-is-incorrect/m-p/232891#M17896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The flexcan can send/receive data successfully between two MX53 baords (On one board running "cansend" and on the other running "candump"). I set the bitrate through flexcan attributes interface (for eg., "echo 125000 &amp;gt; /sys/devices/platform/FlexCAN.0/bitrate").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However MX53 board can not communicate with other CAN devices (for eg., MX6 flexcan). I checked the waveform of MX53 flexcan by an oscilloscope and found the actual bitrate is incorrect. It is about 2.5 time of the expected values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I reviewed the clock settings of CAN and debugged the driver. By "cat /proc/cpu/clocks" I can see the can_clk-0 is 24MHz, and its parent lp_apm-0 is 24MHz too. They should be all correct.&lt;/P&gt;&lt;P&gt;When I set the bitrate (by "echo ..."), for eg, set to 500KHz, the driver calculated the timing values and got the following results:&lt;/P&gt;&lt;P&gt;brp = 2, phase_seg1 = 4, phase_seg2 = 4, prop_seg = 4&lt;/P&gt;&lt;P&gt;So the bitrate is (24MHz / ((brp + 1) * (phase_seg1 + phase_seg2 + prop_seg + 4))) = 24MHz / (3 * 16) = 500KHz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So everything looks right, but why the bitrate waveform on the oscilloscope is incorrect?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BSP I used is MX53 Android R10.3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anybody has similar issue, please advise. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 07:23:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MX53-FlexCAN-bitrate-is-incorrect/m-p/232891#M17896</guid>
      <dc:creator>frankchenmh</dc:creator>
      <dc:date>2013-10-25T07:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: MX53 FlexCAN bitrate is incorrect?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MX53-FlexCAN-bitrate-is-incorrect/m-p/232892#M17897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Frank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the linux kernel flexcan parent clock is set incorrectly. try to correct arch/arm/mach-mx5/clock.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int __init mx53_clocks_init(unsigned long ckil, unsigned long osc, unsigned long ckih1, unsigned long ckih2)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;/*set the SPDIF dividers to 1 */&lt;/P&gt;&lt;P&gt;reg = __raw_readl(MXC_CCM_CDCDR);&lt;/P&gt;&lt;P&gt;reg &amp;amp;= ~MXC_CCM_CDCDR_SPDIF0_CLK_PODF_MASK;&lt;/P&gt;&lt;P&gt;reg &amp;amp;= ~MXC_CCM_CDCDR_SPDIF0_CLK_PRED_MASK;&lt;/P&gt;&lt;P&gt;__raw_writel(reg, MXC_CCM_CDCDR);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;++ clk_set_parent(&amp;amp;can1_clk[0], &amp;amp;lp_apm_clk);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;++ clk_set_parent(&amp;amp;can2_clk[0], &amp;amp;lp_apm_clk);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Move SSI clocks to SSI_LP_APM clock */&lt;/P&gt;&lt;P&gt;clk_set_parent(&amp;amp;ssi_lp_apm_clk, &amp;amp;lp_apm_clk);&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 13:20:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MX53-FlexCAN-bitrate-is-incorrect/m-p/232892#M17897</guid>
      <dc:creator>Sasamy</dc:creator>
      <dc:date>2013-10-25T13:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: MX53 FlexCAN bitrate is incorrect?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MX53-FlexCAN-bitrate-is-incorrect/m-p/232893#M17898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexander,&lt;/P&gt;&lt;P&gt;Your patch fixes the bitrate issue. Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Oct 2013 11:58:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MX53-FlexCAN-bitrate-is-incorrect/m-p/232893#M17898</guid>
      <dc:creator>frankchenmh</dc:creator>
      <dc:date>2013-10-27T11:58:01Z</dc:date>
    </item>
  </channel>
</rss>

