<?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>Model-Based Design Toolbox (MBDT)のトピックS32K344 FlexCAN Change Highest-priority message buffer first to Lowest-number message buffer first</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K344-FlexCAN-Change-Highest-priority-message-buffer-first-to/m-p/2144812#M10371</link>
    <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a project to route CAN messages. I found out that CAN write block by default has arbitration process, which choose&amp;nbsp;highest-priority CAN message buffer to send first. I want to change it to&amp;nbsp;lowest-number message buffer to send first.&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I read document, there are some lines:&amp;nbsp;&lt;/P&gt;&lt;P&gt;73.3.3.1&lt;BR /&gt;Lowest-number message buffer first&lt;BR /&gt;"If CTRL1[LBUF] is 1, the first (lowest number) active transmission message buffer found is the arbitration winner. MCR[LPRIOEN] has no effect when CTRL1[LBUF] is 1."&lt;/P&gt;&lt;P&gt;So I am trying to write CTRL1[LBUF] to 1. I believe that I need to change to Freeze Mode.&amp;nbsp;&lt;/P&gt;&lt;P&gt;"MCR[FRZ] must be 1 and the module must not be in a low-power mode"&lt;/P&gt;&lt;P&gt;"After requesting Freeze mode, you must wait for MCR[FRZACK] to become 1 before executing any other action, otherwise FlexCAN may operate unpredictably. In Freeze mode, all memory-mapped registers are accessible."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to write&amp;nbsp;MCR[FRZ] to 1 but I failed to change to Freeze mode. Can anyone here have the knowledge about this? I appreciate it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;##S32K34 #FlexCAN #CAN #Route #AUTOSAR&amp;nbsp;#NXP&lt;/P&gt;</description>
    <pubDate>Fri, 01 Aug 2025 01:27:20 GMT</pubDate>
    <dc:creator>bruceyun</dc:creator>
    <dc:date>2025-08-01T01:27:20Z</dc:date>
    <item>
      <title>S32K344 FlexCAN Change Highest-priority message buffer first to Lowest-number message buffer first</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K344-FlexCAN-Change-Highest-priority-message-buffer-first-to/m-p/2144812#M10371</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a project to route CAN messages. I found out that CAN write block by default has arbitration process, which choose&amp;nbsp;highest-priority CAN message buffer to send first. I want to change it to&amp;nbsp;lowest-number message buffer to send first.&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I read document, there are some lines:&amp;nbsp;&lt;/P&gt;&lt;P&gt;73.3.3.1&lt;BR /&gt;Lowest-number message buffer first&lt;BR /&gt;"If CTRL1[LBUF] is 1, the first (lowest number) active transmission message buffer found is the arbitration winner. MCR[LPRIOEN] has no effect when CTRL1[LBUF] is 1."&lt;/P&gt;&lt;P&gt;So I am trying to write CTRL1[LBUF] to 1. I believe that I need to change to Freeze Mode.&amp;nbsp;&lt;/P&gt;&lt;P&gt;"MCR[FRZ] must be 1 and the module must not be in a low-power mode"&lt;/P&gt;&lt;P&gt;"After requesting Freeze mode, you must wait for MCR[FRZACK] to become 1 before executing any other action, otherwise FlexCAN may operate unpredictably. In Freeze mode, all memory-mapped registers are accessible."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to write&amp;nbsp;MCR[FRZ] to 1 but I failed to change to Freeze mode. Can anyone here have the knowledge about this? I appreciate it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;##S32K34 #FlexCAN #CAN #Route #AUTOSAR&amp;nbsp;#NXP&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 01:27:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K344-FlexCAN-Change-Highest-priority-message-buffer-first-to/m-p/2144812#M10371</guid>
      <dc:creator>bruceyun</dc:creator>
      <dc:date>2025-08-01T01:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: S32K344 FlexCAN Change Highest-priority message buffer first to Lowest-number message buffer fir</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K344-FlexCAN-Change-Highest-priority-message-buffer-first-to/m-p/2145208#M10373</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To put the FLEXCAN module into FreezeMode, we can use the S32K3 RTD functions:&lt;/P&gt;
