<?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>Model-Based Design Toolbox (MBDT)中的主题 Re: How to achieve Modularity for code generation in NXP_MBDToolbox</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-achieve-Modularity-for-code-generation-in-NXP-MBDToolbox/m-p/1011004#M4056</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/sagar.salunkhe50@gmail.com" rel="noopener noreferrer" target="_blank"&gt;sagar.salunkhe50@gmail.com&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is absolutely possible and quite easy to do with S32Design Studio or any other tools that support &lt;STRONG&gt;Virtual Files/Folders&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You need virtual linkage because you need to have MATLAB responsible for the content of the files and to be all the time in sync with the latest changes/code generation.&lt;/P&gt;&lt;P style="text-align: justify;"&gt;These files will not be part of the S32 Design Studio, but rather these will exists only in the MATLAB generated folders. Each time the files are updated, the S32 Design Studio will be automatically updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 1:&lt;/STRONG&gt; Start by creating a new application project for the target you are developing for:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;IMG alt="pastedImage_1.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100037iC6CE7CF1232FA68C/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;IMG alt="pastedImage_1.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100089i8D048AC3D30443C6/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;STEP 2:&lt;/STRONG&gt; Create a new Virtual Folder in your project. This will be used to linked your files generated by MATLAB with the existing project created at STEP 1.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;IMG alt="pastedImage_4.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100038i7DE78A0CE1A207B0/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_4.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;STEP 3:&lt;/STRONG&gt; In this folder you can link virtually all the files generated from MATLAB. Here you can create additional virtual folders for src/headers etc.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_10.png"&gt;&lt;IMG alt="pastedImage_10.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100123i7077C7F5A2C8445B/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_10.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;STEP 4:&lt;/STRONG&gt;&amp;nbsp;Add your files into these folders. Typically you need only the MATLAB &lt;STRONG&gt;Generated Code&lt;/STRONG&gt; files for your models. You can drag and drop them into your S32 Design Studio virtual folders.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_15.png"&gt;&lt;IMG alt="pastedImage_15.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100125i64C8E5AEE01D4CDA/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_15.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="warning" __jive_macro_name="alert" alert="warning" class="jive_text_macro jive_macro_alert" modifiedtitle="true"&gt;&lt;P&gt;&lt;STRONG&gt;REMEMBER: Select LINK option when drag&amp;amp;drop files into S32 Design Studio.&lt;/STRONG&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_16.png"&gt;&lt;IMG alt="pastedImage_16.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100428i38B679B3F1FD1640/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_16.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this step, the S32 Design Studio will update the INDEXER and will show all the data/functions. All you have to do is to call your functions in the other parts of the projects.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_19.png"&gt;&lt;IMG alt="pastedImage_19.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100724i38F7BAB967A075EF/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_19.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a better code modularity and reuse, I recommend to use &lt;STRONG&gt;&lt;A href="https://www.mathworks.com/help/rtw/ug/reusing-functions-in-generated-code.html;jsessionid=81f579ccf81ed8556c44838c0337" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;Function Packaging&lt;/A&gt;&lt;/STRONG&gt;. This way you can generate files and functions for each subsystem you are interested in, and will avoid having the Simulink Step/Initializa/Terminate functions staying into your S32 Design Studio project. This way you will achieve the best automatic code generation and custom code interfacing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_20.png"&gt;&lt;IMG alt="pastedImage_20.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100855iC588F0F5772BF942/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_20.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Nov 2020 14:34:01 GMT</pubDate>
    <dc:creator>Daniel_Popa</dc:creator>
    <dc:date>2020-11-02T14:34:01Z</dc:date>
    <item>
      <title>How to achieve Modularity for code generation in NXP_MBDToolbox</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-achieve-Modularity-for-code-generation-in-NXP-MBDToolbox/m-p/1011002#M4054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using S32k144EVB board and NXP_MBDToolbox in matlab 2019a. I want to make different models for ADC, GPIO, PWM,etc and then finally I want to combine ADC.c, GPIO.c ,PWM.c file in&amp;nbsp; my S32k design studio.&lt;/P&gt;&lt;P&gt;I have created different .slx files for different modules but when I generate code for these different modules each module is generated as a different project and different dependent file.I just want the code for that module only and then when I will combine .c and .h files it should compile.&lt;/P&gt;&lt;P&gt;I have attached sample module for example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 12:51:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-achieve-Modularity-for-code-generation-in-NXP-MBDToolbox/m-p/1011002#M4054</guid>
      <dc:creator>sagar_salunkhe5</dc:creator>
      <dc:date>2020-02-25T12:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to achieve Modularity for code generation in NXP_MBDToolbox</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-achieve-Modularity-for-code-generation-in-NXP-MBDToolbox/m-p/1011003#M4055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/sagar.salunkhe50@gmail.com"&gt;sagar.salunkhe50@gmail.com&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/dumitru-daniel.popa"&gt;dumitru-daniel.popa&lt;/A&gt;‌ can give you an example on how you can generate code for only part of your model, which you may integrate manually later in your project. Thank you in advance Daniel!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Razvan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2020 08:51:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-achieve-Modularity-for-code-generation-in-NXP-MBDToolbox/m-p/1011003#M4055</guid>
      <dc:creator>constantinrazva</dc:creator>
      <dc:date>2020-03-12T08:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to achieve Modularity for code generation in NXP_MBDToolbox</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-achieve-Modularity-for-code-generation-in-NXP-MBDToolbox/m-p/1011004#M4056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/sagar.salunkhe50@gmail.com" rel="noopener noreferrer" target="_blank"&gt;sagar.salunkhe50@gmail.com&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is absolutely possible and quite easy to do with S32Design Studio or any other tools that support &lt;STRONG&gt;Virtual Files/Folders&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You need virtual linkage because you need to have MATLAB responsible for the content of the files and to be all the time in sync with the latest changes/code generation.&lt;/P&gt;&lt;P style="text-align: justify;"&gt;These files will not be part of the S32 Design Studio, but rather these will exists only in the MATLAB generated folders. Each time the files are updated, the S32 Design Studio will be automatically updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 1:&lt;/STRONG&gt; Start by creating a new application project for the target you are developing for:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;IMG alt="pastedImage_1.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100037iC6CE7CF1232FA68C/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;IMG alt="pastedImage_1.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100089i8D048AC3D30443C6/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;STEP 2:&lt;/STRONG&gt; Create a new Virtual Folder in your project. This will be used to linked your files generated by MATLAB with the existing project created at STEP 1.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;IMG alt="pastedImage_4.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100038i7DE78A0CE1A207B0/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_4.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;STEP 3:&lt;/STRONG&gt; In this folder you can link virtually all the files generated from MATLAB. Here you can create additional virtual folders for src/headers etc.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_10.png"&gt;&lt;IMG alt="pastedImage_10.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100123i7077C7F5A2C8445B/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_10.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;STEP 4:&lt;/STRONG&gt;&amp;nbsp;Add your files into these folders. Typically you need only the MATLAB &lt;STRONG&gt;Generated Code&lt;/STRONG&gt; files for your models. You can drag and drop them into your S32 Design Studio virtual folders.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_15.png"&gt;&lt;IMG alt="pastedImage_15.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100125i64C8E5AEE01D4CDA/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_15.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="warning" __jive_macro_name="alert" alert="warning" class="jive_text_macro jive_macro_alert" modifiedtitle="true"&gt;&lt;P&gt;&lt;STRONG&gt;REMEMBER: Select LINK option when drag&amp;amp;drop files into S32 Design Studio.&lt;/STRONG&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_16.png"&gt;&lt;IMG alt="pastedImage_16.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100428i38B679B3F1FD1640/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_16.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this step, the S32 Design Studio will update the INDEXER and will show all the data/functions. All you have to do is to call your functions in the other parts of the projects.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_19.png"&gt;&lt;IMG alt="pastedImage_19.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100724i38F7BAB967A075EF/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_19.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a better code modularity and reuse, I recommend to use &lt;STRONG&gt;&lt;A href="https://www.mathworks.com/help/rtw/ug/reusing-functions-in-generated-code.html;jsessionid=81f579ccf81ed8556c44838c0337" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;Function Packaging&lt;/A&gt;&lt;/STRONG&gt;. This way you can generate files and functions for each subsystem you are interested in, and will avoid having the Simulink Step/Initializa/Terminate functions staying into your S32 Design Studio project. This way you will achieve the best automatic code generation and custom code interfacing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_20.png"&gt;&lt;IMG alt="pastedImage_20.png" src="https://community.nxp.com/t5/image/serverpage/image-id/100855iC588F0F5772BF942/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_20.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:34:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-achieve-Modularity-for-code-generation-in-NXP-MBDToolbox/m-p/1011004#M4056</guid>
      <dc:creator>Daniel_Popa</dc:creator>
      <dc:date>2020-11-02T14:34:01Z</dc:date>
    </item>
  </channel>
</rss>

