<?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: i.MX RT Toolbox: subsystem executed from TCM RAM</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/i-MX-RT-Toolbox-subsystem-executed-from-TCM-RAM/m-p/1280269#M6076</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/123994"&gt;@nxa11767&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;to clarify:&lt;/P&gt;&lt;P&gt;1) in case of any subsystem (not IRQ handler) we only need to define it's name and signature in 'function packaging' and use these in 'Model Header' block (the same as you did)&lt;/P&gt;&lt;P&gt;2) in case of any IRQ Handler - we need to check the name and signature of the IRQ Handler in SDK&amp;nbsp;and use these in 'Model Header' block (the same as you did)&lt;/P&gt;&lt;P&gt;Am I right ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Maciek&lt;/P&gt;</description>
    <pubDate>Fri, 21 May 2021 09:10:55 GMT</pubDate>
    <dc:creator>Maciek</dc:creator>
    <dc:date>2021-05-21T09:10:55Z</dc:date>
    <item>
      <title>i.MX RT Toolbox: subsystem executed from TCM RAM</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/i-MX-RT-Toolbox-subsystem-executed-from-TCM-RAM/m-p/1278943#M6070</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;is there a way to assign a time/performance critical subsystem (like IRQ handler) to be copied to and executed from TCM RAM on i.MX RT1064 (and not from the internal SPI Flash) ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Maciek&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 10:59:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/i-MX-RT-Toolbox-subsystem-executed-from-TCM-RAM/m-p/1278943#M6070</guid>
      <dc:creator>Maciek</dc:creator>
      <dc:date>2021-05-19T10:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX RT Toolbox: subsystem executed from TCM RAM</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/i-MX-RT-Toolbox-subsystem-executed-from-TCM-RAM/m-p/1279803#M6073</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/12402"&gt;@Maciek&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;There is a support in simulink coder to place variables and functions but using pragmas: &lt;A href="https://www.mathworks.com/help/ecoder/ug/control-data-and-function-placement-in-memory-by-inserting-pragmas.html&amp;nbsp;-" target="_blank"&gt;https://www.mathworks.com/help/ecoder/ug/control-data-and-function-placement-in-memory-by-inserting-pragmas.html&amp;nbsp;-&lt;/A&gt; but for ARM GCC you need to use __attribute__section.&lt;/P&gt;
&lt;P&gt;But even with the above steps, I could not place the function system call of the IRQ handler block in a specific section(but I will continue to investigate in this direction also) so I tried something with custom code block that did the trick:&lt;/P&gt;
&lt;P&gt;I used a Model Header custom code block with the next info:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_0-1621517447702.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/145148i4032EFFD0C1BF3D6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa11767_0-1621517447702.png" alt="nxa11767_0-1621517447702.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I declared the interrupt handler specifying the attribute__section option and is placing the the handler function to be run from address 0x0 (ITC start address). The custom code will be added in the .h file of the model generated by simulink.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;The name of the section got it from the linker file:&amp;nbsp;MIMXRT1064xxxxA.ld.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_1-1621498839970.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/145121i4B53E0878EBCE1D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa11767_1-1621498839970.png" alt="nxa11767_1-1621498839970.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Alexandra&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 13:39:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/i-MX-RT-Toolbox-subsystem-executed-from-TCM-RAM/m-p/1279803#M6073</guid>
      <dc:creator>nxa11767</dc:creator>
      <dc:date>2021-05-20T13:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX RT Toolbox: subsystem executed from TCM RAM</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/i-MX-RT-Toolbox-subsystem-executed-from-TCM-RAM/m-p/1280269#M6076</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/123994"&gt;@nxa11767&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;to clarify:&lt;/P&gt;&lt;P&gt;1) in case of any subsystem (not IRQ handler) we only need to define it's name and signature in 'function packaging' and use these in 'Model Header' block (the same as you did)&lt;/P&gt;&lt;P&gt;2) in case of any IRQ Handler - we need to check the name and signature of the IRQ Handler in SDK&amp;nbsp;and use these in 'Model Header' block (the same as you did)&lt;/P&gt;&lt;P&gt;Am I right ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Maciek&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 09:10:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/i-MX-RT-Toolbox-subsystem-executed-from-TCM-RAM/m-p/1280269#M6076</guid>
      <dc:creator>Maciek</dc:creator>
      <dc:date>2021-05-21T09:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX RT Toolbox: subsystem executed from TCM RAM</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/i-MX-RT-Toolbox-subsystem-executed-from-TCM-RAM/m-p/1281007#M6079</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/12402"&gt;@Maciek&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;1. Yes, for subsystem, you need to mark the subsystem to be treated as atomic and the function packaging option will be enabled in the Code Generation tab, and you can specify there the user defined signature and use that signature in the model header.&lt;/P&gt;
