<?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: S32K148 - Running 3 task at different frequency using FreeRTOS in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K148-Running-3-task-at-different-frequency-using-FreeRTOS/m-p/1586301#M20162</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/210211"&gt;@Chandra13&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can change the optimization level in the project's properties. Please refer to the attached image.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VaneB_0-1674254568706.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/208085i070A0C41E702125F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VaneB_0-1674254568706.png" alt="VaneB_0-1674254568706.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regarding the printf issue take a look this post:&amp;nbsp;&lt;A href="https://community.nxp.com/t5/S32-Design-Studio/I-don-t-understand-how-to-use-the-function-printf-in-S32-Design/m-p/1092210" target="_blank" rel="noopener"&gt;Function printf in S32 Design Studio&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jan 2023 22:55:03 GMT</pubDate>
    <dc:creator>VaneB</dc:creator>
    <dc:date>2023-01-20T22:55:03Z</dc:date>
    <item>
      <title>S32K148 - Running 3 task at different frequency using FreeRTOS</title>
      <link>https://community.nxp.com/t5/S32K/S32K148-Running-3-task-at-different-frequency-using-FreeRTOS/m-p/1585598#M20136</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a S32K148EVB-Q176, and I modified the freertos_s32k148 SDK to run a small project. I would&amp;nbsp;like to run 3 tasks at different frequencies.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Task 1 at 500ms&lt;/LI&gt;&lt;LI&gt;Task 2 at 1000ms&lt;/LI&gt;&lt;LI&gt;Task 3 at 2000ms&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;With the sample code below, whenever the scheduler starts, it executes only the task with higher priority and that too only once. In this case, the output on the PE console is always, "Task 3 counter : 1".&lt;/P&gt;&lt;P&gt;What am&amp;nbsp;I missing here?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include "sdk_project_config.h"
#include &amp;lt;stdio.h&amp;gt;

//void rtos_start(void);
void task1_500ms(void *parameters);
void task2_1000ms(void *parameters);
void task3_2000ms(void *parameters);
int count1 = 0;
int count2 = 0;
int count3 = 0;
int main(void)
{
   //rtos_start();
   printf("Hello World\n\n");

   xTaskCreate(task1_500ms,  "Task1", configMINIMAL_STACK_SIZE, NULL, 1, NULL);
   xTaskCreate(task2_1000ms, "Task2", configMINIMAL_STACK_SIZE, NULL, 2, NULL);
   xTaskCreate(task3_2000ms, "Task3", configMINIMAL_STACK_SIZE, NULL, 3, NULL);

   vTaskStartScheduler();
}
void task1_500ms(void *parameters)
{
   while(1)
   {
      printf("Task 1 counter : %d\n", ++count1);
      vTaskDelay(500/portTICK_PERIOD_MS);
   }
}
void task2_1000ms(void *parameters)
{
   while(1)
   {
      printf("Task 2 counter : %d\n", ++count2);
      vTaskDelay(1000/portTICK_PERIOD_MS);
   }
}
void task3_2000ms(void *parameters)
{
   while(1)
   {
      printf("Task 3 counter : %d\n", ++count3);
      vTaskDelay(2000/portTICK_PERIOD_MS);
   }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 16:20:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K148-Running-3-task-at-different-frequency-using-FreeRTOS/m-p/1585598#M20136</guid>
      <dc:creator>Chandra13</dc:creator>
      <dc:date>2023-01-19T16:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: S32K148 - Running 3 task at different frequency using FreeRTOS</title>
      <link>https://community.nxp.com/t5/S32K/S32K148-Running-3-task-at-different-frequency-using-FreeRTOS/m-p/1585751#M20143</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/210211"&gt;@Chandra13&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Everything looks correct in your code. The only thing missing from the &lt;STRONG&gt;main&lt;/STRONG&gt; function is the infinite loop after calling &lt;STRONG&gt;vTaskStartScheduler()&lt;/STRONG&gt;, which is why the task with the highest priority is executed once, and after that, the program ends. Try to add &lt;STRONG&gt;for( ;; )&lt;/STRONG&gt; after starting the scheduler; if all is well, the scheduler will be running.&lt;/P&gt;
&lt;P&gt;Also, for &lt;STRONG&gt;vTaskDelay&lt;/STRONG&gt;, I suggest you use &lt;STRONG&gt;pdMS_TO_TICKS(xTimeInMs)&lt;/STRONG&gt; as the received parameter, this macro converts a time in milliseconds to a time in ticks.&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;vTaskDelay(pdMS_TO_TICKS(500));&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;B.R.&lt;/P&gt;
&lt;P&gt;VaneB&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 22:21:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K148-Running-3-task-at-different-frequency-using-FreeRTOS/m-p/1585751#M20143</guid>
      <dc:creator>VaneB</dc:creator>
      <dc:date>2023-01-19T22:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: S32K148 - Running 3 task at different frequency using FreeRTOS</title>
      <link>https://community.nxp.com/t5/S32K/S32K148-Running-3-task-at-different-frequency-using-FreeRTOS/m-p/1586127#M20156</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201913"&gt;@VaneB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for the feedback.&lt;BR /&gt;Even with your suggestion, the program still didn't respond after one execution. But after I removed the "printf" statements, the program is working fine.&lt;BR /&gt;Do you know why the printf statement is stalling the program?&lt;/P&gt;&lt;P&gt;Also, is there any option in the Design Studio to turn off the compiler optimizations?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 16:15:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K148-Running-3-task-at-different-frequency-using-FreeRTOS/m-p/1586127#M20156</guid>
      <dc:creator>Chandra13</dc:creator>
      <dc:date>2023-01-20T16:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: S32K148 - Running 3 task at different frequency using FreeRTOS</title>
      <link>https://community.nxp.com/t5/S32K/S32K148-Running-3-task-at-different-frequency-using-FreeRTOS/m-p/1586301#M20162</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/210211"&gt;@Chandra13&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can change the optimization level in the project's properties. Please refer to the attached image.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VaneB_0-1674254568706.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/208085i070A0C41E702125F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VaneB_0-1674254568706.png" alt="VaneB_0-1674254568706.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regarding the printf issue take a look this post:&amp;nbsp;&lt;A href="https://community.nxp.com/t5/S32-Design-Studio/I-don-t-understand-how-to-use-the-function-printf-in-S32-Design/m-p/1092210" target="_blank" rel="noopener"&gt;Function printf in S32 Design Studio&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 22:55:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K148-Running-3-task-at-different-frequency-using-FreeRTOS/m-p/1586301#M20162</guid>
      <dc:creator>VaneB</dc:creator>
      <dc:date>2023-01-20T22:55:03Z</dc:date>
    </item>
  </channel>
</rss>

