<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hi, <br></div><div><br></div><div>i'm trying to create a periodic task but the statut of "rtems_rate_monotonic_create" return 5.</div><div>The code is:<br></div><div><br></div><div>#include <rtems.h><br>#include <stdio.h><br>#include <stdlib.h><br>#include <bsp.h><br><br>#include "../../testmacros.h"<br><br>rtems_id Task_id[ 3]; /* array of task ids */<br>rtems_name Task_name[ 3 ]; /* array of task names */<br>rtems_task_priority Priorites[ 3 ] = {1 ,15 ,5};<br>int j;<br>char Char_Name;<br><br>rtems_task Test_task(<br>rtems_task_argument task_index<br>)<br><br>{<br>rtems_id period;<br>rtems_status_code status;<br>rtems_id tid;<br><br> status =
rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );<br><br>status = rtems_rate_monotonic_create (Task_name[ task_index ], & period);<br>if (status != 0)<br>{<br>printf("creation fail with %d \n", status);<br>exit(1);<br>}<br>while (1){<br>if ( rtems_rate_monotonic_period (period, 5) == RTEMS_TIMEOUT)<br>break;<br>printf (" je suis la tache %s \n", Task_name [task_index]);<br>}<br>status = rtems_rate_monotonic_delete (period);<br>if (status != 0)<br>{<br>printf("destruction fail with %d \n", status);<br>exit(1);<br>}<br><br>status = rtems_task_delete (tid);<br>printf("destruction fail with %d \n", status);<br>exit(1);<br><br>}<br>/**************************************************************************/<br>rtems_task Init(<br> rtems_task_argument argument<br>)<br>{<br> rtems_status_code status;<br> rtems_time_of_day time;<br> rtems_task_priority the_priority;<br><br> time.year =
1988;<br> time.month = 12;<br> time.day = 31;<br> time.hour = 9;<br> time.minute = 0;<br> time.second = 0;<br> time.ticks = 0;<br><br>status = rtems_clock_set( &time );<br>status = rtems_task_set_priority (RTEMS_SELF, 1, &the_priority);<br>status = rtems_task_set_priority (RTEMS_SELF, RTEMS_CURRENT_PRIORITY, &the_priority);<br>for (j = 0; j < 2; j++) {<br>Char_Name = '1'+j;<br>Task_name [j+1] = rtems_build_name( 'T', 'A', Char_Name, ' ');<br>put_name (Task_name [j+1] , FALSE);<br>status = rtems_task_create(<br> Task_name[ j+1 ], Priorites [j+1], RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,<br> RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ j+1]);<br>}<br>for (j = 0; j < 2; j++) {<br> status = rtems_task_start( Task_id[ j+1 ], Test_task , j+1 );<br>}<br> status = rtems_task_delete( RTEMS_SELF
);<br>}<br><br>/**************** START OF CONFIGURATION INFORMATION ****************/<br><br>#define CONFIGURE_INIT<br><br>#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER<br>#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER<br><br>#define CONFIGURE_MAXIMUM_TASKS 3<br><br>#define CONFIGURE_RTEMS_INIT_TASKS_TABLE<br>#define CONFIGURE_INIT_TASK_STACK_SIZE (2 * RTEMS_MINIMUM_STACK_SIZE)<br><br>#define CONFIGURE_EXTRA_TASK_STACKS (4 * RTEMS_MINIMUM_STACK_SIZE)<br><br>#include <rtems/confdefs.h><br><br>/**************** END OF CONFIGURATION INFORMATION ****************/</div></div></body></html>