<?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 S32k3 Hard Fault when using LCU in Model-Based Design Toolbox (MBDT)</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32k3-Hard-Fault-when-using-LCU/m-p/1712558#M8450</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to use the LCU peripheral on a S32k312 MCU.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Matlab R2022a, EB Tresos version 29.0.0, NXP MBDToolbox S32k3xx version 1.4.0 and NXP support package S32k3xx version 1.4.0.&lt;/P&gt;&lt;P&gt;I am currently working on an evaluation board (S32k312EVB-Q172) with a slightly modified version of a DIO example provided with the Matlab toolbox (s32k3xx_dio_ebt). The Simulink model has not been modified, but the EB Tresos configuration has to achieve the following function:&lt;/P&gt;&lt;P&gt;Use PTA19 as input -&amp;gt; Route to LCU_0 LCO through TRGMUX IN 13 -&amp;gt; invert the input to output 0 -&amp;gt; route to PTB21 through TRGMUX out 12.&lt;/P&gt;&lt;P&gt;The problem I have is that the MCU ends up in a hard fault handler during initialization of the LCU (see stack trace in attachment when I try to debug the Matlab generated code using S32DS).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone point out what I am missing to use the LCU peripheral? I am assuming my configuration is either wrong, or there is something that I am forgetting to configure, but I can't find the problem.&lt;/P&gt;&lt;P&gt;I have attached the whole Matlab folder.&lt;/P&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;P&gt;Alex Cloutier&lt;/P&gt;</description>
    <pubDate>Mon, 28 Aug 2023 17:32:35 GMT</pubDate>
    <dc:creator>AlexCloutier</dc:creator>
    <dc:date>2023-08-28T17:32:35Z</dc:date>
    <item>
      <title>S32k3 Hard Fault when using LCU</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32k3-Hard-Fault-when-using-LCU/m-p/1712558#M8450</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to use the LCU peripheral on a S32k312 MCU.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Matlab R2022a, EB Tresos version 29.0.0, NXP MBDToolbox S32k3xx version 1.4.0 and NXP support package S32k3xx version 1.4.0.&lt;/P&gt;&lt;P&gt;I am currently working on an evaluation board (S32k312EVB-Q172) with a slightly modified version of a DIO example provided with the Matlab toolbox (s32k3xx_dio_ebt). The Simulink model has not been modified, but the EB Tresos configuration has to achieve the following function:&lt;/P&gt;&lt;P&gt;Use PTA19 as input -&amp;gt; Route to LCU_0 LCO through TRGMUX IN 13 -&amp;gt; invert the input to output 0 -&amp;gt; route to PTB21 through TRGMUX out 12.&lt;/P&gt;&lt;P&gt;The problem I have is that the MCU ends up in a hard fault handler during initialization of the LCU (see stack trace in attachment when I try to debug the Matlab generated code using S32DS).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone point out what I am missing to use the LCU peripheral? I am assuming my configuration is either wrong, or there is something that I am forgetting to configure, but I can't find the problem.&lt;/P&gt;&lt;P&gt;I have attached the whole Matlab folder.&lt;/P&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;P&gt;Alex Cloutier&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 17:32:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32k3-Hard-Fault-when-using-LCU/m-p/1712558#M8450</guid>
      <dc:creator>AlexCloutier</dc:creator>
      <dc:date>2023-08-28T17:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: S32k3 Hard Fault when using LCU</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32k3-Hard-Fault-when-using-LCU/m-p/1716860#M8482</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/222228"&gt;@AlexCloutier&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thank you for using our S32K3xx toolbox on your projects.&lt;/P&gt;
&lt;P&gt;I have looked over your application's configuration project. In the first place, you should check the Mcu and Platform components to configure LCU-related settings.&lt;/P&gt;
&lt;P&gt;In Mcu, based on your hardware LCU instance configured in Mcl, enable the peripheral clock:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="georgevictor_2-1693895154774.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/239492iE5F32BCC797DAB42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="georgevictor_2-1693895154774.png" alt="georgevictor_2-1693895154774.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In the Platform component, you can find the interrupt section related to the hardware LCU instances.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="georgevictor_3-1693895209991.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/239494i45E9285046D1A5DB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="georgevictor_3-1693895209991.png" alt="georgevictor_3-1693895209991.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Secondly, t&lt;SPAN&gt;he MBDT for S32K3xx generates code based on RTD (Real Time Drivers) MCAL components.&amp;nbsp;&lt;/SPAN&gt; For more details about configuring a specific component, you could check the RTD documentation that is found inside the RTD folder in our toolbox root.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="georgevictor_1-1693894787393.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/239488iD0866DF7C725A2D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="georgevictor_1-1693894787393.png" alt="georgevictor_1-1693894787393.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Based on my suggestions and the information found in the RTD documentation, please update the configuration project and see if the issue has been solved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Victor&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 06:32:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32k3-Hard-Fault-when-using-LCU/m-p/1716860#M8482</guid>
      <dc:creator>georgevictor</dc:creator>
      <dc:date>2023-09-05T06:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: S32k3 Hard Fault when using LCU</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32k3-Hard-Fault-when-using-LCU/m-p/1722135#M8516</link>
      <description>&lt;P&gt;Hello Victor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Indeed, the hard fault was caused by the LCU clock not being enabled. Thank you for pointing it out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The last missing piece of the puzzle was using the Mcl_SetLcuSyncOutputEnable() function in Matlab to enable the correct outputs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, thank you for providing the location of the documentation for the MCAL drivers. I had already found some RTD user manual, but it's the first time I am seeing all of them in the same place, as well as Integration manuals. I'm certain they will prove pretty useful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alex Cloutier&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 14:06:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32k3-Hard-Fault-when-using-LCU/m-p/1722135#M8516</guid>
      <dc:creator>AlexCloutier</dc:creator>
      <dc:date>2023-09-13T14:06:40Z</dc:date>
    </item>
  </channel>
</rss>

