##// END OF EJS Templates
AVGV task added...
paul -
r298:ff57d1825f54 R3_plus draft
parent child
Show More
@@ -0,0 +1,31
1 import time
2
3 proxy.loadSysDriver("SpwPlugin","SpwPlugin0")
4 SpwPlugin0.selectBridge("STAR-Dundee Spw USB Brick")
5
6 proxy.loadSysDriverToParent("dsu3plugin","SpwPlugin0")
7 proxy.loadSysDriverToParent("LFRControlPlugin","SpwPlugin0")
8
9 availableBrickCount = SpwPlugin0.StarDundeeGetAvailableBrickCount()
10 print str(availableBrickCount) + " SpaceWire brick(s) found"
11
12 SpwPlugin0.StarDundeeSelectBrick(1)
13 SpwPlugin0.StarDundeeSetBrickAsARouter(1)
14 SpwPlugin0.StarDundeeSelectLinkNumber( 1 )
15 SpwPlugin0.connectBridge()
16
17 #SpwPlugin0.TCPServerSetIP("127.0.0.1")
18 SpwPlugin0.TCPServerConnect()
19
20 # OPEN SPACEWIRE SERVER
21 #LFRControlPlugin0.SetSpwServerIP(129,104,27,164)
22 LFRControlPlugin0.TCPServerConnect()
23
24 # OPEN TM ECHO BRIDGE SERVER
25 LFRControlPlugin0.TMEchoBridgeOpenPort()
26
27 # START SENDING TIMECODES AT 1 Hz
28 SpwPlugin0.StarDundeeStartTimecodes( 1 )
29
30 # it is possible to change the time code frequency
31 #RMAPPlugin0.changeTimecodeFrequency(2)
@@ -0,0 +1,14
1 # LOAD FSW USING LINK 1
2 SpwPlugin0.StarDundeeSelectLinkNumber( 1 )
3
4 dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw")
5 #dsu3plugin0.openFile("/opt/LFR/LFR-FSW/2.0.2.3/fsw")
6 dsu3plugin0.loadFile()
7
8 dsu3plugin0.run()
9
10 # START SENDING TIMECODES AT 1 Hz
11 #SpwPlugin0.StarDundeeStartTimecodes( 1 )
12
13 # it is possible to change the time code frequency
14 #RMAPPlugin0.changeTimecodeFrequency(2)
@@ -0,0 +1,13
1 # LOAD FSW USING LINK 1
2 SpwPlugin0.StarDundeeSelectLinkNumber( 1 )
3
4 dsu3plugin0.openFile("/opt/LFR/LFR-FSW/3.0.0.10/fsw")
5 dsu3plugin0.loadFile()
6
7 dsu3plugin0.run()
8
9 # START SENDING TIMECODES AT 1 Hz
10 SpwPlugin0.StarDundeeStartTimecodes( 1 )
11
12 # it is possible to change the time code frequency
13 #RMAPPlugin0.changeTimecodeFrequency(2)
@@ -1,2 +1,2
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
2 1ffa3d630b9ced4a87a362dafb10d9838e9cc0d9 header/lfr_common_headers
2 94f0f2fccbcb8030d9437ffbb69ee0eefaaea188 header/lfr_common_headers
@@ -1,64 +1,64
1 #ifndef FSW_INIT_H_INCLUDED
1 #ifndef FSW_INIT_H_INCLUDED
2 #define FSW_INIT_H_INCLUDED
2 #define FSW_INIT_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <leon.h>
5 #include <leon.h>
6
6
7 #include "fsw_params.h"
7 #include "fsw_params.h"
8 #include "fsw_misc.h"
8 #include "fsw_misc.h"
9 #include "fsw_processing.h"
9 #include "fsw_processing.h"
10
10
11 #include "tc_handler.h"
11 #include "tc_handler.h"
12 #include "wf_handler.h"
12 #include "wf_handler.h"
13 #include "fsw_spacewire.h"
13 #include "fsw_spacewire.h"
14
14
15 #include "avf0_prc0.h"
15 #include "avf0_prc0.h"
16 #include "avf1_prc1.h"
16 #include "avf1_prc1.h"
17 #include "avf2_prc2.h"
17 #include "avf2_prc2.h"
18
18
19 extern rtems_name Task_name[20]; /* array of task names */
19 extern rtems_name Task_name[]; /* array of task names */
20 extern rtems_id Task_id[20]; /* array of task ids */
20 extern rtems_id Task_id[]; /* array of task ids */
21 extern rtems_name timecode_timer_name;
21 extern rtems_name timecode_timer_name;
22 extern rtems_id timecode_timer_id;
22 extern rtems_id timecode_timer_id;
23 extern unsigned char pa_bia_status_info;
23 extern unsigned char pa_bia_status_info;
24 extern unsigned char cp_rpw_sc_rw_f_flags;
24 extern unsigned char cp_rpw_sc_rw_f_flags;
25 extern float cp_rpw_sc_rw1_f1;
25 extern float cp_rpw_sc_rw1_f1;
26 extern float cp_rpw_sc_rw1_f2;
26 extern float cp_rpw_sc_rw1_f2;
27 extern float cp_rpw_sc_rw2_f1;
27 extern float cp_rpw_sc_rw2_f1;
28 extern float cp_rpw_sc_rw2_f2;
28 extern float cp_rpw_sc_rw2_f2;
29 extern float cp_rpw_sc_rw3_f1;
29 extern float cp_rpw_sc_rw3_f1;
30 extern float cp_rpw_sc_rw3_f2;
30 extern float cp_rpw_sc_rw3_f2;
31 extern float cp_rpw_sc_rw4_f1;
31 extern float cp_rpw_sc_rw4_f1;
32 extern float cp_rpw_sc_rw4_f2;
32 extern float cp_rpw_sc_rw4_f2;
33 extern filterPar_t filterPar;
33 extern filterPar_t filterPar;
34
34
35 // RTEMS TASKS
35 // RTEMS TASKS
36 rtems_task Init( rtems_task_argument argument);
36 rtems_task Init( rtems_task_argument argument);
37
37
38 // OTHER functions
38 // OTHER functions
39 void create_names( void );
39 void create_names( void );
40 int create_all_tasks( void );
40 int create_all_tasks( void );
41 int start_all_tasks( void );
41 int start_all_tasks( void );
42 //
42 //
43 rtems_status_code create_message_queues( void );
43 rtems_status_code create_message_queues( void );
44 rtems_status_code create_timecode_timer( void );
44 rtems_status_code create_timecode_timer( void );
45 rtems_status_code get_message_queue_id_send( rtems_id *queue_id );
45 rtems_status_code get_message_queue_id_send( rtems_id *queue_id );
46 rtems_status_code get_message_queue_id_recv( rtems_id *queue_id );
46 rtems_status_code get_message_queue_id_recv( rtems_id *queue_id );
47 rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id );
47 rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id );
48 rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id );
48 rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id );
49 rtems_status_code get_message_queue_id_prc2( rtems_id *queue_id );
49 rtems_status_code get_message_queue_id_prc2( rtems_id *queue_id );
50 void update_queue_max_count( rtems_id queue_id, unsigned char*fifo_size_max );
50 void update_queue_max_count( rtems_id queue_id, unsigned char*fifo_size_max );
51 void init_ring(ring_node ring[], unsigned char nbNodes, volatile int buffer[], unsigned int bufferSize );
51 void init_ring(ring_node ring[], unsigned char nbNodes, volatile int buffer[], unsigned int bufferSize );
52 //
52 //
53 int start_recv_send_tasks( void );
53 int start_recv_send_tasks( void );
54 //
54 //
55 void init_local_mode_parameters( void );
55 void init_local_mode_parameters( void );
56 void reset_local_time( void );
56 void reset_local_time( void );
57
57
58 extern void rtems_cpu_usage_report( void );
58 extern void rtems_cpu_usage_report( void );
59 extern void rtems_cpu_usage_reset( void );
59 extern void rtems_cpu_usage_reset( void );
60 extern void rtems_stack_checker_report_usage( void );
60 extern void rtems_stack_checker_report_usage( void );
61
61
62 extern int sched_yield( void );
62 extern int sched_yield( void );
63
63
64 #endif // FSW_INIT_H_INCLUDED
64 #endif // FSW_INIT_H_INCLUDED
@@ -1,84 +1,87
1 #ifndef FSW_MISC_H_INCLUDED
1 #ifndef FSW_MISC_H_INCLUDED
2 #define FSW_MISC_H_INCLUDED
2 #define FSW_MISC_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <stdio.h>
5 #include <stdio.h>
6 #include <grspw.h>
6 #include <grspw.h>
7 #include <grlib_regs.h>
7 #include <grlib_regs.h>
8
8
9 #include "fsw_params.h"
9 #include "fsw_params.h"
10 #include "fsw_spacewire.h"
10 #include "fsw_spacewire.h"
11 #include "lfr_cpu_usage_report.h"
11 #include "lfr_cpu_usage_report.h"
12
12
13
13
14 enum lfr_reset_cause_t{
14 enum lfr_reset_cause_t{
15 UNKNOWN_CAUSE,
15 UNKNOWN_CAUSE,
16 POWER_ON,
16 POWER_ON,
17 TC_RESET,
17 TC_RESET,
18 WATCHDOG,
18 WATCHDOG,
19 ERROR_RESET,
19 ERROR_RESET,
20 UNEXP_RESET
20 UNEXP_RESET
21 };
21 };
22
22
23 extern gptimer_regs_t *gptimer_regs;
23 extern gptimer_regs_t *gptimer_regs;
24 extern void ASR16_get_FPRF_IURF_ErrorCounters( unsigned int*, unsigned int* );
24 extern void ASR16_get_FPRF_IURF_ErrorCounters( unsigned int*, unsigned int* );
25 extern void CCR_getInstructionAndDataErrorCounters( unsigned int*, unsigned int* );
25 extern void CCR_getInstructionAndDataErrorCounters( unsigned int*, unsigned int* );
26
26
27 #define LFR_RESET_CAUSE_UNKNOWN_CAUSE 0
27 #define LFR_RESET_CAUSE_UNKNOWN_CAUSE 0
28
28
29 rtems_name name_hk_rate_monotonic; // name of the HK rate monotonic
29 rtems_name name_hk_rate_monotonic; // name of the HK rate monotonic
30 rtems_id HK_id; // id of the HK rate monotonic period
30 rtems_id HK_id; // id of the HK rate monotonic period
31 rtems_name name_avgv_rate_monotonic; // name of the AVGV rate monotonic
32 rtems_id AVGV_id; // id of the AVGV rate monotonic period
31
33
32 void timer_configure( unsigned char timer, unsigned int clock_divider,
34 void timer_configure( unsigned char timer, unsigned int clock_divider,
33 unsigned char interrupt_level, rtems_isr (*timer_isr)() );
35 unsigned char interrupt_level, rtems_isr (*timer_isr)() );
34 void timer_start( unsigned char timer );
36 void timer_start( unsigned char timer );
35 void timer_stop( unsigned char timer );
37 void timer_stop( unsigned char timer );
36 void timer_set_clock_divider(unsigned char timer, unsigned int clock_divider);
38 void timer_set_clock_divider(unsigned char timer, unsigned int clock_divider);
37
39
38 // WATCHDOG
40 // WATCHDOG
39 rtems_isr watchdog_isr( rtems_vector_number vector );
41 rtems_isr watchdog_isr( rtems_vector_number vector );
40 void watchdog_configure(void);
42 void watchdog_configure(void);
41 void watchdog_stop(void);
43 void watchdog_stop(void);
42 void watchdog_reload(void);
44 void watchdog_reload(void);
43 void watchdog_start(void);
45 void watchdog_start(void);
44
46
45 // SERIAL LINK
47 // SERIAL LINK
46 int send_console_outputs_on_apbuart_port( void );
48 int send_console_outputs_on_apbuart_port( void );
47 int enable_apbuart_transmitter( void );
49 int enable_apbuart_transmitter( void );
48 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value);
50 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value);
49
51
50 // RTEMS TASKS
52 // RTEMS TASKS
51 rtems_task load_task( rtems_task_argument argument );
53 rtems_task load_task( rtems_task_argument argument );
52 rtems_task hous_task( rtems_task_argument argument );
54 rtems_task hous_task( rtems_task_argument argument );
55 rtems_task avgv_task( rtems_task_argument argument );
53 rtems_task dumb_task( rtems_task_argument unused );
56 rtems_task dumb_task( rtems_task_argument unused );
54
57
55 void init_housekeeping_parameters( void );
58 void init_housekeeping_parameters( void );
56 void increment_seq_counter(unsigned short *packetSequenceControl);
59 void increment_seq_counter(unsigned short *packetSequenceControl);
57 void getTime( unsigned char *time);
60 void getTime( unsigned char *time);
58 unsigned long long int getTimeAsUnsignedLongLongInt( );
61 unsigned long long int getTimeAsUnsignedLongLongInt( );
59 void send_dumb_hk( void );
62 void send_dumb_hk( void );
60 void get_temperatures( unsigned char *temperatures );
63 void get_temperatures( unsigned char *temperatures );
61 void get_v_e1_e2_f3( unsigned char *spacecraft_potential );
64 void get_v_e1_e2_f3( unsigned char *spacecraft_potential );
62 void get_cpu_load( unsigned char *resource_statistics );
65 void get_cpu_load( unsigned char *resource_statistics );
63 void set_hk_lfr_sc_potential_flag( bool state );
66 void set_hk_lfr_sc_potential_flag( bool state );
64 void set_sy_lfr_pas_filter_enabled( bool state );
67 void set_sy_lfr_pas_filter_enabled( bool state );
65 void set_sy_lfr_watchdog_enabled( bool state );
68 void set_sy_lfr_watchdog_enabled( bool state );
66 void set_hk_lfr_calib_enable( bool state );
69 void set_hk_lfr_calib_enable( bool state );
67 void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause );
70 void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause );
68 void hk_lfr_le_me_he_update();
71 void hk_lfr_le_me_he_update();
69 void set_hk_lfr_time_not_synchro();
72 void set_hk_lfr_time_not_synchro();
70
73
71 extern int sched_yield( void );
74 extern int sched_yield( void );
72 extern void rtems_cpu_usage_reset();
75 extern void rtems_cpu_usage_reset();
73 extern ring_node *current_ring_node_f3;
76 extern ring_node *current_ring_node_f3;
74 extern ring_node *ring_node_to_send_cwf_f3;
77 extern ring_node *ring_node_to_send_cwf_f3;
75 extern ring_node waveform_ring_f3[];
78 extern ring_node waveform_ring_f3[];
76 extern unsigned short sequenceCounterHK;
79 extern unsigned short sequenceCounterHK;
77
80
78 extern unsigned char hk_lfr_q_sd_fifo_size_max;
81 extern unsigned char hk_lfr_q_sd_fifo_size_max;
79 extern unsigned char hk_lfr_q_rv_fifo_size_max;
82 extern unsigned char hk_lfr_q_rv_fifo_size_max;
80 extern unsigned char hk_lfr_q_p0_fifo_size_max;
83 extern unsigned char hk_lfr_q_p0_fifo_size_max;
81 extern unsigned char hk_lfr_q_p1_fifo_size_max;
84 extern unsigned char hk_lfr_q_p1_fifo_size_max;
82 extern unsigned char hk_lfr_q_p2_fifo_size_max;
85 extern unsigned char hk_lfr_q_p2_fifo_size_max;
83
86
84 #endif // FSW_MISC_H_INCLUDED
87 #endif // FSW_MISC_H_INCLUDED
@@ -1,938 +1,955
1 /** This is the RTEMS initialization module.
1 /** This is the RTEMS initialization module.
2 *
2 *
3 * @file
3 * @file
4 * @author P. LEROY
4 * @author P. LEROY
5 *
5 *
6 * This module contains two very different information:
6 * This module contains two very different information:
7 * - specific instructions to configure the compilation of the RTEMS executive
7 * - specific instructions to configure the compilation of the RTEMS executive
8 * - functions related to the fligth softwre initialization, especially the INIT RTEMS task
8 * - functions related to the fligth softwre initialization, especially the INIT RTEMS task
9 *
9 *
10 */
10 */
11
11
12 //*************************
12 //*************************
13 // GPL reminder to be added
13 // GPL reminder to be added
14 //*************************
14 //*************************
15
15
16 #include <rtems.h>
16 #include <rtems.h>
17
17
18 /* configuration information */
18 /* configuration information */
19
19
20 #define CONFIGURE_INIT
20 #define CONFIGURE_INIT
21
21
22 #include <bsp.h> /* for device driver prototypes */
22 #include <bsp.h> /* for device driver prototypes */
23
23
24 /* configuration information */
24 /* configuration information */
25
25
26 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
26 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
27 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
27 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
28
28
29 #define CONFIGURE_MAXIMUM_TASKS 20
29 #define CONFIGURE_MAXIMUM_TASKS 21 // number of tasks concurrently active including INIT
30 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
30 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
31 #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
31 #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
32 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
32 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
33 #define CONFIGURE_INIT_TASK_PRIORITY 1 // instead of 100
33 #define CONFIGURE_INIT_TASK_PRIORITY 1 // instead of 100
34 #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT)
34 #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT)
35 #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT)
35 #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT)
36 #define CONFIGURE_MAXIMUM_DRIVERS 16
36 #define CONFIGURE_MAXIMUM_DRIVERS 16
37 #define CONFIGURE_MAXIMUM_PERIODS 5
37 #define CONFIGURE_MAXIMUM_PERIODS 5 // [hous] [load] [avgv]
38 #define CONFIGURE_MAXIMUM_TIMERS 5 // [spiq] [link] [spacewire_reset_link]
38 #define CONFIGURE_MAXIMUM_TIMERS 5 // [spiq] [link] [spacewire_reset_link]
39 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 5
39 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 5
40 #ifdef PRINT_STACK_REPORT
40 #ifdef PRINT_STACK_REPORT
41 #define CONFIGURE_STACK_CHECKER_ENABLED
41 #define CONFIGURE_STACK_CHECKER_ENABLED
42 #endif
42 #endif
43
43
44 #include <rtems/confdefs.h>
44 #include <rtems/confdefs.h>
45
45
46 /* If --drvmgr was enabled during the configuration of the RTEMS kernel */
46 /* If --drvmgr was enabled during the configuration of the RTEMS kernel */
47 #ifdef RTEMS_DRVMGR_STARTUP
47 #ifdef RTEMS_DRVMGR_STARTUP
48 #ifdef LEON3
48 #ifdef LEON3
49 /* Add Timer and UART Driver */
49 /* Add Timer and UART Driver */
50
50
51 #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
51 #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
52 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER
52 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER
53 #endif
53 #endif
54
54
55 #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
55 #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
56 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART
56 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART
57 #endif
57 #endif
58
58
59 #endif
59 #endif
60 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */
60 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */
61
61
62 #include <drvmgr/drvmgr_confdefs.h>
62 #include <drvmgr/drvmgr_confdefs.h>
63 #endif
63 #endif
64
64
65 #include "fsw_init.h"
65 #include "fsw_init.h"
66 #include "fsw_config.c"
66 #include "fsw_config.c"
67 #include "GscMemoryLPP.hpp"
67 #include "GscMemoryLPP.hpp"
68
68
69 void initCache()
69 void initCache()
70 {
70 {
71 // ASI 2 contains a few control registers that have not been assigned as ancillary state registers.
71 // ASI 2 contains a few control registers that have not been assigned as ancillary state registers.
72 // These should only be read and written using 32-bit LDA/STA instructions.
72 // These should only be read and written using 32-bit LDA/STA instructions.
73 // All cache registers are accessed through load/store operations to the alternate address space (LDA/STA), using ASI = 2.
73 // All cache registers are accessed through load/store operations to the alternate address space (LDA/STA), using ASI = 2.
74 // The table below shows the register addresses:
74 // The table below shows the register addresses:
75 // 0x00 Cache control register
75 // 0x00 Cache control register
76 // 0x04 Reserved
76 // 0x04 Reserved
77 // 0x08 Instruction cache configuration register
77 // 0x08 Instruction cache configuration register
78 // 0x0C Data cache configuration register
78 // 0x0C Data cache configuration register
79
79
80 // Cache Control Register Leon3 / Leon3FT
80 // Cache Control Register Leon3 / Leon3FT
81 // 31..30 29 28 27..24 23 22 21 20..19 18 17 16
81 // 31..30 29 28 27..24 23 22 21 20..19 18 17 16
82 // RFT PS TB DS FD FI FT ST IB
82 // RFT PS TB DS FD FI FT ST IB
83 // 15 14 13..12 11..10 9..8 7..6 5 4 3..2 1..0
83 // 15 14 13..12 11..10 9..8 7..6 5 4 3..2 1..0
84 // IP DP ITE IDE DTE DDE DF IF DCS ICS
84 // IP DP ITE IDE DTE DDE DF IF DCS ICS
85
85
86 unsigned int cacheControlRegister;
86 unsigned int cacheControlRegister;
87
87
88 CCR_resetCacheControlRegister();
88 CCR_resetCacheControlRegister();
89 ASR16_resetRegisterProtectionControlRegister();
89 ASR16_resetRegisterProtectionControlRegister();
90
90
91 cacheControlRegister = CCR_getValue();
91 cacheControlRegister = CCR_getValue();
92 PRINTF1("(0) CCR - Cache Control Register = %x\n", cacheControlRegister);
92 PRINTF1("(0) CCR - Cache Control Register = %x\n", cacheControlRegister);
93 PRINTF1("(0) ASR16 = %x\n", *asr16Ptr);
93 PRINTF1("(0) ASR16 = %x\n", *asr16Ptr);
94
94
95 CCR_enableInstructionCache(); // ICS bits
95 CCR_enableInstructionCache(); // ICS bits
96 CCR_enableDataCache(); // DCS bits
96 CCR_enableDataCache(); // DCS bits
97 CCR_enableInstructionBurstFetch(); // IB bit
97 CCR_enableInstructionBurstFetch(); // IB bit
98
98
99 faultTolerantScheme();
99 faultTolerantScheme();
100
100
101 cacheControlRegister = CCR_getValue();
101 cacheControlRegister = CCR_getValue();
102 PRINTF1("(1) CCR - Cache Control Register = %x\n", cacheControlRegister);
102 PRINTF1("(1) CCR - Cache Control Register = %x\n", cacheControlRegister);
103 PRINTF1("(1) ASR16 Register protection control register = %x\n", *asr16Ptr);
103 PRINTF1("(1) ASR16 Register protection control register = %x\n", *asr16Ptr);
104
104
105 PRINTF("\n");
105 PRINTF("\n");
106 }
106 }
107
107
108 rtems_task Init( rtems_task_argument ignored )
108 rtems_task Init( rtems_task_argument ignored )
109 {
109 {
110 /** This is the RTEMS INIT taks, it is the first task launched by the system.
110 /** This is the RTEMS INIT taks, it is the first task launched by the system.
111 *
111 *
112 * @param unused is the starting argument of the RTEMS task
112 * @param unused is the starting argument of the RTEMS task
113 *
113 *
114 * The INIT task create and run all other RTEMS tasks.
114 * The INIT task create and run all other RTEMS tasks.
115 *
115 *
116 */
116 */
117
117
118 //***********
118 //***********
119 // INIT CACHE
119 // INIT CACHE
120
120
121 unsigned char *vhdlVersion;
121 unsigned char *vhdlVersion;
122
122
123 reset_lfr();
123 reset_lfr();
124
124
125 reset_local_time();
125 reset_local_time();
126
126
127 rtems_cpu_usage_reset();
127 rtems_cpu_usage_reset();
128
128
129 rtems_status_code status;
129 rtems_status_code status;
130 rtems_status_code status_spw;
130 rtems_status_code status_spw;
131 rtems_isr_entry old_isr_handler;
131 rtems_isr_entry old_isr_handler;
132
132
133 // UART settings
133 // UART settings
134 enable_apbuart_transmitter();
134 enable_apbuart_transmitter();
135 set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE);
135 set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE);
136
136
137 DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n")
137 DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n")
138
138
139
139
140 PRINTF("\n\n\n\n\n")
140 PRINTF("\n\n\n\n\n")
141
141
142 initCache();
142 initCache();
143
143
144 PRINTF("*************************\n")
144 PRINTF("*************************\n")
145 PRINTF("** LFR Flight Software **\n")
145 PRINTF("** LFR Flight Software **\n")
146 PRINTF1("** %d.", SW_VERSION_N1)
146 PRINTF1("** %d-", SW_VERSION_N1)
147 PRINTF1("%d." , SW_VERSION_N2)
147 PRINTF1("%d-" , SW_VERSION_N2)
148 PRINTF1("%d." , SW_VERSION_N3)
148 PRINTF1("%d-" , SW_VERSION_N3)
149 PRINTF1("%d **\n", SW_VERSION_N4)
149 PRINTF1("%d **\n", SW_VERSION_N4)
150
150
151 vhdlVersion = (unsigned char *) (REGS_ADDR_VHDL_VERSION);
151 vhdlVersion = (unsigned char *) (REGS_ADDR_VHDL_VERSION);
152 PRINTF("** VHDL **\n")
152 PRINTF("** VHDL **\n")
153 PRINTF1("** %d.", vhdlVersion[1])
153 PRINTF1("** %d.", vhdlVersion[1])
154 PRINTF1("%d." , vhdlVersion[2])
154 PRINTF1("%d." , vhdlVersion[2])
155 PRINTF1("%d **\n", vhdlVersion[3])
155 PRINTF1("%d **\n", vhdlVersion[3])
156 PRINTF("*************************\n")
156 PRINTF("*************************\n")
157 PRINTF("\n\n")
157 PRINTF("\n\n")
158
158
159 init_parameter_dump();
159 init_parameter_dump();
160 init_kcoefficients_dump();
160 init_kcoefficients_dump();
161 init_local_mode_parameters();
161 init_local_mode_parameters();
162 init_housekeeping_parameters();
162 init_housekeeping_parameters();
163 init_k_coefficients_prc0();
163 init_k_coefficients_prc0();
164 init_k_coefficients_prc1();
164 init_k_coefficients_prc1();
165 init_k_coefficients_prc2();
165 init_k_coefficients_prc2();
166 pa_bia_status_info = 0x00;
166 pa_bia_status_info = 0x00;
167 cp_rpw_sc_rw_f_flags = 0x00;
167 cp_rpw_sc_rw_f_flags = 0x00;
168 cp_rpw_sc_rw1_f1 = 0.0;
168 cp_rpw_sc_rw1_f1 = 0.0;
169 cp_rpw_sc_rw1_f2 = 0.0;
169 cp_rpw_sc_rw1_f2 = 0.0;
170 cp_rpw_sc_rw2_f1 = 0.0;
170 cp_rpw_sc_rw2_f1 = 0.0;
171 cp_rpw_sc_rw2_f2 = 0.0;
171 cp_rpw_sc_rw2_f2 = 0.0;
172 cp_rpw_sc_rw3_f1 = 0.0;
172 cp_rpw_sc_rw3_f1 = 0.0;
173 cp_rpw_sc_rw3_f2 = 0.0;
173 cp_rpw_sc_rw3_f2 = 0.0;
174 cp_rpw_sc_rw4_f1 = 0.0;
174 cp_rpw_sc_rw4_f1 = 0.0;
175 cp_rpw_sc_rw4_f2 = 0.0;
175 cp_rpw_sc_rw4_f2 = 0.0;
176 // initialize filtering parameters
176 // initialize filtering parameters
177 filterPar.spare_sy_lfr_pas_filter_enabled = DEFAULT_SY_LFR_PAS_FILTER_ENABLED;
177 filterPar.spare_sy_lfr_pas_filter_enabled = DEFAULT_SY_LFR_PAS_FILTER_ENABLED;
178 filterPar.sy_lfr_pas_filter_modulus = DEFAULT_SY_LFR_PAS_FILTER_MODULUS;
178 filterPar.sy_lfr_pas_filter_modulus = DEFAULT_SY_LFR_PAS_FILTER_MODULUS;
179 filterPar.sy_lfr_pas_filter_tbad = DEFAULT_SY_LFR_PAS_FILTER_TBAD;
179 filterPar.sy_lfr_pas_filter_tbad = DEFAULT_SY_LFR_PAS_FILTER_TBAD;
180 filterPar.sy_lfr_pas_filter_offset = DEFAULT_SY_LFR_PAS_FILTER_OFFSET;
180 filterPar.sy_lfr_pas_filter_offset = DEFAULT_SY_LFR_PAS_FILTER_OFFSET;
181 filterPar.sy_lfr_pas_filter_shift = DEFAULT_SY_LFR_PAS_FILTER_SHIFT;
181 filterPar.sy_lfr_pas_filter_shift = DEFAULT_SY_LFR_PAS_FILTER_SHIFT;
182 filterPar.sy_lfr_sc_rw_delta_f = DEFAULT_SY_LFR_SC_RW_DELTA_F;
182 filterPar.sy_lfr_sc_rw_delta_f = DEFAULT_SY_LFR_SC_RW_DELTA_F;
183 update_last_valid_transition_date( DEFAULT_LAST_VALID_TRANSITION_DATE );
183 update_last_valid_transition_date( DEFAULT_LAST_VALID_TRANSITION_DATE );
184
184
185 // waveform picker initialization
185 // waveform picker initialization
186 WFP_init_rings();
186 WFP_init_rings();
187 LEON_Clear_interrupt( IRQ_SPARC_GPTIMER_WATCHDOG ); // initialize the waveform rings
187 LEON_Clear_interrupt( IRQ_SPARC_GPTIMER_WATCHDOG ); // initialize the waveform rings
188 WFP_reset_current_ring_nodes();
188 WFP_reset_current_ring_nodes();
189 reset_waveform_picker_regs();
189 reset_waveform_picker_regs();
190
190
191 // spectral matrices initialization
191 // spectral matrices initialization
192 SM_init_rings(); // initialize spectral matrices rings
192 SM_init_rings(); // initialize spectral matrices rings
193 SM_reset_current_ring_nodes();
193 SM_reset_current_ring_nodes();
194 reset_spectral_matrix_regs();
194 reset_spectral_matrix_regs();
195
195
196 // configure calibration
196 // configure calibration
197 configureCalibration( false ); // true means interleaved mode, false is for normal mode
197 configureCalibration( false ); // true means interleaved mode, false is for normal mode
198
198
199 updateLFRCurrentMode( LFR_MODE_STANDBY );
199 updateLFRCurrentMode( LFR_MODE_STANDBY );
200
200
201 BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode)
201 BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode)
202
202
203 create_names(); // create all names
203 create_names(); // create all names
204
204
205 status = create_timecode_timer(); // create the timer used by timecode_irq_handler
205 status = create_timecode_timer(); // create the timer used by timecode_irq_handler
206 if (status != RTEMS_SUCCESSFUL)
206 if (status != RTEMS_SUCCESSFUL)
207 {
207 {
208 PRINTF1("in INIT *** ERR in create_timer_timecode, code %d", status)
208 PRINTF1("in INIT *** ERR in create_timer_timecode, code %d", status)
209 }
209 }
210
210
211 status = create_message_queues(); // create message queues
211 status = create_message_queues(); // create message queues
212 if (status != RTEMS_SUCCESSFUL)
212 if (status != RTEMS_SUCCESSFUL)
213 {
213 {
214 PRINTF1("in INIT *** ERR in create_message_queues, code %d", status)
214 PRINTF1("in INIT *** ERR in create_message_queues, code %d", status)
215 }
215 }
216
216
217 status = create_all_tasks(); // create all tasks
217 status = create_all_tasks(); // create all tasks
218 if (status != RTEMS_SUCCESSFUL)
218 if (status != RTEMS_SUCCESSFUL)
219 {
219 {
220 PRINTF1("in INIT *** ERR in create_all_tasks, code %d\n", status)
220 PRINTF1("in INIT *** ERR in create_all_tasks, code %d\n", status)
221 }
221 }
222
222
223 // **************************
223 // **************************
224 // <SPACEWIRE INITIALIZATION>
224 // <SPACEWIRE INITIALIZATION>
225 status_spw = spacewire_open_link(); // (1) open the link
225 status_spw = spacewire_open_link(); // (1) open the link
226 if ( status_spw != RTEMS_SUCCESSFUL )
226 if ( status_spw != RTEMS_SUCCESSFUL )
227 {
227 {
228 PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw )
228 PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw )
229 }
229 }
230
230
231 if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link
231 if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link
232 {
232 {
233 status_spw = spacewire_configure_link( fdSPW );
233 status_spw = spacewire_configure_link( fdSPW );
234 if ( status_spw != RTEMS_SUCCESSFUL )
234 if ( status_spw != RTEMS_SUCCESSFUL )
235 {
235 {
236 PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw )
236 PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw )
237 }
237 }
238 }
238 }
239
239
240 if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link
240 if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link
241 {
241 {
242 status_spw = spacewire_start_link( fdSPW );
242 status_spw = spacewire_start_link( fdSPW );
243 if ( status_spw != RTEMS_SUCCESSFUL )
243 if ( status_spw != RTEMS_SUCCESSFUL )
244 {
244 {
245 PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw )
245 PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw )
246 }
246 }
247 }
247 }
248 // </SPACEWIRE INITIALIZATION>
248 // </SPACEWIRE INITIALIZATION>
249 // ***************************
249 // ***************************
250
250
251 status = start_all_tasks(); // start all tasks
251 status = start_all_tasks(); // start all tasks
252 if (status != RTEMS_SUCCESSFUL)
252 if (status != RTEMS_SUCCESSFUL)
253 {
253 {
254 PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status)
254 PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status)
255 }
255 }
256
256
257 // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization
257 // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization
258 status = start_recv_send_tasks();
258 status = start_recv_send_tasks();
259 if ( status != RTEMS_SUCCESSFUL )
259 if ( status != RTEMS_SUCCESSFUL )
260 {
260 {
261 PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status )
261 PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status )
262 }
262 }
263
263
264 // suspend science tasks, they will be restarted later depending on the mode
264 // suspend science tasks, they will be restarted later depending on the mode
265 status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY)
265 status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY)
266 if (status != RTEMS_SUCCESSFUL)
266 if (status != RTEMS_SUCCESSFUL)
267 {
267 {
268 PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status)
268 PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status)
269 }
269 }
270
270
271 // configure IRQ handling for the waveform picker unit
271 // configure IRQ handling for the waveform picker unit
272 status = rtems_interrupt_catch( waveforms_isr,
272 status = rtems_interrupt_catch( waveforms_isr,
273 IRQ_SPARC_WAVEFORM_PICKER,
273 IRQ_SPARC_WAVEFORM_PICKER,
274 &old_isr_handler) ;
274 &old_isr_handler) ;
275 // configure IRQ handling for the spectral matrices unit
275 // configure IRQ handling for the spectral matrices unit
276 status = rtems_interrupt_catch( spectral_matrices_isr,
276 status = rtems_interrupt_catch( spectral_matrices_isr,
277 IRQ_SPARC_SPECTRAL_MATRIX,
277 IRQ_SPARC_SPECTRAL_MATRIX,
278 &old_isr_handler) ;
278 &old_isr_handler) ;
279
279
280 // if the spacewire link is not up then send an event to the SPIQ task for link recovery
280 // if the spacewire link is not up then send an event to the SPIQ task for link recovery
281 if ( status_spw != RTEMS_SUCCESSFUL )
281 if ( status_spw != RTEMS_SUCCESSFUL )
282 {
282 {
283 status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT );
283 status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT );
284 if ( status != RTEMS_SUCCESSFUL ) {
284 if ( status != RTEMS_SUCCESSFUL ) {
285 PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status )
285 PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status )
286 }
286 }
287 }
287 }
288
288
289 BOOT_PRINTF("delete INIT\n")
289 BOOT_PRINTF("delete INIT\n")
290
290
291 set_hk_lfr_sc_potential_flag( true );
291 set_hk_lfr_sc_potential_flag( true );
292
292
293 // start the timer to detect a missing spacewire timecode
293 // start the timer to detect a missing spacewire timecode
294 // the timeout is larger because the spw IP needs to receive several valid timecodes before generating a tickout
294 // the timeout is larger because the spw IP needs to receive several valid timecodes before generating a tickout
295 // if a tickout is generated, the timer is restarted
295 // if a tickout is generated, the timer is restarted
296 status = rtems_timer_fire_after( timecode_timer_id, TIMECODE_TIMER_TIMEOUT_INIT, timecode_timer_routine, NULL );
296 status = rtems_timer_fire_after( timecode_timer_id, TIMECODE_TIMER_TIMEOUT_INIT, timecode_timer_routine, NULL );
297
297
298 grspw_timecode_callback = &timecode_irq_handler;
298 grspw_timecode_callback = &timecode_irq_handler;
299
299
300 status = rtems_task_delete(RTEMS_SELF);
300 status = rtems_task_delete(RTEMS_SELF);
301
301
302 }
302 }
303
303
304 void init_local_mode_parameters( void )
304 void init_local_mode_parameters( void )
305 {
305 {
306 /** This function initialize the param_local global variable with default values.
306 /** This function initialize the param_local global variable with default values.
307 *
307 *
308 */
308 */
309
309
310 unsigned int i;
310 unsigned int i;
311
311
312 // LOCAL PARAMETERS
312 // LOCAL PARAMETERS
313
313
314 BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max)
314 BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max)
315 BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max)
315 BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max)
316 BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX)
316 BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX)
317
317
318 // init sequence counters
318 // init sequence counters
319
319
320 for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++)
320 for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++)
321 {
321 {
322 sequenceCounters_TC_EXE[i] = 0x00;
322 sequenceCounters_TC_EXE[i] = 0x00;
323 sequenceCounters_TM_DUMP[i] = 0x00;
323 sequenceCounters_TM_DUMP[i] = 0x00;
324 }
324 }
325 sequenceCounters_SCIENCE_NORMAL_BURST = 0x00;
325 sequenceCounters_SCIENCE_NORMAL_BURST = 0x00;
326 sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00;
326 sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00;
327 sequenceCounterHK = TM_PACKET_SEQ_CTRL_STANDALONE << 8;
327 sequenceCounterHK = TM_PACKET_SEQ_CTRL_STANDALONE << 8;
328 }
328 }
329
329
330 void reset_local_time( void )
330 void reset_local_time( void )
331 {
331 {
332 time_management_regs->ctrl = time_management_regs->ctrl | 0x02; // [0010] software reset, coarse time = 0x80000000
332 time_management_regs->ctrl = time_management_regs->ctrl | 0x02; // [0010] software reset, coarse time = 0x80000000
333 }
333 }
334
334
335 void create_names( void ) // create all names for tasks and queues
335 void create_names( void ) // create all names for tasks and queues
336 {
336 {
337 /** This function creates all RTEMS names used in the software for tasks and queues.
337 /** This function creates all RTEMS names used in the software for tasks and queues.
338 *
338 *
339 * @return RTEMS directive status codes:
339 * @return RTEMS directive status codes:
340 * - RTEMS_SUCCESSFUL - successful completion
340 * - RTEMS_SUCCESSFUL - successful completion
341 *
341 *
342 */
342 */
343
343
344 // task names
344 // task names
345 Task_name[TASKID_AVGV] = rtems_build_name( 'A', 'V', 'G', 'V' );
345 Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' );
346 Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' );
346 Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' );
347 Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' );
347 Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' );
348 Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' );
348 Task_name[TASKID_LOAD] = rtems_build_name( 'L', 'O', 'A', 'D' );
349 Task_name[TASKID_LOAD] = rtems_build_name( 'L', 'O', 'A', 'D' );
349 Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' );
350 Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' );
350 Task_name[TASKID_SWBD] = rtems_build_name( 'S', 'W', 'B', 'D' );
351 Task_name[TASKID_SWBD] = rtems_build_name( 'S', 'W', 'B', 'D' );
351 Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' );
352 Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' );
352 Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' );
353 Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' );
353 Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' );
354 Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' );
354 Task_name[TASKID_PRC0] = rtems_build_name( 'P', 'R', 'C', '0' );
355 Task_name[TASKID_PRC0] = rtems_build_name( 'P', 'R', 'C', '0' );
355 Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' );
356 Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' );
356 Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' );
357 Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' );
357 Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' );
358 Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' );
358 Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' );
359 Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' );
359 Task_name[TASKID_LINK] = rtems_build_name( 'L', 'I', 'N', 'K' );
360 Task_name[TASKID_LINK] = rtems_build_name( 'L', 'I', 'N', 'K' );
360 Task_name[TASKID_AVF1] = rtems_build_name( 'A', 'V', 'F', '1' );
361 Task_name[TASKID_AVF1] = rtems_build_name( 'A', 'V', 'F', '1' );
361 Task_name[TASKID_PRC1] = rtems_build_name( 'P', 'R', 'C', '1' );
362 Task_name[TASKID_PRC1] = rtems_build_name( 'P', 'R', 'C', '1' );
362 Task_name[TASKID_AVF2] = rtems_build_name( 'A', 'V', 'F', '2' );
363 Task_name[TASKID_AVF2] = rtems_build_name( 'A', 'V', 'F', '2' );
363 Task_name[TASKID_PRC2] = rtems_build_name( 'P', 'R', 'C', '2' );
364 Task_name[TASKID_PRC2] = rtems_build_name( 'P', 'R', 'C', '2' );
364
365
365 // rate monotonic period names
366 // rate monotonic period names
366 name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' );
367 name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' );
368 name_avgv_rate_monotonic = rtems_build_name( 'A', 'V', 'G', 'V' );
367
369
368 misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' );
370 misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' );
369 misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' );
371 misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' );
370 misc_name[QUEUE_PRC0] = rtems_build_name( 'Q', '_', 'P', '0' );
372 misc_name[QUEUE_PRC0] = rtems_build_name( 'Q', '_', 'P', '0' );
371 misc_name[QUEUE_PRC1] = rtems_build_name( 'Q', '_', 'P', '1' );
373 misc_name[QUEUE_PRC1] = rtems_build_name( 'Q', '_', 'P', '1' );
372 misc_name[QUEUE_PRC2] = rtems_build_name( 'Q', '_', 'P', '2' );
374 misc_name[QUEUE_PRC2] = rtems_build_name( 'Q', '_', 'P', '2' );
373
375
374 timecode_timer_name = rtems_build_name( 'S', 'P', 'T', 'C' );
376 timecode_timer_name = rtems_build_name( 'S', 'P', 'T', 'C' );
375 }
377 }
376
378
377 int create_all_tasks( void ) // create all tasks which run in the software
379 int create_all_tasks( void ) // create all tasks which run in the software
378 {
380 {
379 /** This function creates all RTEMS tasks used in the software.
381 /** This function creates all RTEMS tasks used in the software.
380 *
382 *
381 * @return RTEMS directive status codes:
383 * @return RTEMS directive status codes:
382 * - RTEMS_SUCCESSFUL - task created successfully
384 * - RTEMS_SUCCESSFUL - task created successfully
383 * - RTEMS_INVALID_ADDRESS - id is NULL
385 * - RTEMS_INVALID_ADDRESS - id is NULL
384 * - RTEMS_INVALID_NAME - invalid task name
386 * - RTEMS_INVALID_NAME - invalid task name
385 * - RTEMS_INVALID_PRIORITY - invalid task priority
387 * - RTEMS_INVALID_PRIORITY - invalid task priority
386 * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured
388 * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured
387 * - RTEMS_TOO_MANY - too many tasks created
389 * - RTEMS_TOO_MANY - too many tasks created
388 * - RTEMS_UNSATISFIED - not enough memory for stack/FP context
390 * - RTEMS_UNSATISFIED - not enough memory for stack/FP context
389 * - RTEMS_TOO_MANY - too many global objects
391 * - RTEMS_TOO_MANY - too many global objects
390 *
392 *
391 */
393 */
392
394
393 rtems_status_code status;
395 rtems_status_code status;
394
396
395 //**********
397 //**********
396 // SPACEWIRE
<