<?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 Motor SuiteのトピックRe: CAN communication interruption problem with FRDM-KV11Z</title>
    <link>https://community.nxp.com/t5/Kinetis-Motor-Suite/CAN-communication-interruption-problem-with-FRDM-KV11Z/m-p/1974923#M955</link>
    <description>&lt;P&gt;您好 XuZhang&lt;/P&gt;&lt;P&gt;感谢您提供的支持。&lt;/P&gt;&lt;P&gt;我已经解决这个问题了&lt;/P&gt;</description>
    <pubDate>Wed, 16 Oct 2024 07:32:55 GMT</pubDate>
    <dc:creator>HL_G</dc:creator>
    <dc:date>2024-10-16T07:32:55Z</dc:date>
    <item>
      <title>CAN communication interruption problem with FRDM-KV11Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Motor-Suite/CAN-communication-interruption-problem-with-FRDM-KV11Z/m-p/1970880#M949</link>
      <description>&lt;P&gt;When testing the FRDM-KV11Z development board with the SDK provided by the official, it was found that the CAN communication could not enter the interrupt. The SDK routines are used with FreeMASTER software. I don't have this device around, so I ported it myself. The following is my code:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;static void init_CAN(void)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;status_t status;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;flexcan_config_t flexcanConfig;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;flexcan_timing_config_t timing_config;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;uint32_t canSrcClock = CLOCK_GetFreq(kCLOCK_CoreSysClk);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;/* Init FlexCAN module. */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;/*&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;* flexcanConfig.clksrc=kFLEXCAN_ClkSrcOsc;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;* flexcanConfig.baudRate = 1000000U;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;* flexcanConfig.baudRateFD = 2000000U;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;* flexcanConfig.maxMbNum = 16;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;* flexcanConfig.enableLoopBack = false;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;* flexcanConfig.enableSelfWakeup = false;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;* flexcanConfig.enableIndividMask = false;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;* flexcanConfig.enableDoze = false;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;*/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;FLEXCAN_GetDefaultConfig(&amp;amp;flexcanConfig);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;flexcanConfig.clksrc=kFLEXCAN_ClkSrcPeri;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;flexcanConfig.baudRate = 100000U;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;/* Update the improved timing configuration */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;if (FLEXCAN_CalculateImprovedTimingValues(CAN0, flexcanConfig.baudRate, canSrcClock, &amp;amp;timing_config))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;flexcanConfig.timingConfig = timing_config;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;FLEXCAN_Init(CAN0, &amp;amp;flexcanConfig, canSrcClock);&lt;BR /&gt;/* Enable CAN interrupt. */&lt;BR /&gt;EnableIRQ(CAN0_IRQn);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT color="#FF6600"&gt;void CAN0_IRQHandler(void)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;uint32_t isrFlags = FLEXCAN_GetStatusFlags(CAN0);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;uint32_t isrFlagsMB = FLEXCAN_GetMbStatusFlags(CAN0, 0xFFFFFFFFUL);&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;count++;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;if (isrFlags != 0U)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;FLEXCAN_ClearStatusFlags(CAN0, isrFlags);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;if (isrFlagsMB != 0U)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;/* Read or Write */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;if ((isrFlagsMB &amp;amp; (1UL &amp;lt;&amp;lt; (FMSTR_FLEXCAN_RXMB))) != 0U)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;/* Is any data received? */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;if (FLEXCAN_GetMbStatusFlags(CAN0, 1UL &amp;lt;&amp;lt; (FMSTR_FLEXCAN_RXMB)) == 0U)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;return;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;/* Try to read data, when successful, the MB is acknowledged and set for next receive */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;status_t s = FLEXCAN_ReadRxMb(CAN0, FMSTR_FLEXCAN_RXMB, &amp;amp;CAN_Rxmsg);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;if ((isrFlagsMB &amp;amp; (1UL &amp;lt;&amp;lt; (FMSTR_FLEXCAN_TXMB))) != 0U)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;/* Acknowledge frame transmission */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;CAN_Txmsg.length = 0U;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT color="#FF6600"&gt;/* Clear all interrupt flags */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;FLEXCAN_ClearMbStatusFlags(CAN0, isrFlagsMB);&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;status_t status_can;&lt;/P&gt;&lt;P&gt;/* Init board hardware. */&lt;BR /&gt;BOARD_InitBootPins();&lt;BR /&gt;BOARD_InitBootClocks();&lt;BR /&gt;BOARD_InitDebugConsole();&lt;BR /&gt;init_CAN();&lt;BR /&gt;PRINTF("SPI DAM Init OK.\r\n");&lt;BR /&gt;CAN_Txmsg.format = 1; //扩展帧ID&lt;BR /&gt;CAN_Txmsg.timestamp = 1000; //超时时间&lt;BR /&gt;CAN_Txmsg.type = 0; //数据帧&lt;BR /&gt;CAN_Txmsg.length = 8; //数据长度&lt;BR /&gt;CAN_Txmsg.id = 0x123; //帧ID&lt;BR /&gt;/* 8位数据 */&lt;BR /&gt;CAN_Txmsg.dataByte0 = 0x0;&lt;BR /&gt;CAN_Txmsg.dataByte1 = 0x1;&lt;BR /&gt;CAN_Txmsg.dataByte2 = 0x2;&lt;BR /&gt;CAN_Txmsg.dataByte3 = 0x3;&lt;BR /&gt;CAN_Txmsg.dataByte4 = 0x4;&lt;BR /&gt;CAN_Txmsg.dataByte5 = 0x5;&lt;BR /&gt;CAN_Txmsg.dataByte6 = 0x6;&lt;BR /&gt;CAN_Txmsg.dataByte7 = 0x7;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT&gt;/* 发送数据 */&lt;BR /&gt;FLEXCAN_WriteTxMb(CAN0, 0, &amp;amp;CAN_Txmsg);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;while (1)&lt;BR /&gt;{&lt;BR /&gt;status_can = FLEXCAN_WriteTxMb(CAN0, 0, &amp;amp;CAN_Txmsg);&lt;BR /&gt;if(status_can != kStatus_Fail)&lt;BR /&gt;PRINTF("CAN Write success %d\r\n", count);&lt;BR /&gt;else&lt;BR /&gt;PRINTF("CAN Write fail %d\r\n", count);&lt;BR /&gt;SDK_DelayAtLeastUs(1000000, BOARD_BOOTCLOCKRUN_CORE_CLOCK); //延时1秒&lt;/FONT&gt;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;The data can now be successfully sent. But there is no interrupt to enter, and there is no interrupt to receive data.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 03:44:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Motor-Suite/CAN-communication-interruption-problem-with-FRDM-KV11Z/m-p/1970880#M949</guid>
      <dc:creator>HL_G</dc:creator>
      <dc:date>2024-10-10T03:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: CAN communication interruption problem with FRDM-KV11Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Motor-Suite/CAN-communication-interruption-problem-with-FRDM-KV11Z/m-p/1972575#M952</link>
      <description>&lt;P&gt;&lt;FONT&gt;hi,&lt;SPAN&gt;HL_G&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for your interest in NXP Semiconductor products and the opportunity to serve you, I will gladly help you with this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Please confirm whether the development board CAN connect to FreeMASTER through Freemaster-over-can. Please conduct connection test in the following way.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XuZhang_0-1728715517072.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/304343iA53D7C4723A62707/image-size/medium?v=v2&amp;amp;px=400" role="button" title="XuZhang_0-1728715517072.png" alt="XuZhang_0-1728715517072.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can then Enable CAN interrupt by modifying the following program in the SDK's frdmkv11z_fmstr_example_can demo.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XuZhang_1-1728715528707.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/304344iD9B4AC99181D27E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="XuZhang_1-1728715528707.png" alt="XuZhang_1-1728715528707.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Besides, are you saying you don't have any FreeMaster tools? Below is the download link.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com.cn/webapp/sps/download/license.jsp?colCode=FMASTERSW&amp;amp;appType=file1&amp;amp;DOWNLOAD_ID=null" target="_blank"&gt;FreeMASTER tool 3.2 (includes Lite 1.3) – Windows installer (nxp.com.cn)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Wish it helps you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you still have question about it,please kindly let me know.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Xu Zhang&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 06:49:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Motor-Suite/CAN-communication-interruption-problem-with-FRDM-KV11Z/m-p/1972575#M952</guid>
      <dc:creator>Joey_z</dc:creator>
      <dc:date>2024-10-12T06:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: CAN communication interruption problem with FRDM-KV11Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Motor-Suite/CAN-communication-interruption-problem-with-FRDM-KV11Z/m-p/1974923#M955</link>
      <description>&lt;P&gt;您好 XuZhang&lt;/P&gt;&lt;P&gt;感谢您提供的支持。&lt;/P&gt;&lt;P&gt;我已经解决这个问题了&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 07:32:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Motor-Suite/CAN-communication-interruption-problem-with-FRDM-KV11Z/m-p/1974923#M955</guid>
      <dc:creator>HL_G</dc:creator>
      <dc:date>2024-10-16T07:32:55Z</dc:date>
    </item>
  </channel>
</rss>

