<?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 S32K312 CAN configuration in Model-Based Design Toolbox (MBDT)</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2044459#M9983</link>
    <description>&lt;P&gt;Hello, I have developed a code using Matlab/Simulink MBDT to echo CAN messages (the echoed message has a CAN ID equal to the received message CAN ID + 1).&lt;/P&gt;&lt;P&gt;I use PCAN-View to send to and receive from the board. This is &lt;STRONG&gt;S32K312-Q172&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;This works OK for messages with extended CAN IDs, but not for standard IDs.&lt;/P&gt;&lt;P&gt;To receive CAN messages on the board, I use &lt;STRONG&gt;CanIf_RxIndication&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;To send CAN messages from the board, I use&amp;nbsp;&lt;STRONG&gt;CanHardwareObject_Can0_Tx_Interrupt&lt;/STRONG&gt; with the following configuration:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Can Implementation Type: FULL&lt;/LI&gt;&lt;LI&gt;Can ID Message Type: MIXED&lt;/LI&gt;&lt;LI&gt;In the simulink mask of the Can_Write block, the "Extended ID CAN Message" option is unchecked&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I also use a&amp;nbsp;&lt;STRONG&gt;CanIf_TxConfirmation&lt;/STRONG&gt;&amp;nbsp;block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please provide some guidance to make my code work for both types of CAN Messages IDs?&lt;/P&gt;</description>
    <pubDate>Fri, 14 Feb 2025 09:41:07 GMT</pubDate>
    <dc:creator>paul_14</dc:creator>
    <dc:date>2025-02-14T09:41:07Z</dc:date>
    <item>
      <title>S32K312 CAN configuration</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2044459#M9983</link>
      <description>&lt;P&gt;Hello, I have developed a code using Matlab/Simulink MBDT to echo CAN messages (the echoed message has a CAN ID equal to the received message CAN ID + 1).&lt;/P&gt;&lt;P&gt;I use PCAN-View to send to and receive from the board. This is &lt;STRONG&gt;S32K312-Q172&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;This works OK for messages with extended CAN IDs, but not for standard IDs.&lt;/P&gt;&lt;P&gt;To receive CAN messages on the board, I use &lt;STRONG&gt;CanIf_RxIndication&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;To send CAN messages from the board, I use&amp;nbsp;&lt;STRONG&gt;CanHardwareObject_Can0_Tx_Interrupt&lt;/STRONG&gt; with the following configuration:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Can Implementation Type: FULL&lt;/LI&gt;&lt;LI&gt;Can ID Message Type: MIXED&lt;/LI&gt;&lt;LI&gt;In the simulink mask of the Can_Write block, the "Extended ID CAN Message" option is unchecked&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I also use a&amp;nbsp;&lt;STRONG&gt;CanIf_TxConfirmation&lt;/STRONG&gt;&amp;nbsp;block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please provide some guidance to make my code work for both types of CAN Messages IDs?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2025 09:41:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2044459#M9983</guid>
      <dc:creator>paul_14</dc:creator>
      <dc:date>2025-02-14T09:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 CAN configuration</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2045396#M9991</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/227365"&gt;@paul_14&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a first step, could you please try and set the CAN ID Message Type for the Receive Hardware Object on &lt;STRONG&gt;MIXED&lt;/STRONG&gt;?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mixed rx.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/324267i989D78A65E44EF97/image-size/large?v=v2&amp;amp;px=999" role="button" title="mixed rx.png" alt="mixed rx.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;After this setting is performed, as illustrated above, could you please try and rebuild the model and check if you are able to receive messages with both EXTENDED and STANDARD IDs?&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Irina&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 10:29:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2045396#M9991</guid>
      <dc:creator>Irina_Costachescu</dc:creator>
      <dc:date>2025-02-17T10:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 CAN configuration</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2045566#M9994</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/100054"&gt;@Irina_Costachescu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I already had this CAN Hw Object with message type as MIXED.&lt;/P&gt;&lt;P&gt;I have all these CAN Objects:&lt;/P&gt;&lt;P&gt;0.&amp;nbsp;CanHardwareObject_Can0_Rx_FIFO: FULL/MIXED/RECEIVE&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;CanHardwareObject_Can0_Rx_Std_Polling: BASIC/MIXED/RECEIVE&lt;/P&gt;&lt;P&gt;2. CanHardwareObject_Can0_Rx_Ext_Interrupt: BASIC/MIXED/RECEIVE&lt;/P&gt;&lt;P&gt;3. CanHardwareObject_Can0_Tx_Polling: BASIC/MIXED/TRANSMIT&lt;/P&gt;&lt;P&gt;4. CanHardwareObject_Can0_Tx_Interrupt: BASIC/MIXED/TRANSMIT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is how my model looks like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="paul_14_0-1739802761637.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/324323iA105F63D6695C09B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="paul_14_0-1739802761637.png" alt="paul_14_0-1739802761637.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pablo&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 14:34:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2045566#M9994</guid>
      <dc:creator>paul_14</dc:creator>
      <dc:date>2025-02-17T14:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 CAN configuration</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2052913#M10035</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/227365"&gt;@paul_14&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to replicate a scenario similar to what you have here.&lt;/P&gt;