&lt;P&gt;2. Yes, for IRQ handler you can take a look in&amp;nbsp;startup_mimxrt1064.c for the IRQ handlers signatures.&lt;/P&gt;
&lt;P&gt;I was mentioning that I am looking for another approach and I have another option. The subsystems, in Code generation tab have the below options:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_0-1621844356298.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/145326iEAEC67636750C970/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa11767_0-1621844356298.png" alt="nxa11767_0-1621844356298.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The problem here is how to add a custom section in that drop down. And I came across something that is called custom storage class designer in simulink.&amp;nbsp; (&lt;A href="https://www.programmersought.com/article/30023346578/" target="_blank"&gt;https://www.mathworks.com/help/ecoder/ug/design-custom-storage-classes-and-memory-sections.html)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Default the storage classes and memory sections for a model are loaded from a package called Simulink. Type&amp;nbsp;cscdesigner and will open the below window:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_2-1621844735738.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/145329i9A4F094C3999D8FB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa11767_2-1621844735738.png" alt="nxa11767_2-1621844735738.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The Simulink package is read only, so you cannot add new memory sections, but you can create your own package. The steps I did:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;-&amp;nbsp; duplicate the Simulink dataclass package ( found it here for my matlab instalation c:\Program Files\MATLAB\R2020b\toolbox\simulink\simdemos\dataclasses).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;- rename duplicate to&amp;nbsp; +MyDataClasses (find it attached), that I placed it in the toolbox root directory and added to the matlab path)&lt;/P&gt;
&lt;P&gt;- in command window, type cscdesigner('MyDataClasses'), and I have my custom package loaded.&lt;/P&gt;
&lt;P&gt;- next i could add a new memory section&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_3-1621845205151.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/145331iEC7DC1331FA8F1D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa11767_3-1621845205151.png" alt="nxa11767_3-1621845205151.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_4-1621845301682.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/145332iEC0D8158080824FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa11767_4-1621845301682.png" alt="nxa11767_4-1621845301682.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, you need to specify to the model to load the storage classes and memory section from this custom package. This is done from Embedded Coder app, Code Interface, Embedded Coder Dictionary:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_5-1621845497644.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/145334iD9E7E11770C7C7FA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa11767_5-1621845497644.png" alt="nxa11767_5-1621845497644.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I used Manage Package (Refresh to se my custom one in the drop down) - I did an Unload of the Simulink package and then Load of the MyDataClasses.&lt;/P&gt;
&lt;P&gt;After doing all the above steps, I could see in the memory section dropdown of the subsystems my added memory section:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_6-1621845671589.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/145339iF820EFC5D4A51347/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa11767_6-1621845671589.png" alt="nxa11767_6-1621845671589.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The option will be available for any subsystems (including the function call ones).&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Alexandra&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 08:47:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/i-MX-RT-Toolbox-subsystem-executed-from-TCM-RAM/m-p/1281007#M6079</guid>
      <dc:creator>nxa11767</dc:creator>
      <dc:date>2021-05-24T08:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX RT Toolbox: subsystem executed from TCM RAM</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/i-MX-RT-Toolbox-subsystem-executed-from-TCM-RAM/m-p/1281767#M6084</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/123994"&gt;@nxa11767&lt;/a&gt;&amp;nbsp;for detailed description!&lt;/P&gt;&lt;P&gt;We will check the solution with custom storage classes. It is much better/cleaner than using function names/signatures.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Maciek&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 10:39:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/i-MX-RT-Toolbox-subsystem-executed-from-TCM-RAM/m-p/1281767#M6084</guid>
      <dc:creator>Maciek</dc:creator>
      <dc:date>2021-05-25T10:39:51Z</dc:date>
    </item>
  </channel>
</rss>

