##// END OF EJS Templates
TM_LFR_TC_EXE packet sending reworked...
paul -
r37:ce861ac72296 default
parent child
Show More
@@ -0,0 +1,6
1 #ifndef TM_BYTE_POSITIONS_H
2 #define TM_BYTE_POSITIONS_H
3
4 #define BYTE_POS_CP_LFR_MODE 11
5
6 #endif // TM_BYTE_POSITIONS_H
@@ -1,233 +1,233
1 1 #############################################################################
2 2 # Makefile for building: bin/fsw
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Oct 10 08:47:12 2013
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Oct 10 15:46:11 2013
4 4 # Project: fsw-qt.pro
5 5 # Template: app
6 6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
7 7 #############################################################################
8 8
9 9 ####### Compiler, tools and options
10 10
11 11 CC = sparc-rtems-gcc
12 12 CXX = sparc-rtems-g++
13 13 DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=14 -DPRINT_MESSAGES_ON_CONSOLE
14 14 CFLAGS = -pipe -O3 -Wall $(DEFINES)
15 15 CXXFLAGS = -pipe -O3 -Wall $(DEFINES)
16 16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header
17 17 LINK = sparc-rtems-g++
18 18 LFLAGS =
19 19 LIBS = $(SUBLIBS)
20 20 AR = sparc-rtems-ar rcs
21 21 RANLIB =
22 22 QMAKE = /usr/bin/qmake-qt4
23 23 TAR = tar -cf
24 24 COMPRESS = gzip -9f
25 25 COPY = cp -f
26 26 SED = sed
27 27 COPY_FILE = $(COPY)
28 28 COPY_DIR = $(COPY) -r
29 29 STRIP = sparc-rtems-strip
30 30 INSTALL_FILE = install -m 644 -p
31 31 INSTALL_DIR = $(COPY_DIR)
32 32 INSTALL_PROGRAM = install -m 755 -p
33 33 DEL_FILE = rm -f
34 34 SYMLINK = ln -f -s
35 35 DEL_DIR = rmdir
36 36 MOVE = mv -f
37 37 CHK_DIR_EXISTS= test -d
38 38 MKDIR = mkdir -p
39 39
40 40 ####### Output directory
41 41
42 42 OBJECTS_DIR = obj/
43 43
44 44 ####### Files
45 45
46 46 SOURCES = ../src/wf_handler.c \
47 47 ../src/tc_handler.c \
48 48 ../src/fsw_processing.c \
49 49 ../src/fsw_misc.c \
50 50 ../src/fsw_init.c \
51 51 ../src/fsw_globals.c \
52 52 ../src/fsw_spacewire.c
53 53 OBJECTS = obj/wf_handler.o \
54 54 obj/tc_handler.o \
55 55 obj/fsw_processing.o \
56 56 obj/fsw_misc.o \
57 57 obj/fsw_init.o \
58 58 obj/fsw_globals.o \
59 59 obj/fsw_spacewire.o
60 60 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
61 61 /usr/lib64/qt4/mkspecs/common/linux.conf \
62 62 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
63 63 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
64 64 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
65 65 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
66 66 /usr/lib64/qt4/mkspecs/qconfig.pri \
67 67 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
68 68 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
69 69 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
70 70 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
71 71 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
72 72 sparc.pri \
73 73 /usr/lib64/qt4/mkspecs/features/release.prf \
74 74 /usr/lib64/qt4/mkspecs/features/default_post.prf \
75 75 /usr/lib64/qt4/mkspecs/features/shared.prf \
76 76 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
77 77 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
78 78 /usr/lib64/qt4/mkspecs/features/resources.prf \
79 79 /usr/lib64/qt4/mkspecs/features/uic.prf \
80 80 /usr/lib64/qt4/mkspecs/features/yacc.prf \
81 81 /usr/lib64/qt4/mkspecs/features/lex.prf \
82 82 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
83 83 fsw-qt.pro
84 84 QMAKE_TARGET = fsw
85 85 DESTDIR = bin/
86 86 TARGET = bin/fsw
87 87
88 88 first: all
89 89 ####### Implicit rules
90 90
91 91 .SUFFIXES: .o .c .cpp .cc .cxx .C
92 92
93 93 .cpp.o:
94 94 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
95 95
96 96 .cc.o:
97 97 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
98 98
99 99 .cxx.o:
100 100 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
101 101
102 102 .C.o:
103 103 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
104 104
105 105 .c.o:
106 106 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
107 107
108 108 ####### Build rules
109 109
110 110 all: Makefile $(TARGET)
111 111
112 112 $(TARGET): $(OBJECTS)
113 113 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
114 114 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
115 115
116 116 Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
117 117 /usr/lib64/qt4/mkspecs/common/linux.conf \
118 118 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
119 119 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
120 120 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
121 121 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
122 122 /usr/lib64/qt4/mkspecs/qconfig.pri \
123 123 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
124 124 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
125 125 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
126 126 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
127 127 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
128 128 sparc.pri \
129 129 /usr/lib64/qt4/mkspecs/features/release.prf \
130 130 /usr/lib64/qt4/mkspecs/features/default_post.prf \
131 131 /usr/lib64/qt4/mkspecs/features/shared.prf \
132 132 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
133 133 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
134 134 /usr/lib64/qt4/mkspecs/features/resources.prf \
135 135 /usr/lib64/qt4/mkspecs/features/uic.prf \
136 136 /usr/lib64/qt4/mkspecs/features/yacc.prf \
137 137 /usr/lib64/qt4/mkspecs/features/lex.prf \
138 138 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf
139 139 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
140 140 /usr/lib64/qt4/mkspecs/common/unix.conf:
141 141 /usr/lib64/qt4/mkspecs/common/linux.conf:
142 142 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
143 143 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
144 144 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
145 145 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
146 146 /usr/lib64/qt4/mkspecs/qconfig.pri:
147 147 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
148 148 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
149 149 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
150 150 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
151 151 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
152 152 sparc.pri:
153 153 /usr/lib64/qt4/mkspecs/features/release.prf:
154 154 /usr/lib64/qt4/mkspecs/features/default_post.prf:
155 155 /usr/lib64/qt4/mkspecs/features/shared.prf:
156 156 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
157 157 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
158 158 /usr/lib64/qt4/mkspecs/features/resources.prf:
159 159 /usr/lib64/qt4/mkspecs/features/uic.prf:
160 160 /usr/lib64/qt4/mkspecs/features/yacc.prf:
161 161 /usr/lib64/qt4/mkspecs/features/lex.prf:
162 162 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
163 163 qmake: FORCE
164 164 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
165 165
166 166 dist:
167 167 @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0
168 168 $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw1.0.0/ && (cd `dirname obj/fsw1.0.0` && $(TAR) fsw1.0.0.tar fsw1.0.0 && $(COMPRESS) fsw1.0.0.tar) && $(MOVE) `dirname obj/fsw1.0.0`/fsw1.0.0.tar.gz . && $(DEL_FILE) -r obj/fsw1.0.0
169 169
170 170
171 171 clean:compiler_clean
172 172 -$(DEL_FILE) $(OBJECTS)
173 173 -$(DEL_FILE) *~ core *.core
174 174
175 175
176 176 ####### Sub-libraries
177 177
178 178 distclean: clean
179 179 -$(DEL_FILE) $(TARGET)
180 180 -$(DEL_FILE) Makefile
181 181
182 182
183 183 grmon:
184 184 cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u
185 185
186 186 check: first
187 187
188 188 compiler_rcc_make_all:
189 189 compiler_rcc_clean:
190 190 compiler_uic_make_all:
191 191 compiler_uic_clean:
192 192 compiler_image_collection_make_all: qmake_image_collection.cpp
193 193 compiler_image_collection_clean:
194 194 -$(DEL_FILE) qmake_image_collection.cpp
195 195 compiler_yacc_decl_make_all:
196 196 compiler_yacc_decl_clean:
197 197 compiler_yacc_impl_make_all:
198 198 compiler_yacc_impl_clean:
199 199 compiler_lex_make_all:
200 200 compiler_lex_clean:
201 201 compiler_clean:
202 202
203 203 ####### Compile
204 204
205 205 obj/wf_handler.o: ../src/wf_handler.c
206 206 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c
207 207
208 208 obj/tc_handler.o: ../src/tc_handler.c
209 209 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c
210 210
211 211 obj/fsw_processing.o: ../src/fsw_processing.c
212 212 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c
213 213
214 214 obj/fsw_misc.o: ../src/fsw_misc.c
215 215 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c
216 216
217 217 obj/fsw_init.o: ../src/fsw_init.c
218 218 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c
219 219
220 220 obj/fsw_globals.o: ../src/fsw_globals.c
221 221 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c
222 222
223 223 obj/fsw_spacewire.o: ../src/fsw_spacewire.c
224 224 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c
225 225
226 226 ####### Install
227 227
228 228 install: FORCE
229 229
230 230 uninstall: FORCE
231 231
232 232 FORCE:
233 233
1 NO CONTENT: modified file, binary diff hidden
@@ -1,62 +1,63
1 1 TEMPLATE = app
2 2 # CONFIG += console v8 sim
3 3 # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** gsa
4 4 CONFIG += console verbose
5 5 CONFIG -= qt
6 6
7 7 include(./sparc.pri)
8 8
9 9 # flight software version
10 10 SWVERSION=-0-14
11 11 DEFINES += SW_VERSION_N1=0
12 12 DEFINES += SW_VERSION_N2=0
13 13 DEFINES += SW_VERSION_N3=0
14 14 DEFINES += SW_VERSION_N4=14
15 15
16 16 contains( CONFIG, verbose ) {
17 17 DEFINES += PRINT_MESSAGES_ON_CONSOLE
18 18 }
19 19
20 20 contains( CONFIG, cpu_usage_report ) {
21 21 DEFINES += PRINT_TASK_STATISTICS
22 22 }
23 23
24 24 contains( CONFIG, stack_report ) {
25 25 DEFINES += PRINT_STACK_REPORT
26 26 }
27 27
28 28 contains( CONFIG, boot_messages ) {
29 29 DEFINES += BOOT_MESSAGES
30 30 }
31 31
32 32 TARGET = fsw
33 33 contains( CONFIG, gsa ) {
34 34 DEFINES += GSA
35 35 TARGET = fsw-gsa
36 36 }
37 37
38 38 INCLUDEPATH += \
39 39 ../src \
40 40 ../header
41 41
42 42 SOURCES += \
43 43 ../src/wf_handler.c \
44 44 ../src/tc_handler.c \
45 45 ../src/fsw_processing.c \
46 46 ../src/fsw_misc.c \
47 47 ../src/fsw_init.c \
48 48 ../src/fsw_globals.c \
49 49 ../src/fsw_spacewire.c
50 50
51 51 HEADERS += \
52 52 ../header/wf_handler.h \
53 53 ../header/tc_handler.h \
54 54 ../header/grlib_regs.h \
55 55 ../header/fsw_processing.h \
56 56 ../header/fsw_params.h \
57 57 ../header/fsw_misc.h \
58 58 ../header/fsw_init.h \
59 59 ../header/ccsds_types.h \
60 60 ../header/fsw_params_processing.h \
61 ../header/fsw_spacewire.h
61 ../header/fsw_spacewire.h \
62 ../header/tm_byte_positions.h
62 63
@@ -1,508 +1,633
1 1 #ifndef CCSDS_H_INCLUDED
2 2 #define CCSDS_H_INCLUDED
3 3
4 4 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
5 5 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
6 6 #define CCSDS_TM_PKT_MAX_SIZE 4412
7 7 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
8 8 #define CCSDS_TC_PKT_MAX_SIZE 256
9 9 #define CCSDS_TC_PKT_MIN_SIZE 16
10 10 #define CCSDS_TC_TM_PACKET_OFFSET 7
11 11 #define CCSDS_PROCESS_ID 76
12 12 #define CCSDS_PACKET_CATEGORY 12
13 13 #define CCSDS_NODE_ADDRESS 0xfe
14 14 #define CCSDS_USER_APP 0x00
15 15
16 16 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
17 17 #define DEFAULT_RESERVED 0x00
18 18 #define DEFAULT_HKBIA 0x1e // 0001 1110
19 19
20 20 // PACKET ID
21 21 #define TM_PACKET_ID_TC_EXE 0x0cc1 // PID 76 CAT 1
22 22 #define TM_PACKET_ID_HK 0x0cc4 // PID 76 CAT 4
23 23 #define TM_PACKET_ID_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9
24 24 #define TM_PACKET_ID_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
25 25 #define TM_PACKET_ID_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
26 26 #define TM_PACKET_PID_DEFAULT 76
27 27 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
28 28 #define TM_PACKET_CAT_TC_EXE 1
29 29 #define TM_PACKET_CAT_HK 4
30 30 #define TM_PACKET_CAT_PARAMETER_DUMP 9
31 31 #define TM_PACKET_CAT_SCIENCE 12
32 32
33 33 // PACKET SEQUENCE CONTROL
34 34 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
35 35 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
36 36 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
37 37 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
38 38 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
39 39
40 40 // DESTINATION ID
41 41 #define TM_DESTINATION_ID_GROUND 0
42 42 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
43 43 #define TM_DESTINATION_ID_TC_SEQUENCES 111
44 44 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
45 45 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
46 46 #define TM_DESTINATION_ID_DIRECT_CMD 120
47 47 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
48 48 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
49 49 #define TM_DESTINATION_ID_OBCP 15
50 50 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
51 51 #define TM_DESTINATION_ID_AOCS 11
52 52
53 53 #define CCSDS_DESTINATION_ID 0x01
54 54 #define CCSDS_PROTOCOLE_ID 0x02
55 55 #define CCSDS_RESERVED 0x00
56 56 #define CCSDS_USER_APP 0x00
57 57
58 58 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
59 59 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
60 60 #define SIZE_HK_PARAMETERS 112
61 61
62 62 // TC TYPES
63 63 #define TC_TYPE_GEN 181
64 64 #define TC_TYPE_TIME 9
65 65
66 66 // TC SUBTYPES
67 67 #define TC_SUBTYPE_RESET 1
68 68 #define TC_SUBTYPE_LOAD_COMM 11
69 69 #define TC_SUBTYPE_LOAD_NORM 13
70 70 #define TC_SUBTYPE_LOAD_BURST 19
71 71 #define TC_SUBTYPE_LOAD_SBM1 25
72 72 #define TC_SUBTYPE_LOAD_SBM2 27
73 73 #define TC_SUBTYPE_DUMP 31
74 74 #define TC_SUBTYPE_ENTER 41
75 75 #define TC_SUBTYPE_UPDT_INFO 51
76 76 #define TC_SUBTYPE_EN_CAL 61
77 77 #define TC_SUBTYPE_DIS_CAL 63
78 78 #define TC_SUBTYPE_UPDT_TIME 129
79 79
80 80 // TC LEN
81 81 #define TC_LEN_RESET 12
82 82 #define TC_LEN_LOAD_COMM 14
83 83 #define TC_LEN_LOAD_NORM 20
84 84 #define TC_LEN_LOAD_BURST 14
85 85 #define TC_LEN_LOAD_SBM1 14
86 86 #define TC_LEN_LOAD_SBM2 14
87 87 #define TC_LEN_DUMP 12
88 88 #define TC_LEN_ENTER 20
89 89 #define TC_LEN_UPDT_INFO 48
90 90 #define TC_LEN_EN_CAL 12
91 91 #define TC_LEN_DIS_CAL 12
92 92 #define TC_LEN_UPDT_TIME 18
93 93
94 94 // TM TYPES
95 95 #define TM_TYPE_TC_EXE 1
96 96 #define TM_TYPE_HK 3
97 97 #define TM_TYPE_PARAMETER_DUMP 3
98 98 #define TM_TYPE_LFR_SCIENCE 21
99 99
100 100 // TM SUBTYPES
101 101 #define TM_SUBTYPE_EXE_OK 7
102 102 #define TM_SUBTYPE_EXE_NOK 8
103 103 #define TM_SUBTYPE_HK 25
104 104 #define TM_SUBTYPE_PARAMETER_DUMP 25
105 105 #define TM_SUBTYPE_SCIENCE 3
106 106 #define TM_SUBTYPE_LFR_SCIENCE 3
107 107
108 108 // FAILURE CODES
109 109 #define ILLEGAL_APID 0
110 110 #define WRONG_LEN_PACKET 1
111 111 #define INCOR_CHECKSUM 2
112 112 #define ILL_TYPE 3
113 113 #define ILL_SUBTYPE 4
114 114 #define WRONG_APP_DATA 5
115 115 //
116 116 #define WRONG_CMD_CODE 6
117 117 #define CCSDS_TM_VALID 7
118 118 #define FAILURE_CODE_INCONSISTENT 5 // 0x00 0x05
119 119 #define FAILURE_CODE_NOT_EXECUTABLE 42000 // 0xa4 0x10
120 120 #define FAILURE_CODE_NOT_IMPLEMENTED 42002 // 0xa4 0x12
121 121 #define FAILURE_CODE_ERROR 42003 // 0xa4 0x13
122 122 #define FAILURE_CODE_CORRUPTED 42005 // 0xa4 0x15
123 123
124 124 // TM SID
125 125 #define SID_DEFAULT 0
126 126 #define SID_EXE_INC 5
127 127 #define SID_NOT_EXE 42000 // 0xa4 0x10
128 128 #define SID_NOT_IMP 42002 // 0xa4 0x12
129 129 #define SID_EXE_ERR 42003 // 0xa4 0x13
130 130 #define SID_EXE_CORR 42005 // 0xa4 0x15
131 131 #define SID_HK 1
132 132 #define SID_PARAMETER_DUMP 10
133 133
134 134 #define SID_NORM_SWF_F0 3
135 135 #define SID_NORM_SWF_F1 4
136 136 #define SID_NORM_SWF_F2 5
137 137 #define SID_NORM_CWF_F3 1
138 138 #define SID_BURST_CWF_F2 2
139 139 #define SID_SBM1_CWF_F1 24
140 140 #define SID_SBM2_CWF_F2 25
141 141 #define SID_NORM_ASM_F0 11
142 142 #define SID_NORM_ASM_F1 12
143 143 #define SID_NORM_ASM_F2 13
144 144 #define SID_NORM_BP1_F0 14
145 145 #define SID_NORM_BP1_F1 15
146 146 #define SID_NORM_BP1_F2 16
147 147 #define SID_NORM_BP2_F0 19
148 148 #define SID_NORM_BP2_F1 20
149 149 #define SID_NORM_BP2_F2 21
150 150 #define SID_BURST_BP1_F0 17
151 151 #define SID_BURST_BP2_F0 22
152 152 #define SID_BURST_BP1_F1 18
153 153 #define SID_BURST_BP2_F1 23
154 154 #define SID_SBM1_BP1_F0 28
155 155 #define SID_SBM1_BP2_F0 31
156 156 #define SID_SBM2_BP1_F0 29
157 157 #define SID_SBM2_BP2_F0 32
158 158 #define SID_SBM2_BP1_F1 30
159 159 #define SID_SBM2_BP2_F1 33
160 160
161 161 // LENGTH (BYTES)
162 162 #define LENGTH_TM_LFR_TC_EXE_MAX 32
163 163 #define LENGTH_TM_LFR_HK 126
164 164
165 165 // HEADER_LENGTH
166 166 #define TM_HEADER_LEN 16
167 167 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28
168 168 // PACKET_LENGTH
169 169 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
170 170 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
171 171 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
172 172 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
173 173 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
174 174 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
175 175 #define PACKET_LENGTH_HK (126 - CCSDS_TC_TM_PACKET_OFFSET)
176 176 #define PACKET_LENGTH_PARAMETER_DUMP (34 - CCSDS_TC_TM_PACKET_OFFSET)
177 177 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM (TOTAL_SIZE_SM + HEADER_LENGTH_TM_LFR_SCIENCE_ASM - CCSDS_TC_TM_PACKET_OFFSET)
178 178
179 179 #define SPARE1_PUSVERSION_SPARE2 0x10
180 180
181 181 #define LEN_TM_LFR_HK 126 + 4
182 182 #define LEN_TM_LFR_TC_EXE_NOT_IMP 24 +4
183 183
184 184 #define TM_LEN_SCI_SWF_340 (340 * 12 + 10 + 12 - 1)
185 185 #define TM_LEN_SCI_SWF_8 (8 * 12 + 10 + 12 - 1)
186 186 #define TM_LEN_SCI_CWF_340 (340 * 12 + 10 + 10 - 1)
187 187 #define TM_LEN_SCI_CWF_8 (8 * 12 + 10 + 10 - 1)
188 188 #define DEFAULT_PKTCNT 0x07
189 189 #define BLK_NR_340 0x0154
190 190 #define BLK_NR_8 0x0008
191 191
192 192 enum TM_TYPE{
193 193 TM_LFR_TC_EXE_OK,
194 194 TM_LFR_TC_EXE_ERR,
195 195 TM_LFR_HK,
196 196 TM_LFR_SCI,
197 197 TM_LFR_SCI_SBM,
198 198 TM_LFR_PAR_DUMP
199 199 };
200 200
201 201 struct TMHeader_str
202 202 {
203 203 volatile unsigned char targetLogicalAddress;
204 204 volatile unsigned char protocolIdentifier;
205 205 volatile unsigned char reserved;
206 206 volatile unsigned char userApplication;
207 207 volatile unsigned char packetID[2];
208 208 volatile unsigned char packetSequenceControl[2];
209 209 volatile unsigned char packetLength[2];
210 210 // DATA FIELD HEADER
211 211 volatile unsigned char spare1_pusVersion_spare2;
212 212 volatile unsigned char serviceType;
213 213 volatile unsigned char serviceSubType;
214 214 volatile unsigned char destinationID;
215 215 volatile unsigned char time[6];
216 216 };
217 217 typedef struct TMHeader_str TMHeader_t;
218 218
219 219 struct Packet_TM_LFR_TC_EXE_str
220 220 {
221 221 volatile unsigned char targetLogicalAddress;
222 222 volatile unsigned char protocolIdentifier;
223 223 volatile unsigned char reserved;
224 224 volatile unsigned char userApplication;
225 225 volatile unsigned char packetID[2];
226 226 volatile unsigned char packetSequenceControl[2];
227 227 volatile unsigned char packetLength[2];
228 228 // DATA FIELD HEADER
229 229 volatile unsigned char spare1_pusVersion_spare2;
230 230 volatile unsigned char serviceType;
231 231 volatile unsigned char serviceSubType;
232 232 volatile unsigned char destinationID;
233 233 volatile unsigned char time[6];
234 234 volatile unsigned char data[LENGTH_TM_LFR_TC_EXE_MAX - 10 + 1];
235 235 };
236 236 typedef struct Packet_TM_LFR_TC_EXE_str Packet_TM_LFR_TC_EXE_t;
237 237
238 struct Packet_TM_LFR_TC_EXE_SUCCESS_str
239 {
240 volatile unsigned char targetLogicalAddress;
241 volatile unsigned char protocolIdentifier;
242 volatile unsigned char reserved;
243 volatile unsigned char userApplication;
244 // PACKET HEADER
245 volatile unsigned char packetID[2];
246 volatile unsigned char packetSequenceControl[2];
247 volatile unsigned char packetLength[2];
248 // DATA FIELD HEADER
249 volatile unsigned char spare1_pusVersion_spare2;
250 volatile unsigned char serviceType;
251 volatile unsigned char serviceSubType;
252 volatile unsigned char destinationID;
253 volatile unsigned char time[6];
254 //
255 volatile unsigned char telecommand_pkt_id[2];
256 volatile unsigned char pkt_seq_control[2];
257 };
258 typedef struct Packet_TM_LFR_TC_EXE_SUCCESS_str Packet_TM_LFR_TC_EXE_SUCCESS_t;
259
260 struct Packet_TM_LFR_TC_EXE_INCONSISTENT_str
261 {
262 volatile unsigned char targetLogicalAddress;
263 volatile unsigned char protocolIdentifier;
264 volatile unsigned char reserved;
265 volatile unsigned char userApplication;
266 // PACKET HEADER
267 volatile unsigned char packetID[2];
268 volatile unsigned char packetSequenceControl[2];
269 volatile unsigned char packetLength[2];
270 // DATA FIELD HEADER
271 volatile unsigned char spare1_pusVersion_spare2;
272 volatile unsigned char serviceType;
273 volatile unsigned char serviceSubType;
274 volatile unsigned char destinationID;
275 volatile unsigned char time[6];
276 //
277 volatile unsigned char tc_failure_code[2];
278 volatile unsigned char telecommand_pkt_id[2];
279 volatile unsigned char pkt_seq_control[2];
280 volatile unsigned char tc_service;
281 volatile unsigned char tc_subtype;
282 volatile unsigned char byte_position;
283 volatile unsigned char rcv_value;
284 };
285 typedef struct Packet_TM_LFR_TC_EXE_INCONSISTENT_str Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
286
287 struct Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_str
288 {
289 volatile unsigned char targetLogicalAddress;
290 volatile unsigned char protocolIdentifier;
291 volatile unsigned char reserved;
292 volatile unsigned char userApplication;
293 // PACKET HEADER
294 volatile unsigned char packetID[2];
295 volatile unsigned char packetSequenceControl[2];
296 volatile unsigned char packetLength[2];
297 // DATA FIELD HEADER
298 volatile unsigned char spare1_pusVersion_spare2;
299 volatile unsigned char serviceType;
300 volatile unsigned char serviceSubType;
301 volatile unsigned char destinationID;
302 volatile unsigned char time[6];
303 //
304 volatile unsigned char tc_failure_code[2];
305 volatile unsigned char telecommand_pkt_id[2];
306 volatile unsigned char pkt_seq_control[2];
307 volatile unsigned char tc_service;
308 volatile unsigned char tc_subtype;
309 volatile unsigned char lfr_status_word[2];
310 };
311 typedef struct Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_str Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
312
313 struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_str
314 {
315 volatile unsigned char targetLogicalAddress;
316 volatile unsigned char protocolIdentifier;
317 volatile unsigned char reserved;
318 volatile unsigned char userApplication;
319 // PACKET HEADER
320 volatile unsigned char packetID[2];
321 volatile unsigned char packetSequenceControl[2];
322 volatile unsigned char packetLength[2];
323 // DATA FIELD HEADER
324 volatile unsigned char spare1_pusVersion_spare2;
325 volatile unsigned char serviceType;
326 volatile unsigned char serviceSubType;
327 volatile unsigned char destinationID;
328 volatile unsigned char time[6];
329 //
330 volatile unsigned char tc_failure_code[2];
331 volatile unsigned char telecommand_pkt_id[2];
332 volatile unsigned char pkt_seq_control[2];
333 volatile unsigned char tc_service;
334 volatile unsigned char tc_subtype;
335 };
336 typedef struct Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_str Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
337
338 struct Packet_TM_LFR_TC_EXE_ERROR_str
339 {
340 volatile unsigned char targetLogicalAddress;
341 volatile unsigned char protocolIdentifier;
342 volatile unsigned char reserved;
343 volatile unsigned char userApplication;
344 // PACKET HEADER
345 volatile unsigned char packetID[2];
346 volatile unsigned char packetSequenceControl[2];
347 volatile unsigned char packetLength[2];
348 // DATA FIELD HEADER
349 volatile unsigned char spare1_pusVersion_spare2;
350 volatile unsigned char serviceType;
351 volatile unsigned char serviceSubType;
352 volatile unsigned char destinationID;
353 volatile unsigned char time[6];
354 //
355 volatile unsigned char tc_failure_code[2];
356 volatile unsigned char telecommand_pkt_id[2];
357 volatile unsigned char pkt_seq_control[2];
358 volatile unsigned char tc_service;
359 volatile unsigned char tc_subtype;
360 };
361 typedef struct Packet_TM_LFR_TC_EXE_ERROR_str Packet_TM_LFR_TC_EXE_ERROR_t;
362
238 363 struct Packet_TM_LFR_TC_EXE_CORRUPTED_str
239 364 {
240 365 volatile unsigned char targetLogicalAddress;
241 366 volatile unsigned char protocolIdentifier;
242 367 volatile unsigned char reserved;
243 368 volatile unsigned char userApplication;
244 369 // PACKET HEADER
245 370 volatile unsigned char packetID[2];
246 371 volatile unsigned char packetSequenceControl[2];
247 372 volatile unsigned char packetLength[2];
248 373 // DATA FIELD HEADER
249 374 volatile unsigned char spare1_pusVersion_spare2;
250 375 volatile unsigned char serviceType;
251 376 volatile unsigned char serviceSubType;
252 377 volatile unsigned char destinationID;
253 378 volatile unsigned char time[6];
254 379 //
255 380 volatile unsigned char tc_failure_code[2];
256 381 volatile unsigned char telecommand_pkt_id[2];
257 382 volatile unsigned char pkt_seq_control[2];
258 383 volatile unsigned char tc_service;
259 384 volatile unsigned char tc_subtype;
260 385 volatile unsigned char pkt_len_rcv_value[2];
261 386 volatile unsigned char pkt_datafieldsize_cnt[2];
262 387 volatile unsigned char rcv_crc[2];
263 388 volatile unsigned char computed_crc[2];
264 389 };
265 390 typedef struct Packet_TM_LFR_TC_EXE_CORRUPTED_str Packet_TM_LFR_TC_EXE_CORRUPTED_t;
266 391
267 392 struct Header_TM_LFR_SCIENCE_SWF_str
268 393 {
269 394 volatile unsigned char targetLogicalAddress;
270 395 volatile unsigned char protocolIdentifier;
271 396 volatile unsigned char reserved;
272 397 volatile unsigned char userApplication;
273 398 volatile unsigned char packetID[2];
274 399 volatile unsigned char packetSequenceControl[2];
275 400 volatile unsigned char packetLength[2];
276 401 // DATA FIELD HEADER
277 402 volatile unsigned char spare1_pusVersion_spare2;
278 403 volatile unsigned char serviceType;
279 404 volatile unsigned char serviceSubType;
280 405 volatile unsigned char destinationID;
281 406 volatile unsigned char time[6];
282 407 // AUXILIARY HEADER
283 408 volatile unsigned char sid;
284 409 volatile unsigned char hkBIA;
285 410 volatile unsigned char pktCnt;
286 411 volatile unsigned char pktNr;
287 412 volatile unsigned char acquisitionTime[6];
288 413 volatile unsigned char blkNr[2];
289 414 };
290 415 typedef struct Header_TM_LFR_SCIENCE_SWF_str Header_TM_LFR_SCIENCE_SWF_t;
291 416
292 417 struct Header_TM_LFR_SCIENCE_CWF_str
293 418 {
294 419 volatile unsigned char targetLogicalAddress;
295 420 volatile unsigned char protocolIdentifier;
296 421 volatile unsigned char reserved;
297 422 volatile unsigned char userApplication;
298 423 volatile unsigned char packetID[2];
299 424 volatile unsigned char packetSequenceControl[2];
300 425 volatile unsigned char packetLength[2];
301 426 // DATA FIELD HEADER
302 427 volatile unsigned char spare1_pusVersion_spare2;
303 428 volatile unsigned char serviceType;
304 429 volatile unsigned char serviceSubType;
305 430 volatile unsigned char destinationID;
306 431 volatile unsigned char time[6];
307 432 // AUXILIARY DATA HEADER
308 433 volatile unsigned char sid;
309 434 volatile unsigned char hkBIA;
310 435 volatile unsigned char acquisitionTime[6];
311 436 volatile unsigned char blkNr[2];
312 437 };
313 438 typedef struct Header_TM_LFR_SCIENCE_CWF_str Header_TM_LFR_SCIENCE_CWF_t;
314 439
315 440 struct Header_TM_LFR_SCIENCE_ASM_str
316 441 {
317 442 volatile unsigned char targetLogicalAddress;
318 443 volatile unsigned char protocolIdentifier;
319 444 volatile unsigned char reserved;
320 445 volatile unsigned char userApplication;
321 446 volatile unsigned char packetID[2];
322 447 volatile unsigned char packetSequenceControl[2];
323 448 volatile unsigned char packetLength[2];
324 449 // DATA FIELD HEADER
325 450 volatile unsigned char spare1_pusVersion_spare2;
326 451 volatile unsigned char serviceType;
327 452 volatile unsigned char serviceSubType;
328 453 volatile unsigned char destinationID;
329 454 volatile unsigned char time[6];
330 455 // AUXILIARY HEADER
331 456 volatile unsigned char sid;
332 457 volatile unsigned char biaStatusInfo;
333 458 volatile unsigned char cntASM;
334 459 volatile unsigned char nrASM;
335 460 volatile unsigned char acquisitionTime[6];
336 461 volatile unsigned char blkNr[2];
337 462 };
338 463 typedef struct Header_TM_LFR_SCIENCE_ASM_str Header_TM_LFR_SCIENCE_ASM_t;
339 464
340 465 struct ccsdsTelecommandPacket_str
341 466 {
342 467 //unsigned char targetLogicalAddress; // removed by the grspw module
343 468 volatile unsigned char protocolIdentifier;
344 469 volatile unsigned char reserved;
345 470 volatile unsigned char userApplication;
346 471 volatile unsigned char packetID[2];
347 472 volatile unsigned char packetSequenceControl[2];
348 473 volatile unsigned char packetLength[2];
349 474 // DATA FIELD HEADER
350 475 volatile unsigned char headerFlag_pusVersion_Ack;
351 476 volatile unsigned char serviceType;
352 477 volatile unsigned char serviceSubType;
353 478 volatile unsigned char sourceID;
354 479 volatile unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
355 480 };
356 481 typedef struct ccsdsTelecommandPacket_str ccsdsTelecommandPacket_t;
357 482
358 483 struct Packet_TM_LFR_HK_str
359 484 {
360 485 volatile unsigned char targetLogicalAddress;
361 486 volatile unsigned char protocolIdentifier;
362 487 volatile unsigned char reserved;
363 488 volatile unsigned char userApplication;
364 489 volatile unsigned char packetID[2];
365 490 volatile unsigned char packetSequenceControl[2];
366 491 volatile unsigned char packetLength[2];
367 492 volatile unsigned char spare1_pusVersion_spare2;
368 493 volatile unsigned char serviceType;
369 494 volatile unsigned char serviceSubType;
370 495 volatile unsigned char destinationID;
371 496 volatile unsigned char time[6];
372 497 volatile unsigned char sid;
373 498
374 499 //**************
375 500 // HK PARAMETERS
376 501 unsigned char lfr_status_word[2];
377 502 unsigned char lfr_sw_version[4];
378 503 // tc statistics
379 504 unsigned char hk_lfr_update_info_tc_cnt[2];
380 505 unsigned char hk_lfr_update_time_tc_cnt[2];
381 506 unsigned char hk_dpu_exe_tc_lfr_cnt[2];
382 507 unsigned char hk_dpu_rej_tc_lfr_cnt[2];
383 508 unsigned char hk_lfr_last_exe_tc_id[2];
384 509 unsigned char hk_lfr_last_exe_tc_type[2];
385 510 unsigned char hk_lfr_last_exe_tc_subtype[2];
386 511 unsigned char hk_lfr_last_exe_tc_time[6];
387 512 unsigned char hk_lfr_last_rej_tc_id[2];
388 513 unsigned char hk_lfr_last_rej_tc_type[2];
389 514 unsigned char hk_lfr_last_rej_tc_subtype[2];
390 515 unsigned char hk_lfr_last_rej_tc_time[6];
391 516 // anomaly statistics
392 517 unsigned char hk_lfr_le_cnt[2];
393 518 unsigned char hk_lfr_me_cnt[2];
394 519 unsigned char hk_lfr_he_cnt[2];
395 520 unsigned char hk_lfr_last_er_rid[2];
396 521 unsigned char hk_lfr_last_er_code;
397 522 unsigned char hk_lfr_last_er_time[6];
398 523 // vhdl_blk_status
399 524 unsigned char hk_lfr_vhdl_aa_sm;
400 525 unsigned char hk_lfr_vhdl_fft_sr;
401 526 unsigned char hk_lfr_vhdl_cic_hk;
402 527 unsigned char hk_lfr_vhdl_iir_cal;
403 528 // spacewire_if_statistics
404 529 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
405 530 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
406 531 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
407 532 unsigned char hk_lfr_dpu_spw_last_timc;
408 533 // ahb error statistics
409 534 unsigned int hk_lfr_last_fail_addr;
410 535 // temperatures
411 536 unsigned char hk_lfr_temp_scm[2];
412 537 unsigned char hk_lfr_temp_pcb[2];
413 538 unsigned char hk_lfr_temp_fpga[2];
414 539 // error counters
415 540 unsigned char hk_lfr_dpu_spw_parity;
416 541 unsigned char hk_lfr_dpu_spw_disconnect;
417 542 unsigned char hk_lfr_dpu_spw_escape;
418 543 unsigned char hk_lfr_dpu_spw_credit;
419 544 unsigned char hk_lfr_dpu_spw_write_sync;
420 545 unsigned char hk_lfr_dpu_spw_rx_ahb;
421 546 unsigned char hk_lfr_dpu_spw_tx_ahb;
422 547 unsigned char hk_lfr_dpu_spw_header_crc;
423 548 unsigned char hk_lfr_dpu_spw_data_crc;
424 549 unsigned char hk_lfr_dpu_spw_early_eop;
425 550 unsigned char hk_lfr_dpu_spw_invalid_addr;
426 551 unsigned char hk_lfr_dpu_spw_eep;
427 552 unsigned char hk_lfr_dpu_spw_rx_too_big;
428 553 // timecode
429 554 unsigned char hk_lfr_timecode_erroneous;
430 555 unsigned char hk_lfr_timecode_missing;
431 556 unsigned char hk_lfr_timecode_invalid;
432 557 // time
433 558 unsigned char hk_lfr_time_timecode_it;
434 559 unsigned char hk_lfr_time_not_synchro;
435 560 unsigned char hk_lfr_time_timecode_ctr;
436 561 // hk_lfr_buffer_dpu_
437 562 unsigned char hk_lfr_buffer_dpu_tc_fifo;
438 563 unsigned char hk_lfr_buffer_dpu_tm_fifo;
439 564 // hk_lfr_ahb_
440 565 unsigned char hk_lfr_ahb_correctable;
441 566 unsigned char hk_lfr_ahb_uncorrectable;
442 567 unsigned char hk_lfr_ahb_fails_trans;
443 568 // hk_lfr_adc_
444 569 unsigned char hk_lfr_adc_failure;
445 570 unsigned char hk_lfr_adc_timeout;
446 571 unsigned char hk_lfr_toomany_err;
447 572 // hk_lfr_cpu_
448 573 unsigned char hk_lfr_cpu_write_err;
449 574 unsigned char hk_lfr_cpu_ins_access_err;
450 575 unsigned char hk_lfr_cpu_illegal_ins;
451 576 unsigned char hk_lfr_cpu_privilegied_ins;
452 577 unsigned char hk_lfr_cpu_register_hw;
453 578 unsigned char hk_lfr_cpu_not_aligned;
454 579 unsigned char hk_lfr_cpu_data_exception;
455 580 unsigned char hk_lfr_cpu_div_exception;
456 581 unsigned char hk_lfr_cpu_arith_overflow;
457 582 };
458 583 typedef struct Packet_TM_LFR_HK_str Packet_TM_LFR_HK_t;
459 584
460 585 struct Packet_TM_LFR_PARAMETER_DUMP_str
461 586 {
462 587 volatile unsigned char targetLogicalAddress;
463 588 volatile unsigned char protocolIdentifier;
464 589 volatile unsigned char reserved;
465 590 volatile unsigned char userApplication;
466 591 volatile unsigned char packetID[2];
467 592 volatile unsigned char packetSequenceControl[2];
468 593 volatile unsigned char packetLength[2];
469 594 // DATA FIELD HEADER
470 595 volatile unsigned char spare1_pusVersion_spare2;
471 596 volatile unsigned char serviceType;
472 597 volatile unsigned char serviceSubType;
473 598 volatile unsigned char destinationID;
474 599 volatile unsigned char time[6];
475 600 volatile unsigned char sid;
476 601
477 602 //******************
478 603 // COMMON PARAMETERS
479 604 volatile unsigned char unused0;
480 605 volatile unsigned char bw_sp0_sp1_r0_r1;
481 606
482 607 //******************
483 608 // NORMAL PARAMETERS
484 609 volatile unsigned char sy_lfr_n_swf_l[2];
485 610 volatile unsigned char sy_lfr_n_swf_p[2];
486 611 volatile unsigned char sy_lfr_n_asm_p[2];
487 612 volatile unsigned char sy_lfr_n_bp_p0;
488 613 volatile unsigned char sy_lfr_n_bp_p1;
489 614
490 615 //*****************
491 616 // BURST PARAMETERS
492 617 volatile unsigned char sy_lfr_b_bp_p0;
493 618 volatile unsigned char sy_lfr_b_bp_p1;
494 619
495 620 //****************
496 621 // SBM1 PARAMETERS
497 622