# HG changeset patch # User Alexis Jeandet # Date 2017-07-05 18:07:52 # Node ID fc82b08705ba9931880e4e57a76b1bb1ffa1e28e # Parent 88d90c878c97d96c81adf5afa487e2404da77988 Added scrubbing Task, to increase scrubbing frequency and avoid entering idle task. diff --git a/.hgsub b/.hgsub --- a/.hgsub +++ b/.hgsub @@ -1,4 +1,4 @@ -header/lfr_common_headers = https://hephaistos.lpp.polytechnique.fr/rhodecode/HG_REPOSITORIES/LPP/INSTRUMENTATION/SOLO_LFR/lfr_common_headers +header/lfr_common_headers = https://hephaistos.lpp.polytechnique.fr/rhodecode/HG_REPOSITORIES/LPP/INSTRUMENTATION/USERS/JEANDET/lfr_common_headers LFR_basic-parameters = https://hephaistos.lpp.polytechnique.fr/rhodecode/HG_REPOSITORIES/LPP/INSTRUMENTATION/USERS/CHUST/LFR_basic-parameters diff --git a/.hgsubstate b/.hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,2 +1,2 @@ 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters -e904b329ff977514bf36af92617afefd22fd06ab header/lfr_common_headers +db74b38fe91cd826fa49fa4eb6f93d626637ceb9 header/lfr_common_headers diff --git a/header/fsw_misc.h b/header/fsw_misc.h --- a/header/fsw_misc.h +++ b/header/fsw_misc.h @@ -136,6 +136,7 @@ rtems_task load_task( rtems_task_argumen rtems_task hous_task( rtems_task_argument argument ); rtems_task avgv_task( rtems_task_argument argument ); rtems_task dumb_task( rtems_task_argument unused ); +rtems_task scrubbing_task( rtems_task_argument unused ); void init_housekeeping_parameters( void ); void increment_seq_counter(unsigned short *packetSequenceControl); diff --git a/src/fsw_init.c b/src/fsw_init.c --- a/src/fsw_init.c +++ b/src/fsw_init.c @@ -15,6 +15,7 @@ #include + /* configuration information */ #define CONFIGURE_INIT @@ -26,7 +27,7 @@ #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 21 // number of tasks concurrently active including INIT +#define CONFIGURE_MAXIMUM_TASKS 22 // number of tasks concurrently active including INIT #define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32 @@ -376,6 +377,7 @@ void create_names( void ) // create all Task_name[TASKID_PRC1] = rtems_build_name( 'P', 'R', 'C', '1' ); Task_name[TASKID_AVF2] = rtems_build_name( 'A', 'V', 'F', '2' ); Task_name[TASKID_PRC2] = rtems_build_name( 'P', 'R', 'C', '2' ); + Task_name[TASKID_SCRB] = rtems_build_name( 'S', 'C', 'R', 'B' ); // rate monotonic period names name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' ); @@ -561,6 +563,14 @@ int create_all_tasks( void ) // create a RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_DUMB] ); } + if (status == RTEMS_SUCCESSFUL) // SCRUBBING TASK + { + status = rtems_task_create( + Task_name[TASKID_SCRB], TASK_PRIORITY_SCRB, RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SCRB] + ); + } if (status == RTEMS_SUCCESSFUL) // HOUS { status = rtems_task_create( @@ -746,6 +756,13 @@ int start_all_tasks( void ) // start all BOOT_PRINTF("in INIT *** Error starting TASK_DUMB\n") } } + if (status == RTEMS_SUCCESSFUL) // SCRUBBING + { + status = rtems_task_start( Task_id[TASKID_SCRB], scrubbing_task, 1 ); + if (status!=RTEMS_SUCCESSFUL) { + BOOT_PRINTF("in INIT *** Error starting TASK_DUMB\n") + } + } if (status == RTEMS_SUCCESSFUL) // LOAD { status = rtems_task_start( Task_id[TASKID_LOAD], load_task, 1 ); diff --git a/src/fsw_misc.c b/src/fsw_misc.c --- a/src/fsw_misc.c +++ b/src/fsw_misc.c @@ -521,6 +521,26 @@ rtems_task dumb_task( rtems_task_argumen } } +rtems_task scrubbing_task( rtems_task_argument unused ) +{ + /** This RTEMS taks is to avoid entering IDLE task and also scrub memory to increase scubbing frequency. + * + * @param unused is the starting argument of the RTEMS task + * + * The scrubbing reads continuously memory when no other tasks are ready. + * + */ + + BOOT_PRINTF("in SCRUBBING *** \n"); + volatile int i=0; + volatile uint32_t* RAM=(uint32_t*)0x40000000; + volatile uint32_t value; + while(1){ + i=(i+1)%(1024*1024); + value += RAM[i]; + } +} + //***************************** // init housekeeping parameters