<?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: MBD Toolbox doesn't initialize LPSPI interrupt vectors when running in PIL mode</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-Toolbox-doesn-t-initialize-LPSPI-interrupt-vectors-when/m-p/1514577#M7644</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/146851"&gt;@glenndoiron&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have investigated the issue that you have with LPSPI interrupts and I have some ideas to explain. As Marius said PIL simulation is not intended to access hardware stuff, it is for validation purposes. In PIL simulation you put an algorithm which will run on the hardware to check if that algorithm is performing well on the target, measure the code execution profiling or to observe code coverage.&lt;/P&gt;
&lt;P&gt;From the model deployed on target in normal mode, the entire LPSPI initialization code is executed before enabling all interrupts, as shown in the next image.&lt;/P&gt;
&lt;DIV id="tinyMceEditorstefancinipeanu_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefancinipeanu_1-1661941349612.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/191969i612315F1501C23CC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefancinipeanu_1-1661941349612.png" alt="stefancinipeanu_1-1661941349612.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In PIL mode, the code is generated differently. The LPSPI init code is executed in the &lt;STRONG&gt;xilSystemInitialize&lt;/STRONG&gt; function defined in the &lt;STRONG&gt;xil_interface.c&lt;/STRONG&gt; which is generated automatically by Siumulink and we don`t have&amp;nbsp; control on this, so we cannot call the functions for enabling the interrupts. Also, the&lt;STRONG&gt; main&lt;/STRONG&gt; function that we defined in normal mode in the &lt;U&gt;&lt;EM&gt;mbd_main.c&lt;/EM&gt;&lt;/U&gt; file is redesigned as &lt;STRONG&gt;hw_init&amp;nbsp;&lt;/STRONG&gt;in the &lt;U&gt;&lt;EM&gt;mbd_hw_init.c&lt;/EM&gt;&lt;/U&gt; file&amp;nbsp;and we could enable the interrupts there, but we cannot call the initialization function which contains the LPSPI init code.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefancinipeanu_2-1661941819298.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/191970i57A8FA6A67177121/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefancinipeanu_2-1661941819298.png" alt="stefancinipeanu_2-1661941819298.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefancinipeanu_3-1661941967759.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/191971i8773E6F667FF4430/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefancinipeanu_3-1661941967759.png" alt="stefancinipeanu_3-1661941967759.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So, our suggestion is to redesign you approach and try not to access hardware in PIL simulation. Also, PIL is not a real time simulation and even if you succeed to have a functional LPSPI, you could lose data in the transfer or it can block the execution of the simulation.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Stefan.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Aug 2022 10:36:07 GMT</pubDate>
    <dc:creator>stefancinipeanu</dc:creator>
    <dc:date>2022-08-31T10:36:07Z</dc:date>
    <item>
      <title>MBD Toolbox doesn't initialize LPSPI interrupt vectors when running in PIL mode</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-Toolbox-doesn-t-initialize-LPSPI-interrupt-vectors-when/m-p/1501323#M7593</link>
      <description>&lt;P&gt;The attached file has two demonstration models and a word file detailing exactly how the issue was found.&lt;/P&gt;&lt;P&gt;TLDR - When compiling for non-PIL upload, the LPSPI interrupt vectors are populated with the appropriate interrupt routines.&amp;nbsp; When compiling for a PIL upload, the vectors are unconfigured and using the LPSPI peripheral causes a crash as soon as the LPSPI module generates an interrupt.&lt;/P&gt;&lt;P&gt;We'd like to know if this is intended or if we are doing something wrong when creating or compiling the PIL model.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 18:52:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-Toolbox-doesn-t-initialize-LPSPI-interrupt-vectors-when/m-p/1501323#M7593</guid>
      <dc:creator>glenndoiron</dc:creator>
      <dc:date>2022-08-04T18:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: MBD Toolbox doesn't initialize LPSPI interrupt vectors when running in PIL mode</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-Toolbox-doesn-t-initialize-LPSPI-interrupt-vectors-when/m-p/1510922#M7612</link>
      <description>&lt;P&gt;Can we please get a support response on this issue? Arrow quoted that 4 business days is typical, its been three weeks.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/72088"&gt;@mariuslucianand&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/24319"&gt;@paulvlase&lt;/a&gt;&amp;nbsp;any timeline for someone picking this up?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 12:25:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-Toolbox-doesn-t-initialize-LPSPI-interrupt-vectors-when/m-p/1510922#M7612</guid>
      <dc:creator>ericrost</dc:creator>
      <dc:date>2022-08-24T12:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: MBD Toolbox doesn't initialize LPSPI interrupt vectors when running in PIL mode</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-Toolbox-doesn-t-initialize-LPSPI-interrupt-vectors-when/m-p/1510926#M7613</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/195042"&gt;@ericrost&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/146851"&gt;@glenndoiron&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am really sorry for our delayed response. We are currently busy preparing a release on another platform and this is why our responses are being delayed. I will have a look at your reported issue.&lt;/P&gt;