&lt;P&gt;First of all, using the default configuration (no changes) that comes with the Toolbox for the S32K312-Q172, i managed to send both EXTENDED and STANDARD frames simply by checking and unchecking the "Extended ID Can Message" property inside the CAN_Write block. Additionally, I tried using the same Can Hardware Object (CanHardwareObject_Can0_Tx_Interrupt) to send EXTENDED and STANDARD frames on alternate execution steps.&lt;/P&gt;
&lt;P&gt;Where I think I noticed a possible inconvenient was when trying to receive both STANDARD and EXTENDED frames, where it seemed like only the EXTENDED frames were being received. That happens because of the way the hardware objects are configured:&lt;BR /&gt;- &lt;STRONG&gt;CanHardwareObject_Can0_Rx_Ext_Interrupt&lt;/STRONG&gt; is able to receive EXTENDED frames, and it's configured to work based on interrupts, meaning&amp;nbsp; there is nothing else you have to do in order for the message to be captured by the Hardware Interrupt Callback set to CanIf_RxIndication.&amp;nbsp;&lt;BR /&gt;- &lt;STRONG&gt;CanHardwareObject_Can0_Rx_Std_Polling&lt;/STRONG&gt; is able to receive STANDARD frames, and it's configured to work based on the polling mechanism, meaning that in order for this to trigger the Hardware Interrupt Callback, an additional block is needed, that being the Can Block set to &lt;STRONG&gt;Can_MainFunction_Read&lt;/STRONG&gt;. This triggers the aforementioned Hardware Interrupt Callback when the hardware object set to polling is receiving messages.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-02-27 122258.png" style="width: 393px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326052iDBB8626159847F18/image-dimensions/393x260?v=v2" width="393" height="260" role="button" title="Screenshot 2025-02-27 122258.png" alt="Screenshot 2025-02-27 122258.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Setting the Can ID Message Type to MIXED might not lead to the desired results when using the RECEIVE objects because &lt;STRONG&gt;MIXED is treated as EXTENDED for this case&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see the following options, to be able to RECEIVE both EXTENDED and STANDARD frames:&lt;BR /&gt;- use the configuration provided by default and also add a Can_MainFunction_Read block into your model, triggering the interrupt for the polling can hardware object&lt;BR /&gt;- modify the polling hardware object to work on interrupts instead:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-02-27 121925.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326051i68E6F1E229900DCC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-02-27 121925.png" alt="Screenshot 2025-02-27 121925.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Let me know if these explanations help you and if you manage to get the model to work as expected.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robert V&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 10:28:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2052913#M10035</guid>
      <dc:creator>robertv</dc:creator>
      <dc:date>2025-02-27T10:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 CAN configuration</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2054604#M10053</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/219933"&gt;@robertv&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I'm afraid I've tried both options and none of the get my code to work with standard IDs.&lt;/P&gt;&lt;P&gt;I'm attaching my model so hopefully you can have a look at it.&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Pablo&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 09:49:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2054604#M10053</guid>
      <dc:creator>paul_14</dc:creator>
      <dc:date>2025-03-03T09:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 CAN configuration</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2054866#M10065</link>
      <description>&lt;P&gt;Hello Pablo,&lt;/P&gt;
