<?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: On the Calculation of FlexCAN Mailbox region in S32K</title>
    <link>https://community.nxp.com/t5/S32K/On-the-Calculation-of-FlexCAN-Mailbox-region/m-p/1565843#M19306</link>
    <description>&lt;P&gt;hi&amp;nbsp;&lt;A href="https://community.nxp.com/t5/user/viewprofilepage/user-id/188029" target="_self"&gt;&lt;SPAN class=""&gt;Senlent&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As shown in the figure below,What is written in the document is the same as what you described, but why is the calculated result of this function different from what is described in the document?&amp;nbsp;The calculated address of Mb [0] is 0x80, while Mb [1] is offset by 32 bytes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JihongZhang_0-1670407139260.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/203353i45E8109F6907E701/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JihongZhang_0-1670407139260.png" alt="JihongZhang_0-1670407139260.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Dec 2022 09:59:05 GMT</pubDate>
    <dc:creator>JihongZhang</dc:creator>
    <dc:date>2022-12-07T09:59:05Z</dc:date>
    <item>
      <title>On the Calculation of FlexCAN Mailbox region</title>
      <link>https://community.nxp.com/t5/S32K/On-the-Calculation-of-FlexCAN-Mailbox-region/m-p/1565539#M19285</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am writing a FlexCAN driver. Refer to S32K144 FlexCAN driver. The MB area calculation function and data manual description do not match. Is there any mistake in my understanding?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As described in the data manual, the MB interval of 8 payloads is 16 bytes, but 32 bytes are calculated in the code. Is there any problem in understanding?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;source Code: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;volatile uint32_t* FLEXCAN_GetMsgBuffRegion(&lt;BR /&gt;CAN_Type * base,&lt;BR /&gt;uint32_t msgBuffIdx)&lt;BR /&gt;{&lt;BR /&gt;#if FEATURE_CAN_HAS_FD&lt;BR /&gt;uint8_t payload_size = FLEXCAN_GetPayloadSize(base);&lt;BR /&gt;#else&lt;BR /&gt;uint8_t payload_size = 8U;&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;uint8_t arbitration_field_size = 8U;&lt;BR /&gt;uint32_t ramBlockSize = 512U;&lt;BR /&gt;uint32_t ramBlockOffset;&lt;/P&gt;&lt;P&gt;uint8_t mb_size = (uint8_t)(payload_size + arbitration_field_size);&lt;BR /&gt;uint8_t maxMbNum = (uint8_t)(ramBlockSize / mb_size);&lt;/P&gt;&lt;P&gt;ramBlockOffset = 128U * (msgBuffIdx / (uint32_t)maxMbNum);&lt;/P&gt;&lt;P&gt;/* Multiply the MB index by the MB size (in words) */&lt;BR /&gt;uint32_t mb_index = ramBlockOffset + ((msgBuffIdx % (uint32_t)maxMbNum) * ((uint32_t)mb_size &amp;gt;&amp;gt; 2U));&lt;/P&gt;&lt;P&gt;return &amp;amp;(base-&amp;gt;RAMn[mb_index]);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JihongZhang_0-1670381572362.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/203282i2CE559A8DBE91B09/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JihongZhang_0-1670381572362.png" alt="JihongZhang_0-1670381572362.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 02:54:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/On-the-Calculation-of-FlexCAN-Mailbox-region/m-p/1565539#M19285</guid>
      <dc:creator>JihongZhang</dc:creator>
      <dc:date>2022-12-07T02:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: On the Calculation of FlexCAN Mailbox region</title>
      <link>https://community.nxp.com/t5/S32K/On-the-Calculation-of-FlexCAN-Mailbox-region/m-p/1565745#M19294</link>
      <description>&lt;P&gt;I didn't get your point, isn't MB_SIZE equal to 16 here?(payloadSize = &lt;LI-EMOJI id="lia_smiling-face-with-sunglasses" title=":smiling_face_with_sunglasses:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Senlent_0-1670400058234.png" style="width: 662px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/203332i748B5496442CD3EE/image-dimensions/662x298?v=v2" width="662" height="298" role="button" title="Senlent_0-1670400058234.png" alt="Senlent_0-1670400058234.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 08:03:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/On-the-Calculation-of-FlexCAN-Mailbox-region/m-p/1565745#M19294</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2022-12-07T08:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: On the Calculation of FlexCAN Mailbox region</title>
      <link>https://community.nxp.com/t5/S32K/On-the-Calculation-of-FlexCAN-Mailbox-region/m-p/1565754#M19296</link>
      <description>&lt;P&gt;My understanding is that this function is used to calculate the starting address of MB, but why is this function used to calculate the second MB of an 8-byte load offset by 32 bytes?&amp;nbsp;Shouldn't it be 16 bytes?&amp;nbsp;（1/32）*512 + （1%32）* 16 = 8 dword， 0x80 + 0x20 = 0xa0. But isn't the interval between two MB in the MB structure description 16 bytes?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JihongZhang_0-1670400672568.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/203333iB50921E4D66E301F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JihongZhang_0-1670400672568.png" alt="JihongZhang_0-1670400672568.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 08:11:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/On-the-Calculation-of-FlexCAN-Mailbox-region/m-p/1565754#M19296</guid>
      <dc:creator>JihongZhang</dc:creator>
      <dc:date>2022-12-07T08:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: On the Calculation of FlexCAN Mailbox region</title>
      <link>https://community.nxp.com/t5/S32K/On-the-Calculation-of-FlexCAN-Mailbox-region/m-p/1565785#M19298</link>
      <description>&lt;P&gt;I didn't understand the logic of your formula, I did a simple calculation based on this function&lt;/P&gt;
&lt;P&gt;for example:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;msgBuffIdx&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;2&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;RAMn[CAN_RAMn_COUNT]&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;RAMn[0]&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;RAMn[4]&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;RAMn[8]&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;RAMn[12]&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The offset address of RAMn is 0x80,the size of each RAMn[x]&amp;nbsp; is 4 bytes and each offset is 4 bytes, and the space occupied by one MB is exactly 16 bytes. Is there any problem?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 09:16:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/On-the-Calculation-of-FlexCAN-Mailbox-region/m-p/1565785#M19298</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2022-12-07T09:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: On the Calculation of FlexCAN Mailbox region</title>
      <link>https://community.nxp.com/t5/S32K/On-the-Calculation-of-FlexCAN-Mailbox-region/m-p/1565843#M19306</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;A href="https://community.nxp.com/t5/user/viewprofilepage/user-id/188029" target="_self"&gt;&lt;SPAN class=""&gt;Senlent&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As shown in the figure below,What is written in the document is the same as what you described, but why is the calculated result of this function different from what is described in the document?&amp;nbsp;The calculated address of Mb [0] is 0x80, while Mb [1] is offset by 32 bytes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JihongZhang_0-1670407139260.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/203353i45E8109F6907E701/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JihongZhang_0-1670407139260.png" alt="JihongZhang_0-1670407139260.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 09:59:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/On-the-Calculation-of-FlexCAN-Mailbox-region/m-p/1565843#M19306</guid>
      <dc:creator>JihongZhang</dc:creator>
      <dc:date>2022-12-07T09:59:05Z</dc:date>
    </item>
  </channel>
</rss>

