<?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 Re: Help with LIN Sleep and Wakeup using MBDT on S32K311 in Model-Based Design Toolbox (MBDT)</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Help-with-LIN-Sleep-and-Wakeup-using-MBDT-on-S32K311/m-p/2187360#M10488</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/251278"&gt;@beginner100&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;From what I have gathered you have implemented a go to sleep functionality for your slave node which is triggered by the master node. After calling the GoToSleepInternal function, your LIN hardware should stop reacting to messages being sent on the bus as this is the intended behavior. So far, there seems to be no issue with the functionality of your application.&lt;/P&gt;
&lt;P&gt;Would you like help implementing a triggered wakeup functionality separately from the triggered sleep functionality that you have already implemented? If so, please let me know which are the details of the behavior you expect your application to have.&lt;/P&gt;
&lt;P&gt;As for the EcuM wakeup source - it is a separate wakeup mechanism that makes use of the EcuM driver. MBDT does not currently support implementing the associated callbacks with this driver from Simulink, which means you are required to implement them in C code. We recommend using the LinIf blocks for implementing the wakeup functionality as it can be done solely from Simulink, without requiring writing any code.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Oct 2025 08:57:55 GMT</pubDate>
    <dc:creator>rares_butilca</dc:creator>
    <dc:date>2025-10-16T08:57:55Z</dc:date>
    <item>
      <title>Help with LIN Sleep and Wakeup using MBDT on S32K311</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Help-with-LIN-Sleep-and-Wakeup-using-MBDT-on-S32K311/m-p/2186713#M10469</link>
      <description>&lt;P&gt;I'm currently using S32K311 with NXP MBDT on Simulink (R2024a), S32CT.&lt;/P&gt;&lt;P&gt;I have followed the examples of LIN provided on the MBDT, configured S32K311 as LIN Slave on LIN_Channel0 using S32CT. I need help implementing LIN Sleep and Wakeup functionality.&lt;/P&gt;&lt;P&gt;Here's what I have so far -&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a sample LDF and a sample test configuration on Vector CANoe. Created just 2 frames - command frame (Frame ID 0x00, PID 0x80) and Status frame (Frame ID 0x01, PID 0xC1). I am able to send Sleep request(0x3C 00 FF FF FF FF FF FF FF) using the same Config and observed that the Slave stops responding as soon as the Sleep request is sent. This is a snippet of LIN Trace.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="beginner100_1-1760536318548.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360922i836F23D201EBB08C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="beginner100_1-1760536318548.png" alt="beginner100_1-1760536318548.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now from the Simulink model perspective, here is the implementation I followed.&lt;/P&gt;&lt;P&gt;Following the example, within 'Initialize' subsystem, I have LIN_WakeupInternal added.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="beginner100_4-1760536649915.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360926iBC9D4E7D4532B79A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="beginner100_4-1760536649915.png" alt="beginner100_4-1760536649915.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Using LINIf_HeaderIndication, checking for Channel as LIN_Channel0 and PID as 0x3C for GoToSleep request as shown below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="beginner100_2-1760536367940.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360923iC5299D12DD29BB0C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="beginner100_2-1760536367940.png" alt="beginner100_2-1760536367940.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="beginner100_3-1760536417895.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360924iD40B1BE62C6E6E7B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="beginner100_3-1760536417895.png" alt="beginner100_3-1760536417895.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Inside, 0x3C Request subsystem&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="beginner100_0-1760536213660.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360921iDABC53696EA9E6BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="beginner100_0-1760536213660.png" alt="beginner100_0-1760536213660.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have also added 'Lin_CheckWakeup' function and I monitored the checkWakeupStatus data store block (iniitalized to 1) on FreeMaster which always returns 0.&lt;/P&gt;&lt;P&gt;I have also read the Documentation on Lin and LinIf supported functionalities which talks about 'EcuM_WakeupSourceType' Is it something to do with enabling this option on S32CT?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="beginner100_5-1760536929758.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360928i8C950249E2336E2F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="beginner100_5-1760536929758.png" alt="beginner100_5-1760536929758.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="beginner100_6-1760537248910.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360940i8C2DFC0A2B7AE28B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="beginner100_6-1760537248910.png" alt="beginner100_6-1760537248910.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="beginner100_7-1760537763628.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360948iC073156EE7CBBABE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="beginner100_7-1760537763628.png" alt="beginner100_7-1760537763628.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now, at this point, I don't know how to implement WakeUp functionality and resume the LIN Trace activity. I couldn't find any resources on this and I need help.&amp;nbsp; Please let me know how to proceed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2025 14:16:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Help-with-LIN-Sleep-and-Wakeup-using-MBDT-on-S32K311/m-p/2186713#M10469</guid>
      <dc:creator>beginner100</dc:creator>
      <dc:date>2025-10-15T14:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help with LIN Sleep and Wakeup using MBDT on S32K311</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Help-with-LIN-Sleep-and-Wakeup-using-MBDT-on-S32K311/m-p/2187360#M10488</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/251278"&gt;@beginner100&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;From what I have gathered you have implemented a go to sleep functionality for your slave node which is triggered by the master node. After calling the GoToSleepInternal function, your LIN hardware should stop reacting to messages being sent on the bus as this is the intended behavior. So far, there seems to be no issue with the functionality of your application.&lt;/P&gt;
