<?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)のトピックHSRUN 112MHz S32K144 : problem execution time</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/HSRUN-112MHz-S32K144-problem-execution-time/m-p/1243217#M5862</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I work on model-based design with code generation on MATLAB / SIMULINK thanks to NXP Toolbox. I try to execute a program for motor vector control.&lt;BR /&gt;In my test, i verify the execution time of all functions that run at differente rates (1kHz / 5kHz / 25kHz / 50kHz).&lt;BR /&gt;To be sure of my mesures, i execute all the program on &lt;STRONG&gt;1 function-call generator&lt;/STRONG&gt; with fixed-step at 1kHz and i suppress all sample time on each task (each task is call by a function-call).&lt;BR /&gt;All &lt;STRONG&gt;ISR interrupt are disabled&lt;/STRONG&gt; (PDB, ADC, etc...).&lt;/P&gt;&lt;P&gt;I obtain some results that are stranges...&lt;/P&gt;&lt;P&gt;&lt;U&gt;Procedure&lt;/U&gt; :&lt;BR /&gt;i write in the generated c-code (mymodel.c) the following code :&lt;/P&gt;&lt;P&gt;*************************************************&lt;/P&gt;&lt;P&gt;PINS_DRV_ClearPins(PTA, 1UL&amp;lt;&amp;lt;8);&lt;/P&gt;&lt;P&gt;for(int i=0; i&amp;lt;10; i++)&lt;BR /&gt;{&lt;BR /&gt;asm("nop");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;PINS_DRV_SetPins(PTA, 1UL&amp;lt;&amp;lt;8);&lt;/P&gt;&lt;P&gt;*************************************************&lt;/P&gt;&lt;P&gt;&lt;U&gt;The results are&lt;/U&gt; :&lt;/P&gt;&lt;P&gt;*************************************************&lt;/P&gt;&lt;P&gt;For Loop Iteration&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Execution time (us)&lt;BR /&gt;10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 0.54&lt;BR /&gt;100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13&lt;BR /&gt;1000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 45&lt;BR /&gt;10000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 367&lt;/P&gt;&lt;P&gt;*************************************************&lt;/P&gt;&lt;P&gt;&lt;U&gt;So, calculation give the following results&lt;/U&gt; :&lt;/P&gt;&lt;P&gt;* 1000 nop -&amp;gt; 10000 nop : 1 nop instruction + 1 for loop = (367-45)/9000 = 35.8ns&lt;BR /&gt;* 100 nop -&amp;gt; 1000 nop&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : (45-13)/900 = 35.6ns&lt;BR /&gt;* 10 nop&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0.54us because there is the time commutation of GPIO so the results are matching&lt;/P&gt;&lt;P&gt;I verify assembler by disassembly the generated code (arm-none-eabi-objdump) :&lt;/P&gt;&lt;P&gt;: nop&lt;BR /&gt;: subs r3, #1&lt;BR /&gt;: bne.n&lt;/P&gt;&lt;P&gt;That's a good assembler code !&lt;BR /&gt;If we try to estimate 1 cycle instruction time, we have 3/35.6ns = 84MHz and not 112MHz...&lt;/P&gt;&lt;P&gt;&lt;U&gt;So, i tried to modify the s32k_clock_init.c file&lt;/U&gt; :&lt;/P&gt;&lt;P&gt;By investigate on the NXP's forum community, i found that i need to modify the .hccrConfig settings by replacing the .src by SCG_SYSTEM_CLOCK_SRC_SYS_PLL by SCG_SYSTEM_CLOCK_SRC_FIRC.&lt;BR /&gt;But the execution time is worst...&lt;/P&gt;&lt;P&gt;&lt;U&gt;So, my question is&lt;/U&gt; : how to ensure by code generation (in my model) that the microcontroler system clock is set at 112MHz ?&lt;BR /&gt;Maybe a link with the Power Management Controller block ?&lt;/P&gt;&lt;P&gt;Thanks in advance for your answer, i hope you will have an explanation on this strange behavior &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;PS : i can't send you a model for confidential reason.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Mar 2021 11:02:10 GMT</pubDate>
    <dc:creator>JessyEFI</dc:creator>
    <dc:date>2021-03-10T11:02:10Z</dc:date>
    <item>
      <title>HSRUN 112MHz S32K144 : problem execution time</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/HSRUN-112MHz-S32K144-problem-execution-time/m-p/1243217#M5862</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I work on model-based design with code generation on MATLAB / SIMULINK thanks to NXP Toolbox. I try to execute a program for motor vector control.&lt;BR /&gt;In my test, i verify the execution time of all functions that run at differente rates (1kHz / 5kHz / 25kHz / 50kHz).&lt;BR /&gt;To be sure of my mesures, i execute all the program on &lt;STRONG&gt;1 function-call generator&lt;/STRONG&gt; with fixed-step at 1kHz and i suppress all sample time on each task (each task is call by a function-call).&lt;BR /&gt;All &lt;STRONG&gt;ISR interrupt are disabled&lt;/STRONG&gt; (PDB, ADC, etc...).&lt;/P&gt;&lt;P&gt;I obtain some results that are stranges...&lt;/P&gt;&lt;P&gt;&lt;U&gt;Procedure&lt;/U&gt; :&lt;BR /&gt;i write in the generated c-code (mymodel.c) the following code :&lt;/P&gt;&lt;P&gt;*************************************************&lt;/P&gt;&lt;P&gt;PINS_DRV_ClearPins(PTA, 1UL&amp;lt;&amp;lt;8);&lt;/P&gt;&lt;P&gt;for(int i=0; i&amp;lt;10; i++)&lt;BR /&gt;{&lt;BR /&gt;asm("nop");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;PINS_DRV_SetPins(PTA, 1UL&amp;lt;&amp;lt;8);&lt;/P&gt;&lt;P&gt;*************************************************&lt;/P&gt;&lt;P&gt;&lt;U&gt;The results are&lt;/U&gt; :&lt;/P&gt;&lt;P&gt;*************************************************&lt;/P&gt;&lt;P&gt;For Loop Iteration&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Execution time (us)&lt;BR /&gt;10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 0.54&lt;BR /&gt;100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13&lt;BR /&gt;1000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 45&lt;BR /&gt;10000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 367&lt;/P&gt;&lt;P&gt;*************************************************&lt;/P&gt;&lt;P&gt;&lt;U&gt;So, calculation give the following results&lt;/U&gt; :&lt;/P&gt;&lt;P&gt;* 1000 nop -&amp;gt; 10000 nop : 1 nop instruction + 1 for loop = (367-45)/9000 = 35.8ns&lt;BR /&gt;* 100 nop -&amp;gt; 1000 nop&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : (45-13)/900 = 35.6ns&lt;BR /&gt;* 10 nop&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0.54us because there is the time commutation of GPIO so the results are matching&lt;/P&gt;&lt;P&gt;I verify assembler by disassembly the generated code (arm-none-eabi-objdump) :&lt;/P&gt;&lt;P&gt;: nop&lt;BR /&gt;: subs r3, #1&lt;BR /&gt;: bne.n&lt;/P&gt;&lt;P&gt;That's a good assembler code !&lt;BR /&gt;If we try to estimate 1 cycle instruction time, we have 3/35.6ns = 84MHz and not 112MHz...&lt;/P&gt;&lt;P&gt;&lt;U&gt;So, i tried to modify the s32k_clock_init.c file&lt;/U&gt; :&lt;/P&gt;&lt;P&gt;By investigate on the NXP's forum community, i found that i need to modify the .hccrConfig settings by replacing the .src by SCG_SYSTEM_CLOCK_SRC_SYS_PLL by SCG_SYSTEM_CLOCK_SRC_FIRC.&lt;BR /&gt;But the execution time is worst...&lt;/P&gt;&lt;P&gt;&lt;U&gt;So, my question is&lt;/U&gt; : how to ensure by code generation (in my model) that the microcontroler system clock is set at 112MHz ?&lt;BR /&gt;Maybe a link with the Power Management Controller block ?&lt;/P&gt;&lt;P&gt;Thanks in advance for your answer, i hope you will have an explanation on this strange behavior &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;PS : i can't send you a model for confidential reason.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 11:02:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/HSRUN-112MHz-S32K144-problem-execution-time/m-p/1243217#M5862</guid>
      <dc:creator>JessyEFI</dc:creator>
      <dc:date>2021-03-10T11:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: HSRUN 112MHz S32K144 : problem execution time</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/HSRUN-112MHz-S32K144-problem-execution-time/m-p/1244109#M5863</link>
      <description>&lt;P&gt;Hi everyone, just to correct my explanation :&lt;/P&gt;&lt;P&gt;bne assembler take in reality 2 cycles so 4/35.6ns = 112MHz, it's a mistake, sorry, so the CPU has the good setting !&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 10:24:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/HSRUN-112MHz-S32K144-problem-execution-time/m-p/1244109#M5863</guid>
      <dc:creator>JessyEFI</dc:creator>
      <dc:date>2021-03-11T10:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: HSRUN 112MHz S32K144 : problem execution time</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/HSRUN-112MHz-S32K144-problem-execution-time/m-p/1509049#M7610</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/184332"&gt;@JessyEFI&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to ask you to explain more how to test the output clock in HSRUN mode because I have the same problem and the output frequency is not correct&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Aug 2022 07:51:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/HSRUN-112MHz-S32K144-problem-execution-time/m-p/1509049#M7610</guid>
      <dc:creator>RehabSoliman</dc:creator>
      <dc:date>2022-08-21T07:51:39Z</dc:date>
    </item>
  </channel>
</rss>

