<?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 RT Crossover MCUsのトピックIs FlexCAN3 (CAN-FD) dependent on LPUART module clock?</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Is-FlexCAN3-CAN-FD-dependent-on-LPUART-module-clock/m-p/961487#M4569</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;For our iMXRT1064-based project, we are using the fsl_flexcan.c driver distributed with MCUXpresso SDK, and we notice that the FLEXCAN_Init() function hangs if we don’t previously initialize one of the LPUART instances. The location of the hang is in FLEXCAN_Init(), when it comes time to disable the module, set CTRL1.CLKSRC bit and then re-enable the module. When the module is disabled (MCR.MDIS = 1), the MCR.LPMACK bit never gets set to acknowledge low power mode so software hangs in the while loop:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static inline void FLEXCAN_Enable(CAN_Type *base, bool enable)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; if (enable)&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; base-&amp;gt;MCR &amp;amp;= ~CAN_MCR_MDIS_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; /* Wait FlexCAN exit from low-power mode. */&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;while (base-&amp;gt;MCR &amp;amp; CAN_MCR_LPMACK_MASK)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; { }&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;…&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We find that FlexCAN initializes successfully only if at least one of the LPUART clocks is enabled (e.g., CCM_CCGR0.CG14=3 for lpuart2 clock). If none of the lpuart clocks is enabled, then the software hangs. This behavior we confirmed with the canfd interrupt_transfer example code using the iMXRT1064EVB.&lt;/P&gt;&lt;P&gt;Is this expected behavior? Is it required to have the lpuart clock enabled for FlexCAN peripheral (at least the FlexCAN3 CAN-FD peripheral) to function correctly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Aug 2019 21:50:17 GMT</pubDate>
    <dc:creator>johnpulera</dc:creator>
    <dc:date>2019-08-06T21:50:17Z</dc:date>
    <item>
      <title>Is FlexCAN3 (CAN-FD) dependent on LPUART module clock?</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Is-FlexCAN3-CAN-FD-dependent-on-LPUART-module-clock/m-p/961487#M4569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;For our iMXRT1064-based project, we are using the fsl_flexcan.c driver distributed with MCUXpresso SDK, and we notice that the FLEXCAN_Init() function hangs if we don’t previously initialize one of the LPUART instances. The location of the hang is in FLEXCAN_Init(), when it comes time to disable the module, set CTRL1.CLKSRC bit and then re-enable the module. When the module is disabled (MCR.MDIS = 1), the MCR.LPMACK bit never gets set to acknowledge low power mode so software hangs in the while loop:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static inline void FLEXCAN_Enable(CAN_Type *base, bool enable)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; if (enable)&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; base-&amp;gt;MCR &amp;amp;= ~CAN_MCR_MDIS_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; /* Wait FlexCAN exit from low-power mode. */&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;while (base-&amp;gt;MCR &amp;amp; CAN_MCR_LPMACK_MASK)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; { }&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;…&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We find that FlexCAN initializes successfully only if at least one of the LPUART clocks is enabled (e.g., CCM_CCGR0.CG14=3 for lpuart2 clock). If none of the lpuart clocks is enabled, then the software hangs. This behavior we confirmed with the canfd interrupt_transfer example code using the iMXRT1064EVB.&lt;/P&gt;&lt;P&gt;Is this expected behavior? Is it required to have the lpuart clock enabled for FlexCAN peripheral (at least the FlexCAN3 CAN-FD peripheral) to function correctly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2019 21:50:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Is-FlexCAN3-CAN-FD-dependent-on-LPUART-module-clock/m-p/961487#M4569</guid>
      <dc:creator>johnpulera</dc:creator>
      <dc:date>2019-08-06T21:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is FlexCAN3 (CAN-FD) dependent on LPUART module clock?</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Is-FlexCAN3-CAN-FD-dependent-on-LPUART-module-clock/m-p/961488#M4570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI &lt;A _jive_internal="true" data-content-finding="Community" data-userid="290162" data-username="johnpulera" href="https://community.nxp.com/people/johnpulera"&gt;John Pulera&lt;/A&gt; ,&lt;/P&gt;&lt;P&gt;Could you please also tell me the detail pins for FlexCan and the LPUART you are using?&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Aug 2019 11:02:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Is-FlexCAN3-CAN-FD-dependent-on-LPUART-module-clock/m-p/961488#M4570</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2019-08-07T11:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Is FlexCAN3 (CAN-FD) dependent on LPUART module clock?</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Is-FlexCAN3-CAN-FD-dependent-on-LPUART-module-clock/m-p/961489#M4571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;We are using FlexCAN3 peripheral at pins&lt;/P&gt;&lt;P&gt;GPIO_AD_B0_14 (FLEXCAN3_TX) and GPIO_AD_B0_15 (FLEXCAN3_RX)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the pin IOMUX initialization:&lt;/P&gt;&lt;PRE&gt;void BOARD_InitCANPins(void) {
