<?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>S12 / MagniV Microcontrollers中的主题 Re: problem with sleep mode</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506864#M12380</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear sir ,&lt;/P&gt;&lt;P&gt;Thanks for your reply /support .&lt;/P&gt;&lt;P&gt;Sir  I have  try as per your feedback but it is still  reset the controller .&lt;/P&gt;&lt;P&gt;1.I have disable the API and watchdog but  we get still problem some time it will reset the controller or does not wake up with LIN .if u have any application note/ reference code  for LIN slave  wake up and sleep please provide us . &lt;/P&gt;&lt;P&gt;Because in  my project we have to used watchdog ,API ,SLEEP mode /stop mode.&lt;/P&gt;&lt;P&gt;2. second in assign frame ID range  in this when we are doing request  it is giving response as per LIN spec 2.1  but I have confusion when  I have request with change &lt;/P&gt;&lt;P&gt;PID it does not giving  any response .&lt;/P&gt;&lt;P&gt;Request -3C 06 06 b7 00 24 1f ff ff&lt;/P&gt;&lt;P&gt;Response- 3d 06 01 F7 ff ff ff ff ff –ok  now new PID is 24 ,when  we request with PID 24 it has to give response – I am right &lt;/P&gt;&lt;P&gt;Now request with PID=24 – no response &lt;/P&gt;&lt;P&gt;*is there any application to write in main or it will change the PID automatically by LIN stack.&lt;/P&gt;&lt;P&gt;Please suggest me how to test  this LIN frame id range after positive response .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 Apr 2016 06:27:10 GMT</pubDate>
    <dc:creator>deepakchandra</dc:creator>
    <dc:date>2016-04-02T06:27:10Z</dc:date>
    <item>
      <title>problem with sleep mode</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506862#M12378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear sir ,&lt;/P&gt;&lt;P&gt;We are working with s12zvl32 controller ,in this we are required sleep mode (power saving mode or stop command )from LIN frame and wake up from LIN as well as &lt;/P&gt;&lt;P&gt;With API (periodical interrupt ). As I have attached code in this mail. In this code I have implemented API, watchdog and stop mode .&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; When my code first time run if there is no LIN command it goes to sleep .after that it will wake up from LIN – working fine &lt;/P&gt;&lt;P&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; It is working fine with API alone .it will wake up and goes to sleep ok&amp;nbsp; .&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt; &amp;nbsp;&lt;/P&gt;&lt;P&gt;PROBLEM: &lt;/P&gt;&lt;P&gt;1.Now when I have send the wake up command from LIN it will wake up and next time before going to sleep it goes reset the controller&amp;nbsp;&amp;nbsp; and then goes to sleep .&lt;/P&gt;&lt;P&gt;2.After removing watch dog it does not goes to sleep mode after wake up&amp;nbsp; and reset the controller sometime .&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt; &amp;nbsp;&lt;/P&gt;&lt;P&gt;I don’t know why it is going to reset ,please suggest me is there any problem with stack ,clock,vector table&amp;nbsp; ,or any other register setting .&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-339061"&gt;GPA_new1.rar&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2016 12:28:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506862#M12378</guid>
      <dc:creator>deepakchandra</dc:creator>
      <dc:date>2016-03-25T12:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sleep mode</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506863#M12379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi deepak,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suppose that your command CPMUCOP=0; should disable watchdog. Right?&lt;/P&gt;&lt;P&gt;Unfortunately, this is possible only in special single chip mode. The CPMUCOP register could be written just once in normal mode.&lt;/P&gt;&lt;P&gt;Also modifying CSAD, COPOSCSEL0 and COPOSCSEL1 bits in CPMUCLKS register is possible in normal mode only until we write into the CPMUCOP register.&lt;/P&gt;&lt;P&gt;So, watchdog should be initialized just once in code. Disabling COP doesn’t have sense. If you do not want periodically wake-up just for trigger watchdog, please configure watchdog clock source to some clock which will be disabled during stop mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The command “setReg8(CPMURFLG, 0x00U);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Clear COP reset flag */” will not clear COP reset flag.&lt;/P&gt;&lt;P&gt;There should be: setReg8(CPMURFLG, 0x08U);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Clear COP reset flag */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to recommend disabling edge interrupt inside SCI interrupt routine instead in main().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note (slightly out of this topic): Be aware, when you combine API and LIN wake-up. When the voltage level on LIN pin is currently low and MCU wakeups by API, LIN PHY will wakeups also and it transfer LIN pin status to SCI module. Therefore, SCI edge interrupt will be triggered also, despite on fact that LIN wake-up signal was not sent yet or duration of LIN wake-up signal is shorter than tWUFR. See chapter 17.4.3.4 Standby Mode with Wake-Up Feature in RM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2016 13:08:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506863#M12379</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2016-03-29T13:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sleep mode</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506864#M12380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear sir ,&lt;/P&gt;&lt;P&gt;Thanks for your reply /support .&lt;/P&gt;&lt;P&gt;Sir  I have  try as per your feedback but it is still  reset the controller .&lt;/P&gt;&lt;P&gt;1.I have disable the API and watchdog but  we get still problem some time it will reset the controller or does not wake up with LIN .if u have any application note/ reference code  for LIN slave  wake up and sleep please provide us . &lt;/P&gt;&lt;P&gt;Because in  my project we have to used watchdog ,API ,SLEEP mode /stop mode.&lt;/P&gt;&lt;P&gt;2. second in assign frame ID range  in this when we are doing request  it is giving response as per LIN spec 2.1  but I have confusion when  I have request with change &lt;/P&gt;&lt;P&gt;PID it does not giving  any response .&lt;/P&gt;&lt;P&gt;Request -3C 06 06 b7 00 24 1f ff ff&lt;/P&gt;&lt;P&gt;Response- 3d 06 01 F7 ff ff ff ff ff –ok  now new PID is 24 ,when  we request with PID 24 it has to give response – I am right &lt;/P&gt;&lt;P&gt;Now request with PID=24 – no response &lt;/P&gt;&lt;P&gt;*is there any application to write in main or it will change the PID automatically by LIN stack.&lt;/P&gt;&lt;P&gt;Please suggest me how to test  this LIN frame id range after positive response .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Apr 2016 06:27:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506864#M12380</guid>
      <dc:creator>deepakchandra</dc:creator>
      <dc:date>2016-04-02T06:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sleep mode</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506865#M12381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Deepak,&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;That is strange. If I understood correctly, MCU sometime reset or MCU does not wake up with LIN when API and watchdog are disabled and you just use LIN stack and power save mode. Correct?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you implement handlers for all interrupts? There might be any unexpected interrupt which causes such strange behavior.&lt;/P&gt;&lt;P&gt;Please look at my example code here:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-330312"&gt;https://community.freescale.com/docs/DOC-330312&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After wake-up even you should clear RXEDGIF flag (directly inside ISR), use command lin_lld_tx_wake_up(); (typically in application code) for wakeup and disable edge interrupt (typically directly inside ISR) by clearing RXEDGIE bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;I am not sure, if I understood what you want to do. You want change diagnostic class PIDs (0x3C, 0x3D) to 0x24? Unfortunately, this is not possible according LIN specification.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2016 10:14:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506865#M12381</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2016-04-04T10:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sleep mode</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506866#M12382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear  sir,&lt;/P&gt;&lt;P&gt;I will check for sleep mode and get back to u.&lt;/P&gt;&lt;P&gt;About my second question , iam not  changing the PID 0x3d or 3c ,I want to Assign PID for frame which I have defined in my LDF &lt;/P&gt;&lt;P&gt; for example .&lt;/P&gt;&lt;P&gt;In  my LDF I have defined the frame(actuator1) =0x21, master frame 0x1f,(actuator2)=0x22,&lt;/P&gt;&lt;P&gt;Now  I have to use Assign frame ID range LIN command to change PID 0x21 to 0x24 (or other PID)&lt;/P&gt;&lt;P&gt;I have send the command  as per LIN spec 2.1 ,and I get the positive response form LIN signal.&lt;/P&gt;&lt;P&gt;Now after that my doubt arise, when I have send the request for actuator1 with new PID 24 (previously 21) I cannot get response from PID 24 – is this correct way to check  &lt;/P&gt;&lt;P&gt;Or I have to write any code in my  main program to save this PID .&lt;/P&gt;&lt;P&gt;I don’t know what is the correct way to check this please suggest .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2016 03:48:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506866#M12382</guid>
      <dc:creator>deepakchandra</dc:creator>
      <dc:date>2016-04-05T03:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sleep mode</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506867#M12383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for clarification.&lt;/P&gt;&lt;P&gt;I went trough the LIN stack code and I see that assign frame id range should be implemented directly by code in CALLBACK_HANDLER inside SCI ISR routine.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;lin_lld_sci_rx_isr () - CALLBACK_HANDLER - lin_pid_response_callback_handler() - lin_update_rx() - lin_update_rx_diag_frame () - lin_tl_handler()-lin_process_pdu() - lin_tl_attach_service() - lin_diagservice_assign_frame_id_range()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try already provided example code?&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/thread/386007#comment-618725" rel="nofollow noopener noreferrer" target="_blank"&gt;https://community.freescale.com/thread/386007#comment-618725&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It works on your side, or not?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In example code I see periodical execution of this code:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14598460806891902 jive_text_macro" data-renderedposition="268_8_1192_176" jivemacro_uid="_14598460806891902"&gt;&lt;P&gt;if(diag_get_flag(DIAGSRV_READ_DATA_BY_IDENTIFIER_ORDER)){&lt;/P&gt;&lt;P&gt;&amp;nbsp; l_u16 req_len = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; l_u8 req_data[10];&lt;/P&gt;&lt;P&gt;diag_clear_flag(DIAGSRV_READ_DATA_BY_IDENTIFIER_ORDER);&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Process data */&lt;/P&gt;&lt;P&gt;ld_receive_message(&amp;amp;req_len, req_data);&lt;/P&gt;&lt;P&gt;&amp;nbsp; req_data[0] += 0x40;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Send response */&lt;/P&gt;&lt;P&gt;&amp;nbsp; ld_send_message(10, req_data);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;It is similar to slave_task() code in other Diagnostic demo codes, but more simplified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2016 08:48:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506867#M12383</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2016-04-05T08:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sleep mode</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506868#M12384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear sir , &lt;/P&gt;&lt;P&gt;In Assign frame Id range "lin_cfg.c"     it is defined as  l_u8 lin_configuration_RAM[LIN_SIZE_OF_CFG]= {0x00, 0x22, 0x1F, 0x3C, 0x3D ,0xFF};ok&lt;/P&gt;&lt;P&gt;now we want to assign frame id range I have to send the command 3c 06 06 b7 00 28 1f ff ff  to change the PID 22 to 28  (is it ok).&lt;/P&gt;&lt;P&gt;After sending command we get positive response as below .getting positive response mean that it has change the PID 22 to 28 .&lt;/P&gt;&lt;P&gt;Now I have to send the command 28 instead of 22 to get response ,but on requesting with 28 we cannot get any response .&lt;/P&gt;&lt;P&gt;As per privious mail I think this code is already implemented in LIN stack function as below&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;void lin_diagservice_assign_frame_id_range()&lt;/P&gt;&lt;P&gt;in my main function I have only read the flag &lt;/P&gt;&lt;P&gt;       if(diag_get_flag(DIAGSRV_ASSIGN_FRAME_ID_RANGE_ORDER))&lt;/P&gt;&lt;P&gt;         diag_clear_flag(DIAGSRV_ASSIGN_FRAME_ID_RANGE_ORDER);&lt;/P&gt;&lt;P&gt;                                                              &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this correct way of testing the assign frame id range is iam right.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 06:21:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/problem-with-sleep-mode/m-p/506868#M12384</guid>
      <dc:creator>deepakchandra</dc:creator>
      <dc:date>2016-04-06T06:21:20Z</dc:date>
    </item>
  </channel>
</rss>