&lt;P&gt;Would you like help implementing a triggered wakeup functionality separately from the triggered sleep functionality that you have already implemented? If so, please let me know which are the details of the behavior you expect your application to have.&lt;/P&gt;
&lt;P&gt;As for the EcuM wakeup source - it is a separate wakeup mechanism that makes use of the EcuM driver. MBDT does not currently support implementing the associated callbacks with this driver from Simulink, which means you are required to implement them in C code. We recommend using the LinIf blocks for implementing the wakeup functionality as it can be done solely from Simulink, without requiring writing any code.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 08:57:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Help-with-LIN-Sleep-and-Wakeup-using-MBDT-on-S32K311/m-p/2187360#M10488</guid>
      <dc:creator>rares_butilca</dc:creator>
      <dc:date>2025-10-16T08:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help with LIN Sleep and Wakeup using MBDT on S32K311</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Help-with-LIN-Sleep-and-Wakeup-using-MBDT-on-S32K311/m-p/2187760#M10492</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/200741"&gt;@rares_butilca&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;Yes, you got it right. Gotosleep is implemented. I need help implementing a triggered wakeup functionality as soon as a Wakeup request is sent from LIN Master (via Vector CANoe).&lt;/P&gt;&lt;P&gt;Coming to the expectation of the application that I'm working on, after a wakeup request is sent on LIN Master, all the data store parameters, internal counters, variables are to be initialized as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see there's 'Initialize' block in the LIN Example (attached snippet below), can this be used to reset all the data store parameters, variables, any counters to their initial values upon wakeup ? It is definitely performing an internal wakeup and also checking wakeup status.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="beginner100_1-1760645365578.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/361250iDB63F5E1C042E3FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="beginner100_1-1760645365578.png" alt="beginner100_1-1760645365578.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="beginner100_0-1760645247472.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/361249i7DA4CA9139E739E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="beginner100_0-1760645247472.png" alt="beginner100_0-1760645247472.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you can send me a sample model or steps which can cover both Sleep and Wakeup functionalities, that would be much appreciated. I just want to understand the right way of implementing these functionalities.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 20:10:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Help-with-LIN-Sleep-and-Wakeup-using-MBDT-on-S32K311/m-p/2187760#M10492</guid>
      <dc:creator>beginner100</dc:creator>
      <dc:date>2025-10-16T20:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help with LIN Sleep and Wakeup using MBDT on S32K311</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Help-with-LIN-Sleep-and-Wakeup-using-MBDT-on-S32K311/m-p/2188316#M10493</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;
&lt;P&gt;The initialize block is ran once at the beginning of the application before anything else in the model. That block should contain initialization logic for your application, such as turning on external peripherals, setting up internal peripherals, etc. In our example, it is used to wake up the LIN channel as to prepare it to receive messages on the bus right away.&lt;/P&gt;
&lt;P&gt;For understanding how to model a triggered wakeup, let's break it down into its components and first understand what each function is used for.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Figure 1" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/361391iA9B9D8DC28D9DDD2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rares_butilca_2-1760699963611.png" alt="Figure 1" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Figure 1&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;CheckWakeup is used to validate whether the Lin channel has been woken up either internally or by the bus it is connected to. This is the function you want to use to check whether a wakeup call has been detected on the bus by the LIN hardware.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Figure 2" style="width: 532px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/361392iA770A07D59A452D7/image-size/large?v=v2&amp;amp;px=999" role="button" title="rares_butilca_3-1760700128797.png" alt="Figure 2" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Figure 2&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;LinIf is composed of functions that are being called by various other drivers to notify various events. The WakeupConfirmation function is the one you are looking for since it is going to be called by CheckWakeup when a wakeup is successfully detected.&lt;/P&gt;
&lt;P&gt;The LinIf block allows you to attach a logic to these functions. The above image shows how to declare what the function is going to do by attaching a function call subsystem that implements the logic of WakeupConfirmation. Here you should be implementing the behavior of your application on a wakeup detection.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Figure 3" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/361394i82E3B8F7A70B0482/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rares_butilca_4-1760700668130.png" alt="Figure 3" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Figure 3&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;WakeUpInternal is used for waking up your channel without sending a wakeup signal on the bus - this is the function you want to use as a slave node. This function does the actual wakeup of the channel (makes the channel exit its sleeping state) and should be called by your application before expecting to receive any messages on the bus. The recommendation here is to use this function within WakeupConfirmation so as to wake up your channel right upon a wakeup trigger detection.&lt;/P&gt;
&lt;P&gt;So as to conclude, your application should look something like this:&lt;/P&gt;
&lt;P&gt;1) Use an initialize block only if you have something you want your application to do before anything else - at the beginning.&lt;/P&gt;
&lt;P&gt;2) Place the CheckWakeup function(Figure 1) in your model where you want the wakeup detection to be checked.&lt;/P&gt;
&lt;P&gt;3) Place a LinIf block with the function set to WakeupConfirmation along with a function call subsystem in your top model or a non-triggered subsystem so as to declare the behavior of the said function. (Here you can also reset the data stores that you mentioned, initialize the counter, etc.)&lt;/P&gt;
&lt;P&gt;4) Do not forget about doing the actual wakeup of the channel. Use the function WakeupInternal (Figure 3) inside the function call subsystem mentioned at the previous step.&lt;/P&gt;
&lt;P&gt;NOTE: For being able to use the WakeupConfirmation successfully, you should have the settings&amp;nbsp;&lt;EM&gt;Lin Channel Wake UP Support&amp;nbsp;&lt;/EM&gt;enabled in the configuration of your LIN channel.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rares_butilca_0-1760703079782.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/361425i85281AA144EF4469/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rares_butilca_0-1760703079782.png" alt="rares_butilca_0-1760703079782.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Oct 2025 12:12:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Help-with-LIN-Sleep-and-Wakeup-using-MBDT-on-S32K311/m-p/2188316#M10493</guid>
      <dc:creator>rares_butilca</dc:creator>
      <dc:date>2025-10-17T12:12:18Z</dc:date>
    </item>
  </channel>
</rss>