&lt;DIV class="rtcContent"&gt;
&lt;UL&gt;
&lt;LI class="lineNode"&gt;&lt;SPAN&gt;FlexCAN_Ip_EnterFreezeMode_Privileged(uint8 instance)&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV class="rtcContent"&gt;
&lt;UL&gt;
&lt;LI class="lineNode"&gt;&lt;SPAN&gt;FlexCAN_Ip_ExitFreezeMode_Privileged(uint8 instance)&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV class="lineNode"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="lineNode"&gt;To test this I've added the following blocks to an already existing model that sends messages over CAN. Basically, I have a variable&amp;nbsp;&lt;STRONG&gt;CAN_0_enterfreeze&amp;nbsp;&lt;/STRONG&gt;which I modify from the FreeMASTER to have one of the following values:&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI class="lineNode"&gt;0: Do nothing&lt;/LI&gt;
&lt;LI class="lineNode"&gt;1: read MCR register for CAN 0 instance and store the result in&amp;nbsp;&lt;STRONG&gt;CAN_0_MCR&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="lineNode"&gt;2: Enter FreezeMode&lt;/LI&gt;
&lt;LI class="lineNode"&gt;3: Exit FreezeMode&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV class="lineNode"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SorinIBancila_0-1754053072043.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/350631iB5E751A958AE2A07/image-size/large?v=v2&amp;amp;px=999" role="button" title="SorinIBancila_0-1754053072043.png" alt="SorinIBancila_0-1754053072043.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Inside case 2 and case 3, you have to add a MATLAB function block. The custom code to enter/exit freezemode can be found below:&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SorinIBancila_1-1754053486901.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/350632iA67E3C78D6ED6D43/image-size/large?v=v2&amp;amp;px=999" role="button" title="SorinIBancila_1-1754053486901.png" alt="SorinIBancila_1-1754053486901.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To validate this I've done the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Reset the development board and read the content of MCR register for CAN 0 instance.&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SorinIBancila_2-1754053730649.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/350633iDBFBB2BF9415F59D/image-size/large?v=v2&amp;amp;px=999" role="button" title="SorinIBancila_2-1754053730649.png" alt="SorinIBancila_2-1754053730649.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Set CAN_0_enterfreeze to&amp;nbsp;&lt;STRONG&gt;2&lt;/STRONG&gt; and read the content of the MCR register. Note! The FlexCAN is not working in FreezeMode.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SorinIBancila_3-1754053812864.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/350634iA7D2E25FFDA45DC4/image-size/large?v=v2&amp;amp;px=999" role="button" title="SorinIBancila_3-1754053812864.png" alt="SorinIBancila_3-1754053812864.png" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;DIV class="lineNode"&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SorinIBancila_5-1754053865424.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/350636i12B004EE689ADA75/image-size/large?v=v2&amp;amp;px=999" role="button" title="SorinIBancila_5-1754053865424.png" alt="SorinIBancila_5-1754053865424.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI class="lineNode"&gt;&amp;nbsp;Set CAN_0_enterfreeze to&amp;nbsp;&lt;STRONG&gt;3&amp;nbsp;&lt;/STRONG&gt;and read the content of the MCR register. The CAN is working again. I just send a message (ID = 101) from CAN analyzer tool and the board replies with a message ID=0.&lt;/LI&gt;
&lt;/UL&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SorinIBancila_6-1754053942109.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/350637iFD2600671E5AC9E7/image-size/large?v=v2&amp;amp;px=999" role="button" title="SorinIBancila_6-1754053942109.png" alt="SorinIBancila_6-1754053942109.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SorinIBancila_7-1754053978440.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/350638iCCC8B227BA0FE9EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="SorinIBancila_7-1754053978440.png" alt="SorinIBancila_7-1754053978440.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The S32K3 RTD sources can be found inside the toolbox, where you can check the implementation for a specific module in case you need it. To open the root of the S32K3 folder, you can type the following command in MATLAB command window :&amp;nbsp;&lt;STRONG&gt;cd(mbd_find_s32k3_root)&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SorinIBancila_0-1754059684536.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/350643i82257A597E9849F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="SorinIBancila_0-1754059684536.png" alt="SorinIBancila_0-1754059684536.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do not hesitate to reply in case you have any other questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Sorin Bancila&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 01 Aug 2025 14:48:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K344-FlexCAN-Change-Highest-priority-message-buffer-first-to/m-p/2145208#M10373</guid>
      <dc:creator>SorinIBancila</dc:creator>
      <dc:date>2025-08-01T14:48:28Z</dc:date>
    </item>
  </channel>
</rss>

