# HG changeset patch # User paul # Date 2013-11-15 08:54:50 # Node ID 4928e8d9328f4ca80eb2d75bf71589bdd1d9511a # Parent 4ddb27882137065eef943b6cd12d2575aab768a4 Minor modifications to meet Logiscope requirements diff --git a/FSW-qt/Makefile b/FSW-qt/Makefile --- a/FSW-qt/Makefile +++ b/FSW-qt/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: bin/fsw -# Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Nov 14 12:02:16 2013 +# Generated by qmake (2.01a) (Qt 4.8.5) on: Fri Nov 15 07:55:16 2013 # Project: fsw-qt.pro # Template: app # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro @@ -10,7 +10,7 @@ CC = sparc-rtems-gcc CXX = sparc-rtems-g++ -DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=23 -DPRINT_MESSAGES_ON_CONSOLE +DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=24 -DPRINT_MESSAGES_ON_CONSOLE CFLAGS = -pipe -O3 -Wall $(DEFINES) CXXFLAGS = -pipe -O3 -Wall $(DEFINES) INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header diff --git a/FSW-qt/fsw-qt.pro b/FSW-qt/fsw-qt.pro --- a/FSW-qt/fsw-qt.pro +++ b/FSW-qt/fsw-qt.pro @@ -7,11 +7,11 @@ CONFIG -= qt include(./sparc.pri) # flight software version -SWVERSION=-0-23 +SWVERSION=-0-24 DEFINES += SW_VERSION_N1=0 DEFINES += SW_VERSION_N2=0 DEFINES += SW_VERSION_N3=0 -DEFINES += SW_VERSION_N4=23 +DEFINES += SW_VERSION_N4=24 contains( CONFIG, verbose ) { DEFINES += PRINT_MESSAGES_ON_CONSOLE @@ -74,5 +74,6 @@ HEADERS += \ ../header/tm_byte_positions.h \ ../header/tc_load_dump_parameters.h \ ../header/tm_lfr_tc_exe.h \ - ../header/tc_acceptance.h + ../header/tc_acceptance.h \ + ../header/fsw_params_nb_bytes.h diff --git a/FSW-qt/fsw-qt.pro.user b/FSW-qt/fsw-qt.pro.user --- a/FSW-qt/fsw-qt.pro.user +++ b/FSW-qt/fsw-qt.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget @@ -51,12 +51,12 @@ ProjectExplorer.Project.Target.0 - Desktop-Qt 4.8.2 in PATH (System) - Desktop-Qt 4.8.2 in PATH (System) - {5289e843-9ef2-45ce-88c6-ad27d8e08def} + Desktop-Qt 4.8.3 in PATH (System) + Desktop-Qt 4.8.3 in PATH (System) + {be73cf6a-f9d8-4d5a-8adf-adc2d83e2e44} 0 0 - 1 + 0 @@ -65,7 +65,7 @@ QtProjectManager.QMakeBuildStep false - true + false false @@ -79,7 +79,7 @@ -r false - -r -w -j 4 + 2 @@ -98,7 +98,7 @@ -r true - -r -w clean + clean 1 @@ -109,73 +109,14 @@ 2 false - Qt 4.8.2 in PATH (System) Release + Release Qt4ProjectManager.Qt4BuildConfiguration 0 - /opt/DEV_PLE/FSW-qt + /home/admin/opt/DEV_PLE/FSW-qt false - - - - true - qmake - - QtProjectManager.QMakeBuildStep - false - true - - false - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - false - -r -w - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - true - -r -w clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Qt 4.8.2 in PATH (System) Debug - - Qt4ProjectManager.Qt4BuildConfiguration - 2 - /opt/DEV_PLE/FSW-qt - false - - 2 + 1 0 @@ -184,7 +125,7 @@ ProjectExplorer.BuildSteps.Deploy 1 - No deployment + Deploy locally ProjectExplorer.DefaultDeployConfiguration @@ -226,7 +167,7 @@ fsw-qt - Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro + Qt4ProjectManager.Qt4RunConfiguration:/home/admin/opt/DEV_PLE/FSW-qt/fsw-qt.pro fsw-qt.pro false @@ -237,57 +178,9 @@ false false false - false - - - true - - false - false - false - false - true - 0.01 - 10 - true - 25 - - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - doxygen - true - /opt/DEV_PLE/doc - Run doxygen - - ProjectExplorer.CustomExecutableRunConfiguration - 3768 - true - false - false - false true - 2 + 1 @@ -296,7 +189,7 @@ ProjectExplorer.Project.Updater.EnvironmentId - {2e58a81f-9962-4bba-ae6b-760177f0656c} + {cdbf9cdc-1e84-406e-889b-c4feef49e75c} ProjectExplorer.Project.Updater.FileVersion diff --git a/header/ccsds_types.h b/header/ccsds_types.h --- a/header/ccsds_types.h +++ b/header/ccsds_types.h @@ -226,45 +226,7 @@ enum TM_TYPE{ TM_LFR_PAR_DUMP }; -struct TMHeader_str -{ - unsigned char targetLogicalAddress; - unsigned char protocolIdentifier; - unsigned char reserved; - unsigned char userApplication; - unsigned char packetID[2]; - unsigned char packetSequenceControl[2]; - unsigned char packetLength[2]; - // DATA FIELD HEADER - unsigned char spare1_pusVersion_spare2; - unsigned char serviceType; - unsigned char serviceSubType; - unsigned char destinationID; - unsigned char time[6]; -}; -typedef struct TMHeader_str TMHeader_t; - -struct Packet_TM_LFR_TC_EXE_str -{ - unsigned char targetLogicalAddress; - unsigned char protocolIdentifier; - unsigned char reserved; - unsigned char userApplication; - unsigned char packetID[2]; - unsigned char packetSequenceControl[2]; - unsigned char packetLength[2]; - // DATA FIELD HEADER - unsigned char spare1_pusVersion_spare2; - unsigned char serviceType; - unsigned char serviceSubType; - unsigned char destinationID; - unsigned char time[6]; - unsigned char data[LENGTH_TM_LFR_TC_EXE_MAX - 10 + 1]; -}; -typedef struct Packet_TM_LFR_TC_EXE_str Packet_TM_LFR_TC_EXE_t; - -struct Packet_TM_LFR_TC_EXE_SUCCESS_str -{ +typedef struct { unsigned char targetLogicalAddress; unsigned char protocolIdentifier; unsigned char reserved; @@ -282,11 +244,9 @@ struct Packet_TM_LFR_TC_EXE_SUCCESS_str // unsigned char telecommand_pkt_id[2]; unsigned char pkt_seq_control[2]; -}; -typedef struct Packet_TM_LFR_TC_EXE_SUCCESS_str Packet_TM_LFR_TC_EXE_SUCCESS_t; +} Packet_TM_LFR_TC_EXE_SUCCESS_t; -struct Packet_TM_LFR_TC_EXE_INCONSISTENT_str -{ +typedef struct { unsigned char targetLogicalAddress; unsigned char protocolIdentifier; unsigned char reserved; @@ -309,11 +269,9 @@ struct Packet_TM_LFR_TC_EXE_INCONSISTENT unsigned char tc_subtype; unsigned char byte_position; unsigned char rcv_value; -}; -typedef struct Packet_TM_LFR_TC_EXE_INCONSISTENT_str Packet_TM_LFR_TC_EXE_INCONSISTENT_t; +} Packet_TM_LFR_TC_EXE_INCONSISTENT_t; -struct Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_str -{ +typedef struct { unsigned char targetLogicalAddress; unsigned char protocolIdentifier; unsigned char reserved; @@ -335,11 +293,9 @@ struct Packet_TM_LFR_TC_EXE_NOT_EXECUTAB unsigned char tc_service; unsigned char tc_subtype; unsigned char lfr_status_word[2]; -}; -typedef struct Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_str Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t; +} Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t; -struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_str -{ +typedef struct { unsigned char targetLogicalAddress; unsigned char protocolIdentifier; unsigned char reserved; @@ -360,11 +316,9 @@ struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMEN unsigned char pkt_seq_control[2]; unsigned char tc_service; unsigned char tc_subtype; -}; -typedef struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_str Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t; +} Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t; -struct Packet_TM_LFR_TC_EXE_ERROR_str -{ +typedef struct { unsigned char targetLogicalAddress; unsigned char protocolIdentifier; unsigned char reserved; @@ -385,11 +339,9 @@ struct Packet_TM_LFR_TC_EXE_ERROR_str unsigned char pkt_seq_control[2]; unsigned char tc_service; unsigned char tc_subtype; -}; -typedef struct Packet_TM_LFR_TC_EXE_ERROR_str Packet_TM_LFR_TC_EXE_ERROR_t; +} Packet_TM_LFR_TC_EXE_ERROR_t; -struct Packet_TM_LFR_TC_EXE_CORRUPTED_str -{ +typedef struct { unsigned char targetLogicalAddress; unsigned char protocolIdentifier; unsigned char reserved; @@ -414,11 +366,9 @@ struct Packet_TM_LFR_TC_EXE_CORRUPTED_st unsigned char pkt_datafieldsize_cnt[2]; unsigned char rcv_crc[2]; unsigned char computed_crc[2]; -}; -typedef struct Packet_TM_LFR_TC_EXE_CORRUPTED_str Packet_TM_LFR_TC_EXE_CORRUPTED_t; +} Packet_TM_LFR_TC_EXE_CORRUPTED_t; -struct Header_TM_LFR_SCIENCE_SWF_str -{ +typedef struct { unsigned char targetLogicalAddress; unsigned char protocolIdentifier; unsigned char reserved; @@ -439,11 +389,9 @@ struct Header_TM_LFR_SCIENCE_SWF_str unsigned char pktNr; unsigned char acquisitionTime[6]; unsigned char blkNr[2]; -}; -typedef struct Header_TM_LFR_SCIENCE_SWF_str Header_TM_LFR_SCIENCE_SWF_t; +} Header_TM_LFR_SCIENCE_SWF_t; -struct Header_TM_LFR_SCIENCE_CWF_str -{ +typedef struct { unsigned char targetLogicalAddress; unsigned char protocolIdentifier; unsigned char reserved; @@ -462,11 +410,9 @@ struct Header_TM_LFR_SCIENCE_CWF_str unsigned char hkBIA; unsigned char acquisitionTime[6]; unsigned char blkNr[2]; -}; -typedef struct Header_TM_LFR_SCIENCE_CWF_str Header_TM_LFR_SCIENCE_CWF_t; +} Header_TM_LFR_SCIENCE_CWF_t; -struct Header_TM_LFR_SCIENCE_ASM_str -{ +typedef struct { unsigned char targetLogicalAddress; unsigned char protocolIdentifier; unsigned char reserved; @@ -487,12 +433,10 @@ struct Header_TM_LFR_SCIENCE_ASM_str unsigned char nrASM; unsigned char acquisitionTime[6]; unsigned char blkNr[2]; -}; -typedef struct Header_TM_LFR_SCIENCE_ASM_str Header_TM_LFR_SCIENCE_ASM_t; +} Header_TM_LFR_SCIENCE_ASM_t; -struct ccsdsTelecommandPacket_str -{ - //unsigned char targetLogicalAddress; // removed by the grspw module +typedef struct { + //targetLogicalAddress is removed by the grspw module unsigned char protocolIdentifier; unsigned char reserved; unsigned char userApplication; @@ -505,11 +449,9 @@ struct ccsdsTelecommandPacket_str unsigned char serviceSubType; unsigned char sourceID; unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10]; -}; -typedef struct ccsdsTelecommandPacket_str ccsdsTelecommandPacket_t; +} ccsdsTelecommandPacket_t; -struct Packet_TM_LFR_HK_str -{ +typedef struct { unsigned char targetLogicalAddress; unsigned char protocolIdentifier; unsigned char reserved; @@ -607,11 +549,9 @@ struct Packet_TM_LFR_HK_str unsigned char hk_lfr_cpu_data_exception; unsigned char hk_lfr_cpu_div_exception; unsigned char hk_lfr_cpu_arith_overflow; -}; -typedef struct Packet_TM_LFR_HK_str Packet_TM_LFR_HK_t; +} Packet_TM_LFR_HK_t; -struct Packet_TM_LFR_PARAMETER_DUMP_str -{ +typedef struct { unsigned char targetLogicalAddress; unsigned char protocolIdentifier; unsigned char reserved; @@ -654,8 +594,7 @@ struct Packet_TM_LFR_PARAMETER_DUMP_str // SBM2 PARAMETERS unsigned char sy_lfr_s2_bp_p0; unsigned char sy_lfr_s2_bp_p1; -}; -typedef struct Packet_TM_LFR_PARAMETER_DUMP_str Packet_TM_LFR_PARAMETER_DUMP_t; +} Packet_TM_LFR_PARAMETER_DUMP_t; #endif // CCSDS_TYPES_H_INCLUDED diff --git a/header/fsw_init.h b/header/fsw_init.h --- a/header/fsw_init.h +++ b/header/fsw_init.h @@ -12,22 +12,6 @@ #include "fsw_spacewire.h" -extern rtems_name misc_name[5]; -extern rtems_id misc_id[5]; -extern rtems_name Task_name[20]; /* array of task names */ -extern rtems_id Task_id[20]; /* array of task ids */ -extern unsigned int maxCount; -extern int fdSPW; // grspw file descriptor -extern int fdUART; // uart file descriptor -extern unsigned char lfrCurrentMode; - -// MODE PARAMETERS -extern struct param_local_str param_local; -extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; -extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; -extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; -extern unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID]; - // RTEMS TASKS rtems_task Init( rtems_task_argument argument); @@ -47,6 +31,5 @@ extern int rtems_cpu_usage_reset( void ) extern void rtems_stack_checker_report_usage( void ); extern int sched_yield( void ); -extern int errno; #endif // FSW_INIT_H_INCLUDED diff --git a/header/fsw_misc.h b/header/fsw_misc.h --- a/header/fsw_misc.h +++ b/header/fsw_misc.h @@ -11,15 +11,15 @@ rtems_name name_hk_rate_monotonic; // name of the HK rate monotonic rtems_id HK_id; // id of the HK rate monotonic period -extern rtems_name misc_name[5]; -time_management_regs_t *time_management_regs; -extern Packet_TM_LFR_HK_t housekeeping_packet; +//extern rtems_name misc_name[5]; +//time_management_regs_t *time_management_regs; +//extern Packet_TM_LFR_HK_t housekeeping_packet; -int configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider, +void configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider, unsigned char interrupt_level, rtems_isr (*timer_isr)() ); -int timer_start( gptimer_regs_t *gptimer_regs, unsigned char timer ); -int timer_stop( gptimer_regs_t *gptimer_regs, unsigned char timer ); -int timer_set_clock_divider(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider); +void timer_start( gptimer_regs_t *gptimer_regs, unsigned char timer ); +void timer_stop( gptimer_regs_t *gptimer_regs, unsigned char timer ); +void timer_set_clock_divider(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider); // SERIAL LINK int send_console_outputs_on_apbuart_port( void ); diff --git a/header/fsw_params_nb_bytes.h b/header/fsw_params_nb_bytes.h new file mode 100644 --- /dev/null +++ b/header/fsw_params_nb_bytes.h @@ -0,0 +1,22 @@ +#ifndef TM_BYTE_POSITIONS_H +#define TM_BYTE_POSITIONS_H + +#define BYTE_POS_CP_LFR_MODE 11 + +// TC_LFR_LOAD_COMMON_PAR + +// TC_LFR_LOAD_NORMAL_PAR +#define BYTE_POS_SY_LFR_N_SWF_L 0 +#define BYTE_POS_SY_LFR_N_SWF_P 2 +#define BYTE_POS_SY_LFR_N_ASM_P 4 +#define BYTE_POS_SY_LFR_N_BP_P0 6 +#define BYTE_POS_SY_LFR_N_BP_P1 7 + +// TC_LFR_LOAD_BURST_PAR + +// TC_LFR_LOAD_SBM1_PAR + +// TC_LFR_LOAD_SBM2_PAR + + +#endif // TM_BYTE_POSITIONS_H diff --git a/header/fsw_params_processing.h b/header/fsw_params_processing.h --- a/header/fsw_params_processing.h +++ b/header/fsw_params_processing.h @@ -3,8 +3,6 @@ #define NB_BINS_PER_SM 128 #define NB_VALUES_PER_SM 25 -//#define TOTAL_SIZE_SM (NB_BINS_PER_SM * NB_VALUES_PER_SM) -//#define SM_HEADER 4 #define TOTAL_SIZE_SM 0 #define SM_HEADER 0 @@ -15,7 +13,7 @@ #define NB_AVERAGE_NORMAL_f0 96*4 #define NB_SM_TO_RECEIVE_BEFORE_AVF0 8 -struct BP1_str{ +typedef struct { volatile unsigned char PE[2]; volatile unsigned char PB[2]; volatile unsigned char V0; @@ -23,7 +21,6 @@ struct BP1_str{ volatile unsigned char V2_ELLIP_DOP; volatile unsigned char SZ; volatile unsigned char VPHI; -}; -typedef struct BP1_str BP1_t; +} BP1_t; #endif // FSW_PARAMS_PROCESSING_H diff --git a/header/fsw_processing.h b/header/fsw_processing.h --- a/header/fsw_processing.h +++ b/header/fsw_processing.h @@ -11,7 +11,6 @@ #include "fsw_params.h" #include "fsw_spacewire.h" - extern volatile int spec_mat_f0_0[ ]; extern volatile int spec_mat_f0_1[ ]; extern volatile int spec_mat_f0_a[ ]; diff --git a/header/fsw_spacewire.h b/header/fsw_spacewire.h --- a/header/fsw_spacewire.h +++ b/header/fsw_spacewire.h @@ -14,8 +14,6 @@ extern spw_stats spacewire_stats; extern spw_stats spacewire_stats_backup; -extern Packet_TM_LFR_HK_t housekeeping_packet; -extern rtems_id Task_id[20]; /* array of task ids */ // RTEMS TASK rtems_task spiq_task( rtems_task_argument argument ); diff --git a/header/grlib_regs.h b/header/grlib_regs.h --- a/header/grlib_regs.h +++ b/header/grlib_regs.h @@ -18,34 +18,29 @@ struct ahbuart_regs_str{ volatile unsigned int scaler; }; -struct timer_regs_str -{ +typedef struct { volatile unsigned int counter; volatile unsigned int reload; volatile unsigned int ctrl; volatile unsigned int unused; -}; -typedef struct timer_regs_str timer_regs_t; +} timer_regs_t; -struct gptimer_regs_str -{ +typedef struct { volatile unsigned int scaler_value; volatile unsigned int scaler_reload; volatile unsigned int conf; volatile unsigned int unused0; timer_regs_t timer[NB_GPTIMER]; -}; -typedef struct gptimer_regs_str gptimer_regs_t; +} gptimer_regs_t; -struct time_management_regs_str{ +typedef struct { volatile int ctrl; // bit 0 forces the load of the coarse_time_load value and resets the fine_time volatile int coarse_time_load; volatile int coarse_time; volatile int fine_time; -}; -typedef struct time_management_regs_str time_management_regs_t; +} time_management_regs_t; -struct waveform_picker_regs_str{ +typedef struct { volatile int data_shaping; // 0x00 00 *** R1 R0 SP1 SP0 BW volatile int burst_enable; // 0x04 01 *** burst f2, f1, f0 enable f3, f2, f1, f0 volatile int addr_data_f0; // 0x08 10 *** @@ -58,36 +53,15 @@ struct waveform_picker_regs_str{ volatile int delta_f2_f0; // 0x24 0001 *** volatile int nb_burst_available;// 0x28 0010 *** volatile int nb_snapshot_param; // 0x2c 0011 *** -}; -typedef struct waveform_picker_regs_str waveform_picker_regs_t; +} waveform_picker_regs_t; -struct waveform_picker_regs_str_alt{ - volatile int data_shaping; // 0x00 00 *** R1 R0 SP1 SP0 BW - volatile int run_burst_enable; // 0x04 01 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ] - volatile int addr_data_f0; // 0x08 - volatile int addr_data_f1; // 0x0c - volatile int addr_data_f2; // 0x10 - volatile int addr_data_f3; // 0x14 - volatile int status; // 0x18 - volatile int delta_snapshot; // 0x1c - volatile int delta_f0; // 0x20 - volatile int delta_f0_2; - volatile int delta_f1; - volatile int delta_f2; - volatile int nb_data_by_buffer; - volatile int snapshot_param; - volatile int start_date; -}; -typedef struct waveform_picker_regs_str_alt waveform_picker_regs_t_alt; - -struct spectral_matrix_regs_str{ +typedef struct { volatile int config; volatile int status; volatile int matrixF0_Address0; volatile int matrixFO_Address1; volatile int matrixF1_Address; volatile int matrixF2_Address; -}; -typedef struct spectral_matrix_regs_str spectral_matrix_regs_t; +} spectral_matrix_regs_t; #endif // GRLIB_REGS_H_INCLUDED diff --git a/header/tc_handler.h b/header/tc_handler.h --- a/header/tc_handler.h +++ b/header/tc_handler.h @@ -10,17 +10,8 @@ #include "wf_handler.h" // MODE PARAMETERS -extern struct param_sbm1_str param_sbm1; -extern struct param_sbm2_str param_sbm2; -extern time_management_regs_t *time_management_regs; -extern waveform_picker_regs_t *waveform_picker_regs; -extern gptimer_regs_t *gptimer_regs; -extern rtems_name misc_name[5]; -extern rtems_id Task_id[20]; /* array of task ids */ -extern unsigned char lfrCurrentMode; extern unsigned int maxCount; - //**** // ISR rtems_isr commutation_isr1( rtems_vector_number vector ); @@ -42,7 +33,7 @@ int action_update_time(ccsdsTelecommandP // mode transition int transition_validation(unsigned char requestedMode); int stop_current_mode(); -int enter_mode(unsigned char mode, ccsdsTelecommandPacket_t *TC); +int enter_mode(unsigned char mode); int enter_standby_mode(); int enter_normal_mode(); int enter_burst_mode(); diff --git a/header/tc_load_dump_parameters.h b/header/tc_load_dump_parameters.h --- a/header/tc_load_dump_parameters.h +++ b/header/tc_load_dump_parameters.h @@ -9,11 +9,6 @@ #include "tm_lfr_tc_exe.h" #include "fsw_misc.h" -extern int fdSPW; -extern unsigned char lfrCurrentMode; -extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; -extern Packet_TM_LFR_HK_t housekeeping_packet; - int action_load_common_par( ccsdsTelecommandPacket_t *TC ); int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); diff --git a/header/tm_lfr_tc_exe.h b/header/tm_lfr_tc_exe.h --- a/header/tm_lfr_tc_exe.h +++ b/header/tm_lfr_tc_exe.h @@ -7,8 +7,6 @@ #include "fsw_params.h" #include "fsw_spacewire.h" -extern time_management_regs_t *time_management_regs; -extern Packet_TM_LFR_HK_t housekeeping_packet; extern unsigned short sequenceCounters_TC_EXE[]; int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time); diff --git a/header/wf_handler.h b/header/wf_handler.h --- a/header/wf_handler.h +++ b/header/wf_handler.h @@ -27,7 +27,6 @@ extern volatile int wf_cont_f3[ ]; extern volatile int wf_cont_f3_bis[ ]; extern char wf_cont_f3_light[ ]; extern waveform_picker_regs_t *waveform_picker_regs; -extern waveform_picker_regs_t_alt *waveform_picker_regs_alt; extern time_management_regs_t *time_management_regs; extern Packet_TM_LFR_HK_t housekeeping_packet; extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; @@ -77,11 +76,11 @@ void reset_waveform_picker_regs(); //***************** // local parameters -void set_local_sbm1_nb_cwf_max(); -void set_local_sbm2_nb_cwf_max(); -void set_local_nb_interrupt_f0_MAX(); -void reset_local_sbm1_nb_cwf_sent(); -void reset_local_sbm2_nb_cwf_sent(); +void set_local_sbm1_nb_cwf_max( void ); +void set_local_sbm2_nb_cwf_max( void ); +void set_local_nb_interrupt_f0_MAX( void ); +void reset_local_sbm1_nb_cwf_sent( void ); +void reset_local_sbm2_nb_cwf_sent( void ); void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ); diff --git a/src/fsw_globals.c b/src/fsw_globals.c --- a/src/fsw_globals.c +++ b/src/fsw_globals.c @@ -37,7 +37,6 @@ gptimer_regs_t *gptimer_regs #ifdef GSA #else waveform_picker_regs_t *waveform_picker_regs = (waveform_picker_regs_t*) REGS_ADDR_WAVEFORM_PICKER; - waveform_picker_regs_t_alt *waveform_picker_regs_alt = (waveform_picker_regs_t_alt*) REGS_ADDR_WAVEFORM_PICKER; #endif spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX; diff --git a/src/fsw_misc.c b/src/fsw_misc.c --- a/src/fsw_misc.c +++ b/src/fsw_misc.c @@ -7,16 +7,16 @@ #include "fsw_misc.h" -char *DumbMessages[7] = {"in DUMB *** default", // RTEMS_EVENT_0 - "in DUMB *** timecode_irq_handler", // RTEMS_EVENT_1 - "in DUMB *** waveforms_isr", // RTEMS_EVENT_2 - "in DUMB *** in SMIQ *** Error sending event to AVF0", // RTEMS_EVENT_3 - "in DUMB *** spectral_matrices_isr *** Error sending event to SMIQ", // RTEMS_EVENT_4 - "in DUMB *** waveforms_simulator_isr", // RTEMS_EVENT_5 - "ERR HK" // RTEMS_EVENT_6 -}; +//char *DumbMessages[7] = {"in DUMB *** default", // RTEMS_EVENT_0 +// "in DUMB *** timecode_irq_handler", // RTEMS_EVENT_1 +// "in DUMB *** waveforms_isr", // RTEMS_EVENT_2 +// "in DUMB *** in SMIQ *** Error sending event to AVF0", // RTEMS_EVENT_3 +// "in DUMB *** spectral_matrices_isr *** Error sending event to SMIQ", // RTEMS_EVENT_4 +// "in DUMB *** waveforms_simulator_isr", // RTEMS_EVENT_5 +// "ERR HK" // RTEMS_EVENT_6 +//}; -int configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider, +void configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider, unsigned char interrupt_level, rtems_isr (*timer_isr)() ) { /** This function configures a GPTIMER timer instantiated in the VHDL design. @@ -27,8 +27,6 @@ int configure_timer(gptimer_regs_t *gpti * @param interrupt_level is the interrupt level that the timer drives. * @param timer_isr is the interrupt subroutine that will be attached to the IRQ driven by the timer. * - * @return - * * Interrupt levels are described in the SPARC documentation sparcv8.pdf p.76 * */ @@ -43,19 +41,15 @@ int configure_timer(gptimer_regs_t *gpti } timer_set_clock_divider( gptimer_regs, timer, clock_divider); - - return 1; } -int timer_start(gptimer_regs_t *gptimer_regs, unsigned char timer) +void timer_start(gptimer_regs_t *gptimer_regs, unsigned char timer) { /** This function starts a GPTIMER timer. * * @param gptimer_regs points to the APB registers of the GPTIMER IP core. * @param timer is the number of the timer in the IP core (several timers can be instantiated). * - * @return 1 - * */ gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000010; // clear pending IRQ if any @@ -63,29 +57,23 @@ int timer_start(gptimer_regs_t *gptimer_ gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000001; // EN enable the timer gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000002; // RS restart gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000008; // IE interrupt enable - - return 1; } -int timer_stop(gptimer_regs_t *gptimer_regs, unsigned char timer) +void timer_stop(gptimer_regs_t *gptimer_regs, unsigned char timer) { /** This function stops a GPTIMER timer. * * @param gptimer_regs points to the APB registers of the GPTIMER IP core. * @param timer is the number of the timer in the IP core (several timers can be instantiated). * - * @return 1 - * */ gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl & 0xfffffffe; // EN enable the timer gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl & 0xffffffef; // IE interrupt enable gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000010; // clear pending IRQ if any - - return 1; } -int timer_set_clock_divider(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider) +void timer_set_clock_divider(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider) { /** This function sets the clock divider of a GPTIMER timer. * @@ -93,13 +81,9 @@ int timer_set_clock_divider(gptimer_regs * @param timer is the number of the timer in the IP core (several timers can be instantiated). * @param clock_divider is the divider of the 1 MHz clock that will be configured. * - * @return 1 - * */ gptimer_regs->timer[timer].reload = clock_divider; // base clock frequency is 1 MHz - - return 1; } int send_console_outputs_on_apbuart_port( void ) // Send the console outputs on the apbuart port @@ -247,6 +231,15 @@ rtems_task dumb_task( rtems_task_argumen unsigned int fine_time = 0; rtems_event_set event_out; + char *DumbMessages[7] = {"in DUMB *** default", // RTEMS_EVENT_0 + "in DUMB *** timecode_irq_handler", // RTEMS_EVENT_1 + "in DUMB *** waveforms_isr", // RTEMS_EVENT_2 + "in DUMB *** in SMIQ *** Error sending event to AVF0", // RTEMS_EVENT_3 + "in DUMB *** spectral_matrices_isr *** Error sending event to SMIQ", // RTEMS_EVENT_4 + "in DUMB *** waveforms_simulator_isr", // RTEMS_EVENT_5 + "ERR HK" // RTEMS_EVENT_6 + }; + BOOT_PRINTF("in DUMB *** \n") while(1){ @@ -296,6 +289,12 @@ void init_housekeeping_parameters( void void increment_seq_counter( unsigned char *packet_sequence_control) { + /** This function increment the sequence counter psased in argument. + * + * The increment does not affect the grouping flag. In case of an overflow, the counter is reset to 0. + * + */ + unsigned short sequence_cnt; unsigned short segmentation_grouping_flag; unsigned short new_packet_sequence_control; @@ -323,6 +322,10 @@ void increment_seq_counter( unsigned cha void getTime( unsigned char *time) { + /** This function write the current local time in the time buffer passed in argument. + * + */ + time[0] = (unsigned char) (time_management_regs->coarse_time>>24); time[1] = (unsigned char) (time_management_regs->coarse_time>>16); time[2] = (unsigned char) (time_management_regs->coarse_time>>8); diff --git a/src/fsw_processing.c b/src/fsw_processing.c --- a/src/fsw_processing.c +++ b/src/fsw_processing.c @@ -11,7 +11,6 @@ #include "fsw_processing_globals.c" -unsigned char LFR_BP1_F0[ NB_BINS_COMPRESSED_SM_F0 * 9 ]; BP1_t data_BP1[ NB_BINS_COMPRESSED_SM_F0 ]; float averaged_spec_mat_f0[ TOTAL_SIZE_SM ]; char averaged_spec_mat_f0_char[ TOTAL_SIZE_SM * 2 ]; @@ -119,26 +118,6 @@ rtems_task smiq_task(rtems_task_argument } } -//rtems_task smiq_task(rtems_task_argument argument) // process the Spectral Matrices IRQ -//{ -// rtems_event_set event_out; -// unsigned int nb_interrupt_f0 = 0; - -// PRINTF("in SMIQ *** \n") - -// while(1){ -// rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0 -// nb_interrupt_f0 = nb_interrupt_f0 + 1; -// if (nb_interrupt_f0 == param_local.local_nb_interrupt_f0_MAX ){ -// if (rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) -// { -// rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); -// } -// nb_interrupt_f0 = 0; -// } -// } -//} - rtems_task spw_bppr_task(rtems_task_argument argument) { rtems_status_code status; @@ -188,6 +167,7 @@ rtems_task avf0_task(rtems_task_argument rtems_task bpf0_task(rtems_task_argument argument) { rtems_event_set event_out; + static unsigned char LFR_BP1_F0[ NB_BINS_COMPRESSED_SM_F0 * 9 ]; BOOT_PRINTF("in BPFO *** \n") @@ -195,7 +175,6 @@ rtems_task bpf0_task(rtems_task_argument rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0 matrix_compression(averaged_spec_mat_f0, 0, compressed_spec_mat_f0); BP1_set(compressed_spec_mat_f0, NB_BINS_COMPRESSED_SM_F0, LFR_BP1_F0); - //PRINTF("IN TASK BPF0 *** Matrix compressed, parameters calculated\n") } } @@ -237,10 +216,10 @@ rtems_task matr_task(rtems_task_argument void matrix_reset(volatile float *averaged_spec_mat) { -// int i; -// for(i=0; ipacketID[0]; housekeeping_packet.hk_lfr_last_exe_tc_id[1] = TC->packetID[1]; housekeeping_packet.hk_lfr_last_exe_tc_type[0] = 0x00; @@ -697,6 +772,13 @@ void update_last_TC_exe(ccsdsTelecommand void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char *time) { + /** This function is used to update the HK packets statistics after a TC rejection. + * + * @param TC points to the TC being processed + * @param time is the time used to date the TC rejection + * + */ + housekeeping_packet.hk_lfr_last_rej_tc_id[0] = TC->packetID[0]; housekeeping_packet.hk_lfr_last_rej_tc_id[1] = TC->packetID[1]; housekeeping_packet.hk_lfr_last_rej_tc_type[0] = 0x00; @@ -713,6 +795,15 @@ void update_last_TC_rej(ccsdsTelecommand void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id, unsigned char *time) { + /** This function is the last step of the TC execution workflow. + * + * @param TC points to the TC being processed + * @param result is the result of the TC execution (LFR_SUCCESSFUL / LFR_DEFAULT) + * @param queue_id is the id of the RTEMS message queue used to send TM packets + * @param time is the time used to date the TC execution + * + */ + unsigned int val = 0; if (result == LFR_SUCCESSFUL) diff --git a/src/tm_lfr_tc_exe.c b/src/tm_lfr_tc_exe.c --- a/src/tm_lfr_tc_exe.c +++ b/src/tm_lfr_tc_exe.c @@ -416,6 +416,15 @@ int send_tm_lfr_tc_exe_corrupted(ccsdsTe void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id ) { + /** This function increment the packet sequence control parameter of a TC, depending on its destination ID. + * + * @param packet_sequence_control points to the packet sequence control which will be incremented + * @param destination_id is the destination ID of the TM, there is one counter by destination ID + * + * If the destination ID is not known, a dedicated counter is incremented. + * + */ + unsigned short sequence_cnt; unsigned short segmentation_grouping_flag; unsigned short new_packet_sequence_control; diff --git a/src/wf_handler.c b/src/wf_handler.c --- a/src/wf_handler.c +++ b/src/wf_handler.c @@ -1095,7 +1095,7 @@ void reset_waveform_picker_regs() //***************** // local parameters -void set_local_sbm1_nb_cwf_max() +void set_local_sbm1_nb_cwf_max( void ) { /** This function sets the value of the sbm1_nb_cwf_max local parameter. * @@ -1109,7 +1109,7 @@ void set_local_sbm1_nb_cwf_max() + parameter_dump_packet.sy_lfr_n_swf_p[1]) - 8; // 16 CWF1 parts during 1 SWF2 } -void set_local_sbm2_nb_cwf_max() +void set_local_sbm2_nb_cwf_max(void) { /** This function sets the value of the sbm1_nb_cwf_max local parameter. * @@ -1123,7 +1123,7 @@ void set_local_sbm2_nb_cwf_max() + parameter_dump_packet.sy_lfr_n_swf_p[1]) / 8; } -void set_local_nb_interrupt_f0_MAX() +void set_local_nb_interrupt_f0_MAX( void ) { /** This function sets the value of the nb_interrupt_f0_MAX local parameter. * @@ -1137,7 +1137,7 @@ void set_local_nb_interrupt_f0_MAX() + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100; } -void reset_local_sbm1_nb_cwf_sent() +void reset_local_sbm1_nb_cwf_sent( void ) { /** This function resets the value of the sbm1_nb_cwf_sent local parameter. * @@ -1149,7 +1149,7 @@ void reset_local_sbm1_nb_cwf_sent() param_local.local_sbm1_nb_cwf_sent = 0; } -void reset_local_sbm2_nb_cwf_sent() +void reset_local_sbm2_nb_cwf_sent( void ) { /** This function resets the value of the sbm2_nb_cwf_sent local parameter. *