&lt;P&gt;I looked at your model and I think I found a solution for your issue.&lt;/P&gt;
&lt;P&gt;What I ultimately had to do was to set Can ID Message Type either to STANDARD or EXTENDED, for the RECEIVE objects. By keeping one of them as a polling hardware object, the MainFunction_Read is still necessary.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I chose &lt;STRONG&gt;STANDARD&lt;/STRONG&gt; for CanHardwareObject_Can0_Rx_Std_Polling (id=1) and &lt;STRONG&gt;EXTENDED&lt;/STRONG&gt; CanHardwareObject_Can0_Rx_Ext_Interrupt (id=2) (&lt;STRONG&gt;instead of MIXED&lt;/STRONG&gt;).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-03-03 185902.png" style="width: 441px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/326509iCF40FF719F7FE394/image-dimensions/441x271?v=v2" width="441" height="271" role="button" title="Screenshot 2025-03-03 185902.png" alt="Screenshot 2025-03-03 185902.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;With these changes alone I got the model to work in the following way:&lt;BR /&gt;- Sent EXTENDED frame from Can Analyzer - &amp;gt; started receiving EXTENDED frame messages with the ID incremented by 1 from the board&lt;BR /&gt;- Sent STANDARD frame from Can Analyzer - &amp;gt; started receiving EXTENDED frame messages with the ID incremented by 1 from the board&lt;BR /&gt;&lt;BR /&gt;In case you are looking to also reply with the same message type, then you would need to implement a workflow that includes 2 Can_Write blocks (one with the checkbox for Extended enabled and one without), and based on the received frame, you redirect to the content to the appropriate Can_Write.&lt;/P&gt;
&lt;P&gt;A few ideas on how you could differentiate between the frames:&lt;BR /&gt;- &lt;STRONG&gt;By received ID length&lt;/STRONG&gt;, but this might be tricky depending on how this is stored&lt;BR /&gt;- &lt;STRONG&gt;By Hardware Object ID&lt;/STRONG&gt;: going back to the configuration referenced above, CanHardwareObject with the ID 1 was set to receive STANDARD messages, so if your received CAN message comes from the object with the ID 1, you know it's a STANDARD message; otherwise if it's ID 2, then you know it was captured by the can hardware object with ID 2, configured to receive EXTENDED frames.&lt;/P&gt;
&lt;P&gt;Please let me know if this fixes the issue you were encountering.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robert V&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 17:14:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2054866#M10065</guid>
      <dc:creator>robertv</dc:creator>
      <dc:date>2025-03-03T17:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 CAN configuration</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2055392#M10066</link>
      <description>&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;I managed to get my model working with your suggestions, receiving and echoing both standard and extended ID CAN messages.&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;&lt;P&gt;Pablo&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 09:22:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2055392#M10066</guid>
      <dc:creator>paul_14</dc:creator>
      <dc:date>2025-03-04T09:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 CAN configuration</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2055617#M10069</link>
      <description>&lt;P&gt;Hello Pablo,&lt;/P&gt;
&lt;P&gt;I'm glad to hear it worked.&lt;BR /&gt;And thank you for confirming the solution was successful!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robert V&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 15:37:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2055617#M10069</guid>
      <dc:creator>robertv</dc:creator>
      <dc:date>2025-03-04T15:37:39Z</dc:date>
    </item>
  </channel>
</rss>

