<?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 S32K144 Simulink External Mode in Model-Based Design Toolbox (MBDT)</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-Simulink-External-Mode/m-p/921968#M3379</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to get the MBDT example for External Mode to work with a S32K144EVB. However,&amp;nbsp;the example&amp;nbsp;fails to compile&amp;nbsp;when External Mode is enabled in config.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Model:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="model.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/86941i9F8F2E5E9A4A509B/image-size/large?v=v2&amp;amp;px=999" role="button" title="model.png" alt="model.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Settings used for External Mode (COM3 port, 56700 baud rate):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="config.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/86943iFA8F2437B1556CC4/image-size/large?v=v2&amp;amp;px=999" role="button" title="config.png" alt="config.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error encountered during build:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="error.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/86944i93E93D0AEF42A617/image-size/large?v=v2&amp;amp;px=999" role="button" title="error.png" alt="error.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Corresponding line in the makefile, I believe:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="makefile.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/86952i216D0D75861F07F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="makefile.png" alt="makefile.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody have an idea what goes wrong here? Or any pointers how to get External Mode working?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jun 2019 16:02:41 GMT</pubDate>
    <dc:creator>b622402</dc:creator>
    <dc:date>2019-06-13T16:02:41Z</dc:date>
    <item>
      <title>S32K144 Simulink External Mode</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-Simulink-External-Mode/m-p/921968#M3379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to get the MBDT example for External Mode to work with a S32K144EVB. However,&amp;nbsp;the example&amp;nbsp;fails to compile&amp;nbsp;when External Mode is enabled in config.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Model:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="model.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/86941i9F8F2E5E9A4A509B/image-size/large?v=v2&amp;amp;px=999" role="button" title="model.png" alt="model.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Settings used for External Mode (COM3 port, 56700 baud rate):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="config.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/86943iFA8F2437B1556CC4/image-size/large?v=v2&amp;amp;px=999" role="button" title="config.png" alt="config.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error encountered during build:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="error.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/86944i93E93D0AEF42A617/image-size/large?v=v2&amp;amp;px=999" role="button" title="error.png" alt="error.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Corresponding line in the makefile, I believe:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="makefile.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/86952i216D0D75861F07F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="makefile.png" alt="makefile.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody have an idea what goes wrong here? Or any pointers how to get External Mode working?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2019 16:02:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-Simulink-External-Mode/m-p/921968#M3379</guid>
      <dc:creator>b622402</dc:creator>
      <dc:date>2019-06-13T16:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 Simulink External Mode</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-Simulink-External-Mode/m-p/921969#M3380</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/b622402@urhen.com"&gt;b622402@urhen.com&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error is caused by how Matlab generates the makefile to build the application in R2019a release. On line 651 in &lt;STRONG&gt;extmode_s32k14x.tmf &lt;/STRONG&gt;it creates a rule with spaces in the prerequisites part, &lt;STRONG&gt;"C:\Programs Files\MATLAB\R2019a\...".&lt;/STRONG&gt; That rule is generated automatically by Matlab to build a required Matlab C source file &lt;STRONG&gt;rtiostream_utils&lt;/STRONG&gt;.&lt;STRONG&gt;c.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am still investigating why Matlab generates this strange rules in R2019a.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For now, as a workaround you can move Matlab to &lt;STRONG&gt;C:\MATLAB\R2019a&lt;/STRONG&gt; or some other path without spaces.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2019 13:20:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-Simulink-External-Mode/m-p/921969#M3380</guid>
      <dc:creator>paulvlase</dc:creator>
      <dc:date>2019-06-18T13:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 Simulink External Mode</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-Simulink-External-Mode/m-p/1174218#M5210</link>
      <description>&lt;P&gt;This problem is still happening in Matlab R2019b.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone reported this in a service request to Mathworks?&lt;/P&gt;&lt;P&gt;It is a miserable problem that will affect a big proportion of MBDT users.&lt;/P&gt;&lt;P&gt;Has anyone found a less painful fix besides a complete re-install of Matlab + MBDT + add-ons?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 05:12:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-Simulink-External-Mode/m-p/1174218#M5210</guid>
      <dc:creator>rsating</dc:creator>
      <dc:date>2020-10-28T05:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 Simulink External Mode</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-Simulink-External-Mode/m-p/1174908#M5221</link>
      <description>&lt;P&gt;I reported the issue to Mathworks. It was confirmed a known problem in R2019a, R2019b, and R2020a.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Yes this is an identified issue that the build fails when the file path contains spaces."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"I have checked internally that changes have been made in the recent MATLAB R2020b release. Now instead of expanding the path, the generated makefile will stay with tokenized path, and thus resolves this issue."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It is true that re-installing Matlab on a path without spaces in the directory names is a workaround.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, a less disruptive workaround is described below.&lt;/P&gt;&lt;P&gt;The following describes how the build process can be customized:&lt;BR /&gt;&lt;A href="https://www.mathworks.com/help/rtw/ug/customizing-the-target-build-process-with-the-stf-make-rtw-hook-file.html" target="_blank"&gt;https://www.mathworks.com/help/rtw/ug/customizing-the-target-build-process-with-the-stf-make-rtw-hook-file.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Look for the m-file&amp;nbsp; *_make_rtw_hook.m&amp;nbsp; In my case I found two matches:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;.\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\mbdtbx_s32k_as\mbd_s32k_as_make_rtw_hook.m&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;.\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\mbdtbx_s32k\mbd_s32k_make_rtw_hook.m&lt;/P&gt;&lt;P&gt;Setting a breakpoint showed only the second script was run in my case, but I applied the fix to both.&lt;/P&gt;&lt;P&gt;Look for the contents of the case statement:&amp;nbsp;&amp;nbsp;case 'before_make'&lt;/P&gt;&lt;P&gt;Mathworks suggested adding the following code [to the end] of the code block for that case option:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;% --- Fix for External Mode Build Error ---&lt;BR /&gt;files = {buildInfo.Src.Files.FileName};&lt;BR /&gt;filesToRemove = {'&lt;STRONG&gt;rtiostream_utils.c&lt;/STRONG&gt;'};&lt;BR /&gt;removeIdxs = cellfun(@(x) strcmp(files,x), filesToRemove,'UniformOutput',false);&lt;BR /&gt;removeIdx = any(cell2mat(removeIdxs'),1);&lt;BR /&gt;if (~isempty(files(removeIdx)))&lt;BR /&gt;&amp;nbsp; buildInfo.Src.Files(removeIdx).Path = '';&lt;BR /&gt;end&lt;/P&gt;&lt;P&gt;The filename in bold (above) must match the filename on the troublesome code on Line 621 of the makefile.&lt;/P&gt;&lt;P&gt;With the this fix in place the build completed successfully, downloaded the executable to the board, and the application started running with the blue LED flashing.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note the Target Connection configuration needs to be set properly for the code to be deployed and run successfully:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NXP_MBDT_S23K1xx_Target_Connection.png" style="width: 459px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/128570i2BC1D0081C9438A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="NXP_MBDT_S23K1xx_Target_Connection.png" alt="NXP_MBDT_S23K1xx_Target_Connection.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There is one remaining challenge, however, given the knob on the dashboard has no effect on the duty cycle of the flashing LED, and the scope does not show any activity from the board; it is as if the application runs on the board without any persistent connection to Simulink, as one would expect from External Mode.&amp;nbsp; It is if the example is not running in External Mode. But I cannot see any options or settings to turn it on.&lt;/P&gt;&lt;P&gt;Any suggestions for overcoming this last challenge are welcome.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 01:00:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-Simulink-External-Mode/m-p/1174908#M5221</guid>
      <dc:creator>rsating</dc:creator>
      <dc:date>2020-10-29T01:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 Simulink External Mode</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-Simulink-External-Mode/m-p/1176790#M5252</link>
      <description>&lt;P&gt;It turns out the broken makefile problem originally reported at the start of this thread returns, and the above fix does not help, with Processor-in-the-Loop (PIL) examples, and likely elsewhere.&amp;nbsp; Only re-installing Matlab/Simulink on a path without spaces is a reliable fix.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2020 18:31:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-Simulink-External-Mode/m-p/1176790#M5252</guid>
      <dc:creator>rsating</dc:creator>
      <dc:date>2020-11-02T18:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 Simulink External Mode</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-Simulink-External-Mode/m-p/1177040#M5256</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/178673"&gt;@rsating&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank you for such a wonderful contribution to our community! Your suggestions will help others too!&lt;/P&gt;
&lt;P&gt;Even if, as you mentioned in your last reply, reinstalling Matlab in a path with no spaces is the best solution so far, maybe for others, the lines of code you've provided will be enough.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's been a while since we are facing this issue with the spaces in the path for PIL.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;Marius&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 07:06:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-Simulink-External-Mode/m-p/1177040#M5256</guid>
      <dc:creator>mariuslucianand</dc:creator>
      <dc:date>2020-11-03T07:06:48Z</dc:date>
    </item>
  </channel>
</rss>

