<?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 CRC Evaluation using direct memory addressing in Model-Based Design Toolbox (MBDT)</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/CRC-Evaluation-using-direct-memory-addressing/m-p/2266820#M10566</link>
    <description>&lt;P&gt;Hello all.&lt;/P&gt;&lt;P&gt;I'm working with S32K358 MCU, MBD Toolbox v1.6.0 and Matlab R2024a.&lt;/P&gt;&lt;P&gt;I know that Crc module isn't supported by the toolbox, so I configured the .mex file of the project in order to generate the RTD configuration suitable for my application, including Crc module, and then I wrote a Matlab function in order to manually call, as custom code, the "Crc_SetChannelCalculate" function.&lt;/P&gt;&lt;P&gt;This works fine and I can evaluate correctlty the CRC over a data streaming like an array.&lt;/P&gt;&lt;P&gt;Now what I would like to do is to evaluate the CRC on an area of memory, using directly the memory address as data input. If I write the code "manually" using S32DS IDE (outside Matlab), the code looks like this:&lt;/P&gt;&lt;P&gt;//--- code start&lt;/P&gt;&lt;P&gt;uint32 CrcResult;&lt;/P&gt;&lt;P&gt;uint8 *data;&lt;/P&gt;&lt;P&gt;data = (uint8 *)0x40A1F0; //arbitrary address chosen for starting calculation&lt;/P&gt;&lt;P&gt;CrcResult = Crc_SetChannelCalculate(CRC_LOGIC_CHANNEL_2, data, 16, 0, TRUE);&lt;/P&gt;&lt;P&gt;//in this way I calculate the CRC of 16 byte, with starting value = 0, read directly in flash starting from address 0x40A1F0&lt;/P&gt;&lt;P&gt;//---&lt;/P&gt;&lt;P&gt;Of course, before this, I initialized the logic channel CRC_LOGIC_CHANNEL_2 with the properties suitable for my application.&lt;/P&gt;&lt;P&gt;This code works fine but I'm not able to "translate" it on Matlab, because I didn't find a suitable way for make a direct memory addressing (and, if I'm not wrong, Matlab doesn't support this possibility).&lt;/P&gt;&lt;P&gt;I would please ask you if someone has an idea on how to face this matter.&lt;/P&gt;&lt;P&gt;Thansk in advance for your help and support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Dec 2025 10:26:44 GMT</pubDate>
    <dc:creator>embedded_dan73</dc:creator>
    <dc:date>2025-12-19T10:26:44Z</dc:date>
    <item>
      <title>CRC Evaluation using direct memory addressing</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/CRC-Evaluation-using-direct-memory-addressing/m-p/2266820#M10566</link>
      <description>&lt;P&gt;Hello all.&lt;/P&gt;&lt;P&gt;I'm working with S32K358 MCU, MBD Toolbox v1.6.0 and Matlab R2024a.&lt;/P&gt;&lt;P&gt;I know that Crc module isn't supported by the toolbox, so I configured the .mex file of the project in order to generate the RTD configuration suitable for my application, including Crc module, and then I wrote a Matlab function in order to manually call, as custom code, the "Crc_SetChannelCalculate" function.&lt;/P&gt;&lt;P&gt;This works fine and I can evaluate correctlty the CRC over a data streaming like an array.&lt;/P&gt;&lt;P&gt;Now what I would like to do is to evaluate the CRC on an area of memory, using directly the memory address as data input. If I write the code "manually" using S32DS IDE (outside Matlab), the code looks like this:&lt;/P&gt;&lt;P&gt;//--- code start&lt;/P&gt;&lt;P&gt;uint32 CrcResult;&lt;/P&gt;&lt;P&gt;uint8 *data;&lt;/P&gt;&lt;P&gt;data = (uint8 *)0x40A1F0; //arbitrary address chosen for starting calculation&lt;/P&gt;&lt;P&gt;CrcResult = Crc_SetChannelCalculate(CRC_LOGIC_CHANNEL_2, data, 16, 0, TRUE);&lt;/P&gt;&lt;P&gt;//in this way I calculate the CRC of 16 byte, with starting value = 0, read directly in flash starting from address 0x40A1F0&lt;/P&gt;&lt;P&gt;//---&lt;/P&gt;&lt;P&gt;Of course, before this, I initialized the logic channel CRC_LOGIC_CHANNEL_2 with the properties suitable for my application.&lt;/P&gt;&lt;P&gt;This code works fine but I'm not able to "translate" it on Matlab, because I didn't find a suitable way for make a direct memory addressing (and, if I'm not wrong, Matlab doesn't support this possibility).&lt;/P&gt;&lt;P&gt;I would please ask you if someone has an idea on how to face this matter.&lt;/P&gt;&lt;P&gt;Thansk in advance for your help and support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Dec 2025 10:26:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/CRC-Evaluation-using-direct-memory-addressing/m-p/2266820#M10566</guid>
      <dc:creator>embedded_dan73</dc:creator>
      <dc:date>2025-12-19T10:26:44Z</dc:date>
    </item>
  </channel>
</rss>

