<?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>topic Re: MKS22FN128 - Issue with CAN BUS in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKS22FN128-Issue-with-CAN-BUS/m-p/1528265#M64085</link>
    <description>&lt;P&gt;Thank you so much for your interest in our products and for using our community.&lt;/P&gt;
&lt;P&gt;I have noticed that you have another ticket with the same topic, please consult the follow-up in this last one that I mention.&lt;/P&gt;
&lt;P&gt;Have a nice day!&lt;/P&gt;</description>
    <pubDate>Mon, 26 Sep 2022 16:24:00 GMT</pubDate>
    <dc:creator>_Leo_</dc:creator>
    <dc:date>2022-09-26T16:24:00Z</dc:date>
    <item>
      <title>MKS22FN128 - Issue with CAN BUS</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKS22FN128-Issue-with-CAN-BUS/m-p/1527231#M64080</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;We have been trying to get the CAN 1 running on the KS22 micro, the data is being sent but we get nothing but can bus errors. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;When we examine the ID on the transmitted message its zero? We used the example code and this is the same. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;We noticed a note in the documentation which seems to infer that we need an external oscillator, we are currently using the internal and have not used an external osc. Do we need an external osc?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; we have tried all methods of bit timing, rewritten the config several times. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;We have never had an issue of this sort before having worked mainly on the S32 and LPC229xx&amp;nbsp; we are concerned that this micro may have an issue.We have used a very simple setup below and just concentrating on CAN1, but I am out of ideas?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;flexcan_config_t flexcanConfig;&lt;BR /&gt;flexcan_rx_mb_config_t mbConfig;&lt;/P&gt;&lt;P&gt;/* Initialize board hardware. */&lt;BR /&gt;BOARD_InitBootPins();&lt;BR /&gt;BOARD_BootClockRUN();&lt;BR /&gt;BOARD_InitDebugConsole();&lt;/P&gt;&lt;P&gt;/* Init FlexCAN module. */&lt;BR /&gt;/*&lt;BR /&gt;* flexcanConfig.clkSrc = kFLEXCAN_ClkSrcOsc;&lt;BR /&gt;* flexcanConfig.baudRate = 125000U;&lt;BR /&gt;* flexcanConfig.maxMbNum = 16;&lt;BR /&gt;* flexcanConfig.enableLoopBack = false;&lt;BR /&gt;* flexcanConfig.enableSelfWakeup = false;&lt;BR /&gt;* flexcanConfig.enableIndividMask = false;&lt;BR /&gt;* flexcanConfig.enableDoze = false;&lt;BR /&gt;*/&lt;BR /&gt;FLEXCAN_GetDefaultConfig(&amp;amp;flexcanConfig);&lt;BR /&gt;flexcanConfig.clkSrc = kFLEXCAN_ClkSrcPeri;&lt;BR /&gt;//flexcanConfig.enableLoopBack = true;&lt;BR /&gt;flexcanConfig.baudRate = 500000U;&lt;BR /&gt;//FLEXCAN_Init(EXAMPLE_CAN, &amp;amp;flexcanConfig, CLOCK_GetFreq(EXAMPLE_CAN_CLKSRC));&lt;BR /&gt;FLEXCAN_Init(EXAMPLE_CAN1, &amp;amp;flexcanConfig, CLOCK_GetFreq(EXAMPLE_CAN_CLKSRC));&lt;/P&gt;&lt;P&gt;/* Setup Rx Message Buffer. */&lt;BR /&gt;mbConfig.format = kFLEXCAN_FrameFormatStandard;&lt;BR /&gt;mbConfig.type = kFLEXCAN_FrameTypeData;&lt;BR /&gt;mbConfig.id = 0x0AB;&lt;BR /&gt;FLEXCAN_SetRxMbConfig(EXAMPLE_CAN1, RX_MESSAGE_BUFFER_NUM, &amp;amp;mbConfig, true);&lt;/P&gt;&lt;P&gt;/* Setup Tx Message Buffer. */&lt;BR /&gt;FLEXCAN_SetTxMbConfig(EXAMPLE_CAN1, TX_MESSAGE_BUFFER_NUM, true);&lt;/P&gt;&lt;P&gt;/* Create FlexCAN handle structure and set call back function. */&lt;BR /&gt;//FLEXCAN_TransferCreateHandle(EXAMPLE_CAN, &amp;amp;flexcanHandle, flexcan_callback, NULL);&lt;BR /&gt;FLEXCAN_TransferCreateHandle(EXAMPLE_CAN1, &amp;amp;flexcanHandle, flexcan_callback, NULL);&lt;/P&gt;&lt;P&gt;/* Start receive data through Rx Message Buffer. */&lt;BR /&gt;rxXfer.frame = &amp;amp;rxFrame;&lt;BR /&gt;rxXfer.mbIdx = RX_MESSAGE_BUFFER_NUM;&lt;BR /&gt;FLEXCAN_TransferReceiveNonBlocking(EXAMPLE_CAN1, &amp;amp;flexcanHandle, &amp;amp;rxXfer);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Prepare Tx Frame for sending. */&lt;BR /&gt;txFrame.format = kFLEXCAN_FrameFormatStandard;&lt;BR /&gt;txFrame.type = kFLEXCAN_FrameTypeData;&lt;BR /&gt;txFrame.id = FLEXCAN_ID_STD(0x223);&lt;BR /&gt;txFrame.length = 8;&lt;BR /&gt;txFrame.dataWord0 = CAN_WORD0_DATA_BYTE_0(0x11) | CAN_WORD0_DATA_BYTE_1(0x22) | CAN_WORD0_DATA_BYTE_2(0x33) |&lt;BR /&gt;CAN_WORD0_DATA_BYTE_3(0x44);&lt;BR /&gt;txFrame.dataWord1 = CAN_WORD1_DATA_BYTE_4(0x55) | CAN_WORD1_DATA_BYTE_5(0x66) | CAN_WORD1_DATA_BYTE_6(0x77) |&lt;BR /&gt;CAN_WORD1_DATA_BYTE_7(0x88);&lt;/P&gt;&lt;P&gt;PRINTF("Send message from MB%d to MB%d\r\n", TX_MESSAGE_BUFFER_NUM, RX_MESSAGE_BUFFER_NUM);&lt;/P&gt;&lt;P&gt;/* Send data through Tx Message Buffer. */&lt;BR /&gt;txXfer.frame = &amp;amp;txFrame;&lt;BR /&gt;txXfer.mbIdx = TX_MESSAGE_BUFFER_NUM;&lt;BR /&gt;FLEXCAN_TransferSendNonBlocking(EXAMPLE_CAN1, &amp;amp;flexcanHandle, &amp;amp;txXfer);&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Any suggestions or help would be really appreciated - otherwise we are going to have to redesign on an alternative process, whcih we would rather not do.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 08:24:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKS22FN128-Issue-with-CAN-BUS/m-p/1527231#M64080</guid>
      <dc:creator>john_keates</dc:creator>
      <dc:date>2022-09-23T08:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: MKS22FN128 - Issue with CAN BUS</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKS22FN128-Issue-with-CAN-BUS/m-p/1528265#M64085</link>
      <description>&lt;P&gt;Thank you so much for your interest in our products and for using our community.&lt;/P&gt;
&lt;P&gt;I have noticed that you have another ticket with the same topic, please consult the follow-up in this last one that I mention.&lt;/P&gt;
&lt;P&gt;Have a nice day!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 16:24:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKS22FN128-Issue-with-CAN-BUS/m-p/1528265#M64085</guid>
      <dc:creator>_Leo_</dc:creator>
      <dc:date>2022-09-26T16:24:00Z</dc:date>
    </item>
  </channel>
</rss>