&lt;P&gt;What I want to mention is that PIL mode is supposed to test the execution of the algorithm on the CPU and we do not recommend accessing the peripherals, because both SIL and PIL are not executed in real-time, so you might face some delays when data is being transmitted. However, I am not sure if this behavior is intended or not, so I need to investigate based on your attached models.&lt;/P&gt;
&lt;P&gt;I will send you a reply soon.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Marius&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 12:35:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-Toolbox-doesn-t-initialize-LPSPI-interrupt-vectors-when/m-p/1510926#M7613</guid>
      <dc:creator>mariuslucianand</dc:creator>
      <dc:date>2022-08-24T12:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: MBD Toolbox doesn't initialize LPSPI interrupt vectors when running in PIL mode</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-Toolbox-doesn-t-initialize-LPSPI-interrupt-vectors-when/m-p/1514577#M7644</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/146851"&gt;@glenndoiron&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have investigated the issue that you have with LPSPI interrupts and I have some ideas to explain. As Marius said PIL simulation is not intended to access hardware stuff, it is for validation purposes. In PIL simulation you put an algorithm which will run on the hardware to check if that algorithm is performing well on the target, measure the code execution profiling or to observe code coverage.&lt;/P&gt;
&lt;P&gt;From the model deployed on target in normal mode, the entire LPSPI initialization code is executed before enabling all interrupts, as shown in the next image.&lt;/P&gt;
&lt;DIV id="tinyMceEditorstefancinipeanu_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefancinipeanu_1-1661941349612.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/191969i612315F1501C23CC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefancinipeanu_1-1661941349612.png" alt="stefancinipeanu_1-1661941349612.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In PIL mode, the code is generated differently. The LPSPI init code is executed in the &lt;STRONG&gt;xilSystemInitialize&lt;/STRONG&gt; function defined in the &lt;STRONG&gt;xil_interface.c&lt;/STRONG&gt; which is generated automatically by Siumulink and we don`t have&amp;nbsp; control on this, so we cannot call the functions for enabling the interrupts. Also, the&lt;STRONG&gt; main&lt;/STRONG&gt; function that we defined in normal mode in the &lt;U&gt;&lt;EM&gt;mbd_main.c&lt;/EM&gt;&lt;/U&gt; file is redesigned as &lt;STRONG&gt;hw_init&amp;nbsp;&lt;/STRONG&gt;in the &lt;U&gt;&lt;EM&gt;mbd_hw_init.c&lt;/EM&gt;&lt;/U&gt; file&amp;nbsp;and we could enable the interrupts there, but we cannot call the initialization function which contains the LPSPI init code.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefancinipeanu_2-1661941819298.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/191970i57A8FA6A67177121/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefancinipeanu_2-1661941819298.png" alt="stefancinipeanu_2-1661941819298.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefancinipeanu_3-1661941967759.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/191971i8773E6F667FF4430/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefancinipeanu_3-1661941967759.png" alt="stefancinipeanu_3-1661941967759.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So, our suggestion is to redesign you approach and try not to access hardware in PIL simulation. Also, PIL is not a real time simulation and even if you succeed to have a functional LPSPI, you could lose data in the transfer or it can block the execution of the simulation.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Stefan.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 10:36:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-Toolbox-doesn-t-initialize-LPSPI-interrupt-vectors-when/m-p/1514577#M7644</guid>
      <dc:creator>stefancinipeanu</dc:creator>
      <dc:date>2022-08-31T10:36:07Z</dc:date>
    </item>
  </channel>
</rss>

