Compare commits

...

195 Commits
v7.7.2 ... main

Author SHA1 Message Date
ea6dbb6454 Merge pull request 'prep v8.2.0' (#907) from prep-release into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #907
2024-06-26 15:49:20 +02:00
bfa9a3c1fe prep v8.2.0
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main Build queued...
2024-06-26 15:45:20 +02:00
0166ebb185 Merge pull request 'Different Rot Rate Source for Detumble' (#902) from use-different-rot-rate-for-detumble into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #902
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-06-26 15:36:31 +02:00
2ba1d0f629 Merge remote-tracking branch 'origin/main' into use-different-rot-rate-for-detumble
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-26 13:34:14 +02:00
ca14429a62 Merge pull request 'Adjust dataset frequency' (#906) from reduce-dataset-freq into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #906
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-06-26 13:30:34 +02:00
00ce2fe611 changelog
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-25 13:45:03 +02:00
64ec2ffd84 acs ctrl controller datasets to 30s at or below idle and 10s above idle
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-25 13:29:32 +02:00
30bb5d1ac7 str solution dataset to 30s 2024-06-25 13:17:43 +02:00
640e316e5e rw status dataset to 30s 2024-06-25 13:13:09 +02:00
fe4ef398ed gnss ctrl core dataset to 60s 2024-06-25 13:10:13 +02:00
09f282cfd5 mtq datasets to 60s 2024-06-25 13:09:02 +02:00
709be2cd24 acs ctrl sensor datasets to 60s 2024-06-25 13:05:50 +02:00
54e4d27fe1 this is cleaner
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-24 13:26:56 +02:00
ce7d1441de whoopsies
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-24 13:19:25 +02:00
6727950eac Merge branch 'main' into use-different-rot-rate-for-detumble
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-24 11:23:56 +02:00
5c951f3e49 Merge pull request 'might be an important fix' (#904) from possible-fix-mpsoc-take-pic into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #904
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-06-24 11:23:09 +02:00
c65ad4ab4f Merge branch 'main' into possible-fix-mpsoc-take-pic 2024-06-24 11:22:47 +02:00
8da305b247 changelog
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-24 11:18:49 +02:00
1731b21953 set quest to invalid if sun vector and mgm vector nearly align 2024-06-24 11:02:54 +02:00
4b99be7316 Merge branch 'main' into use-different-rot-rate-for-detumble 2024-06-24 10:59:32 +02:00
bfcd149574 Merge pull request 'SUS Ass B-Side as Nom' (#905) from change-sus-ass-to-b-side into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #905
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-06-20 10:55:49 +02:00
90701a0723 Merge branch 'main' into change-sus-ass-to-b-side
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-20 09:15:00 +02:00
1a9a054567 changelog 2024-06-20 09:10:50 +02:00
511f7275f2 sus ass b-side as nominal 2024-06-20 09:10:43 +02:00
80ce299d37 Merge pull request 'Use STR for MEKF as default' (#899) from allow-mekf-str into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #899
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-06-20 09:10:05 +02:00
6782b4394b Merge remote-tracking branch 'origin/main' into possible-fix-mpsoc-take-pic
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-17 16:12:12 +02:00
a35b28fc57 might be an important fix
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-17 16:09:55 +02:00
8034982067 and that one
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-12 17:04:13 +02:00
e44f1974cd missed that one
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
2024-06-12 16:53:35 +02:00
b47e8b1ddd fix enum
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
2024-06-12 16:45:33 +02:00
e305d77b32 changelog
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
2024-06-12 16:34:00 +02:00
abbbb0cabb make detumble relevant rotational rate always observable 2024-06-12 16:32:47 +02:00
f19b129609 changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-10 15:51:10 +02:00
f2d7f32952 changed source 2024-06-10 15:50:47 +02:00
e267b69045 Merge branch 'main' into allow-mekf-str
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-10 15:36:04 +02:00
60922ccc0d Merge pull request 'prepare patch release' (#901) from prep-patch-release into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #901
2024-06-05 13:29:59 +02:00
3ec0509bd4
prepare patch release
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
2024-06-05 13:28:08 +02:00
a73c36c237 Merge pull request 'MPSoC Update Retry Logic' (#900) from supv-retry-logic into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #900
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-06-05 13:27:18 +02:00
5dd0c2a5cb
let's not do that for now..
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-05 12:47:17 +02:00
1f8dc67922
some minor improvements
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-05 12:36:31 +02:00
e43a86432b start adding re-try logic for SUPV
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
2024-06-04 15:10:54 +02:00
585c49780f changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-06-04 11:25:07 +02:00
1429aa56a4 enable use of STR for MEKF by default 2024-06-04 11:23:50 +02:00
467ee0028a Merge pull request 'PLOC SUPV bugfix' (#898) from ploc-supv-bugfix into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #898
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-05-29 10:38:15 +02:00
98a92a6b88 Merge remote-tracking branch 'origin/main' into ploc-supv-bugfix
Some checks are pending
EIVE/eive-obsw/pipeline/pr-main Build queued...
2024-05-29 10:13:52 +02:00
e1f2514596 Merge pull request 'Fix MEKF Inits' (#896) from fix-mekf-inits into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #896
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-05-29 10:12:35 +02:00
f255feb819 Merge remote-tracking branch 'origin/main' into fix-mekf-inits 2024-05-29 10:11:53 +02:00
6d27da4939 Merge pull request 'small fix for MPSoC transition failure' (#897) from transition-failure-fix into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #897
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-05-29 10:11:01 +02:00
a3ac2505fe small tweak
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-28 15:38:16 +02:00
6350e0db0a changelog
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-28 15:36:49 +02:00
db9e83cbc8 PLOC SUPV bugfix
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-28 15:33:13 +02:00
42ae9eafb7
bump tmtc
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-23 14:45:18 +02:00
0475ab872d
changelog
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-23 14:23:16 +02:00
225d037c66
small fix for MPSoC transition failure
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
2024-05-23 14:22:07 +02:00
aa5a148800 changelog
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-15 11:07:46 +02:00
4720ab9a35 corrected str sigma
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-15 11:07:12 +02:00
ba219fbe7d changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-15 10:05:32 +02:00
32271a98ff go home compiler, you're drunk
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
2024-05-15 10:04:04 +02:00
6025ea5663 fixed ub with initalization 2024-05-14 15:35:20 +02:00
5af43ca29b Merge pull request 'prep v8.0.0' (#895) from prep_v8.0.0 into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #895
2024-05-13 14:19:59 +02:00
822df9658f
prep v8.0.0
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main Build started...
2024-05-13 14:08:35 +02:00
765e3d6b5b Merge pull request 'MPSoC Fixes' (#894) from mpsoc-fixes into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #894
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-05-13 14:03:11 +02:00
0b3c928886
combining those is acutally problematic..
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-08 11:11:21 +02:00
73279a0bf3
minor fix for periodic HK generation
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
2024-05-08 10:54:24 +02:00
4559d24c62 changelog
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
2024-05-08 10:04:34 +02:00
b54f8e7738 some fixes for MPSoC 2024-05-08 10:03:32 +02:00
6bb12f28a1 Merge pull request 'MPSoC Overhaul' (#892) from mpsoc-overhaul into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #892
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-05-06 14:20:46 +02:00
7e8d995b52 changelog and tmtc 2024-05-06 14:20:13 +02:00
215f2189a6 better name for split file command
Some checks are pending
EIVE/eive-obsw/pipeline/pr-main Build queued...
2024-05-06 14:17:25 +02:00
8103b2fa0d events
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-06 13:48:32 +02:00
b579cd86c1 make marius extremely happy
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-06 13:30:28 +02:00
4fdec7a74c impl proper NORMAL mode for MPSoC
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-06 13:19:15 +02:00
744a94704c
removed TODOs which are done
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-05-02 15:42:14 +02:00
f7f14ff021 Merge branch 'main' into mpsoc-overhaul
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-30 15:57:34 +02:00
fe729f1df0 Merge pull request 'Fix Target Rotation Rate' (#893) from tgt-rot-rate-fix into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #893
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-04-30 15:52:05 +02:00
7734d1066a Merge branch 'main' into tgt-rot-rate-fix 2024-04-30 15:51:39 +02:00
4a0acbf158 further reduce printout
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-30 15:37:53 +02:00
65476f4c98 reduce printouts
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-30 15:18:15 +02:00
aa2bfb7d0e Re-work MPSoC handler module
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-30 15:14:22 +02:00
fa01afe0fa fixed build after EM build was created
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
2024-04-30 11:37:46 +02:00
a6ce06e3f5 Merge branch 'main' into tgt-rot-rate-fix
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-29 11:47:07 +02:00
75070b5e66 i am smart
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-29 10:42:52 +02:00
26341743a8 changelog
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-29 10:26:12 +02:00
7c10f4b1cd fix calculation of target rotation 2024-04-29 10:24:53 +02:00
c1b8e891c5 Merge pull request 'add new payload module' (#889) from payload-module into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #889
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-22 09:32:27 +02:00
18cf46ea31 Merge remote-tracking branch 'origin/main' into payload-module
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-17 15:11:58 +02:00
2d7356b9ed Merge pull request 'Nah' (#891) from i-hate-it-here into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #891
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-04-11 14:04:51 +02:00
675dda8e9e bump version
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
2024-04-11 14:00:30 +02:00
5bb1bd8946 changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
2024-04-11 13:58:57 +02:00
eff9116aec ???
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
2024-04-11 13:57:40 +02:00
4ed516e0bc Merge pull request 'Prep v7.8.0' (#890) from prep-v7.8.0 into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #890
2024-04-10 12:48:14 +02:00
e2ee6a492c changelog
Some checks are pending
EIVE/eive-obsw/pipeline/pr-main Build queued...
2024-04-10 11:57:17 +02:00
a6422f2d73 bump version 2024-04-10 11:56:19 +02:00
ceb2130726 bumped tmtc
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
2024-04-10 11:54:17 +02:00
fcd3b7815c reran gens
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
2024-04-10 11:53:21 +02:00
1067abba9a Merge pull request 'Improve device FDIR' (#885) from improve-dev-fdir into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #885
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-10 11:43:30 +02:00
53376fd9ed fix changelog 2024-04-10 11:43:06 +02:00
c2d05b2045 Merge branch 'main' into improve-dev-fdir 2024-04-10 11:41:51 +02:00
48914a2aba Merge pull request 'GNSS Ctrl Improvements' (#871) from gnss-ctrl-improvements into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #871
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-04-10 11:40:24 +02:00
ef8736bd81 Merge branch 'main' into gnss-ctrl-improvements 2024-04-10 11:40:04 +02:00
584a16a67c Merge pull request 'Fix Error Quaternion' (#883) from error-quat-fix into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #883
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-04-10 11:38:35 +02:00
addfadddb6 Merge branch 'main' into improve-dev-fdir
Some checks are pending
EIVE/eive-obsw/pipeline/pr-main Build started...
2024-04-10 11:30:15 +02:00
df392d3319 Merge branch 'main' into error-quat-fix
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-10 10:49:59 +02:00
b079ce85f2 Merge pull request 'Update for PWR CTRL Limits' (#884) from change-pwr-ctrl-limits into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #884
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-04-10 10:48:12 +02:00
bc9b8efdb8 Merge branch 'main' into change-pwr-ctrl-limits
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-10 08:57:07 +02:00
51dcb56583 Merge remote-tracking branch 'origin/main' into payload-module
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 17:42:01 +02:00
df0c8eefab bump tmtc 2024-04-09 17:41:34 +02:00
5a7df626ab Merge branch 'main' into improve-dev-fdir
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 17:36:37 +02:00
7b53275d61 changelog
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 15:06:23 +02:00
709c53d533 Merge branch 'main' into gnss-ctrl-improvements
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 14:49:36 +02:00
3a70155105 Merge pull request 'Enable MEKF for PTG as Default' (#888) from enable-mekf into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #888
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-04-09 14:45:10 +02:00
7a12c1c8fe the first fix should trigger an event
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 14:43:47 +02:00
0f1c41e828 Merge branch 'main' into enable-mekf
Some checks are pending
EIVE/eive-obsw/pipeline/pr-main Build queued...
2024-04-09 14:33:36 +02:00
c4340c3515 re-point tmtc
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 14:33:02 +02:00
eec934e1b0 bump submodules
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 14:32:00 +02:00
b01d4f6363 bump tmtc
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 14:30:11 +02:00
d9789a48d8 Merge remote-tracking branch 'origin/main' into improve-dev-fdir 2024-04-09 14:29:54 +02:00
c3237cae3c Merge pull request 'impl relative timeshift in framework' (#886) from relative-timeshift into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #886
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-09 14:29:28 +02:00
427c53df8c better
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 14:04:20 +02:00
c89e81cac9 Merge branch 'main' into enable-mekf
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 13:55:11 +02:00
fb54d976d2 Merge branch 'main' into relative-timeshift
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 13:41:34 +02:00
25a1e4ea25 Merge remote-tracking branch 'origin/main' into improve-dev-fdir
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 13:41:10 +02:00
a63eb331eb Merge pull request 'Revert lower PLOC OP Limits' (#887) from ploc-op-limit into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #887
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-04-09 13:34:37 +02:00
1793b325ec compiles again
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 13:33:56 +02:00
1c36f36b1f this seems better
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 13:31:27 +02:00
0f3eeb42d6 15 should be enough 2024-04-09 13:30:22 +02:00
887f165484 ye maybe dont hold the reset pin for 3h 2024-04-09 13:29:42 +02:00
6cc1d86018 add new payload module
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
2024-04-09 13:19:52 +02:00
d4eb124cdf missing reset
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 11:26:55 +02:00
47cedb90f9 bump fsfw
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 11:07:05 +02:00
f3d4e09487 improved event comment
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 09:59:21 +02:00
2057ab9c10 some cleanup
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-09 09:58:05 +02:00
1f0e2d99e9 fix comment block
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-08 13:38:35 +02:00
35181a2693 changelog
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-08 13:36:21 +02:00
e1b5625086 update events 2024-04-08 13:35:42 +02:00
72626582f6 bump submodules
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-08 13:27:08 +02:00
3e6d26669a bump submodules
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-08 11:37:43 +02:00
69f378f8b6 changelog
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-08 10:48:03 +02:00
a46f6f34d6 allow mekf to be used for ptg laws as default 2024-04-08 10:47:14 +02:00
e6855120f3 changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-08 10:28:57 +02:00
e59235fd75 reverted values 2024-04-08 10:28:36 +02:00
3875ddf92b
bump fsfw again
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-03 16:24:07 +02:00
4171b11928
impl relative timeshift in framework
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-03 16:20:18 +02:00
43de097812
changelog
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-03 15:06:37 +02:00
56512fae0d
bump fsfw again
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-04-03 12:52:40 +02:00
76d00ddd37
bump fsfw
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
2024-04-03 12:48:12 +02:00
539221a458 updated limits within the pwr ctrl
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-27 09:24:41 +01:00
9f03341108 changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-22 11:40:00 +01:00
4193a565a4 i hate this 2024-03-22 11:39:18 +01:00
c1c254330b Merge pull request 'Prep v7.7.4' (#882) from prep-v7.7.4 into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #882
2024-03-21 10:47:20 +01:00
c46c6cd28b changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-21 10:18:03 +01:00
aeb8b92bc4 bump version 2024-03-21 10:16:47 +01:00
8011686fbe Merge pull request 'GS Target Pointing Limit Change' (#881) from ptg-improv into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #881
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-03-21 10:10:44 +01:00
58be09bd4b Merge branch 'main' into ptg-improv
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-21 09:15:53 +01:00
ad82573a35 Merge pull request 'Fix for Current Calculation in PWR Ctrl' (#880) from fix-soc into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #880
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-03-21 09:14:52 +01:00
a1be15e939 lets rather be gentle here
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-21 09:14:35 +01:00
ba7c9e1c26 changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-20 16:19:20 +01:00
46c125d9fe rot rate limit change 2024-03-20 16:18:03 +01:00
889dd04c6b changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-20 16:01:20 +01:00
c52746a2df fix 2024-03-20 15:53:51 +01:00
f2f856e227 cleanup
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-18 17:21:08 +01:00
0cbac07f15 this might work 2024-03-18 17:20:55 +01:00
18d3c8fa91 not sure why this was ever archived 2024-03-18 17:20:40 +01:00
3e1ef8bcaf Merge branch 'main' into gnss-ctrl-improvements
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
2024-03-18 16:55:04 +01:00
d1fc876f03 Merge pull request 'Prep v7.7.3' (#879) from prep-v7.7.3 into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #879
2024-03-18 12:34:10 +01:00
0278aabee0 Merge branch 'main' into prep-v7.7.3
Some checks are pending
EIVE/eive-obsw/pipeline/pr-main Build queued...
2024-03-18 11:37:09 +01:00
a9f5b6d2c7 Merge pull request 'TCS Ctrl Time Limit not for Heaters in External Control' (#878) from tcs-ctrl-ignores-ext-ctrl into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #878
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-03-18 11:36:32 +01:00
80ea0b341b changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main Build queued...
2024-03-18 11:14:10 +01:00
9740831755 bumped version 2024-03-18 11:14:00 +01:00
c4e18432e2 Merge branch 'main' into tcs-ctrl-ignores-ext-ctrl
Some checks are pending
EIVE/eive-obsw/pipeline/pr-main Build queued...
2024-03-18 11:05:23 +01:00
f9f5ba5d46 Merge pull request 'Improve GS PTG' (#876) from gs-ptr-improv into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #876
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-03-18 11:04:01 +01:00
3b521966a9 bumped fsfw 2024-03-18 11:03:44 +01:00
c58bae5aa5 Merge branch 'main' into gs-ptr-improv 2024-03-18 11:03:06 +01:00
67e6ccf4ae cleanup
Some checks are pending
EIVE/eive-obsw/pipeline/pr-main Build started...
2024-03-18 11:00:29 +01:00
b795beef85 Merge pull request 'Parameter for STR for MEKF' (#877) from no-str-for-mekf into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #877
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-03-18 10:58:53 +01:00
311ecd7fd2 changelog 2024-03-18 10:58:19 +01:00
950e86ce4b cleaner solution
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-18 10:56:57 +01:00
096328aadc backup heater will not be chosen if heater is on ext ctrl and on
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-18 10:34:21 +01:00
36edd3e324 changed lower op limits for ploc 2024-03-18 10:33:51 +01:00
c65e813e94 changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-16 13:53:22 +01:00
1c93f51f69 prevent switching of heaters in external control 2024-03-16 13:48:49 +01:00
7a43e1bc67 better but still not fixed
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
2024-03-15 14:54:16 +01:00
dade2d519a changelog
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-15 13:21:01 +01:00
c4680f85bb added param to disable str input for mekf
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
2024-03-15 13:16:38 +01:00
6c9a7c3ee5 changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-13 17:01:17 +01:00
346f4ff9de prevent sign jump
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
2024-03-13 16:59:55 +01:00
ad5282ca4a bump fsfw 2024-03-13 16:59:37 +01:00
3c869e5215 idk what i am doing here
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
2024-03-13 16:08:21 +01:00
8374a02ae2 lets wait a bit longer
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
2024-03-13 13:54:49 +01:00
f2d1e16697 Merge branch 'main' into gnss-ctrl-improvements
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
2024-03-13 13:48:34 +01:00
b7bf927288 boop
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
2024-03-01 11:31:01 +01:00
8fe7307a58 remove whatever this is
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
2024-03-01 10:59:37 +01:00
7e7d8c249e between how many beers was this written
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-03-01 10:09:49 +01:00
ffce866ad0 small fix
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-02-29 16:09:16 +01:00
236916bf67 this should remove the fix changed spam
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-02-29 16:06:55 +01:00
80 changed files with 3793 additions and 598 deletions

View File

@ -16,6 +16,149 @@ will consitute of a breaking change warranting a new major release:
# [unreleased]
# [v8.2.0] 2024-06-26
## Changed
- STR quaternions are now used by the `MEKF` by default
- Changed nominal `SUS Assembly` side to `B Side`.
- Changed source for state machine of detumbling to SUS and MGM only.
- Changed `FusedRotRateData` dataset to always display rotation rate from SUS and MGM.
- Solution from `QUEST` will be set to invalid if sun vector and magnetic field vector are too close
to each other.
- Changed collection intervals of dataset collection
- `GPS Controller`: `GPS Set` to 60s
- `MTQ Handler`: `HK with Torque`, `HK without Torque` to 60s
- `RW Handler`: `Status Set` to 30s
- `STR Handler`: `Solution Set` to 30s
- `ACS Controller`: `MGM Sensor`, `MGM Processed`, `SUS Sensor`, `SUS Processed`, `GYR Sensor`,
`GPS Processed` to 60s
- `ACS Controller` at or below `IDLE`: `CTRL Values`, `ACT Commands`, `Attitude Estimation`,
`Fused Rotation Rate` to 30s
- `ACS Controller` above `IDLE`: `CTRL Values`, `ACT Commands`, `Attitude Estimation`,
`Fused Rotation Rate` to 10s
## Fixed
- Added null termination for PLOC MPSoC image taking command which could possibly lead to
default target filenames.
# [v8.1.1] 2024-06-05
## Added
- PLOC SUPV MPSoC update re-try logic for the `WRITE_MEMORY` command. These packets form > 98%
of all packets required for a software update, but the update mechanism is not tolerant against
occasional glitches on the RS485 communication to the PLOC SUPV. A simple re-try mechanism which
tries to re-attempt packet handling up to three times for those packets is introduced.
# [v8.1.0] 2024-05-29
## Fixed
- Small fix for transition failure handling of the MPSoC when the `START_MPSOC` action command
to the supervisor fails.
- Fixed inits of arrays within the `MEKF` not being zeros.
- Important bugfix for PLOC SUPV: The SUPV previously was able to steal packets from the special
communication helper, for example during software updates.
- Corrected sigma of STR for `MEKF`.
## Added
- Added new command to cancel the PLOC SUPV special communication helper.
# [v8.0.0] 2024-05-13
- `eive-tmtc` v7.0.0
## Fixed
- Fixed calculation for target rotation rate during pointing modes.
- Possible fix for MPSoC file read algorithm.
## Changed
- Reworked MPSoC handler to be compatible to new MPSoC software image and use
new device handler base class. This should increase the reliability of the communication
significantly.
- MPSoC device modes IDLE, SNAPSHOT and REPLAY are now modelled using submodes.
- Commanding a submode the device is already in will not result in a completion failure
anymore.
## Added
- Added `VERIFY_BOOT` command for MPSoC.
- New command for MPSoC to store camera image in chunks.
# [v7.8.1] 2024-04-11
## Fixed
- Reverted fix for wrong order in quaternion multiplication for computation of the error quaternion.
# [v7.8.0] 2024-04-10
## Changed
- Reverted lower OP limit of `PLOC` to -10°C.
- All pointing laws are now allowed to use the `MEKF` per default.
- Changed limits in `PWR Controller`.
- PUS time service: Now dumps the time before and after relative timeshift or setting absolute time
- The `GPS Controller` does not set itself to `OFF` anymore, if it has not detected a valid fix for
some time. Instead it attempts to reset both GNSS devices once.
- The maximum time to reach a fix is shortened from 30min to 15min.
- The time the reset pin of the GNSS devices is pulled is prolonged from 5ms to 10s.
- A `GPS FIX HAS CHANGED` is now only triggered if no fix change has been detected within the past
2min. This means, this event might be thrown with a 2min delay. It is instantly thrown, if the mode
of the controller is changed. As arguments it now displays the new fix and the numer of fix changes
missed.
- The number of satellites seen and used is reset to 0, in case they are set to invalid.
- Altitude, latitude and longitude messages are not checked anymore, in case the mode message was
already invalid.
## Added
- PUS timeservice relative timeshift.
## Fixed
- Fixed wrong order in quaternion multiplication for computation of the error quaternion.
- Re-worked some FDIR logic in the FSFW. The former logic prevented events with a severity
higher than INFO if the device was in EXTERNAL CONTROL. The new logic will allow to trigger
events but still inhibit FDIR reactions if the device is in EXTERNAL CONTROL.
# [v7.7.4] 2024-03-21
## Changed
- Rotational rate limit for the GS target pointing is now seperated from controller limit. It
is also reduced to 0.75°/s now.
## Fixed
- Fixed wrong sign in calculation of total current within the `PWR Controller`.
# [v7.7.3] 2024-03-18
- Bumped `eive-fsfw`
## Added
- Added parameter to disable STR input for MEKF.
## Changed
- If a primary heater is set to `EXTERNAL CONTROL` and `ON`, the `TCS Controller` will no
try to control the temperature of that object.
- Set lower OP limit of `PLOC` to -5°C.
## Fixed
- Added prevention of sign jump for target quaternion of GS pointing, which would reduce the
performance of the controller.
- Heaters set to `EXTERNAL CONTROL` no longer can be switched off by the `TCS Controller`, if
they violate the maximum burn duration of the controller.
# [v7.7.2] 2024-03-06
## Fixed
@ -184,7 +327,7 @@ will consitute of a breaking change warranting a new major release:
- `ACS Controller` now has the function `performAttitudeControl` which is called prior to passing
on to the relevant mode functions. It handles all telemetry relevant functions, which were
always called, regardless of the mode.
## Added
- Higher ACS modes can now be entered without a running `MEKF`. Higher modes will collect their

View File

@ -9,9 +9,9 @@
# ##############################################################################
cmake_minimum_required(VERSION 3.13)
set(OBSW_VERSION_MAJOR 7)
set(OBSW_VERSION_MINOR 7)
set(OBSW_VERSION_REVISION 2)
set(OBSW_VERSION_MAJOR 8)
set(OBSW_VERSION_MINOR 2)
set(OBSW_VERSION_REVISION 0)
# set(CMAKE_VERBOSE TRUE)

View File

@ -2,15 +2,15 @@
#include <linux/payload/PlocMpsocHandler.h>
#include <linux/payload/plocSupvDefs.h>
#include <sstream>
#include "OBSWConfig.h"
#include "fsfw/datapool/PoolReadGuard.h"
#include "fsfw/globalfunctions/CRC.h"
#include "fsfw/ipc/QueueFactory.h"
#include "fsfw/parameters/HasParametersIF.h"
PlocMpsocHandler::PlocMpsocHandler(object_id_t objectId, object_id_t uartComIFid,
CookieIF* comCookie, PlocMpsocSpecialComHelper* plocMPSoCHelper,
CookieIF* comCookie,
PlocMpsocSpecialComHelperLegacy* plocMPSoCHelper,
Gpio uartIsolatorSwitch, object_id_t supervisorHandler)
: DeviceHandlerBase(objectId, uartComIFid, comCookie),
hkReport(this),
@ -54,24 +54,26 @@ ReturnValue_t PlocMpsocHandler::initialize() {
return result;
}
result = manager->subscribeToEvent(
eventQueue->getId(), event::getEventId(PlocMpsocSpecialComHelper::MPSOC_FLASH_WRITE_FAILED));
eventQueue->getId(),
event::getEventId(PlocMpsocSpecialComHelperLegacy::MPSOC_FLASH_WRITE_FAILED));
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
result = manager->subscribeToEvent(
eventQueue->getId(),
event::getEventId(PlocMpsocSpecialComHelper::MPSOC_FLASH_WRITE_SUCCESSFUL));
event::getEventId(PlocMpsocSpecialComHelperLegacy::MPSOC_FLASH_WRITE_SUCCESSFUL));
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
result = manager->subscribeToEvent(
eventQueue->getId(),
event::getEventId(PlocMpsocSpecialComHelper::MPSOC_FLASH_READ_SUCCESSFUL));
event::getEventId(PlocMpsocSpecialComHelperLegacy::MPSOC_FLASH_READ_SUCCESSFUL));
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
result = manager->subscribeToEvent(
eventQueue->getId(), event::getEventId(PlocMpsocSpecialComHelper::MPSOC_FLASH_READ_FAILED));
eventQueue->getId(),
event::getEventId(PlocMpsocSpecialComHelperLegacy::MPSOC_FLASH_READ_FAILED));
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
@ -139,7 +141,7 @@ ReturnValue_t PlocMpsocHandler::executeAction(ActionId_t actionId, MessageQueueI
}
if (specialComHelperExecuting) {
return MPSoCReturnValuesIF::MPSOC_HELPER_EXECUTING;
return mpsoc::MPSOC_HELPER_EXECUTING;
}
switch (actionId) {
@ -408,7 +410,7 @@ ReturnValue_t PlocMpsocHandler::scanForReply(const uint8_t* start, size_t remain
sif::debug << "PlocMPSoCHandler::scanForReply: Reply has invalid APID 0x" << std::hex
<< std::setfill('0') << std::setw(2) << apid << std::dec << std::endl;
*foundLen = remainingSize;
return MPSoCReturnValuesIF::INVALID_APID;
return mpsoc::INVALID_APID;
}
}
@ -445,7 +447,7 @@ ReturnValue_t PlocMpsocHandler::interpretDeviceReply(DeviceCommandId_t id, const
}
case (mpsoc::TM_FLASH_DIRECTORY_CONTENT): {
result = verifyPacket(packet, foundPacketLen);
if (result == MPSoCReturnValuesIF::CRC_FAILURE) {
if (result == mpsoc::CRC_FAILURE) {
sif::warning << "PLOC MPSoC: Flash directory content reply invalid CRC" << std::endl;
}
/** Send data to commanding queue */
@ -557,7 +559,7 @@ ReturnValue_t PlocMpsocHandler::prepareTcMemRead(const uint8_t* commandData,
ReturnValue_t PlocMpsocHandler::prepareTcFlashDelete(const uint8_t* commandData,
size_t commandDataLen) {
if (commandDataLen > config::MAX_PATH_SIZE + config::MAX_FILENAME_SIZE) {
return MPSoCReturnValuesIF::NAME_TOO_LONG;
return mpsoc::NAME_TOO_LONG;
}
ReturnValue_t result = returnvalue::OK;
mpsoc::TcFlashDelete tcFlashDelete(spParams, sequenceCount);
@ -718,7 +720,7 @@ ReturnValue_t PlocMpsocHandler::finishTcPrep(mpsoc::TcBase& tcBase) {
ReturnValue_t PlocMpsocHandler::verifyPacket(const uint8_t* start, size_t foundLen) {
if (CRC::crc16ccitt(start, foundLen) != 0) {
return MPSoCReturnValuesIF::CRC_FAILURE;
return mpsoc::CRC_FAILURE;
}
return returnvalue::OK;
}
@ -727,12 +729,12 @@ ReturnValue_t PlocMpsocHandler::handleAckReport(const uint8_t* data) {
ReturnValue_t result = returnvalue::OK;
result = verifyPacket(data, mpsoc::SIZE_ACK_REPORT);
if (result == MPSoCReturnValuesIF::CRC_FAILURE) {
if (result == mpsoc::CRC_FAILURE) {
sif::warning << "PlocMPSoCHandler::handleAckReport: CRC failure" << std::endl;
nextReplyId = mpsoc::NONE;
replyRawReplyIfnotWiretapped(data, mpsoc::SIZE_ACK_REPORT);
triggerEvent(MPSOC_HANDLER_CRC_FAILURE);
sendFailureReport(mpsoc::ACK_REPORT, MPSoCReturnValuesIF::CRC_FAILURE);
sendFailureReport(mpsoc::ACK_REPORT, mpsoc::CRC_FAILURE);
disableAllReplies();
return IGNORE_REPLY_DATA;
}
@ -771,7 +773,7 @@ ReturnValue_t PlocMpsocHandler::handleExecutionReport(const uint8_t* data) {
ReturnValue_t result = returnvalue::OK;
result = verifyPacket(data, mpsoc::SIZE_EXE_REPORT);
if (result == MPSoCReturnValuesIF::CRC_FAILURE) {
if (result == mpsoc::CRC_FAILURE) {
sif::warning << "PlocMPSoCHandler::handleExecutionReport: CRC failure" << std::endl;
nextReplyId = mpsoc::NONE;
return result;
@ -792,9 +794,9 @@ ReturnValue_t PlocMpsocHandler::handleExecutionReport(const uint8_t* data) {
uint16_t status = mpsoc::getStatusFromRawData(data);
sif::warning << "MPSoC EXE Failure: " << mpsoc::getStatusString(status) << std::endl;
triggerEvent(EXE_FAILURE, commandId, status);
sendFailureReport(mpsoc::EXE_REPORT, MPSoCReturnValuesIF::RECEIVED_EXE_FAILURE);
sendFailureReport(mpsoc::EXE_REPORT, mpsoc::RECEIVED_EXE_FAILURE);
result = IGNORE_REPLY_DATA;
cmdDoneHandler(false, MPSoCReturnValuesIF::RECEIVED_EXE_FAILURE);
cmdDoneHandler(false, mpsoc::RECEIVED_EXE_FAILURE);
break;
}
default: {
@ -810,7 +812,7 @@ ReturnValue_t PlocMpsocHandler::handleExecutionReport(const uint8_t* data) {
ReturnValue_t PlocMpsocHandler::handleMemoryReadReport(const uint8_t* data) {
ReturnValue_t result = returnvalue::OK;
result = verifyPacket(data, tmMemReadReport.rememberRequestedSize);
if (result == MPSoCReturnValuesIF::CRC_FAILURE) {
if (result == mpsoc::CRC_FAILURE) {
sif::warning << "PlocMPSoCHandler::handleMemoryReadReport: Memory read report has invalid crc"
<< std::endl;
}
@ -1004,7 +1006,7 @@ ReturnValue_t PlocMpsocHandler::handleGetHkReport(const uint8_t* data) {
ReturnValue_t PlocMpsocHandler::handleCamCmdRpt(const uint8_t* data) {
ReturnValue_t result = verifyPacket(data, foundPacketLen);
if (result == MPSoCReturnValuesIF::CRC_FAILURE) {
if (result == mpsoc::CRC_FAILURE) {
sif::warning << "PlocMPSoCHandler::handleCamCmdRpt: CRC failure" << std::endl;
}
SpacePacketReader packetReader(data, foundPacketLen);

View File

@ -1,23 +1,19 @@
#ifndef BSP_Q7S_DEVICES_PLOC_PLOCMPSOCHANDLER_H_
#define BSP_Q7S_DEVICES_PLOC_PLOCMPSOCHANDLER_H_
#include <linux/payload/PlocMpsocSpecialComHelper.h>
#include <linux/payload/mpsocRetvals.h>
#include <linux/payload/PlocMpsocSpecialComHelperLegacy.h>
#include <linux/payload/plocMpsocHelpers.h>
#include <linux/payload/plocSupvDefs.h>
#include <mission/controller/controllerdefinitions/PowerCtrlDefinitions.h>
#include <string>
#include "fsfw/action/CommandActionHelper.h"
#include "fsfw/action/CommandsActionsIF.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "fsfw/ipc/QueueFactory.h"
#include "fsfw/tmtcservices/SourceSequenceCounter.h"
#include "fsfw_hal/linux/gpio/Gpio.h"
#include "fsfw_hal/linux/serial/SerialComIF.h"
static constexpr bool DEBUG_MPSOC_COMMUNICATION = false;
static constexpr bool DEBUG_MPSOC_COMMUNICATION = true;
/**
* @brief This is the device handler for the MPSoC of the payload computer.
@ -48,7 +44,7 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF {
* @param supervisorHandler Object ID of the supervisor handler
*/
PlocMpsocHandler(object_id_t objectId, object_id_t uartComIFid, CookieIF* comCookie,
PlocMpsocSpecialComHelper* plocMPSoCHelper, Gpio uartIsolatorSwitch,
PlocMpsocSpecialComHelperLegacy* plocMPSoCHelper, Gpio uartIsolatorSwitch,
object_id_t supervisorHandler);
virtual ~PlocMpsocHandler();
virtual ReturnValue_t initialize() override;
@ -171,7 +167,7 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF {
SerialComIF* uartComIf = nullptr;
PlocMpsocSpecialComHelper* specialComHelper = nullptr;
PlocMpsocSpecialComHelperLegacy* specialComHelper = nullptr;
Gpio uartIsolatorSwitch;
object_id_t supervisorHandler = 0;
CommandActionHelper commandActionHelper;
@ -186,7 +182,7 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF {
};
TmMemReadReport tmMemReadReport;
Countdown cmdCountdown = Countdown(10000);
Countdown cmdCountdown = Countdown(15000);
struct TelemetryBuffer {
uint16_t length = 0;

View File

@ -0,0 +1,545 @@
#include <fsfw/globalfunctions/arrayprinter.h>
#include <fsfw/tasks/TaskFactory.h>
#include <linux/payload/PlocMpsocSpecialComHelperLegacy.h>
#include <unistd.h>
#include <filesystem>
#include <fstream>
#ifdef XIPHOS_Q7S
#include "bsp_q7s/fs/FilesystemHelper.h"
#endif
#include "mission/utility/Timestamp.h"
using namespace ploc;
PlocMpsocSpecialComHelperLegacy::PlocMpsocSpecialComHelperLegacy(object_id_t objectId)
: SystemObject(objectId) {
spParams.buf = commandBuffer;
spParams.maxSize = sizeof(commandBuffer);
}
PlocMpsocSpecialComHelperLegacy::~PlocMpsocSpecialComHelperLegacy() {}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::initialize() {
#ifdef XIPHOS_Q7S
sdcMan = SdCardManager::instance();
if (sdcMan == nullptr) {
sif::warning << "PlocMPSoCHelper::initialize: Invalid SD Card Manager" << std::endl;
return returnvalue::FAILED;
}
#endif
return returnvalue::OK;
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::performOperation(uint8_t operationCode) {
ReturnValue_t result = returnvalue::OK;
semaphore.acquire();
while (true) {
#if OBSW_THREAD_TRACING == 1
trace::threadTrace(opCounter, "PLOC MPSOC Helper");
#endif
switch (internalState) {
case InternalState::IDLE: {
semaphore.acquire();
break;
}
case InternalState::FLASH_WRITE: {
result = performFlashWrite();
if (result == returnvalue::OK) {
triggerEvent(MPSOC_FLASH_WRITE_SUCCESSFUL, sequenceCount->get());
} else {
triggerEvent(MPSOC_FLASH_WRITE_FAILED, sequenceCount->get());
}
internalState = InternalState::IDLE;
break;
}
case InternalState::FLASH_READ: {
result = performFlashRead();
if (result == returnvalue::OK) {
triggerEvent(MPSOC_FLASH_READ_SUCCESSFUL, sequenceCount->get());
} else {
triggerEvent(MPSOC_FLASH_READ_FAILED, sequenceCount->get());
}
internalState = InternalState::IDLE;
break;
}
default:
sif::debug << "PlocMPSoCHelper::performOperation: Invalid state" << std::endl;
break;
}
}
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::setComIF(
DeviceCommunicationIF* communicationInterface_) {
uartComIF = dynamic_cast<SerialComIF*>(communicationInterface_);
if (uartComIF == nullptr) {
sif::warning << "PlocMPSoCHelper::initialize: Invalid uart com if" << std::endl;
return returnvalue::FAILED;
}
return returnvalue::OK;
}
void PlocMpsocSpecialComHelperLegacy::setComCookie(CookieIF* comCookie_) { comCookie = comCookie_; }
void PlocMpsocSpecialComHelperLegacy::setSequenceCount(SourceSequenceCounter* sequenceCount_) {
sequenceCount = sequenceCount_;
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::startFlashWrite(std::string obcFile,
std::string mpsocFile) {
if (internalState != InternalState::IDLE) {
return returnvalue::FAILED;
}
ReturnValue_t result = startFlashReadOrWriteBase(std::move(obcFile), std::move(mpsocFile));
if (result != returnvalue::OK) {
return result;
}
internalState = InternalState::FLASH_WRITE;
return semaphore.release();
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::startFlashRead(std::string obcFile,
std::string mpsocFile,
size_t readFileSize) {
if (internalState != InternalState::IDLE) {
return returnvalue::FAILED;
}
ReturnValue_t result = startFlashReadOrWriteBase(std::move(obcFile), std::move(mpsocFile));
if (result != returnvalue::OK) {
return result;
}
flashReadAndWrite.totalReadSize = readFileSize;
internalState = InternalState::FLASH_READ;
return semaphore.release();
}
void PlocMpsocSpecialComHelperLegacy::resetHelper() {
spParams.buf = commandBuffer;
terminate = false;
uartComIF->flushUartRxBuffer(comCookie);
}
void PlocMpsocSpecialComHelperLegacy::stopProcess() { terminate = true; }
ReturnValue_t PlocMpsocSpecialComHelperLegacy::performFlashWrite() {
ReturnValue_t result = returnvalue::OK;
std::ifstream file(flashReadAndWrite.obcFile, std::ifstream::binary);
if (file.bad()) {
return returnvalue::FAILED;
}
result = flashfopen(mpsoc::FileAccessModes::WRITE | mpsoc::FileAccessModes::OPEN_ALWAYS);
if (result != returnvalue::OK) {
return result;
}
// Set position of next character to end of file input stream
file.seekg(0, file.end);
// tellg returns position of character in input stream
size_t remainingSize = file.tellg();
size_t dataLength = 0;
size_t bytesRead = 0;
while (remainingSize > 0) {
if (terminate) {
return returnvalue::OK;
}
// The minus 4 is necessary for unknown reasons. Maybe some bug in the ILH software?
if (remainingSize > mpsoc::MAX_FLASH_WRITE_DATA_SIZE - 4) {
dataLength = mpsoc::MAX_FLASH_WRITE_DATA_SIZE - 4;
} else {
dataLength = remainingSize;
}
if (file.bad() or not file.is_open()) {
return FILE_WRITE_ERROR;
}
file.seekg(bytesRead, file.beg);
file.read(reinterpret_cast<char*>(fileBuf.data()), dataLength);
bytesRead += dataLength;
remainingSize -= dataLength;
mpsoc::TcFlashWrite tc(spParams, *sequenceCount);
result = tc.setPayload(fileBuf.data(), dataLength);
if (result != returnvalue::OK) {
return result;
}
result = tc.finishPacket();
if (result != returnvalue::OK) {
return result;
}
(*sequenceCount)++;
result = handlePacketTransmissionNoReply(tc);
if (result != returnvalue::OK) {
return result;
}
}
result = flashfclose();
if (result != returnvalue::OK) {
return result;
}
return result;
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::performFlashRead() {
std::error_code e;
std::ofstream ofile(flashReadAndWrite.obcFile, std::ios::trunc | std::ios::binary);
if (ofile.bad()) {
return returnvalue::FAILED;
}
ReturnValue_t result = flashfopen(mpsoc::FileAccessModes::READ);
if (result != returnvalue::OK) {
std::filesystem::remove(flashReadAndWrite.obcFile, e);
return result;
}
size_t readSoFar = 0;
size_t nextReadSize = mpsoc::MAX_FLASH_READ_DATA_SIZE;
while (readSoFar < flashReadAndWrite.totalReadSize) {
if (terminate) {
std::filesystem::remove(flashReadAndWrite.obcFile, e);
return returnvalue::OK;
}
nextReadSize = mpsoc::MAX_FLASH_READ_DATA_SIZE;
if (flashReadAndWrite.totalReadSize - readSoFar < mpsoc::MAX_FLASH_READ_DATA_SIZE) {
nextReadSize = flashReadAndWrite.totalReadSize - readSoFar;
}
if (ofile.bad() or not ofile.is_open()) {
std::filesystem::remove(flashReadAndWrite.obcFile, e);
return FILE_READ_ERROR;
}
mpsoc::TcFlashRead flashReadRequest(spParams, *sequenceCount);
result = flashReadRequest.setPayload(nextReadSize);
if (result != returnvalue::OK) {
std::filesystem::remove(flashReadAndWrite.obcFile, e);
return result;
}
result = flashReadRequest.finishPacket();
if (result != returnvalue::OK) {
std::filesystem::remove(flashReadAndWrite.obcFile, e);
return result;
}
(*sequenceCount)++;
result = handlePacketTransmissionFlashRead(flashReadRequest, ofile, nextReadSize);
if (result != returnvalue::OK) {
std::filesystem::remove(flashReadAndWrite.obcFile, e);
return result;
}
readSoFar += nextReadSize;
}
result = flashfclose();
if (result != returnvalue::OK) {
return result;
}
return result;
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::flashfopen(uint8_t mode) {
spParams.buf = commandBuffer;
mpsoc::FlashFopen flashFopen(spParams, *sequenceCount);
ReturnValue_t result = flashFopen.setPayload(flashReadAndWrite.mpsocFile, mode);
if (result != returnvalue::OK) {
return result;
}
result = flashFopen.finishPacket();
if (result != returnvalue::OK) {
return result;
}
(*sequenceCount)++;
result = handlePacketTransmissionNoReply(flashFopen);
if (result != returnvalue::OK) {
return result;
}
return returnvalue::OK;
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::flashfclose() {
spParams.buf = commandBuffer;
mpsoc::FlashFclose flashFclose(spParams, *sequenceCount);
ReturnValue_t result = flashFclose.finishPacket();
if (result != returnvalue::OK) {
return result;
}
(*sequenceCount)++;
result = handlePacketTransmissionNoReply(flashFclose);
if (result != returnvalue::OK) {
return result;
}
return result;
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::handlePacketTransmissionFlashRead(
mpsoc::TcFlashRead& tc, std::ofstream& ofile, size_t expectedReadLen) {
ReturnValue_t result = sendCommand(tc);
if (result != returnvalue::OK) {
return result;
}
result = handleAck();
if (result != returnvalue::OK) {
return result;
}
result = handleTmReception();
if (result != returnvalue::OK) {
return result;
}
// We have the nominal case where the flash read report appears first, or the case where we
// get an EXE failure immediately.
if (spReader.getApid() == mpsoc::apid::TM_FLASH_READ_REPORT) {
result = handleFlashReadReply(ofile, expectedReadLen);
if (result != returnvalue::OK) {
return result;
}
return handleExe();
} else if (spReader.getApid() == mpsoc::apid::EXE_FAILURE) {
handleExeFailure();
} else {
triggerEvent(MPSOC_EXE_INVALID_APID, spReader.getApid(), static_cast<uint32_t>(internalState));
sif::warning << "PLOC MPSoC: Expected execution report "
<< "but received space packet with apid " << std::hex << spReader.getApid()
<< std::endl;
}
return returnvalue::FAILED;
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::handlePacketTransmissionNoReply(ploc::SpTcBase& tc) {
ReturnValue_t result = sendCommand(tc);
if (result != returnvalue::OK) {
return result;
}
result = handleAck();
if (result != returnvalue::OK) {
return result;
}
return handleExe();
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::sendCommand(ploc::SpTcBase& tc) {
ReturnValue_t result = returnvalue::OK;
result = uartComIF->sendMessage(comCookie, tc.getFullPacket(), tc.getFullPacketLen());
if (result != returnvalue::OK) {
sif::warning << "PlocMPSoCHelper::sendCommand: Failed to send command" << std::endl;
triggerEvent(MPSOC_SENDING_COMMAND_FAILED, result, static_cast<uint32_t>(internalState));
return result;
}
return result;
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::handleAck() {
ReturnValue_t result = returnvalue::OK;
result = handleTmReception();
if (result != returnvalue::OK) {
return result;
}
result = checkReceivedTm();
if (result != returnvalue::OK) {
return result;
}
uint16_t apid = spReader.getApid();
if (apid != mpsoc::apid::ACK_SUCCESS) {
handleAckApidFailure(spReader);
return returnvalue::FAILED;
}
return returnvalue::OK;
}
void PlocMpsocSpecialComHelperLegacy::handleAckApidFailure(const ploc::SpTmReader& reader) {
uint16_t apid = reader.getApid();
if (apid == mpsoc::apid::ACK_FAILURE) {
uint16_t status = mpsoc::getStatusFromRawData(reader.getFullData());
sif::warning << "PLOC MPSoC ACK Failure: " << mpsoc::getStatusString(status) << std::endl;
triggerEvent(MPSOC_ACK_FAILURE_REPORT, static_cast<uint32_t>(internalState), status);
} else {
triggerEvent(MPSOC_ACK_INVALID_APID, apid, static_cast<uint32_t>(internalState));
sif::warning << "PlocMPSoCHelper::handleAckApidFailure: Expected acknowledgement report "
<< "but received space packet with apid " << std::hex << apid << std::endl;
}
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::handleExe() {
ReturnValue_t result = returnvalue::OK;
result = handleTmReception();
if (result != returnvalue::OK) {
return result;
}
result = checkReceivedTm();
if (result != returnvalue::OK) {
return result;
}
uint16_t apid = spReader.getApid();
if (apid == mpsoc::apid::EXE_FAILURE) {
handleExeFailure();
return returnvalue::FAILED;
} else if (apid != mpsoc::apid::EXE_SUCCESS) {
triggerEvent(MPSOC_EXE_INVALID_APID, apid, static_cast<uint32_t>(internalState));
sif::warning << "PLOC MPSoC: Expected execution report "
<< "but received space packet with apid " << std::hex << apid << std::endl;
}
return returnvalue::OK;
}
void PlocMpsocSpecialComHelperLegacy::handleExeFailure() {
uint16_t status = mpsoc::getStatusFromRawData(spReader.getFullData());
sif::warning << "PLOC MPSoC EXE Failure: " << mpsoc::getStatusString(status) << std::endl;
triggerEvent(MPSOC_EXE_FAILURE_REPORT, static_cast<uint32_t>(internalState));
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::handleTmReception() {
ReturnValue_t result = returnvalue::OK;
tmCountdown.resetTimer();
size_t readBytes = 0;
size_t currentBytes = 0;
uint32_t usleepDelay = 5;
size_t fullPacketLen = 0;
while (true) {
if (tmCountdown.hasTimedOut()) {
triggerEvent(MPSOC_READ_TIMEOUT, tmCountdown.getTimeoutMs());
return returnvalue::FAILED;
}
result = receive(tmBuf.data() + readBytes, 6, &currentBytes);
if (result != returnvalue::OK) {
return result;
}
spReader.setReadOnlyData(tmBuf.data(), tmBuf.size());
fullPacketLen = spReader.getFullPacketLen();
readBytes += currentBytes;
if (readBytes == 6) {
break;
}
usleep(usleepDelay);
if (usleepDelay < 200000) {
usleepDelay *= 4;
}
}
while (true) {
if (tmCountdown.hasTimedOut()) {
triggerEvent(MPSOC_READ_TIMEOUT, tmCountdown.getTimeoutMs());
return returnvalue::FAILED;
}
result = receive(tmBuf.data() + readBytes, fullPacketLen - readBytes, &currentBytes);
readBytes += currentBytes;
if (fullPacketLen == readBytes) {
break;
}
usleep(usleepDelay);
if (usleepDelay < 200000) {
usleepDelay *= 4;
}
}
// arrayprinter::print(tmBuf.data(), readBytes);
return result;
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::handleFlashReadReply(std::ofstream& ofile,
size_t expectedReadLen) {
ReturnValue_t result = checkReceivedTm();
if (result != returnvalue::OK) {
return result;
}
uint16_t apid = spReader.getApid();
if (apid != mpsoc::apid::TM_FLASH_READ_REPORT) {
triggerEvent(MPSOC_FLASH_READ_PACKET_ERROR, FlashReadErrorType::FLASH_READ_APID_ERROR);
sif::warning << "PLOC MPSoC Flash Read: Unexpected APID" << std::endl;
return result;
}
const uint8_t* packetData = spReader.getPacketData();
size_t deserDummy = spReader.getPacketDataLen() - mpsoc::CRC_SIZE;
uint32_t receivedReadLen = 0;
// I think this is buggy, weird stuff in the short name field.
// std::string receivedShortName = std::string(reinterpret_cast<const char*>(packetData), 12);
// if (receivedShortName != flashReadAndWrite.mpsocFile.substr(0, 11)) {
// sif::warning << "PLOC MPSoC Flash Read: Missmatch between request file name and "
// "received file name"
// << std::endl;
// triggerEvent(MPSOC_FLASH_READ_PACKET_ERROR, FlashReadErrorType::FLASH_READ_FILENAME_ERROR);
// return returnvalue::FAILED;
// }
packetData += 12;
result = SerializeAdapter::deSerialize(&receivedReadLen, &packetData, &deserDummy,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
if (receivedReadLen != expectedReadLen) {
sif::warning << "PLOC MPSoC Flash Read: Missmatch between request read length and "
"received read length"
<< std::endl;
triggerEvent(MPSOC_FLASH_READ_PACKET_ERROR, FlashReadErrorType::FLASH_READ_READLEN_ERROR);
return returnvalue::FAILED;
}
ofile.write(reinterpret_cast<const char*>(packetData), receivedReadLen);
return returnvalue::OK;
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::fileCheck(std::string obcFile) {
#ifdef XIPHOS_Q7S
ReturnValue_t result = FilesystemHelper::checkPath(obcFile);
if (result != returnvalue::OK) {
return result;
}
#elif defined(TE0720_1CFA)
if (not std::filesystem::exists(obcFile)) {
sif::warning << "PlocMPSoCHelper::startFlashWrite: File " << obcFile << "does not exist"
<< std::endl;
return returnvalue::FAILED;
}
#endif
return returnvalue::OK;
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::startFlashReadOrWriteBase(std::string obcFile,
std::string mpsocFile) {
ReturnValue_t result = fileCheck(obcFile);
if (result != returnvalue::OK) {
return result;
}
flashReadAndWrite.obcFile = std::move(obcFile);
flashReadAndWrite.mpsocFile = std::move(mpsocFile);
resetHelper();
return returnvalue::OK;
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::checkReceivedTm() {
ReturnValue_t result = spReader.checkSize();
if (result != returnvalue::OK) {
sif::error << "PLOC MPSoC: Size check on received TM failed" << std::endl;
triggerEvent(MPSOC_TM_SIZE_ERROR);
return result;
}
result = spReader.checkCrc();
if (result != returnvalue::OK) {
sif::warning << "PLOC MPSoC: CRC check failed" << std::endl;
triggerEvent(MPSOC_TM_CRC_MISSMATCH, *sequenceCount);
return result;
}
uint16_t recvSeqCnt = spReader.getSequenceCount();
if (recvSeqCnt != *sequenceCount) {
triggerEvent(MPSOC_HELPER_SEQ_CNT_MISMATCH, *sequenceCount, recvSeqCnt);
*sequenceCount = recvSeqCnt;
}
// This sequence count ping pong does not make any sense but it is how the MPSoC expects it.
(*sequenceCount)++;
return returnvalue::OK;
}
ReturnValue_t PlocMpsocSpecialComHelperLegacy::receive(uint8_t* data, size_t requestBytes,
size_t* readBytes) {
ReturnValue_t result = returnvalue::OK;
uint8_t* buffer = nullptr;
result = uartComIF->requestReceiveMessage(comCookie, requestBytes);
if (result != returnvalue::OK) {
sif::warning << "PlocMPSoCHelper::receive: Failed to request reply" << std::endl;
triggerEvent(MPSOC_HELPER_REQUESTING_REPLY_FAILED, result,
static_cast<uint32_t>(static_cast<uint32_t>(internalState)));
return returnvalue::FAILED;
}
result = uartComIF->readReceivedMessage(comCookie, &buffer, readBytes);
if (result != returnvalue::OK) {
sif::warning << "PlocMPSoCHelper::receive: Failed to read received message" << std::endl;
triggerEvent(MPSOC_HELPER_READING_REPLY_FAILED, result, static_cast<uint32_t>(internalState));
return returnvalue::FAILED;
}
if (*readBytes > 0) {
std::memcpy(data, buffer, *readBytes);
}
return result;
}

View File

@ -0,0 +1,200 @@
#ifndef BSP_Q7S_DEVICES_PLOCMPSOCHELPER_H_
#define BSP_Q7S_DEVICES_PLOCMPSOCHELPER_H_
#include <linux/payload/plocMpsocHelpers.h>
#include <mission/utility/trace.h>
#include <string>
#include "OBSWConfig.h"
#include "fsfw/devicehandlers/CookieIF.h"
#include "fsfw/objectmanager/SystemObject.h"
#include "fsfw/osal/linux/BinarySemaphore.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw/tasks/ExecutableObjectIF.h"
#include "fsfw/tmtcservices/SourceSequenceCounter.h"
#include "fsfw_hal/linux/serial/SerialComIF.h"
#ifdef XIPHOS_Q7S
#include "bsp_q7s/fs/SdCardManager.h"
#endif
/**
* @brief Helper class for MPSoC of PLOC intended to accelerate large data transfers between
* MPSoC and OBC.
* @author J. Meier
*/
class PlocMpsocSpecialComHelperLegacy : public SystemObject, public ExecutableObjectIF {
public:
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_MPSOC_HELPER;
//! [EXPORT] : [COMMENT] Flash write fails
static const Event MPSOC_FLASH_WRITE_FAILED = MAKE_EVENT(0, severity::LOW);
//! [EXPORT] : [COMMENT] Flash write successful
static const Event MPSOC_FLASH_WRITE_SUCCESSFUL = MAKE_EVENT(1, severity::INFO);
//! [EXPORT] : [COMMENT] Communication interface returned failure when trying to send the command
//! to the MPSoC
//! P1: Return value returned by the communication interface sendMessage function
//! P2: Internal state of MPSoC helper
static const Event MPSOC_SENDING_COMMAND_FAILED = MAKE_EVENT(2, severity::LOW);
//! [EXPORT] : [COMMENT] Request receive message of communication interface failed
//! P1: Return value returned by the communication interface requestReceiveMessage function
//! P2: Internal state of MPSoC helper
static const Event MPSOC_HELPER_REQUESTING_REPLY_FAILED = MAKE_EVENT(3, severity::LOW);
//! [EXPORT] : [COMMENT] Reading receive message of communication interface failed
//! P1: Return value returned by the communication interface readingReceivedMessage function
//! P2: Internal state of MPSoC helper
static const Event MPSOC_HELPER_READING_REPLY_FAILED = MAKE_EVENT(4, severity::LOW);
//! [EXPORT] : [COMMENT] Did not receive acknowledgment report
//! P1: Number of bytes missing
//! P2: Internal state of MPSoC helper
static const Event MPSOC_MISSING_ACK = MAKE_EVENT(5, severity::LOW);
//! [EXPORT] : [COMMENT] Did not receive execution report
//! P1: Number of bytes missing
//! P2: Internal state of MPSoC helper
static const Event MPSOC_MISSING_EXE = MAKE_EVENT(6, severity::LOW);
//! [EXPORT] : [COMMENT] Received acknowledgment failure report
//! P1: Internal state of MPSoC
static const Event MPSOC_ACK_FAILURE_REPORT = MAKE_EVENT(7, severity::LOW);
//! [EXPORT] : [COMMENT] Received execution failure report
//! P1: Internal state of MPSoC
static const Event MPSOC_EXE_FAILURE_REPORT = MAKE_EVENT(8, severity::LOW);
//! [EXPORT] : [COMMENT] Expected acknowledgment report but received space packet with other apid
//! P1: Apid of received space packet
//! P2: Internal state of MPSoC
static const Event MPSOC_ACK_INVALID_APID = MAKE_EVENT(9, severity::LOW);
//! [EXPORT] : [COMMENT] Expected execution report but received space packet with other apid
//! P1: Apid of received space packet
//! P2: Internal state of MPSoC
static const Event MPSOC_EXE_INVALID_APID = MAKE_EVENT(10, severity::LOW);
//! [EXPORT] : [COMMENT] Received sequence count does not match expected sequence count
//! P1: Expected sequence count
//! P2: Received sequence count
static const Event MPSOC_HELPER_SEQ_CNT_MISMATCH = MAKE_EVENT(11, severity::LOW);
static const Event MPSOC_TM_SIZE_ERROR = MAKE_EVENT(12, severity::LOW);
static const Event MPSOC_TM_CRC_MISSMATCH = MAKE_EVENT(13, severity::LOW);
static const Event MPSOC_FLASH_READ_PACKET_ERROR = MAKE_EVENT(14, severity::LOW);
static const Event MPSOC_FLASH_READ_FAILED = MAKE_EVENT(15, severity::LOW);
static const Event MPSOC_FLASH_READ_SUCCESSFUL = MAKE_EVENT(16, severity::INFO);
static const Event MPSOC_READ_TIMEOUT = MAKE_EVENT(17, severity::LOW);
enum FlashReadErrorType : uint32_t {
FLASH_READ_APID_ERROR = 0,
FLASH_READ_FILENAME_ERROR = 1,
FLASH_READ_READLEN_ERROR = 2
};
PlocMpsocSpecialComHelperLegacy(object_id_t objectId);
virtual ~PlocMpsocSpecialComHelperLegacy();
ReturnValue_t initialize() override;
ReturnValue_t performOperation(uint8_t operationCode = 0) override;
ReturnValue_t setComIF(DeviceCommunicationIF* communicationInterface_);
void setComCookie(CookieIF* comCookie_);
/**
* @brief Starts flash write sequence
*
* @param obcFile File where to read from the data
* @param mpsocFile The file of the MPSoC where should be written to
*
* @return returnvalue::OK if successful, otherwise error return value
*/
ReturnValue_t startFlashWrite(std::string obcFile, std::string mpsocFile);
/**
*
* @param obcFile Full target file name on OBC
* @param mpsocFile The file on the MPSoC which should be copied ot the OBC
* @param readFileSize The size of the file on the MPSoC.
* @return
*/
ReturnValue_t startFlashRead(std::string obcFile, std::string mpsocFile, size_t readFileSize);
/**
* @brief Can be used to interrupt a running data transfer.
*/
void stopProcess();
/**
* @brief Sets the sequence count object responsible for the sequence count handling
*/
void setSequenceCount(SourceSequenceCounter* sequenceCount_);
private:
static const uint8_t INTERFACE_ID = CLASS_ID::PLOC_MPSOC_HELPER;
//! [EXPORT] : [COMMENT] File error occured for file transfers from OBC to the MPSoC.
static const ReturnValue_t FILE_WRITE_ERROR = MAKE_RETURN_CODE(0xA0);
//! [EXPORT] : [COMMENT] File error occured for file transfers from MPSoC to OBC.
static const ReturnValue_t FILE_READ_ERROR = MAKE_RETURN_CODE(0xA1);
// Maximum number of times the communication interface retries polling data from the reply
// buffer
static const int RETRIES = 10000;
struct FlashInfo {
std::string obcFile;
std::string mpsocFile;
};
struct FlashRead : public FlashInfo {
size_t totalReadSize = 0;
};
struct FlashRead flashReadAndWrite;
#if OBSW_THREAD_TRACING == 1
uint32_t opCounter = 0;
#endif
enum class InternalState { IDLE, FLASH_WRITE, FLASH_READ };
InternalState internalState = InternalState::IDLE;
BinarySemaphore semaphore;
#ifdef XIPHOS_Q7S
SdCardManager* sdcMan = nullptr;
#endif
uint8_t commandBuffer[mpsoc::MAX_COMMAND_SIZE];
SpacePacketCreator creator;
ploc::SpTcParams spParams = ploc::SpTcParams(creator);
Countdown tmCountdown = Countdown(5000);
std::array<uint8_t, mpsoc::SP_MAX_DATA_SIZE> fileBuf{};
std::array<uint8_t, mpsoc::MAX_REPLY_SIZE> tmBuf{};
bool terminate = false;
/**
* Communication interface of MPSoC responsible for low level access. Must be set by the
* MPSoC Handler.
*/
SerialComIF* uartComIF = nullptr;
// Communication cookie. Must be set by the MPSoC Handler
CookieIF* comCookie = nullptr;
// Sequence count, must be set by Ploc MPSoC Handler
SourceSequenceCounter* sequenceCount = nullptr;
ploc::SpTmReader spReader;
void resetHelper();
ReturnValue_t performFlashWrite();
ReturnValue_t performFlashRead();
ReturnValue_t flashfopen(uint8_t accessMode);
ReturnValue_t flashfclose();
ReturnValue_t handlePacketTransmissionNoReply(ploc::SpTcBase& tc);
ReturnValue_t handlePacketTransmissionFlashRead(mpsoc::TcFlashRead& tc, std::ofstream& ofile,
size_t expectedReadLen);
ReturnValue_t handleFlashReadReply(std::ofstream& ofile, size_t expectedReadLen);
ReturnValue_t sendCommand(ploc::SpTcBase& tc);
ReturnValue_t receive(uint8_t* data, size_t requestBytes, size_t* readBytes);
ReturnValue_t handleAck();
ReturnValue_t handleExe();
ReturnValue_t startFlashReadOrWriteBase(std::string obcFile, std::string mpsocFile);
ReturnValue_t fileCheck(std::string obcFile);
void handleAckApidFailure(const ploc::SpTmReader& reader);
void handleExeFailure();
ReturnValue_t handleTmReception();
ReturnValue_t checkReceivedTm();
};
#endif /* BSP_Q7S_DEVICES_PLOCMPSOCHELPER_H_ */

View File

@ -48,6 +48,7 @@
#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1
#define OBSW_PRINT_MISSED_DEADLINES 1
#define OBSW_MPSOC_JTAG_BOOT 0
#define OBSW_SYRLINKS_SIMULATED 1
#define OBSW_ADD_TEST_CODE 0
#define OBSW_ADD_TEST_TASK 0

View File

@ -1,7 +1,7 @@
/**
* @brief Auto-generated event translation file. Contains 320 translations.
* @brief Auto-generated event translation file. Contains 325 translations.
* @details
* Generated on: 2024-02-29 13:15:00
* Generated on: 2024-05-06 13:47:38
*/
#include "translateEvents.h"
@ -82,8 +82,11 @@ const char *BIT_LOCK_STRING = "BIT_LOCK";
const char *BIT_LOCK_LOST_STRING = "BIT_LOCK_LOST";
const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED";
const char *CLOCK_SET_STRING = "CLOCK_SET";
const char *CLOCK_DUMP_STRING = "CLOCK_DUMP";
const char *CLOCK_DUMP_LEGACY_STRING = "CLOCK_DUMP_LEGACY";
const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE";
const char *CLOCK_DUMP_STRING = "CLOCK_DUMP";
const char *CLOCK_DUMP_BEFORE_SETTING_TIME_STRING = "CLOCK_DUMP_BEFORE_SETTING_TIME";
const char *CLOCK_DUMP_AFTER_SETTING_TIME_STRING = "CLOCK_DUMP_AFTER_SETTING_TIME";
const char *TC_DELETION_FAILED_STRING = "TC_DELETION_FAILED";
const char *TEST_STRING = "TEST";
const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER";
@ -139,6 +142,7 @@ const char *MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH_STRING = "MPSOC_HANDLER_SEQUEN
const char *MPSOC_SHUTDOWN_FAILED_STRING = "MPSOC_SHUTDOWN_FAILED";
const char *SUPV_NOT_ON_STRING = "SUPV_NOT_ON";
const char *SUPV_REPLY_TIMEOUT_STRING = "SUPV_REPLY_TIMEOUT";
const char *CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE_STRING = "CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE";
const char *SELF_TEST_I2C_FAILURE_STRING = "SELF_TEST_I2C_FAILURE";
const char *SELF_TEST_SPI_FAILURE_STRING = "SELF_TEST_SPI_FAILURE";
const char *SELF_TEST_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE";
@ -241,6 +245,7 @@ const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_12903_STRING = "SIDE_SWITCH_TRANS
const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE";
const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE";
const char *CANT_GET_FIX_STRING = "CANT_GET_FIX";
const char *RESET_FAIL_STRING = "RESET_FAIL";
const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT";
const char *BATT_MODE_STRING = "BATT_MODE";
const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED";
@ -483,9 +488,15 @@ const char *translateEvents(Event event) {
case (8900):
return CLOCK_SET_STRING;
case (8901):
return CLOCK_DUMP_STRING;
return CLOCK_DUMP_LEGACY_STRING;
case (8902):
return CLOCK_SET_FAILURE_STRING;
case (8903):
return CLOCK_DUMP_STRING;
case (8904):
return CLOCK_DUMP_BEFORE_SETTING_TIME_STRING;
case (8905):
return CLOCK_DUMP_AFTER_SETTING_TIME_STRING;
case (9100):
return TC_DELETION_FAILED_STRING;
case (9700):
@ -596,6 +607,8 @@ const char *translateEvents(Event event) {
return SUPV_NOT_ON_STRING;
case (11608):
return SUPV_REPLY_TIMEOUT_STRING;
case (11609):
return CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE_STRING;
case (11701):
return SELF_TEST_I2C_FAILURE_STRING;
case (11702):
@ -800,6 +813,8 @@ const char *translateEvents(Event event) {
return GPS_FIX_CHANGE_STRING;
case (13101):
return CANT_GET_FIX_STRING;
case (13102):
return RESET_FAIL_STRING;
case (13200):
return P60_BOOT_COUNT_STRING;
case (13201):

View File

@ -1,8 +1,8 @@
/**
* @brief Auto-generated object translation file.
* @details
* Contains 175 translations.
* Generated on: 2024-02-29 13:15:00
* Contains 176 translations.
* Generated on: 2024-05-06 13:47:38
*/
#include "translateObjects.h"
@ -65,6 +65,7 @@ const char *PTME_VC3_CFDP_TM_STRING = "PTME_VC3_CFDP_TM";
const char *PLOC_MPSOC_HANDLER_STRING = "PLOC_MPSOC_HANDLER";
const char *PLOC_SUPERVISOR_HANDLER_STRING = "PLOC_SUPERVISOR_HANDLER";
const char *PLOC_SUPERVISOR_HELPER_STRING = "PLOC_SUPERVISOR_HELPER";
const char *PLOC_MPSOC_COMMUNICATION_STRING = "PLOC_MPSOC_COMMUNICATION";
const char *SCEX_STRING = "SCEX";
const char *SOLAR_ARRAY_DEPL_HANDLER_STRING = "SOLAR_ARRAY_DEPL_HANDLER";
const char *HEATER_HANDLER_STRING = "HEATER_HANDLER";
@ -302,6 +303,8 @@ const char *translateObject(object_id_t object) {
return PLOC_SUPERVISOR_HANDLER_STRING;
case 0x44330017:
return PLOC_SUPERVISOR_HELPER_STRING;
case 0x44330018:
return PLOC_MPSOC_COMMUNICATION_STRING;
case 0x44330032:
return SCEX_STRING;
case 0x444100A2:

View File

@ -39,8 +39,6 @@
#include "devices/gpioIds.h"
#include "fsfw_hal/linux/gpio/Gpio.h"
#include "linux/payload/FreshSupvHandler.h"
#include "linux/payload/PlocMpsocHandler.h"
#include "linux/payload/PlocMpsocSpecialComHelper.h"
#include "linux/payload/PlocSupvUartMan.h"
#include "test/gpio/DummyGpioIF.h"
#endif
@ -79,7 +77,10 @@ void ObjectFactory::produce(void* args) {
switcherList.emplace_back(initVal);
}
dummySwitcher->setInitialSwitcherList(switcherList);
#ifdef PLATFORM_UNIX
// Obsolete dev handler..
/*
new SerialComIF(objects::UART_COM_IF);
#if OBSW_ADD_PLOC_MPSOC == 1
std::string mpscoDev = "";
@ -90,7 +91,8 @@ void ObjectFactory::produce(void* args) {
new PlocMpsocHandler(objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocCookie,
plocMpsocHelper, Gpio(gpioIds::ENABLE_MPSOC_UART, dummyGpioIF),
objects::PLOC_SUPERVISOR_HANDLER);
#endif /* OBSW_ADD_PLOC_MPSOC == 1 */
#endif // OBSW_ADD_PLOC_MPSOC == 1
*/
#if OBSW_ADD_PLOC_SUPERVISOR == 1
std::string plocSupvString = "/dev/ploc_supv";
auto supervisorCookie =

View File

@ -2150,8 +2150,7 @@ ReturnValue_t CoreController::initClockFromTimeFile() {
std::string fileName = currMntPrefix + BACKUP_TIME_FILE;
std::error_code e;
if (sdcMan->isSdCardUsable(std::nullopt) and std::filesystem::exists(fileName, e) and
((gpsFix == FixMode::UNKNOWN or gpsFix == FixMode::NOT_SEEN) or
not utility::timeSanityCheck())) {
((gpsFix == FixMode::NOT_SEEN) or not utility::timeSanityCheck())) {
ifstream timeFile(fileName);
string nextWord;
getline(timeFile, nextWord);

View File

@ -9,7 +9,7 @@
#include <fsfw/parameters/ReceivesParameterMessagesIF.h>
#include <fsfw_hal/linux/uio/UioMapper.h>
#include <libxiphos.h>
#include <mission/acs/archive/GPSDefinitions.h>
#include <linux/acs/GPSDefinitions.h>
#include <mission/utility/trace.h>
#include <atomic>
@ -211,7 +211,7 @@ class CoreController : public ExtendedControllerBase, public ReceivesParameterMe
static constexpr MutexIF::TimeoutType TIMEOUT_TYPE = MutexIF::TimeoutType::WAITING;
static constexpr uint32_t MUTEX_TIMEOUT = 20;
bool enableHkSet = false;
GpsHyperion::FixMode gpsFix = GpsHyperion::FixMode::UNKNOWN;
GpsHyperion::FixMode gpsFix = GpsHyperion::FixMode::NOT_SEEN;
// States for SD state machine, which is used in non-blocking mode
enum class SdStates {

View File

@ -10,8 +10,9 @@
#include <linux/acs/RwPollingTask.h>
#include <linux/acs/StrComHandler.h>
#include <linux/com/SyrlinksComHandler.h>
#include <linux/payload/FreshMpsocHandler.h>
#include <linux/payload/MpsocCommunication.h>
#include <linux/payload/PlocMemoryDumper.h>
#include <linux/payload/PlocMpsocHandler.h>
#include <linux/payload/PlocMpsocSpecialComHelper.h>
#include <linux/payload/ScexUartReader.h>
#include <linux/payload/plocMpsocHelpers.h>
@ -47,6 +48,7 @@
#include "devices/gpioIds.h"
#include "devices/powerSwitcherList.h"
#include "eive/definitions.h"
#include "eive/objects.h"
#include "fsfw/ipc/QueueFactory.h"
#include "linux/ObjectFactory.h"
#include "linux/boardtest/I2cTestClass.h"
@ -59,7 +61,11 @@
#include "linux/ipcore/Ptme.h"
#include "linux/ipcore/PtmeConfig.h"
#include "linux/payload/FreshSupvHandler.h"
#include "linux/payload/MpsocCommunication.h"
#include "linux/payload/PlocMpsocSpecialComHelper.h"
#include "linux/payload/SerialConfig.h"
#include "mission/config/configfile.h"
#include "mission/power/defs.h"
#include "mission/system/acs/AcsBoardFdir.h"
#include "mission/system/acs/AcsSubsystem.h"
#include "mission/system/acs/RwAssembly.h"
@ -67,7 +73,7 @@
#include "mission/system/acs/acsModeTree.h"
#include "mission/system/com/SyrlinksFdir.h"
#include "mission/system/com/comModeTree.h"
#include "mission/system/payloadModeTree.h"
#include "mission/system/payload/payloadModeTree.h"
#include "mission/system/power/GomspacePowerFdir.h"
#include "mission/system/tcs/RtdFdir.h"
#include "mission/system/tcs/TcsBoardAssembly.h"
@ -510,7 +516,7 @@ void ObjectFactory::createAcsBoardComponents(SpiComIF& spiComIF, LinuxLibgpioIF*
debugGps = true;
#endif
RESET_ARGS_GNSS.gpioComIF = gpioComIF;
RESET_ARGS_GNSS.waitPeriodMs = 5;
RESET_ARGS_GNSS.waitPeriodMs = 10 * 1e3;
auto gpsCtrl = new GpsHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT,
enableHkSets, debugGps);
gpsCtrl->setResetPinTriggerFunction(gps::triggerGpioResetPin, &RESET_ARGS_GNSS);
@ -624,14 +630,15 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit
auto mpsocGpioCookie = new GpioCookie;
mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC);
gpioChecker(gpioComIF->addGpios(mpsocGpioCookie), "PLOC MPSoC");
auto mpsocCookie =
new SerialCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV,
serial::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
mpsocCookie->setNoFixedSizeReply();
auto plocMpsocHelper = new PlocMpsocSpecialComHelper(objects::PLOC_MPSOC_HELPER);
auto* mpsocHandler = new PlocMpsocHandler(
objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocCookie, plocMpsocHelper,
Gpio(gpioIds::ENABLE_MPSOC_UART, gpioComIF), objects::PLOC_SUPERVISOR_HANDLER);
SerialConfig serialCfg(q7s::UART_PLOC_MPSOC_DEV, serial::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE,
UartModes::NON_CANONICAL);
auto mpsocCommunication = new MpsocCommunication(objects::PLOC_MPSOC_COMMUNICATION, serialCfg);
auto specialComHelper =
new PlocMpsocSpecialComHelper(objects::PLOC_MPSOC_HELPER, *mpsocCommunication);
DhbConfig dhbConf(objects::PLOC_MPSOC_HANDLER);
auto* mpsocHandler = new FreshMpsocHandler(
dhbConf, *mpsocCommunication, *specialComHelper, Gpio(gpioIds::ENABLE_MPSOC_UART, gpioComIF),
objects::PLOC_SUPERVISOR_HANDLER, pwrSwitcher, power::PDU2_CH8_PAYLOAD_CAMERA);
mpsocHandler->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
#endif /* OBSW_ADD_PLOC_MPSOC == 1 */
#if OBSW_ADD_PLOC_SUPERVISOR == 1
@ -650,7 +657,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit
supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL);
supervisorCookie->setNoFixedSizeReply();
new PlocSupvUartManager(objects::PLOC_SUPERVISOR_HELPER);
DhbConfig dhbConf(objects::PLOC_SUPERVISOR_HANDLER);
dhbConf = DhbConfig(objects::PLOC_SUPERVISOR_HANDLER);
auto* supvHandler =
new FreshSupvHandler(dhbConf, supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF),
pwrSwitcher, power::PDU1_CH6_PLOC_12V);

View File

@ -77,6 +77,7 @@ enum commonObjects : uint32_t {
PLOC_MPSOC_HANDLER = 0x44330015,
PLOC_SUPERVISOR_HANDLER = 0x44330016,
PLOC_SUPERVISOR_HELPER = 0x44330017,
PLOC_MPSOC_COMMUNICATION = 0x44330018,
SCEX = 0x44330032,
SOLAR_ARRAY_DEPL_HANDLER = 0x444100A2,
HEATER_HANDLER = 0x444100A4,

View File

@ -42,6 +42,7 @@ enum commonClassIds : uint8_t {
PERSISTENT_TM_STORE, // PTM
TM_SINK, // TMS
VIRTUAL_CHANNEL, // VCS
PLOC_MPSOC_COM, // PLMPCOM
COMMON_CLASS_ID_END // [EXPORT] : [END]
};
}

View File

@ -2,7 +2,7 @@
#define DUMMIES_GPSCTRLDUMMY_H_
#include <fsfw/controller/ExtendedControllerBase.h>
#include <mission/acs/archive/GPSDefinitions.h>
#include <linux/acs/GPSDefinitions.h>
class GpsCtrlDummy : public ExtendedControllerBase {
public:

View File

@ -1,5 +1,5 @@
#include <dummies/GpsDhbDummy.h>
#include <mission/acs/archive/GPSDefinitions.h>
#include <linux/acs/GPSDefinitions.h>
GpsDhbDummy::GpsDhbDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie) {}

View File

@ -40,7 +40,7 @@
#include "mission/genericFactory.h"
#include "mission/system/acs/acsModeTree.h"
#include "mission/system/com/comModeTree.h"
#include "mission/system/payloadModeTree.h"
#include "mission/system/payload/payloadModeTree.h"
#include "mission/system/tcs/tcsModeTree.h"
#include "mission/tcs/defs.h"

2
fsfw

@ -1 +1 @@
Subproject commit 47b21caf5fa2a27c7ace89f960141b3f24c329ee
Subproject commit 42867ad0cba088ab1cb6cb672d001f991f7e4a60

View File

@ -75,9 +75,12 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
7902;0x1ede;BIT_LOCK;INFO;A Bit Lock signal. Was detected. P1: raw BLO state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
7903;0x1edf;BIT_LOCK_LOST;INFO;A previously found Bit Lock signal was lost. P1: raw BLO state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
7905;0x1ee1;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
8900;0x22c4;CLOCK_SET;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
8901;0x22c5;CLOCK_DUMP;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
8902;0x22c6;CLOCK_SET_FAILURE;LOW;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
8900;0x22c4;CLOCK_SET;INFO;Clock has been set. P1: old timeval seconds. P2: new timeval seconds.;fsfw/src/fsfw/pus/Service9TimeManagement.h
8901;0x22c5;CLOCK_DUMP_LEGACY;INFO;Clock dump event. P1: timeval seconds P2: timeval milliseconds.;fsfw/src/fsfw/pus/Service9TimeManagement.h
8902;0x22c6;CLOCK_SET_FAILURE;LOW;Clock could not be set. P1: Returncode.;fsfw/src/fsfw/pus/Service9TimeManagement.h
8903;0x22c7;CLOCK_DUMP;INFO;Clock dump event. P1: timeval seconds P2: timeval microseconds.;fsfw/src/fsfw/pus/Service9TimeManagement.h
8904;0x22c8;CLOCK_DUMP_BEFORE_SETTING_TIME;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
8905;0x22c9;CLOCK_DUMP_AFTER_SETTING_TIME;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
9100;0x238c;TC_DELETION_FAILED;MEDIUM;Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
9700;0x25e4;TEST;INFO;No description;fsfw/src/fsfw/pus/Service17Test.h
10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;No description;fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
@ -125,14 +128,15 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
11506;0x2cf2;DEPL_SA1_GPIO_SWTICH_OFF_FAILED;HIGH;No description;mission/SolarArrayDeploymentHandler.h
11507;0x2cf3;DEPL_SA2_GPIO_SWTICH_OFF_FAILED;HIGH;No description;mission/SolarArrayDeploymentHandler.h
11508;0x2cf4;AUTONOMOUS_DEPLOYMENT_COMPLETED;INFO;No description;mission/SolarArrayDeploymentHandler.h
11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/payload/PlocMpsocHandler.h
11602;0x2d52;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux/payload/PlocMpsocHandler.h
11603;0x2d53;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux/payload/PlocMpsocHandler.h
11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/payload/PlocMpsocHandler.h
11605;0x2d55;MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/payload/PlocMpsocHandler.h
11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux/payload/PlocMpsocHandler.h
11607;0x2d57;SUPV_NOT_ON;LOW;SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition.;linux/payload/PlocMpsocHandler.h
11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;No description;linux/payload/PlocMpsocHandler.h
11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/payload/plocMpsocHelpers.h
11602;0x2d52;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux/payload/plocMpsocHelpers.h
11603;0x2d53;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux/payload/plocMpsocHelpers.h
11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/payload/plocMpsocHelpers.h
11605;0x2d55;MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/payload/plocMpsocHelpers.h
11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux/payload/plocMpsocHelpers.h
11607;0x2d57;SUPV_NOT_ON;LOW;SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition.;linux/payload/plocMpsocHelpers.h
11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;SUPV reply timeout.;linux/payload/plocMpsocHelpers.h
11609;0x2d59;CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE;LOW;Camera must be commanded on first.;linux/payload/plocMpsocHelpers.h
11701;0x2db5;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h
11702;0x2db6;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h
11703;0x2db7;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h
@ -233,8 +237,9 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;No description;mission/system/acs/SusAssembly.h
12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/acs/SusAssembly.h
13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;No description;mission/system/tcs/TcsBoardAssembly.h
13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;mission/acs/archive/GPSDefinitions.h
13101;0x332d;CANT_GET_FIX;LOW;Could not get fix in maximum allowed time. P1: Maximum allowed time to get a fix after the GPS was switched on.;mission/acs/archive/GPSDefinitions.h
13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: New fix. P2: Missed fix changes 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;linux/acs/GPSDefinitions.h
13101;0x332d;CANT_GET_FIX;MEDIUM;Could not get fix in maximum allowed time. Trying to reset both GNSS devices. P1: Maximum allowed time to get a fix after the GPS was switched on.;linux/acs/GPSDefinitions.h
13102;0x332e;RESET_FAIL;HIGH;Failed to reset an GNNS Device. P1: Board-Side.;linux/acs/GPSDefinitions.h
13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission/power/P60DockHandler.h
13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission/power/P60DockHandler.h
13202;0x3392;BATT_MODE_CHANGED;MEDIUM;Battery mode has changed. P1: Old mode. P2: New mode;mission/power/P60DockHandler.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
75 7902 0x1ede BIT_LOCK INFO A Bit Lock signal. Was detected. P1: raw BLO state, P2: 0 fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
76 7903 0x1edf BIT_LOCK_LOST INFO A previously found Bit Lock signal was lost. P1: raw BLO state, P2: 0 fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
77 7905 0x1ee1 FRAME_PROCESSING_FAILED LOW The CCSDS Board could not interpret a TC fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
78 8900 0x22c4 CLOCK_SET INFO No description Clock has been set. P1: old timeval seconds. P2: new timeval seconds. fsfw/src/fsfw/pus/Service9TimeManagement.h
79 8901 0x22c5 CLOCK_DUMP CLOCK_DUMP_LEGACY INFO No description Clock dump event. P1: timeval seconds P2: timeval milliseconds. fsfw/src/fsfw/pus/Service9TimeManagement.h
80 8902 0x22c6 CLOCK_SET_FAILURE LOW No description Clock could not be set. P1: Returncode. fsfw/src/fsfw/pus/Service9TimeManagement.h
81 8903 0x22c7 CLOCK_DUMP INFO Clock dump event. P1: timeval seconds P2: timeval microseconds. fsfw/src/fsfw/pus/Service9TimeManagement.h
82 8904 0x22c8 CLOCK_DUMP_BEFORE_SETTING_TIME INFO No description fsfw/src/fsfw/pus/Service9TimeManagement.h
83 8905 0x22c9 CLOCK_DUMP_AFTER_SETTING_TIME INFO No description fsfw/src/fsfw/pus/Service9TimeManagement.h
84 9100 0x238c TC_DELETION_FAILED MEDIUM Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
85 9700 0x25e4 TEST INFO No description fsfw/src/fsfw/pus/Service17Test.h
86 10600 0x2968 CHANGE_OF_SETUP_PARAMETER LOW No description fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
128 11506 0x2cf2 DEPL_SA1_GPIO_SWTICH_OFF_FAILED HIGH No description mission/SolarArrayDeploymentHandler.h
129 11507 0x2cf3 DEPL_SA2_GPIO_SWTICH_OFF_FAILED HIGH No description mission/SolarArrayDeploymentHandler.h
130 11508 0x2cf4 AUTONOMOUS_DEPLOYMENT_COMPLETED INFO No description mission/SolarArrayDeploymentHandler.h
131 11601 0x2d51 MEMORY_READ_RPT_CRC_FAILURE LOW PLOC crc failure in telemetry packet linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
132 11602 0x2d52 ACK_FAILURE LOW PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
133 11603 0x2d53 EXE_FAILURE LOW PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
134 11604 0x2d54 MPSOC_HANDLER_CRC_FAILURE LOW PLOC reply has invalid crc linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
135 11605 0x2d55 MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH LOW Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
136 11606 0x2d56 MPSOC_SHUTDOWN_FAILED HIGH Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor. linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
137 11607 0x2d57 SUPV_NOT_ON LOW SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition. linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
138 11608 0x2d58 SUPV_REPLY_TIMEOUT LOW No description SUPV reply timeout. linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
139 11609 0x2d59 CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE LOW Camera must be commanded on first. linux/payload/plocMpsocHelpers.h
140 11701 0x2db5 SELF_TEST_I2C_FAILURE LOW Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA mission/acs/ImtqHandler.h
141 11702 0x2db6 SELF_TEST_SPI_FAILURE LOW Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA mission/acs/ImtqHandler.h
142 11703 0x2db7 SELF_TEST_ADC_FAILURE LOW Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA mission/acs/ImtqHandler.h
237 12902 0x3266 POWER_STATE_MACHINE_TIMEOUT MEDIUM No description mission/system/acs/SusAssembly.h
238 12903 0x3267 SIDE_SWITCH_TRANSITION_NOT_ALLOWED LOW Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination mission/system/acs/SusAssembly.h
239 13000 0x32c8 CHILDREN_LOST_MODE MEDIUM No description mission/system/tcs/TcsBoardAssembly.h
240 13100 0x332c GPS_FIX_CHANGE INFO Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix Fix has changed. P1: New fix. P2: Missed fix changes 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix mission/acs/archive/GPSDefinitions.h linux/acs/GPSDefinitions.h
241 13101 0x332d CANT_GET_FIX LOW MEDIUM Could not get fix in maximum allowed time. P1: Maximum allowed time to get a fix after the GPS was switched on. Could not get fix in maximum allowed time. Trying to reset both GNSS devices. P1: Maximum allowed time to get a fix after the GPS was switched on. mission/acs/archive/GPSDefinitions.h linux/acs/GPSDefinitions.h
242 13102 0x332e RESET_FAIL HIGH Failed to reset an GNNS Device. P1: Board-Side. linux/acs/GPSDefinitions.h
243 13200 0x3390 P60_BOOT_COUNT INFO P60 boot count is broadcasted once at SW startup. P1: Boot count mission/power/P60DockHandler.h
244 13201 0x3391 BATT_MODE INFO Battery mode is broadcasted at startup. P1: Mode mission/power/P60DockHandler.h
245 13202 0x3392 BATT_MODE_CHANGED MEDIUM Battery mode has changed. P1: Old mode. P2: New mode mission/power/P60DockHandler.h

View File

@ -57,6 +57,7 @@
0x44330015;PLOC_MPSOC_HANDLER
0x44330016;PLOC_SUPERVISOR_HANDLER
0x44330017;PLOC_SUPERVISOR_HELPER
0x44330018;PLOC_MPSOC_COMMUNICATION
0x44330032;SCEX
0x444100A2;SOLAR_ARRAY_DEPL_HANDLER
0x444100A4;HEATER_HANDLER

1 0x42694269 TEST_TASK
57 0x44330015 PLOC_MPSOC_HANDLER
58 0x44330016 PLOC_SUPERVISOR_HANDLER
59 0x44330017 PLOC_SUPERVISOR_HELPER
60 0x44330018 PLOC_MPSOC_COMMUNICATION
61 0x44330032 SCEX
62 0x444100A2 SOLAR_ARRAY_DEPL_HANDLER
63 0x444100A4 HEATER_HANDLER

View File

@ -75,9 +75,12 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
7902;0x1ede;BIT_LOCK;INFO;A Bit Lock signal. Was detected. P1: raw BLO state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
7903;0x1edf;BIT_LOCK_LOST;INFO;A previously found Bit Lock signal was lost. P1: raw BLO state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
7905;0x1ee1;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
8900;0x22c4;CLOCK_SET;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
8901;0x22c5;CLOCK_DUMP;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
8902;0x22c6;CLOCK_SET_FAILURE;LOW;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
8900;0x22c4;CLOCK_SET;INFO;Clock has been set. P1: old timeval seconds. P2: new timeval seconds.;fsfw/src/fsfw/pus/Service9TimeManagement.h
8901;0x22c5;CLOCK_DUMP_LEGACY;INFO;Clock dump event. P1: timeval seconds P2: timeval milliseconds.;fsfw/src/fsfw/pus/Service9TimeManagement.h
8902;0x22c6;CLOCK_SET_FAILURE;LOW;Clock could not be set. P1: Returncode.;fsfw/src/fsfw/pus/Service9TimeManagement.h
8903;0x22c7;CLOCK_DUMP;INFO;Clock dump event. P1: timeval seconds P2: timeval microseconds.;fsfw/src/fsfw/pus/Service9TimeManagement.h
8904;0x22c8;CLOCK_DUMP_BEFORE_SETTING_TIME;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
8905;0x22c9;CLOCK_DUMP_AFTER_SETTING_TIME;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
9100;0x238c;TC_DELETION_FAILED;MEDIUM;Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
9700;0x25e4;TEST;INFO;No description;fsfw/src/fsfw/pus/Service17Test.h
10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;No description;fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
@ -125,14 +128,15 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
11506;0x2cf2;DEPL_SA1_GPIO_SWTICH_OFF_FAILED;HIGH;No description;mission/SolarArrayDeploymentHandler.h
11507;0x2cf3;DEPL_SA2_GPIO_SWTICH_OFF_FAILED;HIGH;No description;mission/SolarArrayDeploymentHandler.h
11508;0x2cf4;AUTONOMOUS_DEPLOYMENT_COMPLETED;INFO;No description;mission/SolarArrayDeploymentHandler.h
11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/payload/PlocMpsocHandler.h
11602;0x2d52;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux/payload/PlocMpsocHandler.h
11603;0x2d53;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux/payload/PlocMpsocHandler.h
11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/payload/PlocMpsocHandler.h
11605;0x2d55;MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/payload/PlocMpsocHandler.h
11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux/payload/PlocMpsocHandler.h
11607;0x2d57;SUPV_NOT_ON;LOW;SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition.;linux/payload/PlocMpsocHandler.h
11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;No description;linux/payload/PlocMpsocHandler.h
11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/payload/plocMpsocHelpers.h
11602;0x2d52;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux/payload/plocMpsocHelpers.h
11603;0x2d53;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux/payload/plocMpsocHelpers.h
11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/payload/plocMpsocHelpers.h
11605;0x2d55;MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/payload/plocMpsocHelpers.h
11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux/payload/plocMpsocHelpers.h
11607;0x2d57;SUPV_NOT_ON;LOW;SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition.;linux/payload/plocMpsocHelpers.h
11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;SUPV reply timeout.;linux/payload/plocMpsocHelpers.h
11609;0x2d59;CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE;LOW;Camera must be commanded on first.;linux/payload/plocMpsocHelpers.h
11701;0x2db5;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h
11702;0x2db6;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h
11703;0x2db7;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h
@ -233,8 +237,9 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;No description;mission/system/acs/SusAssembly.h
12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/acs/SusAssembly.h
13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;No description;mission/system/tcs/TcsBoardAssembly.h
13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;mission/acs/archive/GPSDefinitions.h
13101;0x332d;CANT_GET_FIX;LOW;Could not get fix in maximum allowed time. P1: Maximum allowed time to get a fix after the GPS was switched on.;mission/acs/archive/GPSDefinitions.h
13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: New fix. P2: Missed fix changes 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;linux/acs/GPSDefinitions.h
13101;0x332d;CANT_GET_FIX;MEDIUM;Could not get fix in maximum allowed time. Trying to reset both GNSS devices. P1: Maximum allowed time to get a fix after the GPS was switched on.;linux/acs/GPSDefinitions.h
13102;0x332e;RESET_FAIL;HIGH;Failed to reset an GNNS Device. P1: Board-Side.;linux/acs/GPSDefinitions.h
13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission/power/P60DockHandler.h
13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission/power/P60DockHandler.h
13202;0x3392;BATT_MODE_CHANGED;MEDIUM;Battery mode has changed. P1: Old mode. P2: New mode;mission/power/P60DockHandler.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
75 7902 0x1ede BIT_LOCK INFO A Bit Lock signal. Was detected. P1: raw BLO state, P2: 0 fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
76 7903 0x1edf BIT_LOCK_LOST INFO A previously found Bit Lock signal was lost. P1: raw BLO state, P2: 0 fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
77 7905 0x1ee1 FRAME_PROCESSING_FAILED LOW The CCSDS Board could not interpret a TC fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
78 8900 0x22c4 CLOCK_SET INFO No description Clock has been set. P1: old timeval seconds. P2: new timeval seconds. fsfw/src/fsfw/pus/Service9TimeManagement.h
79 8901 0x22c5 CLOCK_DUMP CLOCK_DUMP_LEGACY INFO No description Clock dump event. P1: timeval seconds P2: timeval milliseconds. fsfw/src/fsfw/pus/Service9TimeManagement.h
80 8902 0x22c6 CLOCK_SET_FAILURE LOW No description Clock could not be set. P1: Returncode. fsfw/src/fsfw/pus/Service9TimeManagement.h
81 8903 0x22c7 CLOCK_DUMP INFO Clock dump event. P1: timeval seconds P2: timeval microseconds. fsfw/src/fsfw/pus/Service9TimeManagement.h
82 8904 0x22c8 CLOCK_DUMP_BEFORE_SETTING_TIME INFO No description fsfw/src/fsfw/pus/Service9TimeManagement.h
83 8905 0x22c9 CLOCK_DUMP_AFTER_SETTING_TIME INFO No description fsfw/src/fsfw/pus/Service9TimeManagement.h
84 9100 0x238c TC_DELETION_FAILED MEDIUM Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
85 9700 0x25e4 TEST INFO No description fsfw/src/fsfw/pus/Service17Test.h
86 10600 0x2968 CHANGE_OF_SETUP_PARAMETER LOW No description fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
128 11506 0x2cf2 DEPL_SA1_GPIO_SWTICH_OFF_FAILED HIGH No description mission/SolarArrayDeploymentHandler.h
129 11507 0x2cf3 DEPL_SA2_GPIO_SWTICH_OFF_FAILED HIGH No description mission/SolarArrayDeploymentHandler.h
130 11508 0x2cf4 AUTONOMOUS_DEPLOYMENT_COMPLETED INFO No description mission/SolarArrayDeploymentHandler.h
131 11601 0x2d51 MEMORY_READ_RPT_CRC_FAILURE LOW PLOC crc failure in telemetry packet linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
132 11602 0x2d52 ACK_FAILURE LOW PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
133 11603 0x2d53 EXE_FAILURE LOW PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
134 11604 0x2d54 MPSOC_HANDLER_CRC_FAILURE LOW PLOC reply has invalid crc linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
135 11605 0x2d55 MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH LOW Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
136 11606 0x2d56 MPSOC_SHUTDOWN_FAILED HIGH Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor. linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
137 11607 0x2d57 SUPV_NOT_ON LOW SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition. linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
138 11608 0x2d58 SUPV_REPLY_TIMEOUT LOW No description SUPV reply timeout. linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
139 11609 0x2d59 CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE LOW Camera must be commanded on first. linux/payload/plocMpsocHelpers.h
140 11701 0x2db5 SELF_TEST_I2C_FAILURE LOW Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA mission/acs/ImtqHandler.h
141 11702 0x2db6 SELF_TEST_SPI_FAILURE LOW Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA mission/acs/ImtqHandler.h
142 11703 0x2db7 SELF_TEST_ADC_FAILURE LOW Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA mission/acs/ImtqHandler.h
237 12902 0x3266 POWER_STATE_MACHINE_TIMEOUT MEDIUM No description mission/system/acs/SusAssembly.h
238 12903 0x3267 SIDE_SWITCH_TRANSITION_NOT_ALLOWED LOW Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination mission/system/acs/SusAssembly.h
239 13000 0x32c8 CHILDREN_LOST_MODE MEDIUM No description mission/system/tcs/TcsBoardAssembly.h
240 13100 0x332c GPS_FIX_CHANGE INFO Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix Fix has changed. P1: New fix. P2: Missed fix changes 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix mission/acs/archive/GPSDefinitions.h linux/acs/GPSDefinitions.h
241 13101 0x332d CANT_GET_FIX LOW MEDIUM Could not get fix in maximum allowed time. P1: Maximum allowed time to get a fix after the GPS was switched on. Could not get fix in maximum allowed time. Trying to reset both GNSS devices. P1: Maximum allowed time to get a fix after the GPS was switched on. mission/acs/archive/GPSDefinitions.h linux/acs/GPSDefinitions.h
242 13102 0x332e RESET_FAIL HIGH Failed to reset an GNNS Device. P1: Board-Side. linux/acs/GPSDefinitions.h
243 13200 0x3390 P60_BOOT_COUNT INFO P60 boot count is broadcasted once at SW startup. P1: Boot count mission/power/P60DockHandler.h
244 13201 0x3391 BATT_MODE INFO Battery mode is broadcasted at startup. P1: Mode mission/power/P60DockHandler.h
245 13202 0x3392 BATT_MODE_CHANGED MEDIUM Battery mode has changed. P1: Old mode. P2: New mode mission/power/P60DockHandler.h

View File

@ -56,6 +56,7 @@
0x44330015;PLOC_MPSOC_HANDLER
0x44330016;PLOC_SUPERVISOR_HANDLER
0x44330017;PLOC_SUPERVISOR_HELPER
0x44330018;PLOC_MPSOC_COMMUNICATION
0x44330032;SCEX
0x444100A2;SOLAR_ARRAY_DEPL_HANDLER
0x444100A4;HEATER_HANDLER

1 0x00005060 P60DOCK_TEST_TASK
56 0x44330015 PLOC_MPSOC_HANDLER
57 0x44330016 PLOC_SUPERVISOR_HANDLER
58 0x44330017 PLOC_SUPERVISOR_HELPER
59 0x44330018 PLOC_MPSOC_COMMUNICATION
60 0x44330032 SCEX
61 0x444100A2 SOLAR_ARRAY_DEPL_HANDLER
62 0x444100A4 HEATER_HANDLER

View File

@ -561,16 +561,17 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
0x67a2;SADPL_MainSwitchTimeoutFailure;No description;162;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
0x67a3;SADPL_SwitchingDeplSa1Failed;No description;163;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
0x67a4;SADPL_SwitchingDeplSa2Failed;No description;164;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
0x68a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;160;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;161;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;162;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;163;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;164;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;165;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;166;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);167;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;168;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;169;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x6810;MPSOCRTVIF_CommandTimeout;Command has timed out.;16;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;160;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;161;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;162;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;163;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;164;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;165;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;166;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);167;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;168;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;169;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x69a0;SPVRTVIF_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;160;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
0x69a1;SPVRTVIF_InvalidServiceId;No description;161;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
0x69a2;SPVRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;162;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
@ -626,4 +627,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
0x6f02;TMS_NoWriteActive;No description;2;TM_SINK;mission/tmtc/DirectTmSinkIF.h
0x6f03;TMS_Timeout;No description;3;TM_SINK;mission/tmtc/DirectTmSinkIF.h
0x7000;VCS_ChannelDoesNotExist;No description;0;VIRTUAL_CHANNEL;mission/com/VirtualChannel.h
0x7200;SCBU_KeyNotFound;No description;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h
0x7100;PLMPCOM_PacketReceived;No description;0;PLOC_MPSOC_COM;linux/payload/MpsocCommunication.h
0x7101;PLMPCOM_FaultyPacketSize;No description;1;PLOC_MPSOC_COM;linux/payload/MpsocCommunication.h
0x7102;PLMPCOM_CrcCheckFailed;No description;2;PLOC_MPSOC_COM;linux/payload/MpsocCommunication.h
0x7300;SCBU_KeyNotFound;No description;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h

1 Full ID (hex) Name Description Unique ID Subsytem Name File Path
561 0x67a2 SADPL_MainSwitchTimeoutFailure No description 162 SA_DEPL_HANDLER mission/SolarArrayDeploymentHandler.h
562 0x67a3 SADPL_SwitchingDeplSa1Failed No description 163 SA_DEPL_HANDLER mission/SolarArrayDeploymentHandler.h
563 0x67a4 SADPL_SwitchingDeplSa2Failed No description 164 SA_DEPL_HANDLER mission/SolarArrayDeploymentHandler.h
564 0x68a0 0x6810 MPSOCRTVIF_CrcFailure MPSOCRTVIF_CommandTimeout Space Packet received from PLOC has invalid CRC Command has timed out. 160 16 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
565 0x68a1 0x68a0 MPSOCRTVIF_ReceivedAckFailure MPSOCRTVIF_CrcFailure Received ACK failure reply from PLOC Space Packet received from PLOC has invalid CRC 161 160 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
566 0x68a2 0x68a1 MPSOCRTVIF_ReceivedExeFailure MPSOCRTVIF_ReceivedAckFailure Received execution failure reply from PLOC Received ACK failure reply from PLOC 162 161 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
567 0x68a3 0x68a2 MPSOCRTVIF_InvalidApid MPSOCRTVIF_ReceivedExeFailure Received space packet with invalid APID from PLOC Received execution failure reply from PLOC 163 162 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
568 0x68a4 0x68a3 MPSOCRTVIF_InvalidLength MPSOCRTVIF_InvalidApid Received command with invalid length Received space packet with invalid APID from PLOC 164 163 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
569 0x68a5 0x68a4 MPSOCRTVIF_FilenameTooLong MPSOCRTVIF_InvalidLength Filename of file in OBC filesystem is too long Received command with invalid length 165 164 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
570 0x68a6 0x68a5 MPSOCRTVIF_MpsocHelperExecuting MPSOCRTVIF_FilenameTooLong MPSoC helper is currently executing a command Filename of file in OBC filesystem is too long 166 165 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
571 0x68a7 0x68a6 MPSOCRTVIF_MpsocFilenameTooLong MPSOCRTVIF_MpsocHelperExecuting Filename of MPSoC file is to long (max. 256 bytes) MPSoC helper is currently executing a command 167 166 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
572 0x68a8 0x68a7 MPSOCRTVIF_InvalidParameter MPSOCRTVIF_MpsocFilenameTooLong Command has invalid parameter Filename of MPSoC file is to long (max. 256 bytes) 168 167 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
573 0x68a9 0x68a8 MPSOCRTVIF_NameTooLong MPSOCRTVIF_InvalidParameter Received command has file string with invalid length Command has invalid parameter 169 168 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
574 0x68a9 MPSOCRTVIF_NameTooLong Received command has file string with invalid length 169 MPSOC_RETURN_VALUES_IF linux/payload/plocMpsocHelpers.h
575 0x69a0 SPVRTVIF_CrcFailure Space Packet received from PLOC supervisor has invalid CRC 160 SUPV_RETURN_VALUES_IF linux/payload/plocSupvDefs.h
576 0x69a1 SPVRTVIF_InvalidServiceId No description 161 SUPV_RETURN_VALUES_IF linux/payload/plocSupvDefs.h
577 0x69a2 SPVRTVIF_ReceivedAckFailure Received ACK failure reply from PLOC supervisor 162 SUPV_RETURN_VALUES_IF linux/payload/plocSupvDefs.h
627 0x6f02 TMS_NoWriteActive No description 2 TM_SINK mission/tmtc/DirectTmSinkIF.h
628 0x6f03 TMS_Timeout No description 3 TM_SINK mission/tmtc/DirectTmSinkIF.h
629 0x7000 VCS_ChannelDoesNotExist No description 0 VIRTUAL_CHANNEL mission/com/VirtualChannel.h
630 0x7200 0x7100 SCBU_KeyNotFound PLMPCOM_PacketReceived No description 0 SCRATCH_BUFFER PLOC_MPSOC_COM bsp_q7s/memory/scratchApi.h linux/payload/MpsocCommunication.h
631 0x7101 PLMPCOM_FaultyPacketSize No description 1 PLOC_MPSOC_COM linux/payload/MpsocCommunication.h
632 0x7102 PLMPCOM_CrcCheckFailed No description 2 PLOC_MPSOC_COM linux/payload/MpsocCommunication.h
633 0x7300 SCBU_KeyNotFound No description 0 SCRATCH_BUFFER bsp_q7s/memory/scratchApi.h

View File

@ -1,7 +1,7 @@
/**
* @brief Auto-generated event translation file. Contains 320 translations.
* @brief Auto-generated event translation file. Contains 325 translations.
* @details
* Generated on: 2024-02-29 13:15:00
* Generated on: 2024-05-06 13:47:38
*/
#include "translateEvents.h"
@ -82,8 +82,11 @@ const char *BIT_LOCK_STRING = "BIT_LOCK";
const char *BIT_LOCK_LOST_STRING = "BIT_LOCK_LOST";
const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED";
const char *CLOCK_SET_STRING = "CLOCK_SET";
const char *CLOCK_DUMP_STRING = "CLOCK_DUMP";
const char *CLOCK_DUMP_LEGACY_STRING = "CLOCK_DUMP_LEGACY";
const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE";
const char *CLOCK_DUMP_STRING = "CLOCK_DUMP";
const char *CLOCK_DUMP_BEFORE_SETTING_TIME_STRING = "CLOCK_DUMP_BEFORE_SETTING_TIME";
const char *CLOCK_DUMP_AFTER_SETTING_TIME_STRING = "CLOCK_DUMP_AFTER_SETTING_TIME";
const char *TC_DELETION_FAILED_STRING = "TC_DELETION_FAILED";
const char *TEST_STRING = "TEST";
const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER";
@ -139,6 +142,7 @@ const char *MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH_STRING = "MPSOC_HANDLER_SEQUEN
const char *MPSOC_SHUTDOWN_FAILED_STRING = "MPSOC_SHUTDOWN_FAILED";
const char *SUPV_NOT_ON_STRING = "SUPV_NOT_ON";
const char *SUPV_REPLY_TIMEOUT_STRING = "SUPV_REPLY_TIMEOUT";
const char *CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE_STRING = "CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE";
const char *SELF_TEST_I2C_FAILURE_STRING = "SELF_TEST_I2C_FAILURE";
const char *SELF_TEST_SPI_FAILURE_STRING = "SELF_TEST_SPI_FAILURE";
const char *SELF_TEST_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE";
@ -241,6 +245,7 @@ const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_12903_STRING = "SIDE_SWITCH_TRANS
const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE";
const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE";
const char *CANT_GET_FIX_STRING = "CANT_GET_FIX";
const char *RESET_FAIL_STRING = "RESET_FAIL";
const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT";
const char *BATT_MODE_STRING = "BATT_MODE";
const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED";
@ -483,9 +488,15 @@ const char *translateEvents(Event event) {
case (8900):
return CLOCK_SET_STRING;
case (8901):
return CLOCK_DUMP_STRING;
return CLOCK_DUMP_LEGACY_STRING;
case (8902):
return CLOCK_SET_FAILURE_STRING;
case (8903):
return CLOCK_DUMP_STRING;
case (8904):
return CLOCK_DUMP_BEFORE_SETTING_TIME_STRING;
case (8905):
return CLOCK_DUMP_AFTER_SETTING_TIME_STRING;
case (9100):
return TC_DELETION_FAILED_STRING;
case (9700):
@ -596,6 +607,8 @@ const char *translateEvents(Event event) {
return SUPV_NOT_ON_STRING;
case (11608):
return SUPV_REPLY_TIMEOUT_STRING;
case (11609):
return CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE_STRING;
case (11701):
return SELF_TEST_I2C_FAILURE_STRING;
case (11702):
@ -800,6 +813,8 @@ const char *translateEvents(Event event) {
return GPS_FIX_CHANGE_STRING;
case (13101):
return CANT_GET_FIX_STRING;
case (13102):
return RESET_FAIL_STRING;
case (13200):
return P60_BOOT_COUNT_STRING;
case (13201):

View File

@ -1,8 +1,8 @@
/**
* @brief Auto-generated object translation file.
* @details
* Contains 179 translations.
* Generated on: 2024-02-29 13:15:00
* Contains 180 translations.
* Generated on: 2024-05-06 13:47:38
*/
#include "translateObjects.h"
@ -64,6 +64,7 @@ const char *PTME_VC3_CFDP_TM_STRING = "PTME_VC3_CFDP_TM";
const char *PLOC_MPSOC_HANDLER_STRING = "PLOC_MPSOC_HANDLER";
const char *PLOC_SUPERVISOR_HANDLER_STRING = "PLOC_SUPERVISOR_HANDLER";
const char *PLOC_SUPERVISOR_HELPER_STRING = "PLOC_SUPERVISOR_HELPER";
const char *PLOC_MPSOC_COMMUNICATION_STRING = "PLOC_MPSOC_COMMUNICATION";
const char *SCEX_STRING = "SCEX";
const char *SOLAR_ARRAY_DEPL_HANDLER_STRING = "SOLAR_ARRAY_DEPL_HANDLER";
const char *HEATER_HANDLER_STRING = "HEATER_HANDLER";
@ -304,6 +305,8 @@ const char *translateObject(object_id_t object) {
return PLOC_SUPERVISOR_HANDLER_STRING;
case 0x44330017:
return PLOC_SUPERVISOR_HELPER_STRING;
case 0x44330018:
return PLOC_MPSOC_COMMUNICATION_STRING;
case 0x44330032:
return SCEX_STRING;
case 0x444100A2:

View File

@ -26,7 +26,7 @@
#include "devConf.h"
#include "devices/gpioIds.h"
#include "mission/system/acs/acsModeTree.h"
#include "mission/system/payloadModeTree.h"
#include "mission/system/payload/payloadModeTree.h"
#include "mission/system/power/epsModeTree.h"
void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF,

View File

@ -7,15 +7,19 @@
namespace GpsHyperion {
enum class FixMode : uint8_t { NOT_SEEN = 0, NO_FIX = 1, FIX_2D = 2, FIX_3D = 3, UNKNOWN = 4 };
enum FixMode : uint8_t { NOT_SEEN = 0, NO_FIX = 1, FIX_2D = 2, FIX_3D = 3 };
enum GnssChip : uint8_t { A_SIDE = 0, B_SIDE = 1 };
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::GPS_HANDLER;
//! [EXPORT] : [COMMENT] Fix has changed. P1: Old fix. P2: New fix
//! [EXPORT] : [COMMENT] Fix has changed. P1: New fix. P2: Missed fix changes
//! 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix
static constexpr Event GPS_FIX_CHANGE = event::makeEvent(SUBSYSTEM_ID, 0, severity::INFO);
//! [EXPORT] : [COMMENT] Could not get fix in maximum allowed time. P1: Maximum allowed time
//! to get a fix after the GPS was switched on.
static constexpr Event CANT_GET_FIX = event::makeEvent(SUBSYSTEM_ID, 1, severity::LOW);
//! [EXPORT] : [COMMENT] Could not get fix in maximum allowed time. Trying to reset both GNSS
//! devices. P1: Maximum allowed time to get a fix after the GPS was switched on.
static constexpr Event CANT_GET_FIX = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM);
//! [EXPORT] : [COMMENT] Failed to reset an GNNS Device. P1: Board-Side.
static constexpr Event RESET_FAIL = event::makeEvent(SUBSYSTEM_ID, 2, severity::HIGH);
static constexpr DeviceCommandId_t GPS_REPLY = 0;
static constexpr DeviceCommandId_t TRIGGER_RESET_PIN_GNSS = 5;
@ -53,8 +57,6 @@ static constexpr uint8_t SKYVIEW_ENTRIES = 6;
static constexpr uint8_t MAX_SATELLITES = 30;
enum GpsFixModes : uint8_t { INVALID = 0, NO_FIX = 1, FIX_2D = 2, FIX_3D = 3 };
} // namespace GpsHyperion
class GpsPrimaryDataset : public StaticLocalDataSet<GpsHyperion::CORE_DATASET_ENTRIES> {

View File

@ -44,24 +44,21 @@ LocalPoolDataSetBase *GpsHyperionLinuxController::getDataSetHandle(sid_t sid) {
ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_t submode,
uint32_t *msToReachTheMode) {
if (not modeCommanded) {
if (mode == MODE_ON or mode == MODE_OFF) {
// 5h time to reach fix
*msToReachTheMode = MAX_SECONDS_TO_REACH_FIX;
maxTimeToReachFix.resetTimer();
modeCommanded = true;
} else if (mode == MODE_NORMAL) {
return HasModesIF::INVALID_MODE;
}
if (mode == MODE_ON) {
maxTimeToReachFix.resetTimer();
gainedNewFix.timeOut();
} else if (mode == MODE_NORMAL) {
return HasModesIF::INVALID_MODE;
}
if (mode == MODE_OFF) {
maxTimeToReachFix.timeOut();
gainedNewFix.timeOut();
PoolReadGuard pg(&gpsSet);
gpsSet.setValidity(false, true);
// There can't be a fix with a device that is off.
triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, 0);
gpsSet.fixMode.value = 0;
// The ctrl is off, so it cannot detect the data from the devices.
handleFixChangedEvent(GpsHyperion::FixMode::NOT_SEEN);
gpsSet.fixMode.value = GpsHyperion::FixMode::NOT_SEEN;
oneShotSwitches.reset();
modeCommanded = false;
}
return returnvalue::OK;
}
@ -75,13 +72,16 @@ ReturnValue_t GpsHyperionLinuxController::executeAction(ActionId_t actionId,
PoolReadGuard pg(&gpsSet);
// Set HK entries invalid
gpsSet.setValidity(false, true);
resetCallback(data, size, resetCallbackArgs);
ReturnValue_t result = resetCallback(data, size, resetCallbackArgs);
if (result != returnvalue::OK) {
return result;
}
return HasActionsIF::EXECUTION_FINISHED;
}
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
}
}
return returnvalue::OK;
return HasActionsIF::INVALID_ACTION_ID;
}
ReturnValue_t GpsHyperionLinuxController::initializeLocalDataPool(
@ -100,7 +100,7 @@ ReturnValue_t GpsHyperionLinuxController::initializeLocalDataPool(
localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry<uint8_t>());
localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry<uint8_t>());
localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry<uint8_t>());
poolManager.subscribeForRegularPeriodicPacket({gpsSet.getSid(), enableHkSets, 30.0});
poolManager.subscribeForRegularPeriodicPacket({gpsSet.getSid(), enableHkSets, 60.0});
localDataPoolMap.emplace(GpsHyperion::SKYVIEW_UNIX_SECONDS, new PoolEntry<double>());
localDataPoolMap.emplace(GpsHyperion::PRN_ID, new PoolEntry<int16_t>());
localDataPoolMap.emplace(GpsHyperion::AZIMUTH, new PoolEntry<int16_t>());
@ -216,15 +216,9 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
bool modeIsSet = true;
if (MODE_SET != (MODE_SET & gps.set)) {
if (mode != MODE_OFF) {
if (maxTimeToReachFix.hasTimedOut() and oneShotSwitches.cantGetFixSwitch) {
sif::warning << "GpsHyperionLinuxController: No mode could be set in allowed "
<< maxTimeToReachFix.getTimeoutMs() / 1000 << " seconds" << std::endl;
triggerEvent(GpsHyperion::CANT_GET_FIX, maxTimeToReachFix.getTimeoutMs());
oneShotSwitches.cantGetFixSwitch = false;
}
modeIsSet = false;
} else {
// GPS device is off anyway, so do other handling
// GPS ctrl is off anyway, so do other handling
return returnvalue::FAILED;
}
}
@ -249,27 +243,44 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) {
uint8_t newFix = 0;
if (modeIsSet) {
// 0: Not seen, 1: No fix, 2: 2D-Fix, 3: 3D-Fix
if (gps.fix.mode == 2 or gps.fix.mode == 3) {
if (gps.fix.mode == GpsHyperion::FixMode::FIX_2D or
gps.fix.mode == GpsHyperion::FixMode::FIX_3D) {
validFix = true;
maxTimeToReachFix.resetTimer();
}
newFix = gps.fix.mode;
if (newFix == 0 or newFix == 1) {
if (modeCommanded and maxTimeToReachFix.hasTimedOut()) {
// We are supposed to be on and functioning, but no fix was found
if (mode == MODE_ON or mode == MODE_NORMAL) {
mode = MODE_OFF;
}
modeCommanded = false;
}
}
}
if (gpsSet.fixMode.value != newFix) {
#if OBSW_Q7S_EM != 1
triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, newFix);
#endif
handleFixChangedEvent(newFix);
}
gpsSet.fixMode = newFix;
gpsSet.fixMode.setValid(modeIsSet);
// We are supposed to be on and functioning, but no fix was found
if (not validFix) {
if (maxTimeToReachFix.hasTimedOut()) {
// Set HK entries invalid
gpsSet.setValidity(false, true);
if (oneShotSwitches.cantGetFixSwitch) {
sif::warning << "GpsHyperionLinuxController: No fix detected in allowed "
<< maxTimeToReachFix.getTimeoutMs() / 1000 << " seconds" << std::endl;
triggerEvent(GpsHyperion::CANT_GET_FIX, maxTimeToReachFix.getTimeoutMs());
oneShotSwitches.cantGetFixSwitch = false;
// Try resetting the devices
if (resetCallback != nullptr) {
uint8_t chip = GpsHyperion::GnssChip::A_SIDE;
ReturnValue_t result = resetCallback(&chip, 1, resetCallbackArgs);
if (result != returnvalue::OK) {
triggerEvent(GpsHyperion::RESET_FAIL, chip);
}
chip = GpsHyperion::GnssChip::B_SIDE;
result = resetCallback(&chip, 1, resetCallbackArgs);
if (result != returnvalue::OK) {
triggerEvent(GpsHyperion::RESET_FAIL, chip);
}
}
}
}
}
// Only set on specific messages, so only set a valid flag to invalid
// if not set for more than a full message set (10 messages here)
@ -282,9 +293,12 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) {
}
satNotSetCounter = 0;
} else {
satNotSetCounter++;
if (gpsSet.satInUse.isValid() and satNotSetCounter >= 10) {
if (satNotSetCounter < 10) {
satNotSetCounter++;
} else {
gpsSet.satInUse.value = 0;
gpsSet.satInUse.setValid(false);
gpsSet.satInView.value = 0;
gpsSet.satInView.setValid(false);
}
}
@ -292,22 +306,24 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) {
// LATLON is set for every message, no need for a counter
bool latValid = false;
bool longValid = false;
if (LATLON_SET == (LATLON_SET & gps.set)) {
if (std::isfinite(gps.fix.latitude)) {
// Negative latitude -> South direction
gpsSet.latitude.value = gps.fix.latitude;
// As specified in gps.h: Only valid if mode >= 2
if (gps.fix.mode >= 2) {
latValid = true;
if (modeIsSet) {
if (LATLON_SET == (LATLON_SET & gps.set)) {
if (std::isfinite(gps.fix.latitude)) {
// Negative latitude -> South direction
gpsSet.latitude.value = gps.fix.latitude;
// As specified in gps.h: Only valid if mode >= 2
if (gps.fix.mode >= GpsHyperion::FixMode::FIX_2D) {
latValid = true;
}
}
}
if (std::isfinite(gps.fix.longitude)) {
// Negative longitude -> West direction
gpsSet.longitude.value = gps.fix.longitude;
// As specified in gps.h: Only valid if mode >= 2
if (gps.fix.mode >= 2) {
longValid = true;
if (std::isfinite(gps.fix.longitude)) {
// Negative longitude -> West direction
gpsSet.longitude.value = gps.fix.longitude;
// As specified in gps.h: Only valid if mode >= 2
if (gps.fix.mode >= GpsHyperion::FixMode::FIX_2D) {
longValid = true;
}
}
}
}
@ -316,20 +332,24 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) {
// ALTITUDE is set for every message, no need for a counter
bool altitudeValid = false;
if (ALTITUDE_SET == (ALTITUDE_SET & gps.set) && std::isfinite(gps.fix.altitude)) {
gpsSet.altitude.value = gps.fix.altitude;
// As specified in gps.h: Only valid if mode == 3
if (gps.fix.mode == 3) {
altitudeValid = true;
if (modeIsSet) {
if (ALTITUDE_SET == (ALTITUDE_SET & gps.set) && std::isfinite(gps.fix.altitude)) {
gpsSet.altitude.value = gps.fix.altitude;
// As specified in gps.h: Only valid if mode == 3
if (gps.fix.mode == GpsHyperion::FixMode::FIX_3D) {
altitudeValid = true;
}
}
}
gpsSet.altitude.setValid(altitudeValid);
// SPEED is set for every message, no need for a counter
bool speedValid = false;
if (SPEED_SET == (SPEED_SET & gps.set) && std::isfinite(gps.fix.speed)) {
gpsSet.speed.value = gps.fix.speed;
speedValid = true;
if (modeIsSet) {
if (SPEED_SET == (SPEED_SET & gps.set) && std::isfinite(gps.fix.speed)) {
gpsSet.speed.value = gps.fix.speed;
speedValid = true;
}
}
gpsSet.speed.setValid(speedValid);
@ -430,3 +450,14 @@ void GpsHyperionLinuxController::overwriteTimeIfNotSane(timeval time, bool valid
timeInit = true;
}
}
void GpsHyperionLinuxController::handleFixChangedEvent(uint8_t newFix) {
if (gainedNewFix.hasTimedOut()) {
triggerEvent(GpsHyperion::GPS_FIX_CHANGE, newFix, fixChangeCounter);
fixChangeCounter = 0;
gainedNewFix.resetTimer();
return;
}
fixChangeCounter++;
gainedNewFix.resetTimer();
}

View File

@ -1,14 +1,13 @@
#ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_
#define MISSION_DEVICES_GPSHYPERIONHANDLER_H_
#include <mission/acs/archive/GPSDefinitions.h>
#include <common/config/eive/eventSubsystemIds.h>
#include <fsfw/FSFW.h>
#include <fsfw/controller/ExtendedControllerBase.h>
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
#include <linux/acs/GPSDefinitions.h>
#include <mission/utility/trace.h>
#include "eive/eventSubsystemIds.h"
#include "fsfw/FSFW.h"
#include "fsfw/controller/ExtendedControllerBase.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
#ifdef FSFW_OSAL_LINUX
#include <gps.h>
#include <libgpsmm.h>
@ -24,8 +23,8 @@
*/
class GpsHyperionLinuxController : public ExtendedControllerBase {
public:
// 30 minutes
static constexpr uint32_t MAX_SECONDS_TO_REACH_FIX = 60 * 30;
// 15 minutes
static constexpr uint32_t MAX_SECONDS_TO_REACH_FIX = 60 * 15;
enum ReadModes { SHM = 0, SOCKET = 1 };
@ -65,7 +64,8 @@ class GpsHyperionLinuxController : public ExtendedControllerBase {
const char* currentClientBuf = nullptr;
ReadModes readMode = ReadModes::SOCKET;
Countdown maxTimeToReachFix = Countdown(MAX_SECONDS_TO_REACH_FIX * 1000);
bool modeCommanded = false;
Countdown gainedNewFix = Countdown(60 * 2 * 1000);
uint32_t fixChangeCounter = 0;
bool timeInit = false;
uint8_t satNotSetCounter = 0;
@ -92,6 +92,8 @@ class GpsHyperionLinuxController : public ExtendedControllerBase {
// we set it with the roughly valid time from the GPS. For some reason, NTP might only work
// if the time difference between sys time and current time is not too large
void overwriteTimeIfNotSane(timeval time, bool validFix);
void handleFixChangedEvent(uint8_t newFix);
};
#endif /* MISSION_DEVICES_GPSHYPERIONHANDLER_H_ */

View File

@ -1,7 +1,7 @@
/**
* @brief Auto-generated event translation file. Contains 320 translations.
* @brief Auto-generated event translation file. Contains 325 translations.
* @details
* Generated on: 2024-02-29 13:15:00
* Generated on: 2024-05-06 13:47:38
*/
#include "translateEvents.h"
@ -82,8 +82,11 @@ const char *BIT_LOCK_STRING = "BIT_LOCK";
const char *BIT_LOCK_LOST_STRING = "BIT_LOCK_LOST";
const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED";
const char *CLOCK_SET_STRING = "CLOCK_SET";
const char *CLOCK_DUMP_STRING = "CLOCK_DUMP";
const char *CLOCK_DUMP_LEGACY_STRING = "CLOCK_DUMP_LEGACY";
const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE";
const char *CLOCK_DUMP_STRING = "CLOCK_DUMP";
const char *CLOCK_DUMP_BEFORE_SETTING_TIME_STRING = "CLOCK_DUMP_BEFORE_SETTING_TIME";
const char *CLOCK_DUMP_AFTER_SETTING_TIME_STRING = "CLOCK_DUMP_AFTER_SETTING_TIME";
const char *TC_DELETION_FAILED_STRING = "TC_DELETION_FAILED";
const char *TEST_STRING = "TEST";
const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER";
@ -139,6 +142,7 @@ const char *MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH_STRING = "MPSOC_HANDLER_SEQUEN
const char *MPSOC_SHUTDOWN_FAILED_STRING = "MPSOC_SHUTDOWN_FAILED";
const char *SUPV_NOT_ON_STRING = "SUPV_NOT_ON";
const char *SUPV_REPLY_TIMEOUT_STRING = "SUPV_REPLY_TIMEOUT";
const char *CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE_STRING = "CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE";
const char *SELF_TEST_I2C_FAILURE_STRING = "SELF_TEST_I2C_FAILURE";
const char *SELF_TEST_SPI_FAILURE_STRING = "SELF_TEST_SPI_FAILURE";
const char *SELF_TEST_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE";
@ -241,6 +245,7 @@ const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_12903_STRING = "SIDE_SWITCH_TRANS
const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE";
const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE";
const char *CANT_GET_FIX_STRING = "CANT_GET_FIX";
const char *RESET_FAIL_STRING = "RESET_FAIL";
const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT";
const char *BATT_MODE_STRING = "BATT_MODE";
const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED";
@ -483,9 +488,15 @@ const char *translateEvents(Event event) {
case (8900):
return CLOCK_SET_STRING;
case (8901):
return CLOCK_DUMP_STRING;
return CLOCK_DUMP_LEGACY_STRING;
case (8902):
return CLOCK_SET_FAILURE_STRING;
case (8903):
return CLOCK_DUMP_STRING;
case (8904):
return CLOCK_DUMP_BEFORE_SETTING_TIME_STRING;
case (8905):
return CLOCK_DUMP_AFTER_SETTING_TIME_STRING;
case (9100):
return TC_DELETION_FAILED_STRING;
case (9700):
@ -596,6 +607,8 @@ const char *translateEvents(Event event) {
return SUPV_NOT_ON_STRING;
case (11608):
return SUPV_REPLY_TIMEOUT_STRING;
case (11609):
return CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE_STRING;
case (11701):
return SELF_TEST_I2C_FAILURE_STRING;
case (11702):
@ -800,6 +813,8 @@ const char *translateEvents(Event event) {
return GPS_FIX_CHANGE_STRING;
case (13101):
return CANT_GET_FIX_STRING;
case (13102):
return RESET_FAIL_STRING;
case (13200):
return P60_BOOT_COUNT_STRING;
case (13201):

View File

@ -1,8 +1,8 @@
/**
* @brief Auto-generated object translation file.
* @details
* Contains 179 translations.
* Generated on: 2024-02-29 13:15:00
* Contains 180 translations.
* Generated on: 2024-05-06 13:47:38
*/
#include "translateObjects.h"
@ -64,6 +64,7 @@ const char *PTME_VC3_CFDP_TM_STRING = "PTME_VC3_CFDP_TM";
const char *PLOC_MPSOC_HANDLER_STRING = "PLOC_MPSOC_HANDLER";
const char *PLOC_SUPERVISOR_HANDLER_STRING = "PLOC_SUPERVISOR_HANDLER";
const char *PLOC_SUPERVISOR_HELPER_STRING = "PLOC_SUPERVISOR_HELPER";
const char *PLOC_MPSOC_COMMUNICATION_STRING = "PLOC_MPSOC_COMMUNICATION";
const char *SCEX_STRING = "SCEX";
const char *SOLAR_ARRAY_DEPL_HANDLER_STRING = "SOLAR_ARRAY_DEPL_HANDLER";
const char *HEATER_HANDLER_STRING = "HEATER_HANDLER";
@ -304,6 +305,8 @@ const char *translateObject(object_id_t object) {
return PLOC_SUPERVISOR_HANDLER_STRING;
case 0x44330017:
return PLOC_SUPERVISOR_HELPER_STRING;
case 0x44330018:
return PLOC_MPSOC_COMMUNICATION_STRING;
case 0x44330032:
return SCEX_STRING;
case 0x444100A2:

View File

@ -1,7 +1,9 @@
target_sources(
${OBSW_NAME}
PUBLIC PlocMemoryDumper.cpp
PlocMpsocHandler.cpp
MpsocCommunication.cpp
SerialCommunicationHelper.cpp
FreshMpsocHandler.cpp
FreshSupvHandler.cpp
PlocMpsocSpecialComHelper.cpp
plocMpsocHelpers.cpp

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,212 @@
#include "fsfw/action/ActionMessage.h"
#include "fsfw/action/CommandsActionsIF.h"
#include "fsfw/devicehandlers/DeviceHandlerIF.h"
#include "fsfw/devicehandlers/FreshDeviceHandlerBase.h"
#include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/ipc/messageQueueDefinitions.h"
#include "fsfw/modes/ModeMessage.h"
#include "fsfw/objectmanager/SystemObjectIF.h"
#include "fsfw/power/PowerSwitchIF.h"
#include "fsfw/power/definitions.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw_hal/linux/gpio/Gpio.h"
#include "linux/payload/MpsocCommunication.h"
#include "linux/payload/PlocMpsocSpecialComHelper.h"
#include "linux/payload/plocMpsocHelpers.h"
class FreshMpsocHandler : public FreshDeviceHandlerBase, public CommandsActionsIF {
public:
enum OpCode { DEFAULT_OPERATION = 0, PARSE_TM = 1 };
static constexpr uint32_t MPSOC_MODE_CMD_TIMEOUT_MS = 120000;
FreshMpsocHandler(DhbConfig cfg, MpsocCommunication& comInterface,
PlocMpsocSpecialComHelper& specialComHelper, Gpio uartIsolatorSwitch,
object_id_t supervisorHandler, PowerSwitchIF& powerSwitcher,
power::Switch_t camSwitchId);
/**
* Periodic helper executed function, implemented by child class.
*/
void performDeviceOperation(uint8_t opCode) override;
void performDefaultDeviceOperation();
/**
* Implemented by child class. Handle all command messages which are
* not health, mode, action or housekeeping messages.
* @param message
* @return
*/
ReturnValue_t handleCommandMessage(CommandMessage* message) override;
ReturnValue_t initialize() override;
private:
enum class StartupState { IDLE, HW_INIT, DONE } startupState = StartupState::IDLE;
enum class PowerState { IDLE, PENDING_STARTUP, PENDING_SHUTDOWN, SUPV_FAILED, DONE };
enum TransitionState { NONE, TO_ON, TO_OFF, SUBMODE } transitionState = TransitionState::NONE;
MpsocCommunication& comInterface;
PlocMpsocSpecialComHelper& specialComHelper;
MessageQueueIF* eventQueue = nullptr;
SourceSequenceCounter commandSequenceCount = SourceSequenceCounter(0);
MessageQueueIF* commandActionHelperQueue = nullptr;
CommandActionHelper commandActionHelper;
Gpio uartIsolatorSwitch;
mpsoc::HkReport hkReport;
object_id_t supervisorHandler;
Countdown mpsocBootTransitionCd = Countdown(6500);
Countdown supvTransitionCd = Countdown(3000);
PoolEntry<uint32_t> peStatus = PoolEntry<uint32_t>();
PoolEntry<uint8_t> peMode = PoolEntry<uint8_t>();
PoolEntry<uint8_t> peDownlinkPwrOn = PoolEntry<uint8_t>();
PoolEntry<uint8_t> peDownlinkReplyActive = PoolEntry<uint8_t>();
PoolEntry<uint8_t> peDownlinkJesdSyncStatus = PoolEntry<uint8_t>();
PoolEntry<uint8_t> peDownlinkDacStatus = PoolEntry<uint8_t>();
PoolEntry<uint8_t> peCameraStatus = PoolEntry<uint8_t>();
PoolEntry<uint8_t> peCameraSdiStatus = PoolEntry<uint8_t>();
PoolEntry<float> peCameraFpgaTemp = PoolEntry<float>();
PoolEntry<float> peCameraSocTemp = PoolEntry<float>();
PoolEntry<float> peSysmonTemp = PoolEntry<float>();
PoolEntry<float> peSysmonVccInt = PoolEntry<float>();
PoolEntry<float> peSysmonVccAux = PoolEntry<float>();
PoolEntry<float> peSysmonVccBram = PoolEntry<float>();
PoolEntry<float> peSysmonVccPaux = PoolEntry<float>();
PoolEntry<float> peSysmonVccPint = PoolEntry<float>();
PoolEntry<float> peSysmonVccPdro = PoolEntry<float>();
PoolEntry<float> peSysmonMb12V = PoolEntry<float>();
PoolEntry<float> peSysmonMb3V3 = PoolEntry<float>();
PoolEntry<float> peSysmonMb1V8 = PoolEntry<float>();
PoolEntry<float> peSysmonVcc12V = PoolEntry<float>();
PoolEntry<float> peSysmonVcc5V = PoolEntry<float>();
PoolEntry<float> peSysmonVcc3V3 = PoolEntry<float>();
PoolEntry<float> peSysmonVcc3V3VA = PoolEntry<float>();
PoolEntry<float> peSysmonVcc2V5DDR = PoolEntry<float>();
PoolEntry<float> peSysmonVcc1V2DDR = PoolEntry<float>();
PoolEntry<float> peSysmonVcc0V9 = PoolEntry<float>();
PoolEntry<float> peSysmonVcc0V6VTT = PoolEntry<float>();
PoolEntry<float> peSysmonSafeCotsCur = PoolEntry<float>();
PoolEntry<float> peSysmonNvm4XoCur = PoolEntry<float>();
PoolEntry<uint16_t> peSemUncorrectableErrs = PoolEntry<uint16_t>();
PoolEntry<uint16_t> peSemCorrectableErrs = PoolEntry<uint16_t>();
PoolEntry<uint8_t> peSemStatus = PoolEntry<uint8_t>();
PoolEntry<uint8_t> peRebootMpsocRequired = PoolEntry<uint8_t>();
PowerState powerState;
bool specialComHelperExecuting = false;
struct ActionCommandInfo {
Countdown cmdCountdown = Countdown(mpsoc::DEFAULT_CMD_TIMEOUT_MS);
bool pending = false;
MessageQueueId_t commandedBy = MessageQueueIF::NO_QUEUE;
DeviceCommandId_t pendingCmd = DeviceHandlerIF::NO_COMMAND_ID;
uint16_t pendingCmdMpsocApid = 0;
void reset() {
pending = false;
commandedBy = MessageQueueIF::NO_QUEUE;
pendingCmd = DeviceHandlerIF::NO_COMMAND_ID;
}
void start(DeviceCommandId_t commandId, MessageQueueId_t commandedBy) {
pending = true;
cmdCountdown.resetTimer();
pendingCmd = commandId;
this->commandedBy = commandedBy;
}
} activeCmdInfo;
uint8_t commandBuffer[mpsoc::MAX_COMMAND_SIZE];
SpacePacketCreator creator;
ploc::SpTcParams spParams = ploc::SpTcParams(creator);
Mode_t targetMode = HasModesIF::MODE_UNDEFINED;
Submode_t targetSubmode = 0;
struct TmMemReadReport {
static const uint8_t FIX_SIZE = 14;
size_t rememberRequestedSize = 0;
};
TmMemReadReport tmMemReadReport;
uint32_t lastReplySequenceCount = 0;
uint8_t skipSupvCommandingToOn = false;
PowerSwitchIF& powerSwitcher;
power::Switch_t camSwitchId;
// HK manager abstract functions.
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
// Mode abstract functions
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
uint32_t* msToReachTheMode) override;
// Action override. Forward to user.
ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t* data, size_t size) override;
/**
* @overload
* @param submode
*/
void startTransition(Mode_t newMode, Submode_t submode) override;
ReturnValue_t performDeviceOperationPreQueueHandling(uint8_t opCode) override;
// CommandsActionsIF overrides.
MessageQueueIF* getCommandQueuePtr() override;
void stepSuccessfulReceived(ActionId_t actionId, uint8_t step) override;
void stepFailedReceived(ActionId_t actionId, uint8_t step, ReturnValue_t returnCode) override;
void dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) override;
void completionSuccessfulReceived(ActionId_t actionId) override;
void completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) override;
ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueId, ParameterWrapper* parameterWrapper,
const ParameterWrapper* newValues, uint16_t startAtIndex) override;
void handleActionCommandFailure(ActionId_t actionId, ReturnValue_t returnCode);
ReturnValue_t executeRegularCmd(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t* data, size_t dataLen);
void handleTransitionToOn();
void handleTransitionToOff();
ReturnValue_t commandTcModeReplay();
ReturnValue_t commandTcMemWrite(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcMemRead(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcFlashDelete(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcReplayStart(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcReplayStop();
ReturnValue_t commandTcDownlinkPwrOn(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcDownlinkPwrOff();
ReturnValue_t commandTcGetHkReport();
ReturnValue_t commandTcGetDirContent(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcReplayWriteSequence(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcCamCmdSend(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcModeIdle();
ReturnValue_t commandTcCamTakePic(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcSimplexStreamFile(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcSplitFile(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcDownlinkDataModulate(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t commandTcModeSnapshot();
ReturnValue_t finishAndSendTc(DeviceCommandId_t cmdId, mpsoc::TcBase& tcBase,
uint32_t cmdCountdown = mpsoc::DEFAULT_CMD_TIMEOUT_MS);
void handleEvent(EventMessage* eventMessage);
void cmdDoneHandler(bool success, ReturnValue_t result);
ReturnValue_t handleDeviceReply();
ReturnValue_t handleAckReport();
ReturnValue_t handleExecutionReport();
void sendFailureReport(DeviceCommandId_t replyId, ReturnValue_t status);
ReturnValue_t reportReplyData(DeviceCommandId_t tmId);
ReturnValue_t handleGetHkReport();
bool handleHwStartup();
bool handleHwShutdown();
void stopSpecialComHelper();
void commandSubmodeTransition();
void commonSpecialComInit();
void commonSpecialComStop();
void commandInitHandling(ActionId_t actionId, MessageQueueId_t commandedBy);
};

View File

@ -241,6 +241,10 @@ ReturnValue_t FreshSupvHandler::executeAction(ActionId_t actionId, MessageQueueI
uartManager->initiateUpdateContinuation();
return EXECUTION_FINISHED;
}
case ABORT_LONGER_REQUEST: {
uartManager->stop();
return EXECUTION_FINISHED;
}
case MEMORY_CHECK_WITH_FILE: {
UpdateParams params;
result = extractBaseParams(&data, size, params);
@ -849,6 +853,10 @@ ReturnValue_t FreshSupvHandler::prepareWipeMramCmd(const uint8_t* commandData, s
ReturnValue_t FreshSupvHandler::parseTmPackets() {
uint8_t* receivedData = nullptr;
size_t receivedSize = 0;
// We do not want to steal packets from the long request handler.
if (uartManager->longerRequestActive()) {
return returnvalue::OK;
}
while (true) {
ReturnValue_t result =
uartManager->readReceivedMessage(comCookie, &receivedData, &receivedSize);
@ -1299,7 +1307,7 @@ void FreshSupvHandler::handleExecutionFailureReport(ActiveCmdInfo& info, Executi
triggerEvent(SUPV_EXE_FAILURE, info.commandId, static_cast<uint32_t>(report.getStatusCode()));
}
if (info.commandedBy) {
actionHelper.finish(false, info.commandedBy, info.commandId, report.getStatusCode());
actionHelper.finish(false, info.commandedBy, info.commandId, result::RECEIVED_EXE_FAILURE);
}
info.isPending = false;
}

View File

@ -0,0 +1,75 @@
#include "MpsocCommunication.h"
#include "fsfw/globalfunctions/CRC.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw/tmtcpacket/ccsds/SpacePacketReader.h"
#include "fsfw/tmtcpacket/ccsds/header.h"
#include "linux/payload/plocMpsocHelpers.h"
#include "unistd.h"
MpsocCommunication::MpsocCommunication(object_id_t objectId, SerialConfig cfg)
: SystemObject(objectId), readRingBuf(4096, true), helper(cfg) {}
ReturnValue_t MpsocCommunication::initialize() { return helper.initialize(); }
ReturnValue_t MpsocCommunication::send(const uint8_t* data, size_t dataLen) {
if (MPSOC_LOW_LEVEL_TX_WIRETAPPING) {
sif::debug << "SEND MPSOC packet with size " << dataLen << std::endl;
}
return helper.send(data, dataLen);
}
ReturnValue_t MpsocCommunication::parseAndRetrieveNextPacket() {
// We do not have a data link layer, so this whole thing is a mess in any case..
// But basically, we try to parse space packets from the internal ring buffer and trasnfer
// them to the higher level device handler. The CRC check is performed here as well, with
// few other ways to detect if we even have a valid packet.
size_t availableReadData = readRingBuf.getAvailableReadData();
// Minimum valid size for a space packet header.
if (availableReadData < ccsds::HEADER_LEN + 1) {
return returnvalue::OK;
}
readRingBuf.readData(readBuf, availableReadData);
spReader.setReadOnlyData(readBuf, sizeof(readBuf));
auto res = spReader.checkSize();
if (res != returnvalue::OK) {
return res;
}
// The packet might be garbage, with no way to recover without a data link layer.
if (spReader.getFullPacketLen() > 4096) {
readRingBuf.clear();
// TODO: Maybe we should also clear the serial input buffer in Linux?
return FAULTY_PACKET_SIZE;
}
if (availableReadData < spReader.getFullPacketLen()) {
// Might be split packet where the rest still has to be read.
return returnvalue::OK;
}
if (CRC::crc16ccitt(readBuf, spReader.getFullPacketLen()) != 0) {
// Possibly invalid packet. We can not even trust the detected packet length.
// Just clear the whole read buffer as well.
readRingBuf.clear();
triggerEvent(mpsoc::CRC_FAILURE);
return CRC_CHECK_FAILED;
}
readRingBuf.deleteData(spReader.getFullPacketLen());
return PACKET_RECEIVED;
}
ReturnValue_t MpsocCommunication::readSerialInterface() {
int bytesRead = read(helper.rawFd(), readBuf, sizeof(readBuf));
if (bytesRead < 0) {
return returnvalue::FAILED;
}
if (bytesRead > 0) {
if (MPSOC_LOW_LEVEL_RX_WIRETAPPING) {
sif::debug << "Read " << bytesRead << " bytes on the MPSoC interface" << std::endl;
}
return readRingBuf.writeData(readBuf, bytesRead);
}
return returnvalue::OK;
}
const SpacePacketReader& MpsocCommunication::getSpReader() const { return spReader; }
SerialCommunicationHelper& MpsocCommunication::getComHelper() { return helper; }

View File

@ -0,0 +1,44 @@
#pragma once
#include <fsfw/objectmanager/SystemObject.h>
#include "eive/resultClassIds.h"
#include "fsfw/container/SimpleRingBuffer.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw/tmtcpacket/ccsds/SpacePacketReader.h"
#include "linux/payload/SerialCommunicationHelper.h"
static constexpr bool MPSOC_LOW_LEVEL_TX_WIRETAPPING = false;
static constexpr bool MPSOC_LOW_LEVEL_RX_WIRETAPPING = false;
class MpsocCommunication : public SystemObject {
public:
static const uint8_t CLASS_ID = CLASS_ID::PLOC_MPSOC_COM;
static constexpr ReturnValue_t PACKET_RECEIVED = returnvalue::makeCode(CLASS_ID, 0);
static constexpr ReturnValue_t FAULTY_PACKET_SIZE = returnvalue::makeCode(CLASS_ID, 1);
static constexpr ReturnValue_t CRC_CHECK_FAILED = returnvalue::makeCode(CLASS_ID, 2);
MpsocCommunication(object_id_t objectId, SerialConfig cfg);
ReturnValue_t initialize() override;
ReturnValue_t send(const uint8_t* data, size_t dataLen);
// Should be called periodically to transfer the received data from the MPSoC from the Linux
// buffer to the internal ring buffer for further processing.
ReturnValue_t readSerialInterface();
// Parses the internal ring buffer for packets and checks whether a packet was received.
ReturnValue_t parseAndRetrieveNextPacket();
// Can be used to read the parse packet, if one was received.
const SpacePacketReader& getSpReader() const;
SerialCommunicationHelper& getComHelper();
private:
SpacePacketReader spReader;
uint8_t readBuf[4096];
SimpleRingBuffer readRingBuf;
SerialCommunicationHelper helper;
};

View File

@ -6,16 +6,21 @@
#include <filesystem>
#include <fstream>
#include "fsfw/serviceinterface/ServiceInterfacePrinter.h"
#include "fsfw/serviceinterface/ServiceInterfaceStream.h"
#include "fsfw/tmtcpacket/ccsds/SpacePacketReader.h"
#include "linux/payload/MpsocCommunication.h"
#include "linux/payload/plocMpsocHelpers.h"
#ifdef XIPHOS_Q7S
#include "bsp_q7s/fs/FilesystemHelper.h"
#endif
#include "mission/utility/Timestamp.h"
using namespace ploc;
PlocMpsocSpecialComHelper::PlocMpsocSpecialComHelper(object_id_t objectId)
: SystemObject(objectId) {
PlocMpsocSpecialComHelper::PlocMpsocSpecialComHelper(object_id_t objectId,
MpsocCommunication& comInterface)
: SystemObject(objectId), comInterface(comInterface) {
spParams.buf = commandBuffer;
spParams.maxSize = sizeof(commandBuffer);
}
@ -48,9 +53,9 @@ ReturnValue_t PlocMpsocSpecialComHelper::performOperation(uint8_t operationCode)
case InternalState::FLASH_WRITE: {
result = performFlashWrite();
if (result == returnvalue::OK) {
triggerEvent(MPSOC_FLASH_WRITE_SUCCESSFUL, sequenceCount->get());
triggerEvent(MPSOC_FLASH_WRITE_SUCCESSFUL, txSequenceCount.get());
} else {
triggerEvent(MPSOC_FLASH_WRITE_FAILED, sequenceCount->get());
triggerEvent(MPSOC_FLASH_WRITE_FAILED, txSequenceCount.get());
}
internalState = InternalState::IDLE;
break;
@ -58,9 +63,10 @@ ReturnValue_t PlocMpsocSpecialComHelper::performOperation(uint8_t operationCode)
case InternalState::FLASH_READ: {
result = performFlashRead();
if (result == returnvalue::OK) {
triggerEvent(MPSOC_FLASH_READ_SUCCESSFUL, sequenceCount->get());
triggerEvent(MPSOC_FLASH_READ_SUCCESSFUL, txSequenceCount.get());
} else {
triggerEvent(MPSOC_FLASH_READ_FAILED, sequenceCount->get());
sif::printWarning("PLOC MPSoC Helper: Flash read failed with code %04x\n", result);
triggerEvent(MPSOC_FLASH_READ_FAILED, txSequenceCount.get(), result);
}
internalState = InternalState::IDLE;
break;
@ -72,19 +78,12 @@ ReturnValue_t PlocMpsocSpecialComHelper::performOperation(uint8_t operationCode)
}
}
ReturnValue_t PlocMpsocSpecialComHelper::setComIF(DeviceCommunicationIF* communicationInterface_) {
uartComIF = dynamic_cast<SerialComIF*>(communicationInterface_);
if (uartComIF == nullptr) {
sif::warning << "PlocMPSoCHelper::initialize: Invalid uart com if" << std::endl;
return returnvalue::FAILED;
}
return returnvalue::OK;
void PlocMpsocSpecialComHelper::setCommandSequenceCount(uint16_t sequenceCount_) {
txSequenceCount.set(sequenceCount_);
}
void PlocMpsocSpecialComHelper::setComCookie(CookieIF* comCookie_) { comCookie = comCookie_; }
void PlocMpsocSpecialComHelper::setSequenceCount(SourceSequenceCounter* sequenceCount_) {
sequenceCount = sequenceCount_;
uint16_t PlocMpsocSpecialComHelper::getCommandSequenceCount() const {
return txSequenceCount.get();
}
ReturnValue_t PlocMpsocSpecialComHelper::startFlashWrite(std::string obcFile,
@ -117,7 +116,8 @@ ReturnValue_t PlocMpsocSpecialComHelper::startFlashRead(std::string obcFile, std
void PlocMpsocSpecialComHelper::resetHelper() {
spParams.buf = commandBuffer;
terminate = false;
uartComIF->flushUartRxBuffer(comCookie);
auto& helper = comInterface.getComHelper();
helper.flushUartRxBuffer();
}
void PlocMpsocSpecialComHelper::stopProcess() { terminate = true; }
@ -155,7 +155,7 @@ ReturnValue_t PlocMpsocSpecialComHelper::performFlashWrite() {
file.read(reinterpret_cast<char*>(fileBuf.data()), dataLength);
bytesRead += dataLength;
remainingSize -= dataLength;
mpsoc::TcFlashWrite tc(spParams, *sequenceCount);
mpsoc::TcFlashWrite tc(spParams, txSequenceCount);
result = tc.setPayload(fileBuf.data(), dataLength);
if (result != returnvalue::OK) {
return result;
@ -164,7 +164,7 @@ ReturnValue_t PlocMpsocSpecialComHelper::performFlashWrite() {
if (result != returnvalue::OK) {
return result;
}
(*sequenceCount)++;
txSequenceCount.increment();
result = handlePacketTransmissionNoReply(tc);
if (result != returnvalue::OK) {
return result;
@ -179,8 +179,12 @@ ReturnValue_t PlocMpsocSpecialComHelper::performFlashWrite() {
ReturnValue_t PlocMpsocSpecialComHelper::performFlashRead() {
std::error_code e;
std::ofstream ofile(flashReadAndWrite.obcFile, std::ios::trunc | std::ios::binary);
if (ofile.bad()) {
if (std::filesystem::exists(flashReadAndWrite.obcFile)) {
// Truncate the file first.
std::ofstream ofile(flashReadAndWrite.obcFile, std::ios::binary | std::ios::trunc);
}
std::ofstream ofile(flashReadAndWrite.obcFile, std::ios::binary | std::ios::app);
if (ofile.bad() or not ofile.is_open()) {
return returnvalue::FAILED;
}
ReturnValue_t result = flashfopen(mpsoc::FileAccessModes::READ);
@ -203,7 +207,7 @@ ReturnValue_t PlocMpsocSpecialComHelper::performFlashRead() {
std::filesystem::remove(flashReadAndWrite.obcFile, e);
return FILE_READ_ERROR;
}
mpsoc::TcFlashRead flashReadRequest(spParams, *sequenceCount);
mpsoc::TcFlashRead flashReadRequest(spParams, txSequenceCount);
result = flashReadRequest.setPayload(nextReadSize);
if (result != returnvalue::OK) {
std::filesystem::remove(flashReadAndWrite.obcFile, e);
@ -214,7 +218,7 @@ ReturnValue_t PlocMpsocSpecialComHelper::performFlashRead() {
std::filesystem::remove(flashReadAndWrite.obcFile, e);
return result;
}
(*sequenceCount)++;
txSequenceCount.increment();
result = handlePacketTransmissionFlashRead(flashReadRequest, ofile, nextReadSize);
if (result != returnvalue::OK) {
std::filesystem::remove(flashReadAndWrite.obcFile, e);
@ -231,7 +235,7 @@ ReturnValue_t PlocMpsocSpecialComHelper::performFlashRead() {
ReturnValue_t PlocMpsocSpecialComHelper::flashfopen(uint8_t mode) {
spParams.buf = commandBuffer;
mpsoc::FlashFopen flashFopen(spParams, *sequenceCount);
mpsoc::TcFlashFopen flashFopen(spParams, txSequenceCount);
ReturnValue_t result = flashFopen.setPayload(flashReadAndWrite.mpsocFile, mode);
if (result != returnvalue::OK) {
return result;
@ -240,7 +244,7 @@ ReturnValue_t PlocMpsocSpecialComHelper::flashfopen(uint8_t mode) {
if (result != returnvalue::OK) {
return result;
}
(*sequenceCount)++;
txSequenceCount.increment();
result = handlePacketTransmissionNoReply(flashFopen);
if (result != returnvalue::OK) {
return result;
@ -250,12 +254,12 @@ ReturnValue_t PlocMpsocSpecialComHelper::flashfopen(uint8_t mode) {
ReturnValue_t PlocMpsocSpecialComHelper::flashfclose() {
spParams.buf = commandBuffer;
mpsoc::FlashFclose flashFclose(spParams, *sequenceCount);
mpsoc::TcFlashFclose flashFclose(spParams, txSequenceCount);
ReturnValue_t result = flashFclose.finishPacket();
if (result != returnvalue::OK) {
return result;
}
(*sequenceCount)++;
txSequenceCount.increment();
result = handlePacketTransmissionNoReply(flashFclose);
if (result != returnvalue::OK) {
return result;
@ -278,6 +282,7 @@ ReturnValue_t PlocMpsocSpecialComHelper::handlePacketTransmissionFlashRead(mpsoc
if (result != returnvalue::OK) {
return result;
}
auto& spReader = comInterface.getSpReader();
// We have the nominal case where the flash read report appears first, or the case where we
// get an EXE failure immediately.
@ -288,7 +293,7 @@ ReturnValue_t PlocMpsocSpecialComHelper::handlePacketTransmissionFlashRead(mpsoc
}
return handleExe();
} else if (spReader.getApid() == mpsoc::apid::EXE_FAILURE) {
handleExeFailure();
handleExeFailure(spReader);
} else {
triggerEvent(MPSOC_EXE_INVALID_APID, spReader.getApid(), static_cast<uint32_t>(internalState));
sif::warning << "PLOC MPSoC: Expected execution report "
@ -311,8 +316,8 @@ ReturnValue_t PlocMpsocSpecialComHelper::handlePacketTransmissionNoReply(ploc::S
}
ReturnValue_t PlocMpsocSpecialComHelper::sendCommand(ploc::SpTcBase& tc) {
ReturnValue_t result = returnvalue::OK;
result = uartComIF->sendMessage(comCookie, tc.getFullPacket(), tc.getFullPacketLen());
ReturnValue_t result = comInterface.send(tc.getFullPacket(), tc.getFullPacketLen());
mpsoc::printTxPacket(tc);
if (result != returnvalue::OK) {
sif::warning << "PlocMPSoCHelper::sendCommand: Failed to send command" << std::endl;
triggerEvent(MPSOC_SENDING_COMMAND_FAILED, result, static_cast<uint32_t>(internalState));
@ -331,6 +336,8 @@ ReturnValue_t PlocMpsocSpecialComHelper::handleAck() {
if (result != returnvalue::OK) {
return result;
}
const auto& spReader = comInterface.getSpReader();
uint16_t apid = spReader.getApid();
if (apid != mpsoc::apid::ACK_SUCCESS) {
handleAckApidFailure(spReader);
@ -339,7 +346,7 @@ ReturnValue_t PlocMpsocSpecialComHelper::handleAck() {
return returnvalue::OK;
}
void PlocMpsocSpecialComHelper::handleAckApidFailure(const ploc::SpTmReader& reader) {
void PlocMpsocSpecialComHelper::handleAckApidFailure(const SpacePacketReader& reader) {
uint16_t apid = reader.getApid();
if (apid == mpsoc::apid::ACK_FAILURE) {
uint16_t status = mpsoc::getStatusFromRawData(reader.getFullData());
@ -363,9 +370,10 @@ ReturnValue_t PlocMpsocSpecialComHelper::handleExe() {
if (result != returnvalue::OK) {
return result;
}
const auto& spReader = comInterface.getSpReader();
uint16_t apid = spReader.getApid();
if (apid == mpsoc::apid::EXE_FAILURE) {
handleExeFailure();
handleExeFailure(spReader);
return returnvalue::FAILED;
} else if (apid != mpsoc::apid::EXE_SUCCESS) {
triggerEvent(MPSOC_EXE_INVALID_APID, apid, static_cast<uint32_t>(internalState));
@ -375,7 +383,7 @@ ReturnValue_t PlocMpsocSpecialComHelper::handleExe() {
return returnvalue::OK;
}
void PlocMpsocSpecialComHelper::handleExeFailure() {
void PlocMpsocSpecialComHelper::handleExeFailure(const SpacePacketReader& spReader) {
uint16_t status = mpsoc::getStatusFromRawData(spReader.getFullData());
sif::warning << "PLOC MPSoC EXE Failure: " << mpsoc::getStatusString(status) << std::endl;
triggerEvent(MPSOC_EXE_FAILURE_REPORT, static_cast<uint32_t>(internalState));
@ -384,46 +392,32 @@ void PlocMpsocSpecialComHelper::handleExeFailure() {
ReturnValue_t PlocMpsocSpecialComHelper::handleTmReception() {
ReturnValue_t result = returnvalue::OK;
tmCountdown.resetTimer();
size_t readBytes = 0;
size_t currentBytes = 0;
uint32_t usleepDelay = 5;
size_t fullPacketLen = 0;
while (true) {
if (tmCountdown.hasTimedOut()) {
triggerEvent(MPSOC_READ_TIMEOUT, tmCountdown.getTimeoutMs());
return returnvalue::FAILED;
}
result = receive(tmBuf.data() + readBytes, 6, &currentBytes);
result = tryReceiveNextReply();
if (result == MpsocCommunication::PACKET_RECEIVED) {
// Need to convert this, we are faking a synchronous API here.
result = returnvalue::OK;
break;
}
if (result != returnvalue::OK) {
if (result == MpsocCommunication::FAULTY_PACKET_SIZE) {
sif::printWarning("PLOC MPSoC Helper: retrieving next reply failed: faulty packet size\n");
} else if (result == MpsocCommunication::CRC_CHECK_FAILED) {
sif::printWarning("PLOC MPSoC Helper: retrieving next reply failed: CRC check failed\n");
}
sif::printWarning("PLOC MPSoC Helper: retrieving next reply failed with code %d\n", result);
return result;
}
spReader.setReadOnlyData(tmBuf.data(), tmBuf.size());
fullPacketLen = spReader.getFullPacketLen();
readBytes += currentBytes;
if (readBytes == 6) {
break;
}
usleep(usleepDelay);
if (usleepDelay < 200000) {
usleepDelay *= 4;
}
}
while (true) {
if (tmCountdown.hasTimedOut()) {
triggerEvent(MPSOC_READ_TIMEOUT, tmCountdown.getTimeoutMs());
return returnvalue::FAILED;
}
result = receive(tmBuf.data() + readBytes, fullPacketLen - readBytes, &currentBytes);
readBytes += currentBytes;
if (fullPacketLen == readBytes) {
break;
}
usleep(usleepDelay);
if (usleepDelay < 200000) {
usleepDelay *= 4;
}
}
// arrayprinter::print(tmBuf.data(), readBytes);
return result;
}
@ -433,6 +427,7 @@ ReturnValue_t PlocMpsocSpecialComHelper::handleFlashReadReply(std::ofstream& ofi
if (result != returnvalue::OK) {
return result;
}
auto& spReader = comInterface.getSpReader();
uint16_t apid = spReader.getApid();
if (apid != mpsoc::apid::TM_FLASH_READ_REPORT) {
triggerEvent(MPSOC_FLASH_READ_PACKET_ERROR, FlashReadErrorType::FLASH_READ_APID_ERROR);
@ -498,47 +493,25 @@ ReturnValue_t PlocMpsocSpecialComHelper::startFlashReadOrWriteBase(std::string o
}
ReturnValue_t PlocMpsocSpecialComHelper::checkReceivedTm() {
const auto& spReader = comInterface.getSpReader();
ReturnValue_t result = spReader.checkSize();
if (result != returnvalue::OK) {
sif::error << "PLOC MPSoC: Size check on received TM failed" << std::endl;
triggerEvent(MPSOC_TM_SIZE_ERROR);
return result;
}
result = spReader.checkCrc();
if (result != returnvalue::OK) {
sif::warning << "PLOC MPSoC: CRC check failed" << std::endl;
triggerEvent(MPSOC_TM_CRC_MISSMATCH, *sequenceCount);
return result;
}
uint16_t recvSeqCnt = spReader.getSequenceCount();
if (recvSeqCnt != *sequenceCount) {
triggerEvent(MPSOC_HELPER_SEQ_CNT_MISMATCH, *sequenceCount, recvSeqCnt);
*sequenceCount = recvSeqCnt;
}
// This sequence count ping pong does not make any sense but it is how the MPSoC expects it.
(*sequenceCount)++;
rxSequenceCount = spReader.getSequenceCount();
mpsoc::printRxPacket(spReader);
return returnvalue::OK;
}
ReturnValue_t PlocMpsocSpecialComHelper::receive(uint8_t* data, size_t requestBytes,
size_t* readBytes) {
ReturnValue_t PlocMpsocSpecialComHelper::tryReceiveNextReply() {
ReturnValue_t result = returnvalue::OK;
uint8_t* buffer = nullptr;
result = uartComIF->requestReceiveMessage(comCookie, requestBytes);
result = comInterface.readSerialInterface();
if (result != returnvalue::OK) {
sif::warning << "PlocMPSoCHelper::receive: Failed to request reply" << std::endl;
triggerEvent(MPSOC_HELPER_REQUESTING_REPLY_FAILED, result,
static_cast<uint32_t>(static_cast<uint32_t>(internalState)));
return returnvalue::FAILED;
}
result = uartComIF->readReceivedMessage(comCookie, &buffer, readBytes);
if (result != returnvalue::OK) {
sif::warning << "PlocMPSoCHelper::receive: Failed to read received message" << std::endl;
triggerEvent(MPSOC_HELPER_READING_REPLY_FAILED, result, static_cast<uint32_t>(internalState));
return returnvalue::FAILED;
}
if (*readBytes > 0) {
std::memcpy(data, buffer, *readBytes);
}
return result;
return comInterface.parseAndRetrieveNextPacket();
}

View File

@ -6,14 +6,13 @@
#include <string>
#include "OBSWConfig.h"
#include "fsfw/devicehandlers/CookieIF.h"
#include "fsfw/objectmanager/SystemObject.h"
#include "fsfw/osal/linux/BinarySemaphore.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw/tasks/ExecutableObjectIF.h"
#include "fsfw/tmtcpacket/ccsds/SpacePacketReader.h"
#include "fsfw/tmtcservices/SourceSequenceCounter.h"
#include "fsfw_hal/linux/serial/SerialComIF.h"
#include "linux/payload/MpsocCommunication.h"
#ifdef XIPHOS_Q7S
#include "bsp_q7s/fs/SdCardManager.h"
#endif
@ -83,15 +82,12 @@ class PlocMpsocSpecialComHelper : public SystemObject, public ExecutableObjectIF
FLASH_READ_READLEN_ERROR = 2
};
PlocMpsocSpecialComHelper(object_id_t objectId);
PlocMpsocSpecialComHelper(object_id_t objectId, MpsocCommunication& comInterface);
virtual ~PlocMpsocSpecialComHelper();
ReturnValue_t initialize() override;
ReturnValue_t performOperation(uint8_t operationCode = 0) override;
ReturnValue_t setComIF(DeviceCommunicationIF* communicationInterface_);
void setComCookie(CookieIF* comCookie_);
/**
* @brief Starts flash write sequence
*
@ -118,7 +114,8 @@ class PlocMpsocSpecialComHelper : public SystemObject, public ExecutableObjectIF
/**
* @brief Sets the sequence count object responsible for the sequence count handling
*/
void setSequenceCount(SourceSequenceCounter* sequenceCount_);
void setCommandSequenceCount(uint16_t sequenceCount_);
uint16_t getCommandSequenceCount() const;
private:
static const uint8_t INTERFACE_ID = CLASS_ID::PLOC_MPSOC_HELPER;
@ -169,12 +166,14 @@ class PlocMpsocSpecialComHelper : public SystemObject, public ExecutableObjectIF
* Communication interface of MPSoC responsible for low level access. Must be set by the
* MPSoC Handler.
*/
SerialComIF* uartComIF = nullptr;
// SerialComIF* uartComIF = nullptr;
// Communication cookie. Must be set by the MPSoC Handler
CookieIF* comCookie = nullptr;
// CookieIF* comCookie = nullptr;
MpsocCommunication& comInterface;
// Sequence count, must be set by Ploc MPSoC Handler
SourceSequenceCounter* sequenceCount = nullptr;
ploc::SpTmReader spReader;
// ploc::SpTmReader spReader;
uint16_t rxSequenceCount = 0;
SourceSequenceCounter txSequenceCount = 0;
void resetHelper();
ReturnValue_t performFlashWrite();
@ -186,13 +185,13 @@ class PlocMpsocSpecialComHelper : public SystemObject, public ExecutableObjectIF
size_t expectedReadLen);
ReturnValue_t handleFlashReadReply(std::ofstream& ofile, size_t expectedReadLen);
ReturnValue_t sendCommand(ploc::SpTcBase& tc);
ReturnValue_t receive(uint8_t* data, size_t requestBytes, size_t* readBytes);
ReturnValue_t tryReceiveNextReply();
ReturnValue_t handleAck();
ReturnValue_t handleExe();
ReturnValue_t startFlashReadOrWriteBase(std::string obcFile, std::string mpsocFile);
ReturnValue_t fileCheck(std::string obcFile);
void handleAckApidFailure(const ploc::SpTmReader& reader);
void handleExeFailure();
void handleAckApidFailure(const SpacePacketReader& reader);
void handleExeFailure(const SpacePacketReader& reader);
ReturnValue_t handleTmReception();
ReturnValue_t checkReceivedTm();
};

View File

@ -11,6 +11,8 @@
#include <fstream>
#include "OBSWConfig.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "linux/payload/plocSupvDefs.h"
#include "tas/hdlc.h"
#ifdef XIPHOS_Q7S
#include "bsp_q7s/fs/FilesystemHelper.h"
@ -21,9 +23,13 @@
#include "fsfw/tasks/TaskFactory.h"
#include "fsfw/timemanager/Countdown.h"
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1
#include "mission/utility/Filenaming.h"
#include "mission/utility/ProgressPrinter.h"
#include "mission/utility/Timestamp.h"
#endif
#include "tas/crc.h"
using namespace returnvalue;
@ -277,23 +283,6 @@ ReturnValue_t PlocSupvUartManager::initiateUpdateContinuation() {
return returnvalue::OK;
}
// ReturnValue_t PlocSupvHelper::startEventBufferRequest(std::string path) {
// #ifdef XIPHOS_Q7S
// ReturnValue_t result = FilesystemHelper::checkPath(path);
// if (result != returnvalue::OK) {
// return result;
// }
// #endif
// if (not std::filesystem::exists(path)) {
// return PATH_NOT_EXISTS;
// }
// eventBufferReq.path = path;
// request = Request::REQUEST_EVENT_BUFFER;
// //uartComIF->flushUartTxAndRxBuf(comCookie);
// semaphore->release();
// return returnvalue::OK;
// }
void PlocSupvUartManager::stop() {
MutexGuard mg(lock);
if (state == InternalState::SLEEPING or state == InternalState::GO_TO_SLEEP) {
@ -437,6 +426,8 @@ ReturnValue_t PlocSupvUartManager::writeUpdatePackets() {
// Useful to allow restarting the update
triggerEvent(SUPV_UPDATE_PROGRESS, buildProgParams1(progPercent, update.sequenceCount),
update.bytesWritten);
sif::info << "PLOC SUPV update progress " << (int)progPercent << " % at "
<< update.bytesWritten << " bytes" << std::endl;
}
}
supv::WriteMemory packet(spParams);
@ -447,10 +438,8 @@ ReturnValue_t PlocSupvUartManager::writeUpdatePackets() {
update.bytesWritten);
return result;
}
result = handlePacketTransmissionNoReply(packet, 5000);
result = writeMemoryHandlingWithRetryLogic(packet, progPercent);
if (result != returnvalue::OK) {
triggerEvent(WRITE_MEMORY_FAILED, buildProgParams1(progPercent, update.sequenceCount),
update.bytesWritten);
return result;
}
@ -461,7 +450,25 @@ ReturnValue_t PlocSupvUartManager::writeUpdatePackets() {
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1
progressPrinter.print(update.bytesWritten);
#endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */
// TaskFactory::delayTask(1);
}
return result;
}
ReturnValue_t PlocSupvUartManager::writeMemoryHandlingWithRetryLogic(supv::WriteMemory& packet,
unsigned progPercent) {
ReturnValue_t result = returnvalue::OK;
// Simple re-try logic in place to deal with communication unreliability in orbit.
for (uint8_t retryCount = 0; retryCount < MAX_RETRY_COUNT; retryCount++) {
result = handlePacketTransmissionNoReply(packet, COM_TIMEOUT_MS);
if (result == returnvalue::OK) {
return result;
}
triggerEvent(WRITE_MEMORY_FAILED, buildProgParams1(progPercent, update.sequenceCount),
update.bytesWritten);
// Clear data structures related to reply handling.
serial::flushTxRxBuf(serialPort);
recRingBuf.clear();
decodedRingBuf.clear();
}
return result;
}
@ -570,7 +577,16 @@ ReturnValue_t PlocSupvUartManager::handlePacketTransmissionNoReply(
bool ackReceived = false;
bool packetWasHandled = false;
while (true) {
handleUartReception();
ReturnValue_t status = handleUartReception();
if (status != returnvalue::OK) {
result = status;
if (result == HDLC_ERROR) {
// We could bail here immediately.. but I prefer to wait for the timeout, because we should
// ensure that all packets which might be related to the transfer are still received and
// cleared from all data structures related to reply handling.
// return result;
}
}
if (not decodedQueue.empty()) {
size_t packetLen = 0;
decodedQueue.retrieve(&packetLen);
@ -613,7 +629,7 @@ ReturnValue_t PlocSupvUartManager::handlePacketTransmissionNoReply(
return result::NO_REPLY_TIMEOUT;
}
}
return returnvalue::OK;
return result;
}
int PlocSupvUartManager::handleAckReception(supv::TcBase& tc, size_t packetLen) {

View File

@ -118,6 +118,7 @@ class PlocSupvUartManager : public DeviceCommunicationIF,
static constexpr Event HDLC_FRAME_REMOVAL_ERROR = MAKE_EVENT(31, severity::INFO);
static constexpr Event HDLC_CRC_ERROR = MAKE_EVENT(32, severity::INFO);
static constexpr unsigned MAX_RETRY_COUNT = 3;
PlocSupvUartManager(object_id_t objectId);
virtual ~PlocSupvUartManager();
/**
@ -199,6 +200,8 @@ class PlocSupvUartManager : public DeviceCommunicationIF,
static constexpr ReturnValue_t POSSIBLE_PACKET_LOSS_CONSECUTIVE_END = returnvalue::makeCode(1, 4);
static constexpr ReturnValue_t HDLC_ERROR = returnvalue::makeCode(1, 5);
static constexpr uint32_t COM_TIMEOUT_MS = 3000;
static const uint16_t CRC16_INIT = 0xFFFF;
// Event buffer reply will carry 24 space packets with 1016 bytes and one space packet with
// 192 bytes
@ -369,6 +372,8 @@ class PlocSupvUartManager : public DeviceCommunicationIF,
*/
ReturnValue_t requestReceiveMessage(CookieIF* cookie, size_t requestLen) override;
ReturnValue_t writeMemoryHandlingWithRetryLogic(supv::WriteMemory& packet, unsigned progPercent);
void performUartShutdown();
void updateVtime(uint8_t vtime);
};

View File

@ -0,0 +1,126 @@
#include "SerialCommunicationHelper.h"
#include <errno.h>
#include <fcntl.h>
#include <termios.h>
#include <unistd.h>
#include <cstring>
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw_hal/linux/serial/helper.h"
SerialCommunicationHelper::SerialCommunicationHelper(SerialConfig cfg) : cfg(cfg) {}
ReturnValue_t SerialCommunicationHelper::initialize() {
fd = configureUartPort();
if (fd < 0) {
return returnvalue::FAILED;
}
return returnvalue::OK;
}
int SerialCommunicationHelper::rawFd() const { return fd; }
ReturnValue_t SerialCommunicationHelper::send(const uint8_t* data, size_t dataLen) {
if (write(fd, data, dataLen) != static_cast<int>(dataLen)) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "UartComIF::sendMessage: Failed to send data with error code " << errno
<< ": Error description: " << strerror(errno) << std::endl;
#endif
return returnvalue::FAILED;
}
return returnvalue::OK;
}
int SerialCommunicationHelper::configureUartPort() {
struct termios options = {};
int flags = O_RDWR;
if (cfg.getUartMode() == UartModes::CANONICAL) {
// In non-canonical mode, don't specify O_NONBLOCK because these properties will be
// controlled by the VTIME and VMIN parameters and O_NONBLOCK would override this
flags |= O_NONBLOCK;
}
int fd = open(cfg.getDeviceFile().c_str(), flags);
if (fd < 0) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "UartComIF::configureUartPort: Failed to open uart "
<< cfg.getDeviceFile().c_str()
<< "with error code " << errno << strerror(errno) << std::endl;
#endif
return fd;
}
/* Read in existing settings */
if (tcgetattr(fd, &options) != 0) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "UartComIF::configureUartPort: Error " << errno
<< "from tcgetattr: " << strerror(errno) << std::endl;
#endif
return fd;
}
serial::setParity(options, cfg.getParity());
serial::setStopbits(options, cfg.getStopBits());
serial::setBitsPerWord(options, cfg.getBitsPerWord());
setFixedOptions(&options);
serial::setMode(options, cfg.getUartMode());
tcflush(fd, TCIFLUSH);
/* Sets uart to non-blocking mode. Read returns immediately when there are no data available */
options.c_cc[VTIME] = 0;
options.c_cc[VMIN] = 0;
serial::setBaudrate(options, cfg.getBaudrate());
/* Save option settings */
if (tcsetattr(fd, TCSANOW, &options) != 0) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "UartComIF::configureUartPort: Failed to set options with error " << errno
<< ": " << strerror(errno);
#endif
return fd;
}
return fd;
}
void SerialCommunicationHelper::setFixedOptions(struct termios* options) {
/* Disable RTS/CTS hardware flow control */
options->c_cflag &= ~CRTSCTS;
/* Turn on READ & ignore ctrl lines (CLOCAL = 1) */
options->c_cflag |= CREAD | CLOCAL;
/* Disable echo */
options->c_lflag &= ~ECHO;
/* Disable erasure */
options->c_lflag &= ~ECHOE;
/* Disable new-line echo */
options->c_lflag &= ~ECHONL;
/* Disable interpretation of INTR, QUIT and SUSP */
options->c_lflag &= ~ISIG;
/* Turn off s/w flow ctrl */
options->c_iflag &= ~(IXON | IXOFF | IXANY);
/* Disable any special handling of received bytes */
options->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL);
/* Prevent special interpretation of output bytes (e.g. newline chars) */
options->c_oflag &= ~OPOST;
/* Prevent conversion of newline to carriage return/line feed */
options->c_oflag &= ~ONLCR;
}
ReturnValue_t SerialCommunicationHelper::flushUartRxBuffer() {
serial::flushRxBuf(fd);
return returnvalue::OK;
}
ReturnValue_t SerialCommunicationHelper::flushUartTxBuffer() {
serial::flushTxBuf(fd);
return returnvalue::OK;
}
ReturnValue_t SerialCommunicationHelper::flushUartTxAndRxBuf() {
serial::flushTxRxBuf(fd);
return returnvalue::OK;
}

View File

@ -0,0 +1,69 @@
#pragma once
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw_hal/linux/serial/SerialCookie.h>
#include <fsfw_hal/linux/serial/helper.h>
#include "SerialConfig.h"
#include "fsfw/returnvalues/returnvalue.h"
/**
* @brief This is the communication interface to access serial ports on linux based operating
* systems.
*
* @details The implementation follows the instructions from https://blog.mbedded.ninja/programming/
* operating-systems/linux/linux-serial-ports-using-c-cpp/#disabling-canonical-mode
*
* @author J. Meier
*/
class SerialCommunicationHelper {
public:
SerialCommunicationHelper(SerialConfig serialCfg);
ReturnValue_t send(const uint8_t* data, size_t dataLen);
int rawFd() const;
ReturnValue_t initialize();
/**
* @brief This function discards all data received but not read in the UART buffer.
*/
ReturnValue_t flushUartRxBuffer();
/**
* @brief This function discards all data in the transmit buffer of the UART driver.
*/
ReturnValue_t flushUartTxBuffer();
/**
* @brief This function discards both data in the transmit and receive buffer of the UART.
*/
ReturnValue_t flushUartTxAndRxBuf();
private:
SerialConfig cfg;
int fd = 0;
/**
* @brief This function opens and configures a uart device by using the information stored
* in the uart cookie.
* @param uartCookie Pointer to uart cookie with information about the uart. Contains the
* uart device file, baudrate, parity, stopbits etc.
* @return The file descriptor of the configured uart.
*/
int configureUartPort();
void setStopBitOptions(struct termios* options);
/**
* @brief This function sets options which are not configurable by the uartCookie.
*/
void setFixedOptions(struct termios* options);
/**
* @brief With this function the datasize settings are added to the termios options struct.
*/
void setDatasizeOptions(struct termios* options);
};

View File

@ -0,0 +1,70 @@
#pragma once
#include <fsfw/devicehandlers/CookieIF.h>
#include <fsfw/objectmanager/SystemObjectIF.h>
#include <fsfw_hal/linux/serial/helper.h>
#include <string>
/**
* @brief Cookie for the UartComIF. There are many options available to configure the UART driver.
* The constructor only requests for common options like the baudrate. Other options can
* be set by member functions.
*
* @author J. Meier
*/
class SerialConfig : public CookieIF {
public:
/**
* @brief Constructor for the uart cookie.
* @param deviceFile The device file specifying the uart to use, e.g. "/dev/ttyPS1"
* @param uartMode Specify the UART mode. The canonical mode should be used if the
* messages are separated by a delimited character like '\n'. See the
* termios documentation for more information
* @param baudrate The baudrate to use for input and output.
* @param maxReplyLen The maximum size an object using this cookie expects
* @details
* Default configuration: No parity
* 8 databits (number of bits transfered with one uart frame)
* One stop bit
*/
SerialConfig(std::string deviceFile, UartBaudRate baudrate, size_t maxReplyLen,
UartModes uartMode = UartModes::NON_CANONICAL)
: deviceFile(deviceFile), baudrate(baudrate), maxReplyLen(maxReplyLen), uartMode(uartMode) {}
virtual ~SerialConfig() = default;
UartBaudRate getBaudrate() const { return baudrate; }
size_t getMaxReplyLen() const { return maxReplyLen; }
std::string getDeviceFile() const { return deviceFile; }
Parity getParity() const { return parity; }
BitsPerWord getBitsPerWord() const { return bitsPerWord; }
StopBits getStopBits() const { return stopBits; }
UartModes getUartMode() const { return uartMode; }
/**
* Functions two enable parity checking.
*/
void setParityOdd() { parity = Parity::ODD; }
void setParityEven() { parity = Parity::EVEN; }
/**
* Function two set number of bits per UART frame.
*/
void setBitsPerWord(BitsPerWord bitsPerWord_) { bitsPerWord = bitsPerWord_; }
/**
* Function to specify the number of stopbits.
*/
void setTwoStopBits() { stopBits = StopBits::TWO_STOP_BITS; }
void setOneStopBit() { stopBits = StopBits::ONE_STOP_BIT; }
private:
std::string deviceFile;
UartBaudRate baudrate;
size_t maxReplyLen = 0;
const UartModes uartMode;
Parity parity = Parity::NONE;
BitsPerWord bitsPerWord = BitsPerWord::BITS_8;
StopBits stopBits = StopBits::ONE_STOP_BIT;
};

View File

@ -1,33 +0,0 @@
#ifndef MPSOC_RETURN_VALUES_IF_H_
#define MPSOC_RETURN_VALUES_IF_H_
#include "eive/resultClassIds.h"
#include "fsfw/returnvalues/returnvalue.h"
class MPSoCReturnValuesIF {
public:
static const uint8_t INTERFACE_ID = CLASS_ID::MPSOC_RETURN_VALUES_IF;
//! [EXPORT] : [COMMENT] Space Packet received from PLOC has invalid CRC
static const ReturnValue_t CRC_FAILURE = MAKE_RETURN_CODE(0xA0);
//! [EXPORT] : [COMMENT] Received ACK failure reply from PLOC
static const ReturnValue_t RECEIVED_ACK_FAILURE = MAKE_RETURN_CODE(0xA1);
//! [EXPORT] : [COMMENT] Received execution failure reply from PLOC
static const ReturnValue_t RECEIVED_EXE_FAILURE = MAKE_RETURN_CODE(0xA2);
//! [EXPORT] : [COMMENT] Received space packet with invalid APID from PLOC
static const ReturnValue_t INVALID_APID = MAKE_RETURN_CODE(0xA3);
//! [EXPORT] : [COMMENT] Received command with invalid length
static const ReturnValue_t INVALID_LENGTH = MAKE_RETURN_CODE(0xA4);
//! [EXPORT] : [COMMENT] Filename of file in OBC filesystem is too long
static const ReturnValue_t FILENAME_TOO_LONG = MAKE_RETURN_CODE(0xA5);
//! [EXPORT] : [COMMENT] MPSoC helper is currently executing a command
static const ReturnValue_t MPSOC_HELPER_EXECUTING = MAKE_RETURN_CODE(0xA6);
//! [EXPORT] : [COMMENT] Filename of MPSoC file is to long (max. 256 bytes)
static const ReturnValue_t MPSOC_FILENAME_TOO_LONG = MAKE_RETURN_CODE(0xA7);
//! [EXPORT] : [COMMENT] Command has invalid parameter
static const ReturnValue_t INVALID_PARAMETER = MAKE_RETURN_CODE(0xA8);
//! [EXPORT] : [COMMENT] Received command has file string with invalid length
static const ReturnValue_t NAME_TOO_LONG = MAKE_RETURN_CODE(0xA9);
};
#endif /* MPSOC_RETURN_VALUES_IF_H_ */

View File

@ -1,87 +1,94 @@
#include "plocMpsocHelpers.h"
#include "fsfw/tmtcpacket/ccsds/SpacePacketReader.h"
#include "mission/payload/plocSpBase.h"
uint16_t mpsoc::getStatusFromRawData(const uint8_t* data) {
return (*(data + STATUS_OFFSET) << 8) | *(data + STATUS_OFFSET + 1);
}
std::string mpsoc::getStatusString(uint16_t status) {
switch (status) {
case (mpsoc::status_code::UNKNOWN_APID): {
case (mpsoc::statusCode::UNKNOWN_APID): {
return "Unknown APID";
break;
}
case (mpsoc::status_code::INCORRECT_LENGTH): {
case (mpsoc::statusCode::INCORRECT_LENGTH): {
return "Incorrect length";
break;
}
case (mpsoc::status_code::INCORRECT_CRC): {
case (mpsoc::statusCode::FLASH_DRIVE_ERROR): {
return "flash drive error";
break;
}
case (mpsoc::statusCode::INCORRECT_CRC): {
return "Incorrect crc";
break;
}
case (mpsoc::status_code::INCORRECT_PKT_SEQ_CNT): {
case (mpsoc::statusCode::INCORRECT_PKT_SEQ_CNT): {
return "Incorrect packet sequence count";
break;
}
case (mpsoc::status_code::TC_NOT_ALLOWED_IN_MODE): {
case (mpsoc::statusCode::TC_NOT_ALLOWED_IN_MODE): {
return "TC not allowed in this mode";
break;
}
case (mpsoc::status_code::TC_EXEUTION_DISABLED): {
case (mpsoc::statusCode::TC_EXEUTION_DISABLED): {
return "TC execution disabled";
break;
}
case (mpsoc::status_code::FLASH_MOUNT_FAILED): {
case (mpsoc::statusCode::FLASH_MOUNT_FAILED): {
return "Flash mount failed";
break;
}
case (mpsoc::status_code::FLASH_FILE_ALREADY_OPEN): {
case (mpsoc::statusCode::FLASH_FILE_ALREADY_OPEN): {
return "Flash file already open";
break;
}
case (mpsoc::status_code::FLASH_FILE_ALREADY_CLOSED): {
case (mpsoc::statusCode::FLASH_FILE_ALREADY_CLOSED): {
return "Flash file already closed";
break;
}
case (mpsoc::status_code::FLASH_FILE_OPEN_FAILED): {
case (mpsoc::statusCode::FLASH_FILE_OPEN_FAILED): {
return "Flash file open failed";
break;
}
case (mpsoc::status_code::FLASH_FILE_NOT_OPEN): {
case (mpsoc::statusCode::FLASH_FILE_NOT_OPEN): {
return "Flash file not open";
break;
}
case (mpsoc::status_code::FLASH_UNMOUNT_FAILED): {
case (mpsoc::statusCode::FLASH_UNMOUNT_FAILED): {
return "Flash unmount failed";
break;
}
case (mpsoc::status_code::HEAP_ALLOCATION_FAILED): {
case (mpsoc::statusCode::HEAP_ALLOCATION_FAILED): {
return "Heap allocation failed";
break;
}
case (mpsoc::status_code::INVALID_PARAMETER): {
case (mpsoc::statusCode::INVALID_PARAMETER): {
return "Invalid parameter";
break;
}
case (mpsoc::status_code::NOT_INITIALIZED): {
case (mpsoc::statusCode::NOT_INITIALIZED): {
return "Not initialized";
break;
}
case (mpsoc::status_code::REBOOT_IMMINENT): {
case (mpsoc::statusCode::REBOOT_IMMINENT): {
return "Reboot imminent";
break;
}
case (mpsoc::status_code::CORRUPT_DATA): {
case (mpsoc::statusCode::CORRUPT_DATA): {
return "Corrupt data";
break;
}
case (mpsoc::status_code::FLASH_CORRECTABLE_MISMATCH): {
case (mpsoc::statusCode::FLASH_CORRECTABLE_MISMATCH): {
return "Flash correctable mismatch";
break;
}
case (mpsoc::status_code::FLASH_UNCORRECTABLE_MISMATCH): {
case (mpsoc::statusCode::FLASH_UNCORRECTABLE_MISMATCH): {
return "Flash uncorrectable mismatch";
break;
}
case (mpsoc::status_code::DEFAULT_ERROR_CODE): {
case (mpsoc::statusCode::DEFAULT_ERROR_CODE): {
return "Default error code";
break;
}
@ -93,3 +100,19 @@ std::string mpsoc::getStatusString(uint16_t status) {
}
return "";
}
void mpsoc::printRxPacket(const SpacePacketReader& spReader) {
if (mpsoc::MPSOC_RX_WIRETAPPING) {
sif::debug << "RECV MPSOC packet. APID 0x" << std::hex << std::setw(3) << spReader.getApid()
<< std::dec << " Size " << spReader.getFullPacketLen() << " SSC "
<< spReader.getSequenceCount() << std::endl;
}
}
void mpsoc::printTxPacket(const ploc::SpTcBase& tcBase) {
if (mpsoc::MPSOC_TX_WIRETAPPING) {
sif::debug << "SEND MPSOC packet. APID 0x" << std::hex << std::setw(3) << tcBase.getApid()
<< " Size " << std::dec << tcBase.getFullPacketLen() << " SSC "
<< tcBase.getSeqCount() << std::endl;
}
}

View File

@ -3,16 +3,122 @@
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include <linux/payload/mpsocRetvals.h>
#include <mission/payload/plocSpBase.h>
#include "OBSWConfig.h"
#include "eive/definitions.h"
#include "fsfw/globalfunctions/CRC.h"
#include "eive/eventSubsystemIds.h"
#include "eive/resultClassIds.h"
#include "fsfw/action/HasActionsIF.h"
#include "fsfw/events/Event.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw/serialize/SerializeAdapter.h"
#include "fsfw/serialize/SerializeIF.h"
namespace mpsoc {
static constexpr bool MPSOC_TX_WIRETAPPING = false;
static constexpr bool MPSOC_RX_WIRETAPPING = false;
static constexpr size_t CRC_SIZE = 2;
/**
* @brief Abstract base class for TC space packet of MPSoC.
*/
class TcBase : public ploc::SpTcBase {
public:
virtual ~TcBase() = default;
// Initial length field of space packet. Will always be updated when packet is created.
static const uint16_t INIT_LENGTH = CRC_SIZE;
/**
* @brief Constructor
*
* @param sequenceCount Sequence count of space packet which will be incremented with each
* sent and received packets.
*/
TcBase(ploc::SpTcParams params, uint16_t apid, uint16_t sequenceCount)
: ploc::SpTcBase(params, apid, 0, sequenceCount) {
payloadStart = spParams.buf + ccsds::HEADER_LEN;
spParams.setFullPayloadLen(INIT_LENGTH);
}
/**
* @brief Function to finsh and write the space packet. It is expected that the user has
* set the payload fields in the child class*
* @return returnvalue::OK if packet creation was successful, otherwise error return value
*/
ReturnValue_t finishPacket() {
updateSpFields();
ReturnValue_t res = checkSizeAndSerializeHeader();
if (res != returnvalue::OK) {
return res;
}
return calcAndSetCrc();
}
};
void printRxPacket(const SpacePacketReader& spReader);
void printTxPacket(const ploc::SpTcBase& tcBase);
static constexpr uint32_t DEFAULT_CMD_TIMEOUT_MS = 5000;
static constexpr uint32_t CMD_TIMEOUT_MKFS = 15000;
enum FlashId : uint8_t { FLASH_0 = 0, FLASH_1 = 1 };
static const uint8_t INTERFACE_ID = CLASS_ID::MPSOC_RETURN_VALUES_IF;
//! [EXPORT] : [COMMENT] Space Packet received from PLOC has invalid CRC
static const ReturnValue_t CRC_FAILURE = MAKE_RETURN_CODE(0xA0);
//! [EXPORT] : [COMMENT] Received ACK failure reply from PLOC
static const ReturnValue_t RECEIVED_ACK_FAILURE = MAKE_RETURN_CODE(0xA1);
//! [EXPORT] : [COMMENT] Received execution failure reply from PLOC
static const ReturnValue_t RECEIVED_EXE_FAILURE = MAKE_RETURN_CODE(0xA2);
//! [EXPORT] : [COMMENT] Received space packet with invalid APID from PLOC
static const ReturnValue_t INVALID_APID = MAKE_RETURN_CODE(0xA3);
//! [EXPORT] : [COMMENT] Received command with invalid length
static const ReturnValue_t INVALID_LENGTH = MAKE_RETURN_CODE(0xA4);
//! [EXPORT] : [COMMENT] Filename of file in OBC filesystem is too long
static const ReturnValue_t FILENAME_TOO_LONG = MAKE_RETURN_CODE(0xA5);
//! [EXPORT] : [COMMENT] MPSoC helper is currently executing a command
static const ReturnValue_t MPSOC_HELPER_EXECUTING = MAKE_RETURN_CODE(0xA6);
//! [EXPORT] : [COMMENT] Filename of MPSoC file is to long (max. 256 bytes)
static const ReturnValue_t MPSOC_FILENAME_TOO_LONG = MAKE_RETURN_CODE(0xA7);
//! [EXPORT] : [COMMENT] Command has invalid parameter
static const ReturnValue_t INVALID_PARAMETER = MAKE_RETURN_CODE(0xA8);
//! [EXPORT] : [COMMENT] Received command has file string with invalid length
static const ReturnValue_t NAME_TOO_LONG = MAKE_RETURN_CODE(0xA9);
//! [EXPORT] : [COMMENT] Command has timed out.
static const ReturnValue_t COMMAND_TIMEOUT = MAKE_RETURN_CODE(0x10);
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_MPSOC_HANDLER;
//! [EXPORT] : [COMMENT] PLOC crc failure in telemetry packet
static const Event MEMORY_READ_RPT_CRC_FAILURE = MAKE_EVENT(1, severity::LOW);
//! [EXPORT] : [COMMENT] PLOC receive acknowledgment failure report
//! P1: Command Id which leads the acknowledgment failure report
//! P2: The status field inserted by the MPSoC into the data field
static const Event ACK_FAILURE = MAKE_EVENT(2, severity::LOW);
//! [EXPORT] : [COMMENT] PLOC receive execution failure report
//! P1: Command Id which leads the execution failure report
//! P2: The status field inserted by the MPSoC into the data field
static const Event EXE_FAILURE = MAKE_EVENT(3, severity::LOW);
//! [EXPORT] : [COMMENT] PLOC reply has invalid crc
static const Event MPSOC_HANDLER_CRC_FAILURE = MAKE_EVENT(4, severity::LOW);
//! [EXPORT] : [COMMENT] Packet sequence count in received space packet does not match expected
//! count P1: Expected sequence count P2: Received sequence count
static const Event MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH = MAKE_EVENT(5, severity::LOW);
//! [EXPORT] : [COMMENT] Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and
//! thus also to shutdown the supervisor.
static const Event MPSOC_SHUTDOWN_FAILED = MAKE_EVENT(6, severity::HIGH);
//! [EXPORT] : [COMMENT] SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for
//! ON transition.
static constexpr Event SUPV_NOT_ON = event::makeEvent(SUBSYSTEM_ID, 7, severity::LOW);
//! [EXPORT] : [COMMENT] SUPV reply timeout.
static constexpr Event SUPV_REPLY_TIMEOUT = event::makeEvent(SUBSYSTEM_ID, 8, severity::LOW);
//! [EXPORT] : [COMMENT] Camera must be commanded on first.
static constexpr Event CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE =
event::makeEvent(SUBSYSTEM_ID, 9, severity::LOW);
enum ParamId : uint8_t { SKIP_SUPV_ON_COMMANDING = 0x01 };
enum FileAccessModes : uint8_t {
@ -30,6 +136,8 @@ enum FileAccessModes : uint8_t {
};
static constexpr uint32_t HK_SET_ID = 0;
static constexpr uint32_t DEADBEEF_ADDR = 0x40000004;
static constexpr uint32_t DEADBEEF_VALUE = 0xdeadbeef;
namespace poolid {
enum {
@ -92,7 +200,8 @@ static const DeviceCommandId_t TM_CAM_CMD_RPT = 19;
static const DeviceCommandId_t SET_UART_TX_TRISTATE = 20;
static const DeviceCommandId_t RELEASE_UART_TX = 21;
static const DeviceCommandId_t TC_CAM_TAKE_PIC = 22;
static const DeviceCommandId_t TC_SIMPLEX_SEND_FILE = 23;
// Stream file down using E-Band component directly.
static const DeviceCommandId_t TC_SIMPLEX_STREAM_FILE = 23;
static const DeviceCommandId_t TC_DOWNLINK_DATA_MODULATE = 24;
static const DeviceCommandId_t TC_MODE_SNAPSHOT = 25;
static const DeviceCommandId_t TC_GET_HK_REPORT = 26;
@ -100,16 +209,31 @@ static const DeviceCommandId_t TM_GET_HK_REPORT = 27;
static const DeviceCommandId_t TC_FLASH_GET_DIRECTORY_CONTENT = 28;
static const DeviceCommandId_t TM_FLASH_DIRECTORY_CONTENT = 29;
static constexpr DeviceCommandId_t TC_FLASH_READ_FULL_FILE = 30;
// Store file on MPSoC.
static const DeviceCommandId_t TC_SPLIT_FILE = 31;
static const DeviceCommandId_t TC_VERIFY_BOOT = 32;
static const DeviceCommandId_t TC_ENABLE_TC_EXECTION = 33;
static const DeviceCommandId_t TC_FLASH_MKFS = 34;
// Will reset the sequence count of the OBSW
static const DeviceCommandId_t OBSW_RESET_SEQ_COUNT = 50;
// Will reset the sequence count of the OBSW. Not required anymore after MPSoC update.
static const DeviceCommandId_t OBSW_RESET_SEQ_COUNT_LEGACY = 50;
static const uint16_t SIZE_ACK_REPORT = 14;
static const uint16_t SIZE_EXE_REPORT = 14;
static const uint16_t SIZE_TM_MEM_READ_REPORT = 18;
static const uint16_t SIZE_TM_CAM_CMD_RPT = 18;
static constexpr size_t SIZE_TM_HK_REPORT = 369;
enum Submode : uint8_t { IDLE_OR_NONE = 0, REPLAY = 1, SNAPSHOT = 2 };
// Setting the internal mode value to the actual telecommand ID
/*
enum InternalMode {
OFF = HasModesIF::MODE_OFF,
IDLE = ,
REPLAY = TC_MODE_REPLAY,
SNAPSHOT = TC_MODE_SNAPSHOT
};
*/
/**
* SpacePacket apids of PLOC telecommands and telemetry.
*/
@ -134,6 +258,8 @@ static const uint16_t TC_MODE_SNAPSHOT = 0x120;
static const uint16_t TC_DOWNLINK_DATA_MODULATE = 0x121;
static constexpr uint16_t TC_HK_GET_REPORT = 0x123;
static const uint16_t TC_DOWNLINK_PWR_OFF = 0x124;
static constexpr uint16_t TC_ENABLE_TC_EXECUTION = 0x129;
static constexpr uint16_t TC_FLASH_MKFS = 0x12A;
static const uint16_t TC_CAM_CMD_SEND = 0x12C;
static constexpr uint16_t TC_FLASH_COPY_FILE = 0x12E;
static const uint16_t TC_SIMPLEX_SEND_FILE = 0x130;
@ -158,15 +284,15 @@ static const uint8_t SPACE_PACKET_HEADER_SIZE = 6;
static const uint8_t STATUS_OFFSET = 10;
static constexpr size_t CRC_SIZE = 2;
/**
* The size of payload data which will be forwarded to the requesting object. e.g. PUS Service
* 8.
*/
static const uint8_t SIZE_MEM_READ_RPT_FIX = 6;
static const size_t MAX_FILENAME_SIZE = 256;
static const size_t FILENAME_FIELD_SIZE = 256;
// Subtract size of NULL terminator.
static const size_t MAX_FILENAME_SIZE = FILENAME_FIELD_SIZE - 1;
/**
* PLOC space packet length for fixed size packets. This is the size of the whole packet data
@ -201,8 +327,9 @@ static const uint16_t TC_DOWNLINK_PWR_ON_EXECUTION_DELAY = 8;
static const uint16_t TC_CAM_TAKE_PIC_EXECUTION_DELAY = 20;
static const uint16_t TC_SIMPLEX_SEND_FILE_DELAY = 80;
namespace status_code {
namespace statusCode {
static const uint16_t DEFAULT_ERROR_CODE = 0x1;
static constexpr uint16_t FLASH_DRIVE_ERROR = 0xb;
static const uint16_t UNKNOWN_APID = 0x5DD;
static const uint16_t INCORRECT_LENGTH = 0x5DE;
static const uint16_t INCORRECT_CRC = 0x5DF;
@ -227,49 +354,12 @@ static const uint16_t RESERVED_1 = 0x5F1;
static const uint16_t RESERVED_2 = 0x5F2;
static const uint16_t RESERVED_3 = 0x5F3;
static const uint16_t RESERVED_4 = 0x5F4;
} // namespace status_code
/**
* @brief Abstract base class for TC space packet of MPSoC.
*/
class TcBase : public ploc::SpTcBase, public MPSoCReturnValuesIF {
public:
virtual ~TcBase() = default;
// Initial length field of space packet. Will always be updated when packet is created.
static const uint16_t INIT_LENGTH = CRC_SIZE;
/**
* @brief Constructor
*
* @param sequenceCount Sequence count of space packet which will be incremented with each
* sent and received packets.
*/
TcBase(ploc::SpTcParams params, uint16_t apid, uint16_t sequenceCount)
: ploc::SpTcBase(params, apid, 0, sequenceCount) {
payloadStart = spParams.buf + ccsds::HEADER_LEN;
spParams.setFullPayloadLen(INIT_LENGTH);
}
/**
* @brief Function to finsh and write the space packet. It is expected that the user has
* set the payload fields in the child class*
* @return returnvalue::OK if packet creation was successful, otherwise error return value
*/
ReturnValue_t finishPacket() {
updateSpFields();
ReturnValue_t res = checkSizeAndSerializeHeader();
if (res != returnvalue::OK) {
return res;
}
return calcAndSetCrc();
}
};
} // namespace statusCode
/**
* @brief This class helps to build the memory read command for the PLOC.
*/
class TcMemRead : public TcBase {
class TcMemRead : public mpsoc::TcBase {
public:
/**
* @brief Constructor
@ -319,7 +409,7 @@ class TcMemRead : public TcBase {
* @brief This class helps to generate the space packet to write data to a memory address within
* the PLOC.
*/
class TcMemWrite : public TcBase {
class TcMemWrite : public mpsoc::TcBase {
public:
/**
* @brief Constructor
@ -369,24 +459,21 @@ class TcMemWrite : public TcBase {
/**
* @brief Class to help creation of flash fopen command.
*/
class FlashFopen : public TcBase {
class TcFlashFopen : public mpsoc::TcBase {
public:
FlashFopen(ploc::SpTcParams params, uint16_t sequenceCount)
TcFlashFopen(ploc::SpTcParams params, uint16_t sequenceCount)
: TcBase(params, apid::TC_FLASHFOPEN, sequenceCount) {}
ReturnValue_t setPayload(std::string filename, uint8_t mode) {
accessMode = mode;
size_t nameSize = filename.size();
spParams.setFullPayloadLen(256 + sizeof(uint8_t) + CRC_SIZE);
ReturnValue_t result = checkPayloadLen();
if (result != returnvalue::OK) {
return result;
}
std::memcpy(payloadStart, filename.c_str(), nameSize);
// payloadStart[nameSize] = NULL_TERMINATOR;
std::memset(payloadStart + nameSize, 0, 256 - nameSize);
// payloadStart[255] = NULL_TERMINATOR;
payloadStart[256] = accessMode;
std::memset(payloadStart, 0, FILENAME_FIELD_SIZE);
std::memcpy(payloadStart, filename.c_str(), filename.size());
payloadStart[FILENAME_FIELD_SIZE] = accessMode;
spParams.setFullPayloadLen(FILENAME_FIELD_SIZE + 1 + CRC_SIZE);
return returnvalue::OK;
}
@ -397,14 +484,46 @@ class FlashFopen : public TcBase {
/**
* @brief Class to help creation of flash fclose command.
*/
class FlashFclose : public TcBase {
class TcFlashFclose : public TcBase {
public:
FlashFclose(ploc::SpTcParams params, uint16_t sequenceCount)
TcFlashFclose(ploc::SpTcParams params, uint16_t sequenceCount)
: TcBase(params, apid::TC_FLASHFCLOSE, sequenceCount) {
spParams.setFullPayloadLen(CRC_SIZE);
}
};
class TcEnableTcExec : public TcBase {
public:
TcEnableTcExec(ploc::SpTcParams params, uint16_t sequenceCount)
: TcBase(params, apid::TC_ENABLE_TC_EXECUTION, sequenceCount) {
spParams.setFullPayloadLen(CRC_SIZE);
}
ReturnValue_t setPayload(const uint8_t* cmdData, size_t cmdDataLen) {
if (cmdDataLen != 2) {
return HasActionsIF::INVALID_PARAMETERS;
}
std::memcpy(payloadStart, cmdData, 2);
spParams.setFullPayloadLen(2 + CRC_SIZE);
return returnvalue::OK;
}
};
class TcFlashMkfs : public TcBase {
public:
TcFlashMkfs(ploc::SpTcParams params, uint16_t sequenceCount, FlashId flashId)
: TcBase(params, apid::TC_FLASH_MKFS, sequenceCount) {
const char* flashIdStr = "0:\\";
if (flashId == FlashId::FLASH_1) {
flashIdStr = "1:\\";
}
std::memcpy(payloadStart, flashIdStr, 3);
// Null terminator
payloadStart[3] = 0;
spParams.setFullPayloadLen(4 + CRC_SIZE);
}
};
/**
* @brief Class to build flash write space packet.
*/
@ -464,15 +583,6 @@ class TcFlashRead : public TcBase {
if (result != returnvalue::OK) {
return result;
}
updateSpFields();
result = checkSizeAndSerializeHeader();
if (result != returnvalue::OK) {
return result;
}
result = calcAndSetCrc();
if (result != returnvalue::OK) {
return result;
}
readSize = readLen;
return result;
}
@ -490,20 +600,14 @@ class TcFlashDelete : public TcBase {
ReturnValue_t setPayload(std::string filename) {
size_t nameSize = filename.size();
spParams.setFullPayloadLen(nameSize + sizeof(NULL_TERMINATOR) + CRC_SIZE);
spParams.setFullPayloadLen(FILENAME_FIELD_SIZE + CRC_SIZE);
auto res = checkPayloadLen();
if (res != returnvalue::OK) {
return res;
}
std::memcpy(payloadStart, filename.c_str(), nameSize);
*(payloadStart + nameSize) = NULL_TERMINATOR;
updateSpFields();
res = checkSizeAndSerializeHeader();
if (res != returnvalue::OK) {
return res;
}
return calcAndSetCrc();
return returnvalue::OK;
}
};
@ -655,8 +759,9 @@ class TcGetDirContent : public TcBase {
if (result != returnvalue::OK) {
return result;
}
std::memset(payloadStart, 0, 256);
std::memcpy(payloadStart, commandData, commandDataLen);
payloadStart[255] = '\0';
payloadStart[255] = 0;
return result;
}
};
@ -697,7 +802,7 @@ class TcReplayWriteSeq : public TcBase {
static const size_t USE_DECODING_LENGTH = 1;
ReturnValue_t lengthCheck(size_t commandDataLen) {
if (commandDataLen > USE_DECODING_LENGTH + MAX_FILENAME_SIZE or
if (commandDataLen > USE_DECODING_LENGTH + FILENAME_FIELD_SIZE or
checkPayloadLen() != returnvalue::OK) {
sif::warning << "TcReplayWriteSeq: Command has invalid length " << commandDataLen
<< std::endl;
@ -710,24 +815,24 @@ class TcReplayWriteSeq : public TcBase {
/**
* @brief Helps to extract the fields of the flash write command from the PUS packet.
*/
class FlashBasePusCmd : public MPSoCReturnValuesIF {
class FlashBasePusCmd {
public:
FlashBasePusCmd() = default;
virtual ~FlashBasePusCmd() = default;
virtual ReturnValue_t extractFields(const uint8_t* commandData, size_t commandDataLen) {
if (commandDataLen > (config::MAX_PATH_SIZE + config::MAX_FILENAME_SIZE + MAX_FILENAME_SIZE)) {
if (commandDataLen > FILENAME_FIELD_SIZE) {
return INVALID_LENGTH;
}
size_t fileLen = strnlen(reinterpret_cast<const char*>(commandData), commandDataLen);
if (fileLen > (config::MAX_PATH_SIZE + config::MAX_FILENAME_SIZE)) {
if (fileLen > MAX_FILENAME_SIZE) {
return FILENAME_TOO_LONG;
}
obcFile = std::string(reinterpret_cast<const char*>(commandData), fileLen);
fileLen =
strnlen(reinterpret_cast<const char*>(commandData + obcFile.size() + SIZE_NULL_TERMINATOR),
commandDataLen - obcFile.size() - 1);
if (fileLen > MAX_FILENAME_SIZE) {
if (fileLen > FILENAME_FIELD_SIZE) {
return MPSOC_FILENAME_TOO_LONG;
}
mpsocFile = std::string(
@ -738,11 +843,11 @@ class FlashBasePusCmd : public MPSoCReturnValuesIF {
const std::string& getObcFile() const { return obcFile; }
const std::string& getMPSoCFile() const { return mpsocFile; }
const std::string& getMpsocFile() const { return mpsocFile; }
protected:
size_t getParsedSize() const {
return getObcFile().size() + getMPSoCFile().size() + 2 * SIZE_NULL_TERMINATOR;
return getObcFile().size() + getMpsocFile().size() + 2 * SIZE_NULL_TERMINATOR;
}
static const size_t SIZE_NULL_TERMINATOR = 1;
@ -809,49 +914,191 @@ class TcCamTakePic : public TcBase {
: TcBase(params, apid::TC_CAM_TAKE_PIC, sequenceCount) {}
ReturnValue_t setPayload(const uint8_t* commandData, size_t commandDataLen) {
if (commandDataLen > MAX_DATA_LENGTH) {
const uint8_t** dataPtr = &commandData;
if (commandDataLen > FULL_PAYLOAD_SIZE) {
return INVALID_LENGTH;
}
std::string fileName(reinterpret_cast<const char*>(commandData));
if (fileName.size() + sizeof(NULL_TERMINATOR) > MAX_FILENAME_SIZE) {
size_t deserLen = commandDataLen;
size_t serLen = 0;
fileName = std::string(reinterpret_cast<const char*>(commandData));
if (fileName.size() > MAX_FILENAME_SIZE) {
return FILENAME_TOO_LONG;
}
if (commandDataLen - (fileName.size() + sizeof(NULL_TERMINATOR)) != PARAMETER_SIZE) {
return INVALID_LENGTH;
deserLen -= fileName.length() + 1;
*dataPtr += fileName.length() + 1;
uint8_t** payloadPtr = &payloadStart;
memset(payloadStart, 0, FILENAME_FIELD_SIZE);
memcpy(payloadStart, fileName.data(), fileName.size());
*payloadPtr += FILENAME_FIELD_SIZE;
serLen += FILENAME_FIELD_SIZE;
ReturnValue_t result = SerializeAdapter::deSerialize(&encoderSettingY, dataPtr, &deserLen,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
spParams.setFullPayloadLen(commandDataLen + CRC_SIZE);
std::memcpy(payloadStart, commandData, commandDataLen);
result = SerializeAdapter::serialize(&encoderSettingY, payloadPtr, &serLen, FULL_PAYLOAD_SIZE,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
result = SerializeAdapter::deSerialize(&quantizationY, dataPtr, &deserLen,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
result = SerializeAdapter::serialize(&quantizationY, payloadPtr, &serLen, FULL_PAYLOAD_SIZE,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
result = SerializeAdapter::deSerialize(&encoderSettingsCb, dataPtr, &deserLen,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
result = SerializeAdapter::serialize(&encoderSettingsCb, payloadPtr, &serLen, FULL_PAYLOAD_SIZE,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
result = SerializeAdapter::deSerialize(&quantizationCb, dataPtr, &deserLen,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
result = SerializeAdapter::serialize(&quantizationCb, payloadPtr, &serLen, FULL_PAYLOAD_SIZE,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
result = SerializeAdapter::deSerialize(&encoderSettingsCr, dataPtr, &deserLen,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
result = SerializeAdapter::serialize(&encoderSettingsCr, payloadPtr, &serLen, FULL_PAYLOAD_SIZE,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
result = SerializeAdapter::deSerialize(&quantizationCr, dataPtr, &deserLen,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
result = SerializeAdapter::serialize(&quantizationCr, payloadPtr, &serLen, FULL_PAYLOAD_SIZE,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
result = SerializeAdapter::deSerialize(&bypassCompressor, dataPtr, &deserLen,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
result = SerializeAdapter::serialize(&bypassCompressor, payloadPtr, &serLen, FULL_PAYLOAD_SIZE,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
spParams.setFullPayloadLen(FULL_PAYLOAD_SIZE + CRC_SIZE);
return returnvalue::OK;
}
std::string fileName;
uint8_t encoderSettingY = 7;
uint64_t quantizationY = 0;
uint8_t encoderSettingsCb = 7;
uint64_t quantizationCb = 0;
uint8_t encoderSettingsCr = 7;
uint64_t quantizationCr = 0;
uint8_t bypassCompressor = 0;
private:
static const size_t MAX_DATA_LENGTH = 286;
static const size_t PARAMETER_SIZE = 28;
static constexpr size_t FULL_PAYLOAD_SIZE = FILENAME_FIELD_SIZE + PARAMETER_SIZE;
};
/**
* @brief Class to build simplex send file command
*/
class TcSimplexSendFile : public TcBase {
class TcSimplexStreamFile : public TcBase {
public:
TcSimplexSendFile(ploc::SpTcParams params, uint16_t sequenceCount)
TcSimplexStreamFile(ploc::SpTcParams params, uint16_t sequenceCount)
: TcBase(params, apid::TC_SIMPLEX_SEND_FILE, sequenceCount) {}
ReturnValue_t setPayload(const uint8_t* commandData, size_t commandDataLen) {
if (commandDataLen > MAX_DATA_LENGTH) {
if (commandDataLen > MAX_FILENAME_SIZE) {
return INVALID_LENGTH;
}
std::string fileName(reinterpret_cast<const char*>(commandData));
if (fileName.size() + sizeof(NULL_TERMINATOR) > MAX_FILENAME_SIZE) {
if (fileName.size() > MAX_FILENAME_SIZE) {
return FILENAME_TOO_LONG;
}
spParams.setFullPayloadLen(commandDataLen + CRC_SIZE);
std::memcpy(payloadStart, commandData, commandDataLen);
std::memset(payloadStart, 0, FILENAME_FIELD_SIZE);
std::memcpy(payloadStart, fileName.data(), fileName.length());
payloadStart[fileName.length()] = 0;
spParams.setFullPayloadLen(FILENAME_FIELD_SIZE + CRC_SIZE);
;
return returnvalue::OK;
}
private:
static const size_t MAX_DATA_LENGTH = 256;
};
/**
* @brief Class to build simplex send file command
*/
class TcSplitFile : public TcBase {
public:
TcSplitFile(ploc::SpTcParams params, uint16_t sequenceCount)
: TcBase(params, apid::TC_SIMPLEX_SEND_FILE, sequenceCount) {}
ReturnValue_t setPayload(const uint8_t* commandData, size_t commandDataLen) {
if (commandDataLen < MIN_DATA_LENGTH) {
return INVALID_LENGTH;
}
if (commandDataLen > MAX_DATA_LENGTH) {
return INVALID_LENGTH;
}
const uint8_t** dataPtr = &commandData;
ReturnValue_t result = SerializeAdapter::deSerialize(&chunkParameter, dataPtr, &commandDataLen,
SerializeIF::Endianness::NETWORK);
if (result != returnvalue::OK) {
return result;
}
/// No chunks makes no sense, and DIV str can not be longer than whats representable with 3
/// decimal digits.
if (chunkParameter == 0 or chunkParameter > 999) {
return INVALID_PARAMETER;
}
std::string fileName(reinterpret_cast<const char*>(*dataPtr));
if (fileName.size() > MAX_FILENAME_SIZE) {
return FILENAME_TOO_LONG;
}
char divStr[16]{};
sprintf(divStr, "DIV%03u", chunkParameter);
std::memcpy(payloadStart, divStr, DIV_STR_LEN);
payloadStart[DIV_STR_LEN] = 0;
std::memset(payloadStart + DIV_STR_LEN + 1, 0, FILENAME_FIELD_SIZE - DIV_STR_LEN - 1);
std::memcpy(payloadStart + DIV_STR_LEN + 1, fileName.data(), fileName.length());
spParams.setFullPayloadLen(FILENAME_FIELD_SIZE + CRC_SIZE);
return returnvalue::OK;
}
private:
uint32_t chunkParameter = 0;
static constexpr size_t MIN_DATA_LENGTH = 4;
static constexpr size_t DIV_STR_LEN = 6;
static constexpr size_t MAX_DATA_LENGTH = 4 + MAX_FILENAME_SIZE;
};
/**

View File

@ -159,6 +159,7 @@ static const DeviceCommandId_t ENABLE_NVMS = 59;
static const DeviceCommandId_t CONTINUE_UPDATE = 60;
static const DeviceCommandId_t MEMORY_CHECK_WITH_FILE = 61;
static constexpr DeviceCommandId_t MEMORY_CHECK = 62;
static constexpr DeviceCommandId_t ABORT_LONGER_REQUEST = 63;
/** Reply IDs */
enum ReplyId : DeviceCommandId_t {
@ -1145,14 +1146,14 @@ class WriteMemory : public TcBase {
: TcBase(params, Apid::MEM_MAN, static_cast<uint8_t>(tc::MemManId::WRITE), 1) {}
ReturnValue_t buildPacket(ccsds::SequenceFlags seqFlags, uint16_t sequenceCount, uint8_t memoryId,
uint32_t startAddress, uint16_t length, uint8_t* updateData) {
uint32_t currentAddr, uint16_t length, uint8_t* updateData) {
if (length > CHUNK_MAX) {
sif::error << "WriteMemory::WriteMemory: Invalid length" << std::endl;
return SerializeIF::BUFFER_TOO_SHORT;
}
spParams.creator.setSeqFlags(seqFlags);
spParams.creator.setSeqCount(sequenceCount);
auto res = initPacket(memoryId, startAddress, length, updateData);
auto res = initPacket(memoryId, currentAddr, length, updateData);
if (res != returnvalue::OK) {
return res;
}
@ -1170,7 +1171,7 @@ class WriteMemory : public TcBase {
static const uint16_t META_DATA_LENGTH = 8;
uint8_t n = 1;
ReturnValue_t initPacket(uint8_t memoryId, uint32_t startAddr, uint16_t updateDataLen,
ReturnValue_t initPacket(uint8_t memoryId, uint32_t currentAddr, uint16_t updateDataLen,
uint8_t* updateData) {
uint8_t* data = payloadStart;
if (updateDataLen % 2 != 0) {
@ -1188,7 +1189,7 @@ class WriteMemory : public TcBase {
SerializeIF::Endianness::BIG);
SerializeAdapter::serialize(&n, &data, &serializedSize, spParams.maxSize,
SerializeIF::Endianness::BIG);
SerializeAdapter::serialize(&startAddr, &data, &serializedSize, spParams.maxSize,
SerializeAdapter::serialize(&currentAddr, &data, &serializedSize, spParams.maxSize,
SerializeIF::Endianness::BIG);
SerializeAdapter::serialize(&updateDataLen, &data, &serializedSize, spParams.maxSize,
SerializeIF::Endianness::BIG);

View File

@ -795,9 +795,9 @@ ReturnValue_t ImtqHandler::initializeLocalDataPool(localpool::DataPool& localDat
localDataPoolMap.emplace(imtq::FINA_NEG_Z_COIL_Z_TEMPERATURE, new PoolEntry<int16_t>({0}));
poolManager.subscribeForDiagPeriodicPacket(
subdp::DiagnosticsHkPeriodicParams(hkDatasetNoTorque.getSid(), enableHkSets, 30.0));
subdp::DiagnosticsHkPeriodicParams(hkDatasetNoTorque.getSid(), enableHkSets, 60.0));
poolManager.subscribeForDiagPeriodicPacket(
subdp::DiagnosticsHkPeriodicParams(hkDatasetWithTorque.getSid(), enableHkSets, 30.0));
subdp::DiagnosticsHkPeriodicParams(hkDatasetWithTorque.getSid(), enableHkSets, 60.0));
poolManager.subscribeForDiagPeriodicPacket(
subdp::DiagnosticsHkPeriodicParams(rawMtmNoTorque.getSid(), false, 10.0));
poolManager.subscribeForDiagPeriodicPacket(

View File

@ -340,7 +340,7 @@ ReturnValue_t RwHandler::initializeLocalDataPool(localpool::DataPool& localDataP
localDataPoolMap.emplace(rws::SPI_REG_OVERRUN_ERRORS, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(rws::SPI_TOTAL_ERRORS, new PoolEntry<uint32_t>({0}));
poolManager.subscribeForDiagPeriodicPacket(
subdp::DiagnosticsHkPeriodicParams(statusSet.getSid(), false, 12.0));
subdp::DiagnosticsHkPeriodicParams(statusSet.getSid(), false, 30.0));
poolManager.subscribeForRegularPeriodicPacket(
subdp::RegularHkPeriodicParams(tmDataset.getSid(), false, 30.0));
poolManager.subscribeForRegularPeriodicPacket(

View File

@ -1662,7 +1662,7 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l
poolManager.subscribeForRegularPeriodicPacket(
subdp::RegularHkPeriodicParams(interfaceSet.getSid(), false, 10.0));
poolManager.subscribeForDiagPeriodicPacket(
subdp::DiagnosticsHkPeriodicParams(solutionSet.getSid(), false, 12.0));
subdp::DiagnosticsHkPeriodicParams(solutionSet.getSid(), false, 30.0));
poolManager.subscribeForRegularPeriodicPacket(
subdp::RegularHkPeriodicParams(cameraSet.getSid(), false, 10.0));
poolManager.subscribeForRegularPeriodicPacket(

View File

@ -180,7 +180,8 @@ void AcsController::performAttitudeControl() {
mode, &susDataProcessed, &mgmDataProcessed, &gyrDataProcessed, &sensorValues,
&attitudeEstimationData, timeDelta, &fusedRotRateSourcesData, &fusedRotRateData);
result = navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed,
&susDataProcessed, timeDelta, &attitudeEstimationData);
&susDataProcessed, timeDelta, &attitudeEstimationData,
acsParameters.kalmanFilterParameters.allowStr);
if (result != MultiplicativeKalmanFilter::MEKF_RUNNING and
result != MultiplicativeKalmanFilter::MEKF_INITIALIZED) {
@ -231,7 +232,8 @@ void AcsController::performSafe() {
acs::ControlModeStrategy safeCtrlStrat = safeCtrl.safeCtrlStrategy(
mgmDataProcessed.mgmVecTot.isValid(), not mekfInvalidFlag,
gyrDataProcessed.gyrVecTot.isValid(), susDataProcessed.susVecTot.isValid(),
fusedRotRateData.rotRateTotal.isValid(), acsParameters.safeModeControllerParameters.useMekf,
fusedRotRateSourcesData.rotRateTotalSusMgm.isValid(),
acsParameters.safeModeControllerParameters.useMekf,
acsParameters.safeModeControllerParameters.useGyr,
acsParameters.safeModeControllerParameters.dampingDuringEclipse);
switch (safeCtrlStrat) {
@ -250,9 +252,10 @@ void AcsController::performSafe() {
safeCtrlFailureCounter = 0;
break;
case (acs::ControlModeStrategy::SAFECTRL_SUSMGM):
safeCtrl.safeSusMgm(mgmDataProcessed.mgmVecTot.value, fusedRotRateData.rotRateTotal.value,
fusedRotRateData.rotRateParallel.value,
fusedRotRateData.rotRateOrthogonal.value,
safeCtrl.safeSusMgm(mgmDataProcessed.mgmVecTot.value,
fusedRotRateSourcesData.rotRateTotalSusMgm.value,
fusedRotRateSourcesData.rotRateParallelSusMgm.value,
fusedRotRateSourcesData.rotRateOrthogonalSusMgm.value,
susDataProcessed.susVecTot.value, sunTargetDir, magMomMtq, errAng);
safeCtrlFailureFlag = false;
safeCtrlFailureCounter = 0;
@ -266,8 +269,8 @@ void AcsController::performSafe() {
break;
case (acs::ControlModeStrategy::SAFECTRL_ECLIPSE_DAMPING_SUSMGM):
safeCtrl.safeRateDampingSusMgm(mgmDataProcessed.mgmVecTot.value,
fusedRotRateData.rotRateTotal.value, sunTargetDir, magMomMtq,
errAng);
fusedRotRateSourcesData.rotRateTotalSusMgm.value, sunTargetDir,
magMomMtq, errAng);
safeCtrlFailureFlag = false;
safeCtrlFailureCounter = 0;
break;
@ -354,7 +357,7 @@ void AcsController::performPointingCtrl() {
}
acs::ControlModeStrategy ptgCtrlStrat = ptgCtrl.pointingCtrlStrategy(
mgmDataProcessed.mgmVecTot.isValid(), not mekfInvalidFlag, strValid,
attitudeEstimationData.quatQuest.isValid(), fusedRotRateData.rotRateTotal.isValid(),
attitudeEstimationData.quatQuest.isValid(), fusedRotRateData.rotRateTotalSource.isValid(),
fusedRotRateData.rotRateSource.value, useMekf);
if (ptgCtrlStrat == acs::ControlModeStrategy::CTRL_NO_MAG_FIELD_FOR_CONTROL or
@ -386,11 +389,11 @@ void AcsController::performPointingCtrl() {
quatBI[1] = sensorValues.strSet.caliQy.value;
quatBI[2] = sensorValues.strSet.caliQz.value;
quatBI[3] = sensorValues.strSet.caliQw.value;
std::memcpy(rotRateB, fusedRotRateData.rotRateTotal.value, sizeof(rotRateB));
std::memcpy(rotRateB, fusedRotRateData.rotRateTotalSource.value, sizeof(rotRateB));
break;
case acs::ControlModeStrategy::PTGCTRL_QUEST:
std::memcpy(quatBI, attitudeEstimationData.quatQuest.value, sizeof(quatBI));
std::memcpy(rotRateB, fusedRotRateData.rotRateTotal.value, sizeof(rotRateB));
std::memcpy(rotRateB, fusedRotRateData.rotRateTotalSource.value, sizeof(rotRateB));
break;
default:
sif::error << "AcsController: Invalid pointing mode strategy for performPointingCtrl"
@ -554,8 +557,8 @@ void AcsController::performPointingCtrl() {
void AcsController::handleDetumbling() {
switch (detumbleState) {
case DetumbleState::NO_DETUMBLE:
if (fusedRotRateData.rotRateTotal.isValid() and
VectorOperations<double>::norm(fusedRotRateData.rotRateTotal.value, 3) >
if (fusedRotRateData.rotRateTotalSusMgm.isValid() and
VectorOperations<double>::norm(fusedRotRateData.rotRateTotalSusMgm.value, 3) >
acsParameters.detumbleParameter.omegaDetumbleStart) {
detumbleCounter++;
} else if (detumbleCounter > 0) {
@ -598,8 +601,8 @@ void AcsController::handleDetumbling() {
detumbleState = DetumbleState::NO_DETUMBLE;
break;
case DetumbleState::IN_DETUMBLE:
if (fusedRotRateData.rotRateTotal.isValid() and
VectorOperations<double>::norm(fusedRotRateData.rotRateTotal.value, 3) <
if (fusedRotRateData.rotRateTotalSusMgm.isValid() and
VectorOperations<double>::norm(fusedRotRateData.rotRateTotalSusMgm.value, 3) <
acsParameters.detumbleParameter.omegaDetumbleEnd) {
detumbleCounter++;
} else if (detumbleCounter > 0) {
@ -746,7 +749,7 @@ ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localD
localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_RM3100_UT, &mgm3VecRaw);
localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_NT, &imtqMgmVecRaw);
localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_ACT_STATUS, &imtqCalActStatus);
poolManager.subscribeForRegularPeriodicPacket({mgmDataRaw.getSid(), false, 10.0});
poolManager.subscribeForRegularPeriodicPacket({mgmDataRaw.getSid(), false, 60.0});
// MGM Processed
localDataPoolMap.emplace(acsctrl::PoolIds::MGM_0_VEC, &mgm0VecProc);
localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_VEC, &mgm1VecProc);
@ -756,7 +759,7 @@ ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localD
localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT, &mgmVecTot);
localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT_DERIVATIVE, &mgmVecTotDer);
localDataPoolMap.emplace(acsctrl::PoolIds::MAG_IGRF_MODEL, &magIgrf);
poolManager.subscribeForRegularPeriodicPacket({mgmDataProcessed.getSid(), enableHkSets, 10.0});
poolManager.subscribeForRegularPeriodicPacket({mgmDataProcessed.getSid(), enableHkSets, 60.0});
// SUS Raw
localDataPoolMap.emplace(acsctrl::PoolIds::SUS_0_N_LOC_XFYFZM_PT_XF, &sus0ValRaw);
localDataPoolMap.emplace(acsctrl::PoolIds::SUS_1_N_LOC_XBYFZM_PT_XB, &sus1ValRaw);
@ -770,7 +773,7 @@ ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localD
localDataPoolMap.emplace(acsctrl::PoolIds::SUS_9_R_LOC_XBYBZB_PT_YF, &sus9ValRaw);
localDataPoolMap.emplace(acsctrl::PoolIds::SUS_10_N_LOC_XMYBZF_PT_ZF, &sus10ValRaw);
localDataPoolMap.emplace(acsctrl::PoolIds::SUS_11_R_LOC_XBYMZB_PT_ZB, &sus11ValRaw);
poolManager.subscribeForRegularPeriodicPacket({susDataRaw.getSid(), false, 10.0});
poolManager.subscribeForRegularPeriodicPacket({susDataRaw.getSid(), false, 60.0});
// SUS Processed
localDataPoolMap.emplace(acsctrl::PoolIds::SUS_0_VEC, &sus0VecProc);
localDataPoolMap.emplace(acsctrl::PoolIds::SUS_1_VEC, &sus1VecProc);
@ -787,20 +790,20 @@ ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localD
localDataPoolMap.emplace(acsctrl::PoolIds::SUS_VEC_TOT, &susVecTot);
localDataPoolMap.emplace(acsctrl::PoolIds::SUS_VEC_TOT_DERIVATIVE, &susVecTotDer);
localDataPoolMap.emplace(acsctrl::PoolIds::SUN_IJK_MODEL, &sunIjk);
poolManager.subscribeForRegularPeriodicPacket({susDataProcessed.getSid(), enableHkSets, 10.0});
poolManager.subscribeForRegularPeriodicPacket({susDataProcessed.getSid(), enableHkSets, 60.0});
// GYR Raw
localDataPoolMap.emplace(acsctrl::PoolIds::GYR_0_ADIS, &gyr0VecRaw);
localDataPoolMap.emplace(acsctrl::PoolIds::GYR_1_L3, &gyr1VecRaw);
localDataPoolMap.emplace(acsctrl::PoolIds::GYR_2_ADIS, &gyr2VecRaw);
localDataPoolMap.emplace(acsctrl::PoolIds::GYR_3_L3, &gyr3VecRaw);
poolManager.subscribeForDiagPeriodicPacket({gyrDataRaw.getSid(), false, 10.0});
poolManager.subscribeForDiagPeriodicPacket({gyrDataRaw.getSid(), false, 60.0});
// GYR Processed
localDataPoolMap.emplace(acsctrl::PoolIds::GYR_0_VEC, &gyr0VecProc);
localDataPoolMap.emplace(acsctrl::PoolIds::GYR_1_VEC, &gyr1VecProc);
localDataPoolMap.emplace(acsctrl::PoolIds::GYR_2_VEC, &gyr2VecProc);
localDataPoolMap.emplace(acsctrl::PoolIds::GYR_3_VEC, &gyr3VecProc);
localDataPoolMap.emplace(acsctrl::PoolIds::GYR_VEC_TOT, &gyrVecTot);
poolManager.subscribeForDiagPeriodicPacket({gyrDataProcessed.getSid(), enableHkSets, 10.0});
poolManager.subscribeForDiagPeriodicPacket({gyrDataProcessed.getSid(), enableHkSets, 60.0});
// GPS Processed
localDataPoolMap.emplace(acsctrl::PoolIds::GC_LATITUDE, &gcLatitude);
localDataPoolMap.emplace(acsctrl::PoolIds::GD_LONGITUDE, &gdLongitude);
@ -808,38 +811,37 @@ ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localD
localDataPoolMap.emplace(acsctrl::PoolIds::GPS_POSITION, &gpsPosition);
localDataPoolMap.emplace(acsctrl::PoolIds::GPS_VELOCITY, &gpsVelocity);
localDataPoolMap.emplace(acsctrl::PoolIds::SOURCE, &gpsSource);
poolManager.subscribeForRegularPeriodicPacket({gpsDataProcessed.getSid(), enableHkSets, 30.0});
poolManager.subscribeForRegularPeriodicPacket({gpsDataProcessed.getSid(), enableHkSets, 60.0});
// Attitude Estimation
localDataPoolMap.emplace(acsctrl::PoolIds::QUAT_MEKF, &quatMekf);
localDataPoolMap.emplace(acsctrl::PoolIds::SAT_ROT_RATE_MEKF, &satRotRateMekf);
localDataPoolMap.emplace(acsctrl::PoolIds::MEKF_STATUS, &mekfStatus);
localDataPoolMap.emplace(acsctrl::PoolIds::QUAT_QUEST, &quatQuest);
poolManager.subscribeForDiagPeriodicPacket({attitudeEstimationData.getSid(), enableHkSets, 10.0});
poolManager.subscribeForDiagPeriodicPacket({attitudeEstimationData.getSid(), enableHkSets, 30.0});
// Ctrl Values
localDataPoolMap.emplace(acsctrl::PoolIds::SAFE_STRAT, &safeStrat);
localDataPoolMap.emplace(acsctrl::PoolIds::TGT_QUAT, &tgtQuat);
localDataPoolMap.emplace(acsctrl::PoolIds::ERROR_QUAT, &errQuat);
localDataPoolMap.emplace(acsctrl::PoolIds::ERROR_ANG, &errAng);
localDataPoolMap.emplace(acsctrl::PoolIds::TGT_ROT_RATE, &tgtRotRate);
poolManager.subscribeForRegularPeriodicPacket({ctrlValData.getSid(), enableHkSets, 10.0});
poolManager.subscribeForRegularPeriodicPacket({ctrlValData.getSid(), enableHkSets, 30.0});
// Actuator CMD
localDataPoolMap.emplace(acsctrl::PoolIds::RW_TARGET_TORQUE, &rwTargetTorque);
localDataPoolMap.emplace(acsctrl::PoolIds::RW_TARGET_SPEED, &rwTargetSpeed);
localDataPoolMap.emplace(acsctrl::PoolIds::MTQ_TARGET_DIPOLE, &mtqTargetDipole);
poolManager.subscribeForRegularPeriodicPacket({actuatorCmdData.getSid(), enableHkSets, 10.0});
poolManager.subscribeForRegularPeriodicPacket({actuatorCmdData.getSid(), enableHkSets, 30.0});
// Fused Rot Rate
localDataPoolMap.emplace(acsctrl::PoolIds::ROT_RATE_ORTHOGONAL, &rotRateOrthogonal);
localDataPoolMap.emplace(acsctrl::PoolIds::ROT_RATE_PARALLEL, &rotRateParallel);
localDataPoolMap.emplace(acsctrl::PoolIds::ROT_RATE_TOTAL, &rotRateTotal);
localDataPoolMap.emplace(acsctrl::PoolIds::ROT_RATE_TOT_SUSMGM, &rotRateTotSusMgm);
localDataPoolMap.emplace(acsctrl::PoolIds::ROT_RATE_TOT_SOURCE, &rotRateTotSource);
localDataPoolMap.emplace(acsctrl::PoolIds::ROT_RATE_SOURCE, &rotRateSource);
poolManager.subscribeForRegularPeriodicPacket({fusedRotRateData.getSid(), enableHkSets, 10.0});
poolManager.subscribeForRegularPeriodicPacket({fusedRotRateData.getSid(), enableHkSets, 30.0});
// Fused Rot Rate Sources
localDataPoolMap.emplace(acsctrl::PoolIds::ROT_RATE_ORTHOGONAL_SUSMGM, &rotRateOrthogonalSusMgm);
localDataPoolMap.emplace(acsctrl::PoolIds::ROT_RATE_PARALLEL_SUSMGM, &rotRateParallelSusMgm);
localDataPoolMap.emplace(acsctrl::PoolIds::ROT_RATE_TOTAL_SUSMGM, &rotRateTotalSusMgm);
localDataPoolMap.emplace(acsctrl::PoolIds::ROT_RATE_TOTAL_QUEST, &rotRateTotalQuest);
localDataPoolMap.emplace(acsctrl::PoolIds::ROT_RATE_TOTAL_STR, &rotRateTotalStr);
poolManager.subscribeForRegularPeriodicPacket({fusedRotRateSourcesData.getSid(), false, 10.0});
poolManager.subscribeForRegularPeriodicPacket({fusedRotRateSourcesData.getSid(), false, 60.0});
return returnvalue::OK;
}
@ -925,6 +927,17 @@ void AcsController::modeChanged(Mode_t mode, Submode_t submode) {
if (detumbleState == DetumbleState::IN_DETUMBLE and submode != acs::SafeSubmode::DETUMBLE) {
detumbleState = DetumbleState::NO_DETUMBLE;
}
if (mode > acs::AcsMode::PTG_IDLE) {
poolManager.changeCollectionInterval(ctrlValData.getSid(), 10);
poolManager.changeCollectionInterval(actuatorCmdData.getSid(), 10);
poolManager.changeCollectionInterval(fusedRotRateData.getSid(), 10);
poolManager.changeCollectionInterval(attitudeEstimationData.getSid(), 10);
} else {
poolManager.changeCollectionInterval(ctrlValData.getSid(), 30);
poolManager.changeCollectionInterval(actuatorCmdData.getSid(), 30);
poolManager.changeCollectionInterval(fusedRotRateData.getSid(), 30);
poolManager.changeCollectionInterval(attitudeEstimationData.getSid(), 30);
}
return ExtendedControllerBase::modeChanged(mode, submode);
}

View File

@ -271,9 +271,8 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes
// Fused Rot Rate
acsctrl::FusedRotRateData fusedRotRateData;
PoolEntry<double> rotRateOrthogonal = PoolEntry<double>(3);
PoolEntry<double> rotRateParallel = PoolEntry<double>(3);
PoolEntry<double> rotRateTotal = PoolEntry<double>(3);
PoolEntry<double> rotRateTotSusMgm = PoolEntry<double>(3);
PoolEntry<double> rotRateTotSource = PoolEntry<double>(3);
PoolEntry<uint8_t> rotRateSource = PoolEntry<uint8_t>();
// Fused Rot Rate Sources

View File

@ -182,7 +182,7 @@ void PowerController::calculateStateOfCharge() {
}
// calculate total battery current
iBat = p60CoreHk.batteryCurrent.value + bpxBatteryHk.dischargeCurrent.value;
iBat = p60CoreHk.batteryCurrent.value - bpxBatteryHk.dischargeCurrent.value;
result = calculateOpenCircuitVoltageCharge();
if (result != returnvalue::OK) {

View File

@ -57,9 +57,9 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM
float batteryMaximumCapacity = 2.6 * 2; // [Ah]
float coulombCounterVoltageUpperThreshold = 16.2; // [V]
double maxAllowedTimeDiff = 1.5; // [s]
float payloadOpLimitOn = 0.90; // [%]
float payloadOpLimitLow = 0.75; // [%]
float higherModesLimit = 0.6; // [%]
float payloadOpLimitOn = 0.80; // [%]
float payloadOpLimitLow = 0.65; // [%]
float higherModesLimit = 0.60; // [%]
// OCV Look-up-Table {[Ah],[V]}
static constexpr uint8_t LOOK_UP_TABLE_MAX_IDX = 99;

View File

@ -1641,7 +1641,11 @@ bool ThermalController::chooseHeater(heater::Switch& switchNr, heater::Switch re
bool heaterAvailable = true;
HasHealthIF::HealthState mainHealth = heaterHandler.getHealth(switchNr);
heater::SwitchState mainState = heaterHandler.getSwitchState(switchNr);
HasHealthIF::HealthState redHealth = heaterHandler.getHealth(redSwitchNr);
if (mainHealth == HasHealthIF::EXTERNAL_CONTROL and mainState == heater::SwitchState::ON) {
return false;
}
if (mainHealth != HasHealthIF::HEALTHY) {
if (redHealth == HasHealthIF::HEALTHY) {
switchNr = redSwitchNr;
@ -1656,6 +1660,7 @@ bool ThermalController::chooseHeater(heater::Switch& switchNr, heater::Switch re
} else {
ctrlCtx.redSwitchNrInUse = false;
}
return heaterAvailable;
}
@ -1792,7 +1797,8 @@ void ThermalController::heaterMaxDurationControl(
for (unsigned i = 0; i < heater::Switch::NUMBER_OF_SWITCHES; i++) {
// Right now, we only track the maximum duration for heater which were commanded by the TCS
// controller.
if (currentHeaterStates[i] == heater::SwitchState::ON and
if (heaterHandler.getHealth(static_cast<heater::Switch>(i)) != HasHealthIF::EXTERNAL_CONTROL and
currentHeaterStates[i] == heater::SwitchState::ON and
heaterStates[i].trackHeaterMaxBurnTime and
heaterStates[i].heaterOnMaxBurnTime.hasTimedOut()) {
heaterStates[i].switchTransition = false;

View File

@ -38,6 +38,9 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
case 0x5:
parameterWrapper->set(onBoardParams.questFilterWeight);
break;
case 0x6:
parameterWrapper->set(onBoardParams.questAngleLimit);
break;
default:
return INVALID_IDENTIFIER_ID;
}
@ -554,6 +557,9 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
case 0xE:
parameterWrapper->set(gsTargetModeControllerParameters.altitudeTgt);
break;
case 0xF:
parameterWrapper->set(gsTargetModeControllerParameters.rotRateLimit);
break;
default:
return INVALID_IDENTIFIER_ID;
}
@ -734,6 +740,9 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
case 0x5:
parameterWrapper->set(kalmanFilterParameters.sensorNoiseGyrBs);
break;
case 0x6:
parameterWrapper->set(kalmanFilterParameters.allowStr);
break;
default:
return INVALID_IDENTIFIER_ID;
}

View File

@ -26,6 +26,7 @@ class AcsParameters : public HasParametersIF {
uint8_t fusedRateFromStr = true;
uint8_t fusedRateFromQuest = true;
double questFilterWeight = 0.9;
double questAngleLimit = 5 * DEG2RAD;
} onBoardParams;
struct InertiaEIVE {
@ -866,7 +867,7 @@ class AcsParameters : public HasParametersIF {
double desatMomentumRef[3] = {0, 0, 0};
double deSatGainFactor = 1000;
uint8_t desatOn = true;
uint8_t useMekf = false;
uint8_t useMekf = true;
} pointingLawParameters;
struct IdleModeControllerParameters : PointingLawParameters {
@ -898,6 +899,7 @@ class AcsParameters : public HasParametersIF {
double latitudeTgt = 48.7495 * DEG2RAD; // [rad] Latitude
double longitudeTgt = 9.10384 * DEG2RAD; // [rad] Longitude
double altitudeTgt = 500; // [m]
double rotRateLimit = .75 * DEG2RAD;
} gsTargetModeControllerParameters;
struct NadirModeControllerParameters : PointingLawParameters {
@ -940,13 +942,15 @@ class AcsParameters : public HasParametersIF {
} sunModelParameters;
struct KalmanFilterParameters {
double sensorNoiseStr = 0.1 * DEG2RAD;
double sensorNoiseStr = 0.0028 * DEG2RAD;
double sensorNoiseSus = 8. * DEG2RAD;
double sensorNoiseMgm = 4. * DEG2RAD;
double sensorNoiseGyr = 0.1 * DEG2RAD;
double sensorNoiseGyrArw = 3. * 0.0043 / sqrt(10) * DEG2RAD; // Angular Random Walk
double sensorNoiseGyrBs = 3. / 3600. * DEG2RAD; // Bias Stability
uint8_t allowStr = true;
} kalmanFilterParameters;
struct MagnetorquerParameter {

View File

@ -29,6 +29,20 @@ void AttitudeEstimation::quest(acsctrl::SusDataProcessed *susData,
VectorOperations<double>::normalize(mgmData->mgmVecTot.value, normMgmB, 3);
VectorOperations<double>::normalize(mgmData->magIgrfModel.value, normMgmI, 3);
if ((std::acos(VectorOperations<double>::dot(normSusB, normMgmB)) <
acsParameters->onBoardParams.questAngleLimit) or
(std::acos(VectorOperations<double>::dot(normSusI, normMgmI)) <
acsParameters->onBoardParams.questAngleLimit)) {
{
PoolReadGuard pg{attitudeEstimationData};
if (pg.getReadResult() == returnvalue::OK) {
std::memcpy(attitudeEstimationData->quatQuest.value, ZERO_VEC4, 4 * sizeof(double));
attitudeEstimationData->quatQuest.setValid(false);
}
}
return;
}
// Create Helper Vectors
double normHelperB[3] = {0, 0, 0}, normHelperI[3] = {0, 0, 0}, helperCross[3] = {0, 0, 0},
helperSum[3] = {0, 0, 0};

View File

@ -19,13 +19,9 @@ void FusedRotationEstimation::estimateFusedRotationRate(
acsParameters->onBoardParams.fusedRateFromStr)) {
PoolReadGuard pg(fusedRotRateData);
if (pg.getReadResult() == returnvalue::OK) {
std::memcpy(fusedRotRateData->rotRateOrthogonal.value, ZERO_VEC3, 3 * sizeof(double));
fusedRotRateData->rotRateOrthogonal.setValid(false);
std::memcpy(fusedRotRateData->rotRateParallel.value, ZERO_VEC3, 3 * sizeof(double));
fusedRotRateData->rotRateParallel.setValid(false);
std::memcpy(fusedRotRateData->rotRateTotal.value,
std::memcpy(fusedRotRateData->rotRateTotalSource.value,
fusedRotRateSourcesData->rotRateTotalStr.value, 3 * sizeof(double));
fusedRotRateData->rotRateTotal.setValid(true);
fusedRotRateData->rotRateTotalSource.setValid(true);
fusedRotRateData->rotRateSource.value = acs::rotrate::Source::STR;
fusedRotRateData->rotRateSource.setValid(true);
}
@ -34,41 +30,38 @@ void FusedRotationEstimation::estimateFusedRotationRate(
acsParameters->onBoardParams.fusedRateFromQuest)) {
PoolReadGuard pg(fusedRotRateData);
if (pg.getReadResult() == returnvalue::OK) {
std::memcpy(fusedRotRateData->rotRateOrthogonal.value, ZERO_VEC3, 3 * sizeof(double));
fusedRotRateData->rotRateOrthogonal.setValid(false);
std::memcpy(fusedRotRateData->rotRateParallel.value, ZERO_VEC3, 3 * sizeof(double));
fusedRotRateData->rotRateParallel.setValid(false);
std::memcpy(fusedRotRateData->rotRateTotal.value,
std::memcpy(fusedRotRateData->rotRateTotalSource.value,
fusedRotRateSourcesData->rotRateTotalQuest.value, 3 * sizeof(double));
fusedRotRateData->rotRateTotal.setValid(true);
fusedRotRateData->rotRateTotalSource.setValid(true);
fusedRotRateData->rotRateSource.value = acs::rotrate::Source::QUEST;
fusedRotRateData->rotRateSource.setValid(true);
}
} else if (fusedRotRateSourcesData->rotRateTotalSusMgm.isValid()) {
std::memcpy(fusedRotRateData->rotRateOrthogonal.value,
fusedRotRateSourcesData->rotRateOrthogonalSusMgm.value, 3 * sizeof(double));
fusedRotRateData->rotRateOrthogonal.setValid(
fusedRotRateSourcesData->rotRateOrthogonalSusMgm.isValid());
std::memcpy(fusedRotRateData->rotRateParallel.value,
fusedRotRateSourcesData->rotRateParallelSusMgm.value, 3 * sizeof(double));
fusedRotRateData->rotRateParallel.setValid(
fusedRotRateSourcesData->rotRateParallelSusMgm.isValid());
std::memcpy(fusedRotRateData->rotRateTotal.value,
std::memcpy(fusedRotRateData->rotRateTotalSource.value,
fusedRotRateSourcesData->rotRateTotalSusMgm.value, 3 * sizeof(double));
fusedRotRateData->rotRateTotal.setValid(true);
fusedRotRateData->rotRateTotalSource.setValid(true);
fusedRotRateData->rotRateSource.value = acs::rotrate::Source::SUSMGM;
fusedRotRateData->rotRateSource.setValid(true);
} else {
PoolReadGuard pg(fusedRotRateData);
if (pg.getReadResult() == returnvalue::OK) {
std::memcpy(fusedRotRateData->rotRateOrthogonal.value, ZERO_VEC3, 3 * sizeof(double));
std::memcpy(fusedRotRateData->rotRateParallel.value, ZERO_VEC3, 3 * sizeof(double));
std::memcpy(fusedRotRateData->rotRateTotal.value, ZERO_VEC3, 3 * sizeof(double));
fusedRotRateData->setValidity(false, true);
std::memcpy(fusedRotRateData->rotRateTotalSource.value, ZERO_VEC3, 3 * sizeof(double));
fusedRotRateData->rotRateTotalSource.setValid(false);
fusedRotRateData->rotRateSource.value = acs::rotrate::Source::NONE;
fusedRotRateData->rotRateSource.setValid(true);
}
}
if (fusedRotRateSourcesData->rotRateTotalSusMgm.isValid()) {
std::memcpy(fusedRotRateData->rotRateTotalSusMgm.value,
fusedRotRateSourcesData->rotRateTotalSusMgm.value, 3 * sizeof(double));
fusedRotRateData->rotRateTotalSusMgm.setValid(true);
} else {
PoolReadGuard pg(fusedRotRateData);
if (pg.getReadResult() == returnvalue::OK) {
std::memcpy(fusedRotRateData->rotRateTotalSusMgm.value, ZERO_VEC3, 3 * sizeof(double));
fusedRotRateData->rotRateTotalSusMgm.setValid(false);
}
}
}
void FusedRotationEstimation::estimateFusedRotationRateStr(

View File

@ -232,6 +232,7 @@ void Guidance::targetRotationRate(const double timeDelta, double quatIX[4], doub
}
if (timeDelta != 0.0) {
QuaternionOperations::rotationFromQuaternions(quatIX, quatIXprev, timeDelta, refSatRate);
VectorOperations<double>::mulScalar(refSatRate, -1, refSatRate, 3);
} else {
std::memcpy(refSatRate, ZERO_VEC3, 3 * sizeof(double));
}
@ -244,12 +245,14 @@ void Guidance::limitReferenceRotation(const double xAxisIX[3], double quatIX[4])
return;
}
QuaternionOperations::preventSignJump(quatIX, quatIXprev);
// check required rotation and return if below limit
double quatXprevX[4] = {0, 0, 0, 0}, quatXprevI[4] = {0, 0, 0, 0};
QuaternionOperations::inverse(quatIXprev, quatXprevI);
QuaternionOperations::multiply(quatIX, quatXprevI, quatXprevX);
QuaternionOperations::normalize(quatXprevX);
double phiMax = acsParameters->gsTargetModeControllerParameters.omMax *
double phiMax = acsParameters->gsTargetModeControllerParameters.rotRateLimit *
acsParameters->onBoardParams.sampleTime;
if (2 * std::acos(quatXprevX[3]) < phiMax) {
return;
@ -313,9 +316,9 @@ void Guidance::comparePtg(double currentQuat[4], double currentSatRotRate[3], do
// Calculate error satellite rotational rate
// Convert target rotational rate into body RF
double errorQuatInv[4] = {0, 0, 0, 0}, targetSatRotRateB[3] = {0, 0, 0};
QuaternionOperations::inverse(errorQuat, errorQuatInv);
QuaternionOperations::multiplyVector(errorQuatInv, targetSatRotRate, targetSatRotRateB);
double targetSatRotRateB[3] = {0, 0, 0};
QuaternionOperations::multiplyVector(currentQuat, targetSatRotRate, targetSatRotRateB);
VectorOperations<double>::copy(targetSatRotRateB, targetSatRotRate, 3);
// Combine the target and reference satellite rotational rates
double combinedRefSatRotRate[3] = {0, 0, 0};
VectorOperations<double>::add(targetSatRotRate, refSatRotRate, combinedRefSatRotRate, 3);

View File

@ -114,12 +114,13 @@ ReturnValue_t MultiplicativeKalmanFilter::mekfEst(
return result;
}
double measSensMatrix[matrixDimensionFactor][6] = {{0}},
measCovMatrix[matrixDimensionFactor][matrixDimensionFactor] = {{0}},
measVec[matrixDimensionFactor] = {0}, estVec[matrixDimensionFactor] = {0};
double measSensMatrix[matrixDimensionFactor][6] = {},
measCovMatrix[matrixDimensionFactor][matrixDimensionFactor] = {},
measVec[matrixDimensionFactor] = {}, estVec[matrixDimensionFactor] = {};
kfUpdate(susData, mgmData, *measSensMatrix, *measCovMatrix, measVec, estVec);
double kalmanGain[6][matrixDimensionFactor] = {{0}};
double kalmanGain[6][matrixDimensionFactor];
std::memset(kalmanGain, 0, sizeof(kalmanGain));
result = kfGain(*measSensMatrix, *measCovMatrix, *kalmanGain, attitudeEstimationData);
if (result != returnvalue::OK) {
reset(attitudeEstimationData);
@ -342,10 +343,11 @@ ReturnValue_t MultiplicativeKalmanFilter::kfGain(
double *measSensMatrix, double *measCovMatrix, double *kalmanGain,
acsctrl::AttitudeEstimationData *attitudeEstimationData) {
// Kalman Gain: K = P * H' / (H * P * H' + R)
double kalmanGainDen[matrixDimensionFactor][matrixDimensionFactor] = {{0}},
invKalmanGainDen[matrixDimensionFactor][matrixDimensionFactor] = {{0}},
residualCov[6][matrixDimensionFactor] = {{0}},
measSensMatrixTransposed[6][matrixDimensionFactor] = {{0}};
double kalmanGainDen[matrixDimensionFactor][matrixDimensionFactor] = {},
invKalmanGainDen[matrixDimensionFactor][matrixDimensionFactor] = {};
double residualCov[6][matrixDimensionFactor], measSensMatrixTransposed[6][matrixDimensionFactor];
std::memset(residualCov, 0, sizeof(residualCov));
std::memset(measSensMatrixTransposed, 0, sizeof(measSensMatrixTransposed));
MatrixOperations<double>::transpose(measSensMatrix, *measSensMatrixTransposed,
matrixDimensionFactor, 6);
@ -382,8 +384,7 @@ void MultiplicativeKalmanFilter::kfCovAposteriori(double *kalmanGain, double *me
void MultiplicativeKalmanFilter::kfStateAposteriori(double *kalmanGain, double *measVec,
double *estVec) {
double stateVecErr[6] = {0, 0, 0, 0, 0, 0};
double plantOutputDiff[matrixDimensionFactor] = {0};
double stateVecErr[6] = {0, 0, 0, 0, 0, 0}, plantOutputDiff[matrixDimensionFactor] = {};
VectorOperations<double>::subtract(measVec, estVec, plantOutputDiff, matrixDimensionFactor);
MatrixOperations<double>::multiply(kalmanGain, plantOutputDiff, stateVecErr, 6,
matrixDimensionFactor, 1);
@ -626,11 +627,11 @@ void MultiplicativeKalmanFilter::updateDataSet(
}
}
void MultiplicativeKalmanFilter::setStrData(double qX, double qY, double qZ, double qW,
bool valid) {
void MultiplicativeKalmanFilter::setStrData(double qX, double qY, double qZ, double qW, bool valid,
bool allowStr) {
strData.strQuat.value[0] = qX;
strData.strQuat.value[1] = qY;
strData.strQuat.value[2] = qZ;
strData.strQuat.value[3] = qW;
strData.strQuat.valid = valid;
strData.strQuat.valid = (valid and allowStr);
}

View File

@ -38,7 +38,7 @@ class MultiplicativeKalmanFilter {
void updateStandardDeviations(const AcsParameters *acsParameters);
void setStrData(const double qX, const double qY, const double qZ, const double qW,
const bool valid);
const bool valid, const bool allowStr);
static constexpr uint8_t IF_MEKF_ID = CLASS_ID::ACS_MEKF;
static constexpr ReturnValue_t MEKF_UNINITIALIZED = returnvalue::makeCode(IF_MEKF_ID, 2);

View File

@ -9,11 +9,12 @@ ReturnValue_t Navigation::useMekf(const ACS::SensorValues *sensorValues,
const acsctrl::MgmDataProcessed *mgmDataProcessed,
const acsctrl::SusDataProcessed *susDataProcessed,
const double timeDelta,
acsctrl::AttitudeEstimationData *attitudeEstimationData) {
acsctrl::AttitudeEstimationData *attitudeEstimationData,
const bool allowStr) {
multiplicativeKalmanFilter.setStrData(
sensorValues->strSet.caliQx.value, sensorValues->strSet.caliQy.value,
sensorValues->strSet.caliQz.value, sensorValues->strSet.caliQw.value,
sensorValues->strSet.caliQx.isValid());
sensorValues->strSet.caliQx.isValid(), allowStr);
if (mekfStatus == MultiplicativeKalmanFilter::MEKF_UNINITIALIZED) {
mekfStatus = multiplicativeKalmanFilter.init(susDataProcessed, mgmDataProcessed,

View File

@ -17,7 +17,8 @@ class Navigation {
const acsctrl::GyrDataProcessed *gyrDataProcessed,
const acsctrl::MgmDataProcessed *mgmDataProcessed,
const acsctrl::SusDataProcessed *susDataProcessed, const double timeDelta,
acsctrl::AttitudeEstimationData *attitudeEstimationData);
acsctrl::AttitudeEstimationData *attitudeEstimationData,
const bool allowStr);
void resetMekf(acsctrl::AttitudeEstimationData *mekfData);
ReturnValue_t useSpg4(timeval now, acsctrl::GpsDataProcessed *gpsDataProcessed);

View File

@ -4,7 +4,7 @@
#include <fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h>
#include <fsfw_hal/devicehandlers/MgmRM3100Handler.h>
#include <fsfw_hal/devicehandlers/devicedefinitions/gyroL3gHelpers.h>
#include <mission/acs/archive/GPSDefinitions.h>
#include <linux/acs/GPSDefinitions.h>
#include <mission/acs/gyroAdisHelpers.h>
#include <mission/acs/imtqHelpers.h>
#include <mission/acs/rwHelpers.h>

View File

@ -129,9 +129,8 @@ enum PoolIds : lp_id_t {
RW_TARGET_SPEED,
MTQ_TARGET_DIPOLE,
// Fused Rotation Rate
ROT_RATE_ORTHOGONAL,
ROT_RATE_PARALLEL,
ROT_RATE_TOTAL,
ROT_RATE_TOT_SUSMGM,
ROT_RATE_TOT_SOURCE,
ROT_RATE_SOURCE,
// Fused Rotation Rate Sources
ROT_RATE_ORTHOGONAL_SUSMGM,
@ -151,7 +150,7 @@ static constexpr uint8_t GPS_SET_PROCESSED_ENTRIES = 6;
static constexpr uint8_t ATTITUDE_ESTIMATION_SET_ENTRIES = 4;
static constexpr uint8_t CTRL_VAL_SET_ENTRIES = 5;
static constexpr uint8_t ACT_CMD_SET_ENTRIES = 3;
static constexpr uint8_t FUSED_ROT_RATE_SET_ENTRIES = 4;
static constexpr uint8_t FUSED_ROT_RATE_SET_ENTRIES = 3;
static constexpr uint8_t FUSED_ROT_RATE_SOURCES_SET_ENTRIES = 5;
/**
@ -318,10 +317,10 @@ class FusedRotRateData : public StaticLocalDataSet<FUSED_ROT_RATE_SET_ENTRIES> {
FusedRotRateData(HasLocalDataPoolIF* hkOwner)
: StaticLocalDataSet(hkOwner, FUSED_ROTATION_RATE_DATA) {}
lp_vec_t<double, 3> rotRateOrthogonal =
lp_vec_t<double, 3>(sid.objectId, ROT_RATE_ORTHOGONAL, this);
lp_vec_t<double, 3> rotRateParallel = lp_vec_t<double, 3>(sid.objectId, ROT_RATE_PARALLEL, this);
lp_vec_t<double, 3> rotRateTotal = lp_vec_t<double, 3>(sid.objectId, ROT_RATE_TOTAL, this);
lp_vec_t<double, 3> rotRateTotalSusMgm =
lp_vec_t<double, 3>(sid.objectId, ROT_RATE_TOT_SUSMGM, this);
lp_vec_t<double, 3> rotRateTotalSource =
lp_vec_t<double, 3>(sid.objectId, ROT_RATE_TOT_SOURCE, this);
lp_var_t<uint8_t> rotRateSource = lp_var_t<uint8_t>(sid.objectId, ROT_RATE_SOURCE, this);
private:

View File

@ -10,6 +10,7 @@
#include "OBSWConfig.h"
#include "eive/definitions.h"
#include "eive/objects.h"
#include "linux/payload/FreshMpsocHandler.h"
#include "linux/payload/FreshSupvHandler.h"
#ifndef RPI_TEST_ADIS16507
@ -617,17 +618,21 @@ ReturnValue_t pst::pstPayload(FixedTimeslotTaskIF *thisSequence) {
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0,
FreshSupvHandler::OpCode::DEFAULT_OPERATION);
// Two COM TM steps, which might cover telemetry which takes a bit longer to be sent.
// Parse TM with a bit of delay. Two COM steps which might cover telemetry wehich takes a bit
// longer to send
thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0.1,
FreshSupvHandler::OpCode::PARSE_TM);
thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0.2,
FreshSupvHandler::OpCode::PARSE_TM);
// Parse TM with a bit of delay. Two COM steps which might cover telemetry wehich takes a bit
// longer to send
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.2,
FreshMpsocHandler::OpCode::PARSE_TM);
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.4,
FreshMpsocHandler::OpCode::PARSE_TM);
thisSequence->addSlot(objects::SCEX, length * 0.6, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::SCEX, length * 0.6, DeviceHandlerIF::SEND_WRITE);

View File

@ -3,8 +3,9 @@ add_subdirectory(acs)
add_subdirectory(tcs)
add_subdirectory(com)
add_subdirectory(power)
add_subdirectory(payload)
target_sources(
${LIB_EIVE_MISSION}
PRIVATE systemTree.cpp DualLanePowerStateMachine.cpp EiveSystem.cpp
treeUtil.cpp SharedPowerAssemblyBase.cpp payloadModeTree.cpp)
treeUtil.cpp SharedPowerAssemblyBase.cpp)

View File

@ -105,7 +105,7 @@ Subsystem& satsystem::acs::init() {
};
// Build TARGET PT transition 0
iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_PTG_TRANS_0.second);
iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_PTG_TRANS_0.second, true);
iht(objects::SUS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_PTG_TRANS_0.second, true);
iht(objects::ACS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_PTG_TRANS_0.second, true);
iht(objects::RW_ASSY, NML, 0, ACS_TABLE_PTG_TRANS_0.second);
iht(objects::STR_ASSY, NML, 0, ACS_TABLE_PTG_TRANS_0.second);
@ -114,7 +114,7 @@ Subsystem& satsystem::acs::init() {
ctxc);
// Build SUS board transition
iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, SUS_BOARD_NML_TRANS.second, true);
iht(objects::SUS_BOARD_ASS, NML, duallane::B_SIDE, SUS_BOARD_NML_TRANS.second, true);
check(ACS_SUBSYSTEM.addTable(TableEntry(SUS_BOARD_NML_TRANS.first, &SUS_BOARD_NML_TRANS.second)),
ctxc);
@ -200,14 +200,14 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) {
iht(objects::ACS_CONTROLLER, acs::AcsMode::SAFE, acs::SafeSubmode::DEFAULT,
ACS_TABLE_SAFE_TGT.second, true);
iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_SAFE_TGT.second);
iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_SAFE_TGT.second, true);
iht(objects::SUS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_SAFE_TGT.second, true);
iht(objects::ACS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_SAFE_TGT.second, true);
check(ss.addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_SAFE_TGT.first, false, true), ctxc);
// Build SAFE transition 0
iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_SAFE_TRANS_0.second);
iht(objects::ACS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_SAFE_TRANS_0.second, true);
iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_SAFE_TRANS_0.second, true);
iht(objects::SUS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_SAFE_TRANS_0.second, true);
iht(objects::STR_ASSY, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second);
iht(objects::RW_ASSY, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second);
check(ss.addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true),
@ -257,14 +257,14 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) {
iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_IDLE_TGT.second);
iht(objects::RW_ASSY, NML, 0, ACS_TABLE_IDLE_TGT.second);
iht(objects::STR_ASSY, NML, 0, ACS_TABLE_IDLE_TGT.second);
iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_IDLE_TGT.second, true);
iht(objects::SUS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_IDLE_TGT.second, true);
iht(objects::ACS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_IDLE_TGT.second, true);
ss.addTable(&ACS_TABLE_IDLE_TGT.second, ACS_TABLE_IDLE_TGT.first, false, true);
// Build IDLE transition 0
iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_IDLE_TRANS_0.second);
iht(objects::ACS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_IDLE_TRANS_0.second, true);
iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_IDLE_TRANS_0.second, true);
iht(objects::SUS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_IDLE_TRANS_0.second, true);
iht(objects::RW_ASSY, NML, 0, ACS_TABLE_IDLE_TRANS_0.second);
iht(objects::STR_ASSY, NML, 0, ACS_TABLE_IDLE_TRANS_0.second);
ss.addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true);
@ -307,7 +307,7 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) {
// Build TARGET PT table
iht(objects::ACS_CONTROLLER, acs::AcsMode::PTG_TARGET, 0, ACS_TABLE_PTG_TARGET_TGT.second);
iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second);
iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_PTG_TARGET_TGT.second, true);
iht(objects::SUS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_PTG_TARGET_TGT.second, true);
iht(objects::ACS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_PTG_TARGET_TGT.second, true);
iht(objects::RW_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second);
iht(objects::STR_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second);
@ -356,7 +356,7 @@ void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) {
// Build TARGET PT table
iht(objects::ACS_CONTROLLER, acs::AcsMode::PTG_NADIR, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second);
iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second);
iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_PTG_TARGET_NADIR_TGT.second, true);
iht(objects::SUS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_PTG_TARGET_NADIR_TGT.second, true);
iht(objects::ACS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_PTG_TARGET_NADIR_TGT.second, true);
iht(objects::RW_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second);
iht(objects::STR_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second);
@ -409,7 +409,7 @@ void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& eh) {
// Build TARGET PT table
iht(objects::ACS_CONTROLLER, acs::AcsMode::PTG_TARGET_GS, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second);
iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second);
iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_PTG_TARGET_GS_TGT.second, true);
iht(objects::SUS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_PTG_TARGET_GS_TGT.second, true);
iht(objects::ACS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_PTG_TARGET_GS_TGT.second, true);
iht(objects::RW_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second);
iht(objects::STR_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second);
@ -462,7 +462,7 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& eh) {
iht(objects::ACS_CONTROLLER, acs::AcsMode::PTG_INERTIAL, 0,
ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second);
iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second);
iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second,
iht(objects::SUS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second,
true);
iht(objects::ACS_BOARD_ASS, NML, duallane::B_SIDE, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second,
true);

View File

@ -0,0 +1 @@
target_sources(${LIB_EIVE_MISSION} PRIVATE payloadModeTree.cpp)

View File

@ -10,7 +10,7 @@
#include "mission/com/defs.h"
#include "mission/sysDefs.h"
#include "mission/system/acs/acsModeTree.h"
#include "mission/system/payloadModeTree.h"
#include "mission/system/payload/payloadModeTree.h"
#include "mission/system/power/epsModeTree.h"
#include "mission/system/tcs/tcsModeTree.h"
#include "treeUtil.h"

View File

@ -9,7 +9,7 @@ export ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-li
export PATH=${CROSS_COMPILE_BIN_PATH}:$PATH
export CROSS_COMPILE="arm-linux-gnueabihf"
# export EIVE_Q7S_EM=1
unset EIVE_Q7S_EM
if [[ -d "eive-obsw" ]]; then
echo "Detected EIVE OBSW root directory at $(pwd)/eive-obsw. Setting to EIVE_OBSW_ROOT"

View File

@ -4,6 +4,9 @@ import os
import sys
DEFAULT_PORT = 1539
def main():
args = handle_args()
cmd = build_cmd(args)
@ -20,7 +23,7 @@ def prompt_ssh_key_removal():
do_remove_key = input(
"Do you want to remove problematic keys on localhost ([Y]/n)?: "
)
if not do_remove_key.lower() in ["y", "yes", "1", ""]:
if do_remove_key.lower() not in ["y", "yes", "1", ""]:
sys.exit(1)
port = 0
while True:
@ -54,7 +57,7 @@ def handle_args():
"If files are copied back to host, will be current directory by default",
default="",
)
parser.add_argument("-P", "--port", help="Target port", default=1535)
parser.add_argument("-P", "--port", help="Target port", default=DEFAULT_PORT)
parser.add_argument(
"-i",
"--invert",

2
tmtc

@ -1 +1 @@
Subproject commit c843356c8af22bf45a04c71c93813716c9d743ec
Subproject commit 9a06c64dfac3f4283c2d5af72a9c095f4726480b

View File

@ -6,5 +6,6 @@ target_sources(${UNITTEST_NAME} PRIVATE
testEnvironment.cpp
testGenericFilesystem.cpp
hdlcEncodingRw.cpp
mpsocTests.cpp
printChar.cpp
)
)

14
unittest/mpsocTests.cpp Normal file
View File

@ -0,0 +1,14 @@
#include <catch2/catch_test_macros.hpp>
TEST_CASE("MPSoC helper tests", "[payload]") {
char divStr[16]{};
uint32_t divParam = 0;
SECTION("Simple Test") {
divParam = 3;
CHECK(divParam < 999);
sprintf(divStr, "DIV%03u", divParam);
REQUIRE(strcmp(divStr, "DIV003") == 0);
}
}