<?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 S32DS for ARM 2.2 - Problem on callback of Rx FIFO in S32 SDK</title>
    <link>https://community.nxp.com/t5/S32-SDK/S32DS-for-ARM-2-2-Problem-on-callback-of-Rx-FIFO/m-p/1094442#M1789</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We use can_pal.c moudle to implement CAN bus function.&lt;/P&gt;&lt;P&gt;System starts reception via&amp;nbsp;CAN_Receive and install a callback function via CAN_InstallEventCallback.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Static void internalCallback(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; U32 interface, /**&amp;lt; CAN interface */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; can_event_t eventType, /**&amp;lt; The type of the event */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; U32 box, /**&amp;lt; Message box */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; void *state) /**&amp;lt; Internal driver state information */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When a CAN frame is received, the callback function is called correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However,&amp;nbsp; when we get message: ((flexcan_state_t*)state)-&amp;gt;mbs-&amp;gt;mb_message, it's not correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After investigation, I found that in function:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;static inline void FLEXCAN_IRQHandlerRxFIFO(uint8_t instance, uint32_t mb_idx)&lt;/P&gt;&lt;P&gt;mb_message&amp;nbsp;is cleared before calling the callback function&amp;nbsp;by:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FLEXCAN_CompleteRxMessageFifoData(instance);&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From my perspective, callback function SHOULD be called before completing receive data.&lt;/P&gt;&lt;P&gt;Please check it out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BRs,&lt;/P&gt;&lt;P&gt;Matthew Xu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Aug 2020 03:16:23 GMT</pubDate>
    <dc:creator>xu_wenming</dc:creator>
    <dc:date>2020-08-14T03:16:23Z</dc:date>
    <item>
      <title>S32DS for ARM 2.2 - Problem on callback of Rx FIFO</title>
      <link>https://community.nxp.com/t5/S32-SDK/S32DS-for-ARM-2-2-Problem-on-callback-of-Rx-FIFO/m-p/1094442#M1789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We use can_pal.c moudle to implement CAN bus function.&lt;/P&gt;&lt;P&gt;System starts reception via&amp;nbsp;CAN_Receive and install a callback function via CAN_InstallEventCallback.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Static void internalCallback(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; U32 interface, /**&amp;lt; CAN interface */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; can_event_t eventType, /**&amp;lt; The type of the event */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; U32 box, /**&amp;lt; Message box */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; void *state) /**&amp;lt; Internal driver state information */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When a CAN frame is received, the callback function is called correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However,&amp;nbsp; when we get message: ((flexcan_state_t*)state)-&amp;gt;mbs-&amp;gt;mb_message, it's not correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After investigation, I found that in function:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;static inline void FLEXCAN_IRQHandlerRxFIFO(uint8_t instance, uint32_t mb_idx)&lt;/P&gt;&lt;P&gt;mb_message&amp;nbsp;is cleared before calling the callback function&amp;nbsp;by:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FLEXCAN_CompleteRxMessageFifoData(instance);&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From my perspective, callback function SHOULD be called before completing receive data.&lt;/P&gt;&lt;P&gt;Please check it out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BRs,&lt;/P&gt;&lt;P&gt;Matthew Xu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2020 03:16:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-SDK/S32DS-for-ARM-2-2-Problem-on-callback-of-Rx-FIFO/m-p/1094442#M1789</guid>
      <dc:creator>xu_wenming</dc:creator>
      <dc:date>2020-08-14T03:16:23Z</dc:date>
    </item>
  </channel>
</rss>