&amp;nbsp; &amp;nbsp; CLOCK_EnableClock(kCLOCK_Iomuxc);
&amp;nbsp; &amp;nbsp; IOMUXC_SetPinMux( IOMUXC_GPIO_AD_B0_14_FLEXCAN3_TX, 1U);
&amp;nbsp; &amp;nbsp; IOMUXC_SetPinMux( IOMUXC_GPIO_AD_B0_15_FLEXCAN3_RX, 1U);
&amp;nbsp; &amp;nbsp; IOMUXC_SetPinConfig( IOMUXC_GPIO_AD_B0_14_FLEXCAN3_TX, 0x10B0u);
&amp;nbsp; &amp;nbsp; IOMUXC_SetPinConfig( IOMUXC_GPIO_AD_B0_15_FLEXCAN3_RX, 0x10B0u);
}&lt;/PRE&gt;&lt;P&gt;We are not using LPUART (all the LPUART clocks are disabled in CGM), which is&amp;nbsp;how we discovered the issue. But if one of the LPUART peripherals (doesn't matter which) is initialized, then&amp;nbsp;the CAN successfully initializes. We simply enable an LPUART clock at the end of BOARD_BootClockRun( ) to workaround the issue rather than initialize the LPUART with the lpuart driver:&lt;/P&gt;&lt;PRE&gt;    CLOCK_EnableClock(kCLOCK_Lpuart1); &lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Aug 2019 16:28:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Is-FlexCAN3-CAN-FD-dependent-on-LPUART-module-clock/m-p/961489#M4571</guid>
      <dc:creator>johnpulera</dc:creator>
      <dc:date>2019-08-07T16:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Is FlexCAN3 (CAN-FD) dependent on LPUART module clock?</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Is-FlexCAN3-CAN-FD-dependent-on-LPUART-module-clock/m-p/961490#M4572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class=""&gt;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="290162" data-username="johnpulera" href="https://community.nxp.com/people/johnpulera"&gt;John Pulera&lt;/A&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; That's strange, please share your simple project which can reproduce the problem, I will check it on my side.&lt;/P&gt;&lt;P&gt;&amp;nbsp; You can delete all the other code, just leave the FlexCAN code, I will test it on my MIMXRT1064-EVK board.&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2019 09:31:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Is-FlexCAN3-CAN-FD-dependent-on-LPUART-module-clock/m-p/961490#M4572</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2019-08-08T09:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Is FlexCAN3 (CAN-FD) dependent on LPUART module clock?</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Is-FlexCAN3-CAN-FD-dependent-on-LPUART-module-clock/m-p/961491#M4573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;The problem is reproducible with the can_fd\interrupt_transfer example in the MCUXpresso SDK 2.4.0 with slight modification to remove dependencies on the debug console and lpuart code--that way the lpuart peripheral remains uninitialized. I don't see how I can attach a file, so I've inserted the modification of the single file (SDK\boards\evkmimxrt1064\driver_examples\canfd\interrupt_transfer\flexcan_interrupt_transfer.c) that I made below. When the code executes, it hangs inside FLEXCAN_Enable() as I described.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; * Copyright (c) 2015, Freescale Semiconductor, Inc.&lt;BR /&gt; * Copyright 2016-2018 NXP&lt;BR /&gt; * All rights reserved.&lt;BR /&gt; *&lt;BR /&gt; * SPDX-License-Identifier: BSD-3-Clause&lt;BR /&gt; */&lt;/P&gt;&lt;P&gt;//#include "fsl_debug_console.h"&lt;BR /&gt;#include "fsl_flexcan.h"&lt;BR /&gt;#include "board.h"&lt;/P&gt;&lt;P&gt;#include "pin_mux.h"&lt;BR /&gt;#include "clock_config.h"&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt; * Definitions&lt;BR /&gt; ******************************************************************************/&lt;BR /&gt;#define EXAMPLE_CAN CAN3&lt;BR /&gt;#define USE_CANFD (1)&lt;BR /&gt;/* &lt;BR /&gt; * DWORD_IN_MB DLC BYTES_IN_MB Maximum MBs&lt;BR /&gt; * 2 8 kFLEXCAN_8BperMB 32&lt;BR /&gt; * 4 10 kFLEXCAN_16BperMB 21&lt;BR /&gt; * 8 13 kFLEXCAN_32BperMB 12&lt;BR /&gt; * 16 15 kFLEXCAN_64BperMB 7&lt;BR /&gt; *&lt;BR /&gt; * Dword in each message buffer, Length of data in bytes, Payload size must align,&lt;BR /&gt; * and the Message Buffers are limited corresponding to each payload configuration:&lt;BR /&gt; */&lt;BR /&gt;#define DWORD_IN_MB (2)&lt;BR /&gt;#define DLC (8)&lt;BR /&gt;#define BYTES_IN_MB kFLEXCAN_8BperMB&lt;/P&gt;&lt;P&gt;/* Select 80M clock divided by USB1 PLL (480 MHz) as master flexcan clock source */&lt;BR /&gt;#define FLEXCAN_CLOCK_SOURCE_SELECT (2U)&lt;BR /&gt;/* Clock divider for master flexcan clock source */&lt;BR /&gt;#define FLEXCAN_CLOCK_SOURCE_DIVIDER (0U)&lt;BR /&gt;/* Get frequency of flexcan clock */&lt;BR /&gt;#define EXAMPLE_CAN_CLK_FREQ ((CLOCK_GetFreq(kCLOCK_Usb1PllClk) / 6) / (FLEXCAN_CLOCK_SOURCE_DIVIDER + 1U))&lt;BR /&gt;#define RX_MESSAGE_BUFFER_NUM (9)&lt;BR /&gt;#define TX_MESSAGE_BUFFER_NUM (8)&lt;/P&gt;&lt;P&gt;/*******************************************************************************&lt;BR /&gt; * Prototypes&lt;BR /&gt; ******************************************************************************/&lt;/P&gt;&lt;P&gt;/*******************************************************************************&lt;BR /&gt; * Variables&lt;BR /&gt; ******************************************************************************/&lt;BR /&gt;flexcan_handle_t flexcanHandle;&lt;BR /&gt;volatile bool txComplete = false;&lt;BR /&gt;volatile bool rxComplete = false;&lt;BR /&gt;flexcan_mb_transfer_t txXfer, rxXfer;&lt;BR /&gt;#if (defined(USE_CANFD) &amp;amp;&amp;amp; USE_CANFD)&lt;BR /&gt;flexcan_fd_frame_t frame;&lt;BR /&gt;#else&lt;BR /&gt;flexcan_frame_t frame;&lt;BR /&gt;#endif&lt;BR /&gt;uint32_t txIdentifier;&lt;BR /&gt;uint32_t rxIdentifier;&lt;/P&gt;&lt;P&gt;/*******************************************************************************&lt;BR /&gt; * Code&lt;BR /&gt; ******************************************************************************/&lt;BR /&gt;/*!&lt;BR /&gt; * @brief FlexCAN Call Back function&lt;BR /&gt; */&lt;BR /&gt;static void flexcan_callback(CAN_Type *base, flexcan_handle_t *handle, status_t status, uint32_t result, void *userData)&lt;BR /&gt;{&lt;BR /&gt; switch (status)&lt;BR /&gt; {&lt;BR /&gt; case kStatus_FLEXCAN_RxIdle:&lt;BR /&gt; if (RX_MESSAGE_BUFFER_NUM == result)&lt;BR /&gt; {&lt;BR /&gt; rxComplete = true;&lt;BR /&gt; }&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;case kStatus_FLEXCAN_TxIdle:&lt;BR /&gt; if (TX_MESSAGE_BUFFER_NUM == result)&lt;BR /&gt; {&lt;BR /&gt; txComplete = true;&lt;BR /&gt; }&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;default:&lt;BR /&gt; break;&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*!&lt;BR /&gt; * @brief Main function&lt;BR /&gt; */&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt; flexcan_config_t flexcanConfig;&lt;BR /&gt; flexcan_rx_mb_config_t mbConfig;&lt;BR /&gt; uint8_t node_type;&lt;/P&gt;&lt;P&gt;/* Initialize board hardware. */&lt;BR /&gt; BOARD_ConfigMPU();&lt;BR /&gt; BOARD_InitPins();&lt;BR /&gt; BOARD_BootClockRUN();&lt;BR /&gt; //BOARD_InitDebugConsole();&lt;/P&gt;&lt;P&gt;/*Clock setting for FLEXCAN*/&lt;BR /&gt; CLOCK_SetMux(kCLOCK_CanMux, FLEXCAN_CLOCK_SOURCE_SELECT);&lt;BR /&gt; CLOCK_SetDiv(kCLOCK_CanDiv, FLEXCAN_CLOCK_SOURCE_DIVIDER);&lt;/P&gt;&lt;P&gt;//PRINTF("********* FLEXCAN Interrupt EXAMPLE *********\r\n");&lt;BR /&gt; //PRINTF(" Message format: Standard (11 bit id)\r\n");&lt;BR /&gt; //PRINTF(" Message buffer %d used for Rx.\r\n", RX_MESSAGE_BUFFER_NUM);&lt;BR /&gt; //PRINTF(" Message buffer %d used for Tx.\r\n", TX_MESSAGE_BUFFER_NUM);&lt;BR /&gt; //PRINTF(" Interrupt Mode: Enabled\r\n");&lt;BR /&gt; //PRINTF(" Operation Mode: TX and RX --&amp;gt; Normal\r\n");&lt;BR /&gt; //PRINTF("*********************************************\r\n\r\n");&lt;/P&gt;&lt;P&gt;do&lt;BR /&gt; {&lt;BR /&gt; //PRINTF("Please select local node as A or B:\r\n");&lt;BR /&gt; //PRINTF("Note: Node B should start first.\r\n");&lt;BR /&gt; //PRINTF("Node:");&lt;BR /&gt; //node_type = GETCHAR();&lt;BR /&gt; node_type = 'B';&lt;BR /&gt; //PRINTF("%c", node_type);&lt;BR /&gt; //PRINTF("\r\n");&lt;BR /&gt; } while ((node_type != 'A') &amp;amp;&amp;amp; (node_type != 'B') &amp;amp;&amp;amp; (node_type != 'a') &amp;amp;&amp;amp; (node_type != 'b'));&lt;/P&gt;&lt;P&gt;/* Select mailbox ID. */&lt;BR /&gt; if ((node_type == 'A') || (node_type == 'a'))&lt;BR /&gt; {&lt;BR /&gt; txIdentifier = 0x321;&lt;BR /&gt; rxIdentifier = 0x123;&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; txIdentifier = 0x123;&lt;BR /&gt; rxIdentifier = 0x321;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;/* Get FlexCAN module default Configuration. */&lt;BR /&gt; /*&lt;BR /&gt; * flexcanConfig.clkSrc = kFLEXCAN_ClkSrcOsc;&lt;BR /&gt; * flexcanConfig.baudRate = 1000000U;&lt;BR /&gt; * flexcanConfig.baudRateFD = 2000000U;&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; * flexcanConfig.timingConfig = timingConfig;&lt;BR /&gt; */&lt;BR /&gt; FLEXCAN_GetDefaultConfig(&amp;amp;flexcanConfig);&lt;/P&gt;&lt;P&gt;/* Init FlexCAN module. */&lt;BR /&gt;#if (!defined(FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE)) || !FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE&lt;BR /&gt; flexcanConfig.clkSrc = kFLEXCAN_ClkSrcPeri;&lt;BR /&gt;#else&lt;BR /&gt;#if defined(CAN_CTRL1_CLKSRC_MASK)&lt;BR /&gt; if (!FSL_FEATURE_FLEXCAN_INSTANCE_SUPPORT_ENGINE_CLK_SEL_REMOVEn(EXAMPLE_CAN))&lt;BR /&gt; {&lt;BR /&gt; flexcanConfig.clkSrc = kFLEXCAN_ClkSrcPeri;&lt;BR /&gt; }&lt;BR /&gt;#endif&lt;BR /&gt;#endif /* FSL_FEATURE_FLEXCAN_SUPPORT_ENGINE_CLK_SEL_REMOVE */&lt;BR /&gt; /* If special quantum setting is needed, set the timing parameters. */&lt;BR /&gt;#if (defined(SET_CAN_QUANTUM) &amp;amp;&amp;amp; SET_CAN_QUANTUM)&lt;BR /&gt; flexcanConfig.timingConfig.phaseSeg1 = PSEG1;&lt;BR /&gt; flexcanConfig.timingConfig.phaseSeg2 = PSEG2;&lt;BR /&gt; flexcanConfig.timingConfig.propSeg = PROPSEG;&lt;BR /&gt;#if (defined(FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE) &amp;amp;&amp;amp; FSL_FEATURE_FLEXCAN_HAS_FLEXIBLE_DATA_RATE)&lt;BR /&gt; flexcanConfig.timingConfig.fphaseSeg1 = FPSEG1;&lt;BR /&gt; flexcanConfig.timingConfig.fphaseSeg2 = FPSEG2;&lt;BR /&gt; flexcanConfig.timingConfig.fpropSeg = FPROPSEG;&lt;BR /&gt;#endif&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;#if (defined(USE_CANFD) &amp;amp;&amp;amp; USE_CANFD)&lt;BR /&gt; FLEXCAN_FDInit(EXAMPLE_CAN, &amp;amp;flexcanConfig, EXAMPLE_CAN_CLK_FREQ, BYTES_IN_MB, true);&lt;BR /&gt;#else&lt;BR /&gt; FLEXCAN_Init(EXAMPLE_CAN, &amp;amp;flexcanConfig, EXAMPLE_CAN_CLK_FREQ);&lt;BR /&gt;#endif&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;/P&gt;&lt;P&gt;/* Set Rx Masking mechanism. */&lt;BR /&gt; FLEXCAN_SetRxMbGlobalMask(EXAMPLE_CAN, FLEXCAN_RX_MB_STD_MASK(rxIdentifier, 0, 0));&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 = FLEXCAN_ID_STD(rxIdentifier);&lt;BR /&gt;#if (defined(USE_CANFD) &amp;amp;&amp;amp; USE_CANFD)&lt;BR /&gt; FLEXCAN_SetFDRxMbConfig(EXAMPLE_CAN, RX_MESSAGE_BUFFER_NUM, &amp;amp;mbConfig, true);&lt;BR /&gt;#else&lt;BR /&gt; FLEXCAN_SetRxMbConfig(EXAMPLE_CAN, RX_MESSAGE_BUFFER_NUM, &amp;amp;mbConfig, true);&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;/* Setup Tx Message Buffer. */&lt;BR /&gt;#if (defined(USE_CANFD) &amp;amp;&amp;amp; USE_CANFD)&lt;BR /&gt; FLEXCAN_SetFDTxMbConfig(EXAMPLE_CAN, TX_MESSAGE_BUFFER_NUM, true);&lt;BR /&gt;#else&lt;BR /&gt; FLEXCAN_SetTxMbConfig(EXAMPLE_CAN, TX_MESSAGE_BUFFER_NUM, true);&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;if ((node_type == 'A') || (node_type == 'a'))&lt;BR /&gt; {&lt;BR /&gt; //PRINTF("Press any key to trigger one-shot transmission\r\n\r\n");&lt;BR /&gt; frame.dataByte0 = 0;&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; //PRINTF("Start to Wait data from Node A\r\n\r\n");&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;while (1)&lt;BR /&gt; {&lt;BR /&gt; if ((node_type == 'A') || (node_type == 'a'))&lt;BR /&gt; {&lt;BR /&gt; //GETCHAR();&lt;BR /&gt; frame.id = FLEXCAN_ID_STD(txIdentifier);&lt;BR /&gt; frame.format = kFLEXCAN_FrameFormatStandard;&lt;BR /&gt; frame.type = kFLEXCAN_FrameTypeData;&lt;BR /&gt; frame.length = DLC;&lt;BR /&gt;#if (defined(USE_CANFD) &amp;amp;&amp;amp; USE_CANFD)&lt;BR /&gt; frame.brs = 1;&lt;BR /&gt;#endif&lt;BR /&gt; txXfer.mbIdx = TX_MESSAGE_BUFFER_NUM;&lt;BR /&gt;#if (defined(USE_CANFD) &amp;amp;&amp;amp; USE_CANFD)&lt;BR /&gt; txXfer.framefd = &amp;amp;frame;&lt;BR /&gt; FLEXCAN_TransferFDSendNonBlocking(EXAMPLE_CAN, &amp;amp;flexcanHandle, &amp;amp;txXfer);&lt;BR /&gt;#else&lt;BR /&gt; txXfer.frame = &amp;amp;frame;&lt;BR /&gt; FLEXCAN_TransferSendNonBlocking(EXAMPLE_CAN, &amp;amp;flexcanHandle, &amp;amp;txXfer);&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;while (!txComplete)&lt;BR /&gt; {&lt;BR /&gt; };&lt;BR /&gt; txComplete = false;&lt;/P&gt;&lt;P&gt;/* Start receive data through Rx Message Buffer. */&lt;BR /&gt; rxXfer.mbIdx = RX_MESSAGE_BUFFER_NUM;&lt;BR /&gt;#if (defined(USE_CANFD) &amp;amp;&amp;amp; USE_CANFD)&lt;BR /&gt; rxXfer.framefd = &amp;amp;frame;&lt;BR /&gt; FLEXCAN_TransferFDReceiveNonBlocking(EXAMPLE_CAN, &amp;amp;flexcanHandle, &amp;amp;rxXfer);&lt;BR /&gt;#else&lt;BR /&gt; rxXfer.frame = &amp;amp;frame;&lt;BR /&gt; FLEXCAN_TransferReceiveNonBlocking(EXAMPLE_CAN, &amp;amp;flexcanHandle, &amp;amp;rxXfer);&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;/* Wait until Rx MB full. */&lt;BR /&gt; while (!rxComplete)&lt;BR /&gt; {&lt;BR /&gt; };&lt;BR /&gt; rxComplete = false;&lt;/P&gt;&lt;P&gt;//PRINTF("Rx MB ID: 0x%3x, Rx MB data: 0x%x, Time stamp: %d\r\n", frame.id &amp;gt;&amp;gt; CAN_ID_STD_SHIFT, frame.dataByte0, frame.timestamp);&lt;BR /&gt; //PRINTF("Press any key to trigger the next transmission!\r\n\r\n");&lt;BR /&gt; frame.dataByte0++;&lt;BR /&gt; frame.dataByte1=0x55;&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; /* Start receive data through Rx Message Buffer. */&lt;BR /&gt; rxXfer.mbIdx = RX_MESSAGE_BUFFER_NUM;&lt;BR /&gt;#if (defined(USE_CANFD) &amp;amp;&amp;amp; USE_CANFD)&lt;BR /&gt; rxXfer.framefd = &amp;amp;frame;&lt;BR /&gt; FLEXCAN_TransferFDReceiveNonBlocking(EXAMPLE_CAN, &amp;amp;flexcanHandle, &amp;amp;rxXfer);&lt;BR /&gt;#else&lt;BR /&gt; rxXfer.frame = &amp;amp;frame;&lt;BR /&gt; FLEXCAN_TransferReceiveNonBlocking(EXAMPLE_CAN, &amp;amp;flexcanHandle, &amp;amp;rxXfer);&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;/* Wait until Rx receive full. */&lt;BR /&gt; while (!rxComplete)&lt;BR /&gt; {&lt;BR /&gt; };&lt;BR /&gt; rxComplete = false;&lt;/P&gt;&lt;P&gt;//PRINTF("Rx MB ID: 0x%3x, Rx MB data: 0x%x, Time stamp: %d\r\n", frame.id &amp;gt;&amp;gt; CAN_ID_STD_SHIFT, frame.dataByte0, frame.timestamp);&lt;/P&gt;&lt;P&gt;frame.id = FLEXCAN_ID_STD(txIdentifier);&lt;BR /&gt; txXfer.mbIdx = TX_MESSAGE_BUFFER_NUM;&lt;BR /&gt;#if (defined(USE_CANFD) &amp;amp;&amp;amp; USE_CANFD)&lt;BR /&gt; frame.brs = 1;&lt;BR /&gt; txXfer.framefd = &amp;amp;frame;&lt;BR /&gt; FLEXCAN_TransferFDSendNonBlocking(EXAMPLE_CAN, &amp;amp;flexcanHandle, &amp;amp;txXfer);&lt;BR /&gt;#else&lt;BR /&gt; txXfer.frame = &amp;amp;frame;&lt;BR /&gt; FLEXCAN_TransferSendNonBlocking(EXAMPLE_CAN, &amp;amp;flexcanHandle, &amp;amp;txXfer);&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;while (!txComplete)&lt;BR /&gt; {&lt;BR /&gt; };&lt;BR /&gt; txComplete = false;&lt;BR /&gt; //PRINTF("Wait Node A to trigger the next transmission!\r\n\r\n");&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2019 16:23:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Is-FlexCAN3-CAN-FD-dependent-on-LPUART-module-clock/m-p/961491#M4573</guid>
      <dc:creator>johnpulera</dc:creator>
      <dc:date>2019-08-08T16:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Is FlexCAN3 (CAN-FD) dependent on LPUART module clock?</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Is-FlexCAN3-CAN-FD-dependent-on-LPUART-module-clock/m-p/961492#M4574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG class=""&gt;&lt;SPAN class=""&gt;John Pulera&lt;/SPAN&gt;&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Thank you very much for your post about this question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; You are right, today, I also test the newest SDK with the canfd function, when I disable the lpuart clock, I also reproduce the problems, so I check it with our internal related department, it turns out it is a known bug.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;There are two workarounds for this issue:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;-- Set CAN_CLK_SEL to 0 or 1 for CAN clock selection.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Or,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;-- If CAN_CLK_SEL is set to 2, then the CCM must open any of UART clock gate by configuring the CCM_CCGRx register.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In the near future, we will put this workaround in the errata.&lt;/P&gt;&lt;P&gt;Now, please use the above two workarounds to solve it.&lt;/P&gt;&lt;P&gt;Sorry for the inconvenience we bring you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2019 08:08:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Is-FlexCAN3-CAN-FD-dependent-on-LPUART-module-clock/m-p/961492#M4574</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2019-08-09T08:08:25Z</dc:date>
    </item>
  </channel>
</rss>

