<?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>S32KのトピックRe: s32k118 CAN Rx Interrupt</title>
    <link>https://community.nxp.com/t5/S32K/s32k118-CAN-Rx-Interrupt/m-p/1886627#M36535</link>
    <description>&lt;P&gt;Thanks, that solves the issue!&lt;/P&gt;&lt;P&gt;Seems like the key point I'd missed was to call&amp;nbsp;&lt;SPAN&gt;FLEXCAN_DRV_Receive(),&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;FLEXCAN_DRV_RxFifo() or&amp;nbsp;CAN_Receive() at least once on each Mailbox, for the Callback to work properly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2024 06:35:19 GMT</pubDate>
    <dc:creator>ArushThomas</dc:creator>
    <dc:date>2024-06-13T06:35:19Z</dc:date>
    <item>
      <title>s32k118 CAN Rx Interrupt</title>
      <link>https://community.nxp.com/t5/S32K/s32k118-CAN-Rx-Interrupt/m-p/1886051#M36495</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am using the s32k118 MCU and need to interface with a CAN bus. I've been polling the CAN bus every 100ms with the&amp;nbsp;CAN_Receive() function to retrieve any messages from the bus, but unfortunately I do miss a lot of messages, since there are more than one message on the bus every 100ms.&lt;/P&gt;&lt;P&gt;My end goal is to asynchronously add all received messages to a Queue of CAN messages, which I can parse periodically. I was hoping to accomplish this with a CAN Rx Interrupt, which would be triggered whenever the MCU detects a message on the bus. Unfortunately, I'm not able to set up such an ISR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried setting up an ISR with the interrupt_manager component, on the&amp;nbsp;CAN0_ORed_0_31_MB_IRQn IRQ. But it seems my ISR is being triggered only &lt;EM&gt;after&lt;/EM&gt; I call&amp;nbsp;CAN_Receive() in my main() function. This does not meet my requirements, as I was hoping to all the&amp;nbsp;CAN_Receive() function exclusively in the ISR. Furthermore, after being triggered once, the code appears to get stuck in continuously calling the ISR over and over.&lt;/P&gt;&lt;P&gt;I tried installing a callback function with&amp;nbsp;CAN_InstallEventCallback(), but again, the callback function is only called&amp;nbsp;&lt;EM&gt;after&lt;/EM&gt; I call&amp;nbsp;CAN_Receive() or CAN_Send(). So again, it doesn't seem like I can depend on the Callback to catch all messages from the bus.&lt;/P&gt;&lt;P&gt;Finally, I used the Rx FIFO feature, which does successfully add all messages to a the Mailbox 0 in a buffer-type format. This is what I need... except it's limited to a maximum of 6 messages.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ArushThomas_0-1718187128272.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/283690i91B8E4DC2CACF1C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ArushThomas_0-1718187128272.png" alt="ArushThomas_0-1718187128272.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'm anticipating a need for ~16 messages to be buffered at a time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To illustrate the issues I've faced with Polling, ISR and Callback, I've attached a "CAN_Example" project. Hope it serves to further clarify the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I accomplish this task, of buffering incoming CAN messages for future parsing?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 10:16:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/s32k118-CAN-Rx-Interrupt/m-p/1886051#M36495</guid>
      <dc:creator>ArushThomas</dc:creator>
      <dc:date>2024-06-12T10:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: s32k118 CAN Rx Interrupt</title>
      <link>https://community.nxp.com/t5/S32K/s32k118-CAN-Rx-Interrupt/m-p/1886509#M36528</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@ArushThomas" target="_blank"&gt;Hi@ArushThomas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You can refer to the demo in the link below which shows how to receive or transmit CAN frames using MB or FIFO interrupts.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S32K-Knowledge-Base/S32K1xx-FlexCAN-Mask-Setting-Demo/ta-p/1519753" target="_blank"&gt;https://community.nxp.com/t5/S32K-Knowledge-Base/S32K1xx-FlexCAN-Mask-Setting-Demo/ta-p/1519753&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 02:33:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/s32k118-CAN-Rx-Interrupt/m-p/1886509#M36528</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2024-06-13T02:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: s32k118 CAN Rx Interrupt</title>
      <link>https://community.nxp.com/t5/S32K/s32k118-CAN-Rx-Interrupt/m-p/1886627#M36535</link>
      <description>&lt;P&gt;Thanks, that solves the issue!&lt;/P&gt;&lt;P&gt;Seems like the key point I'd missed was to call&amp;nbsp;&lt;SPAN&gt;FLEXCAN_DRV_Receive(),&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;FLEXCAN_DRV_RxFifo() or&amp;nbsp;CAN_Receive() at least once on each Mailbox, for the Callback to work properly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 06:35:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/s32k118-CAN-Rx-Interrupt/m-p/1886627#M36535</guid>
      <dc:creator>ArushThomas</dc:creator>
      <dc:date>2024-06-13T06:35:19Z</dc:date>
    </item>
  </channel>
</rss>

