<?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: Cannot transmit CAN message in Free RTOS in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Cannot-transmit-CAN-message-in-Free-RTOS/m-p/1439240#M188984</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;BR /&gt;To provide the fastest possible support, I'd highly recommend you to refer to the below demos in the SDK library for the MIMXRT1060 EVK, as it needs to adjust the above code architecture to integrate the FreeRTOS.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jeremyzhou_0-1649210406872.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/175960iD47FFFC1304867E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jeremyzhou_0-1649210406872.png" alt="jeremyzhou_0-1649210406872.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&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&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;</description>
    <pubDate>Wed, 06 Apr 2022 02:00:38 GMT</pubDate>
    <dc:creator>jeremyzhou</dc:creator>
    <dc:date>2022-04-06T02:00:38Z</dc:date>
    <item>
      <title>Cannot transmit CAN message in Free RTOS</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Cannot-transmit-CAN-message-in-Free-RTOS/m-p/1438945#M188969</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am planning to add CAN2&amp;nbsp; to SLN_LOCAL2 and I am able to initialise the CAN communication but not able to transmit can message and it gets struck at this line "while (!FLEXCAN_GetMbStatusFlags(CAN2, 1 &amp;lt;&amp;lt; FrameTx));"&lt;/P&gt;&lt;P&gt;/*******************************************************************************&lt;BR /&gt;* Initialise CAN&lt;BR /&gt;******************************************************************************/&lt;BR /&gt;void CAN_INIT()&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;/* Initialise CAN */&lt;BR /&gt;flexcan_config_t flexcanConfig;&lt;BR /&gt;flexcanConfig.clksrc=kFLEXCAN_ClkSrc0;&lt;BR /&gt;flexcanConfig.baudRate = 50000U;&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.disableSelfReception = false;&lt;BR /&gt;flexcanConfig.enableListenOnlyMode = false;&lt;BR /&gt;flexcanConfig.enableDoze = false;&lt;BR /&gt;FLEXCAN_Init(CAN2, &amp;amp;flexcanConfig, 80000000UL);&lt;BR /&gt;configPRINTF(("\r\nCAN initialized"));&lt;/P&gt;&lt;P&gt;/* Enable FlexCAN module. */&lt;BR /&gt;FLEXCAN_Enable(CAN2, true);&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt;* CAN Transmit Function&lt;BR /&gt;******************************************************************************/&lt;BR /&gt;void CAN_SEND(long CANID,char m1,char m2,char m3,char m4,char m5,char m6,char m7,char m8,int CANDLC)&lt;BR /&gt;{&lt;BR /&gt;status_t status1;&lt;BR /&gt;flexcan_frame_t txFrame;&lt;BR /&gt;/* Enable FlexCAN module. */&lt;BR /&gt;uint8_t FrameTx=1UL;&lt;BR /&gt;FLEXCAN_Enable(CAN2, true);&lt;BR /&gt;/* Sets up the transmit message buffer. */&lt;BR /&gt;FLEXCAN_SetTxMbConfig(CAN2, FrameTx, true);&lt;BR /&gt;/* Prepares the transmit 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(CANID);&lt;BR /&gt;txFrame.length = CANDLC;&lt;BR /&gt;txFrame.dataWord0 = CAN_WORD0_DATA_BYTE_0(m1) |&lt;BR /&gt;CAN_WORD0_DATA_BYTE_1(m2) |&lt;BR /&gt;CAN_WORD0_DATA_BYTE_2(m3) |&lt;BR /&gt;CAN_WORD0_DATA_BYTE_3(m4);&lt;BR /&gt;txFrame.dataWord1 = CAN_WORD1_DATA_BYTE_4(m5) |&lt;BR /&gt;CAN_WORD1_DATA_BYTE_5(m6) |&lt;BR /&gt;CAN_WORD1_DATA_BYTE_6(m7) |&lt;BR /&gt;CAN_WORD1_DATA_BYTE_7(m8);&lt;BR /&gt;/* Writes a transmit message buffer to send a CAN Message. */&lt;BR /&gt;status1=FLEXCAN_WriteTxMb(CAN2, FrameTx, &amp;amp;txFrame);&lt;BR /&gt;configPRINTF(("\r\nCAN Message sent %d",status1));&lt;BR /&gt;/* Waits until the transmit message buffer is empty. */&lt;BR /&gt;while (!FLEXCAN_GetMbStatusFlags(CAN2, 1 &amp;lt;&amp;lt; FrameTx));&lt;BR /&gt;/* Cleans the transmit message buffer empty status. */&lt;BR /&gt;FLEXCAN_ClearMbStatusFlags(CAN2, 1 &amp;lt;&amp;lt; FrameTx);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;This is the example code from SDK. I was having proble in initialise CAN clock and initialised UART clock and the problem dissapeard is it something to do with it.&lt;/P&gt;&lt;P&gt;Does any one has sample or example code in FreeRTOS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 14:36:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Cannot-transmit-CAN-message-in-Free-RTOS/m-p/1438945#M188969</guid>
      <dc:creator>ndasrm</dc:creator>
      <dc:date>2022-04-05T14:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot transmit CAN message in Free RTOS</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Cannot-transmit-CAN-message-in-Free-RTOS/m-p/1439240#M188984</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;BR /&gt;To provide the fastest possible support, I'd highly recommend you to refer to the below demos in the SDK library for the MIMXRT1060 EVK, as it needs to adjust the above code architecture to integrate the FreeRTOS.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jeremyzhou_0-1649210406872.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/175960iD47FFFC1304867E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jeremyzhou_0-1649210406872.png" alt="jeremyzhou_0-1649210406872.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&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&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;</description>
      <pubDate>Wed, 06 Apr 2022 02:00:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Cannot-transmit-CAN-message-in-Free-RTOS/m-p/1439240#M188984</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2022-04-06T02:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot transmit CAN message in Free RTOS</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Cannot-transmit-CAN-message-in-Free-RTOS/m-p/1443978#M189313</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;After adjusting clock the CAN Initialisation is done and I am transmitting CAN messages but the IFLAG1 is not set and it is transmitting continously.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ndasrm_0-1649924820537.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/176923i6F23C81AF2012FD7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ndasrm_0-1649924820537.png" alt="ndasrm_0-1649924820537.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;CAN Tx signal:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ndasrm_1-1649925023013.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/176926i4AFBBA8F3216B481/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ndasrm_1-1649925023013.png" alt="ndasrm_1-1649925023013.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but the IFLAG is not set, so its looping and continously transmitting.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ndasrm_2-1649925072640.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/176927i69FF4805FD0DF8D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ndasrm_2-1649925072640.png" alt="ndasrm_2-1649925072640.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I also see this, is it MCUxpresso problem or debugger?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ndasrm_3-1649925242733.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/176928i2C75913245103204/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ndasrm_3-1649925242733.png" alt="ndasrm_3-1649925242733.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;the macro is defined but some how the line is skipped I could not understand but the pheriperal clock has value defined.&lt;/P&gt;&lt;P&gt;P.S: I am using CAN2 as the voice demo has serial output connetor with lpuart6.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 08:36:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Cannot-transmit-CAN-message-in-Free-RTOS/m-p/1443978#M189313</guid>
      <dc:creator>ndasrm</dc:creator>
      <dc:date>2022-04-14T08:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot transmit CAN message in Free RTOS</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Cannot-transmit-CAN-message-in-Free-RTOS/m-p/1444918#M189419</link>
      <description>Hi,
Sorry for reply late.
Frankly, I'm a bit confused and hard to share some advice, as I can't get some useful information from above introduction.
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------</description>
      <pubDate>Mon, 18 Apr 2022 06:18:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Cannot-transmit-CAN-message-in-Free-RTOS/m-p/1444918#M189419</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2022-04-18T06:18:20Z</dc:date>
    </item>
  </channel>
</rss>

