Compare commits

...

474 Commits

Author SHA1 Message Date
c6f60fbe82 Merge pull request 'v1.12.1' () from develop into main
Reviewed-on: 
Reviewed-by: Jakob Meier <meierj@irs.uni-stuttgart.de>
2022-07-05 11:39:58 +02:00
269c93a9f3 Merge branch 'main' into develop 2022-07-05 11:24:52 +02:00
2e966aba77 repoint tmtc 2022-07-05 11:19:42 +02:00
76a217ffc2 bump changelog and version 2022-07-05 02:14:32 +02:00
be7a9af8cd disable TCS ctrl spam 2022-07-05 02:13:07 +02:00
75e71f7dca Merge pull request 'v1.12.0' () from develop into main
Reviewed-on: 
2022-07-04 11:19:04 +02:00
62f725beea bump changelog and version 2022-07-04 11:13:26 +02:00
812c814a30 bump tmtc 2022-07-04 11:08:05 +02:00
e092d9bf3d Merge pull request 'CCSDS Handler Improvements' () from meier/ccsds into develop
Reviewed-on: 
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-06-29 13:53:29 +02:00
bf8ffac624 removed unused event 2022-06-27 15:03:37 +02:00
d78155fd79 remove ccsds components from em object factory 2022-06-27 14:56:46 +02:00
3a93cdc105 add thermal controller for hosted build 2022-06-27 13:53:38 +02:00
a2e7c6cca6 moved ccsds object creation back to core object factory and run auto formatter 2022-06-27 10:58:46 +02:00
b5ff0edbc9 fixed merge conflict 2022-06-27 09:31:39 +02:00
95da2372c9 run generators 2022-06-27 09:15:29 +02:00
70450041e6 removed command action helper form ccsds handler 2022-06-27 08:53:14 +02:00
ed0eb4fe9c adaptions for setup with ccsds testbed 2022-06-23 20:12:56 +02:00
af039c540a moved TmFunnel 2022-06-23 12:05:56 +02:00
d2a12ea71e Merge pull request 'fsfwgen update' () from mueller/gen-update into develop
Reviewed-on: 
2022-06-21 10:40:15 +02:00
53e556d0b3 improve csv format 2022-06-21 01:21:23 +02:00
72ab141b41 use lib logger 2022-06-21 01:02:00 +02:00
c6b00e2448 update deps and gen files 2022-06-21 00:58:59 +02:00
d4a1cb9f62 fsfwgen update 2022-06-20 18:05:05 +02:00
83c93a9637 Merge pull request 'Thermal controller and temperature bugfixes' () from meier/thermal-bugfixes into develop
Reviewed-on: 
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-06-20 09:43:03 +02:00
89757c447c run auto-formatter 2022-06-17 08:31:36 +02:00
61aa57f021 Merge branch 'develop' into meier/thermal-bugfixes 2022-06-16 09:00:56 +02:00
0ee912665e removed mock files from mission directory 2022-06-16 08:47:56 +02:00
b53bfb9a6f dummy devices 2022-06-16 08:26:40 +02:00
bd11d13b99 dummy devices for hosted build, adaptions to run thermal controller unit test 2022-06-16 07:00:09 +02:00
1133736d48 Merge pull request 'Fixed tmtc and fsfw submodule' () from meier/submodules into develop
Reviewed-on: 
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-06-15 11:02:48 +02:00
9918c7c255 tmtc update 2022-06-15 10:49:46 +02:00
b0a175610a fsfw update 2022-06-15 10:49:22 +02:00
d96d3b155b syrlinks carrier wave command 2022-06-15 10:37:00 +02:00
eff80a58ee improvements for hosted build 2022-06-13 08:58:06 +02:00
5f796ec1e3 init poll variable 2022-06-10 14:22:35 +02:00
3825304088 rtd set id 2022-06-10 14:13:59 +02:00
66d6b6d707 changed max13865 namespace 2022-06-10 14:01:34 +02:00
a787de531b changed namespace 2022-06-10 13:56:35 +02:00
772ab430e0 only include core definitions in thermal controller 2022-06-10 12:18:23 +02:00
35ea8a50f4 update tmtc submodule 2022-06-10 11:26:00 +02:00
63c669bc27 fixed type of imtq self test temperatures 2022-06-10 11:06:05 +02:00
17d17dce06 bugfix for some negative temperature conversions 2022-06-10 10:39:43 +02:00
1ebae7f938 fixes for te0720 build 2022-06-08 07:16:12 +02:00
8c850614e5 fixed merge conflicts 2022-06-05 10:54:46 +02:00
b8cf825307 rerun generators 2022-06-05 09:13:08 +02:00
f2d5932883 fixes in build config 2022-06-05 09:12:56 +02:00
917090e39d Merge branch 'meier/thermal-controller-fix' of https://egit.irs.uni-stuttgart.de/eive/eive-obsw into meier/thermal-controller-fix 2022-06-04 09:42:59 +02:00
67037e2dae use memset to set invalid temperatures of cau 2022-06-04 09:31:34 +02:00
f72dfa255d submodule update 2022-06-03 18:05:54 +02:00
b3bb76c75f bugfixes in hk handling 2022-06-03 18:03:25 +02:00
6c32ddf864 changed gomspace temperatures to float 2022-06-03 09:33:08 +02:00
b1c20b22c8 set temeprature to invalid value when invalid flag is set by owner 2022-06-03 07:51:04 +02:00
678b22438f tmtc update 2022-06-02 18:52:09 +02:00
f47712552e hk set fixes 2022-06-02 18:46:08 +02:00
cbb8832fab tmtc update 2022-06-01 18:47:52 +02:00
b66dcc0a86 local port forward script 2022-06-01 18:46:53 +02:00
04b7c82501 type fixes in device temperatures sets 2022-06-01 18:46:22 +02:00
5051af82c2 tmtc update 2022-06-01 15:52:51 +02:00
ba7ac6bab2 variable for number of sus entries 2022-06-01 13:08:34 +02:00
52d94f44d4 device temeprature set 2022-06-01 10:48:18 +02:00
87783b01f5 device temperature set wip 2022-05-31 16:46:07 +02:00
593cc68b84 rtd dataset 2022-05-31 16:44:57 +02:00
0e6d2354fc thermal set fix 2022-05-30 14:32:50 +02:00
23cabe4ca6 Merge branch 'develop' into mohr/thermal_controller 2022-05-30 12:10:19 +02:00
3d1e104fa4 Merge pull request 'Adaptions for EM' () from meier/q7s-em into develop
Reviewed-on: 
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-05-28 12:21:49 +02:00
8106722a08 replaced EM preprocessor define 2022-05-27 16:24:41 +02:00
9e93f1c814 adaptions for EM 2022-05-27 13:44:40 +02:00
1f1e1e8eae Merge pull request 'Bugfix SdCardManager' () from meier/SdCardManager into develop
Reviewed-on: 
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-05-26 12:15:32 +02:00
6f9d3c2f63 Merge branch 'develop' into meier/SdCardManager 2022-05-26 12:15:14 +02:00
25070d9543 Merge pull request 'MPSoC Status Codes' () from meier/ploc into develop
Reviewed-on: 
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-05-26 12:14:19 +02:00
bbdfc0427a Merge branch 'develop' into meier/ploc 2022-05-26 12:14:01 +02:00
97db44e500 fix raspberry pi build 2022-05-26 11:46:28 +02:00
c588ec4a1a bugfix SdCardManager 2022-05-26 01:56:19 +02:00
09a6707c6c run generator scripts 2022-05-25 18:42:40 +02:00
ee9a13f59b Merge branch 'develop' into meier/ploc 2022-05-25 18:40:39 +02:00
e9ccb2fd4f status code parsing, fix in cam command 2022-05-25 18:38:54 +02:00
e5459bb1f7 re-run generators 2022-05-25 18:15:44 +02:00
335d3ba3b0 bump submodules 2022-05-25 15:45:11 +02:00
f50682b56a Merge pull request 'Split ACU HK' () from mueller/split-acu-hk into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-25 15:23:19 +02:00
ad679a810e Merge pull request 'add and schedule PUS11' () from mueller/add-schedule-pus-11 into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-25 15:21:25 +02:00
686ec4bffa Merge pull request 'GPS Reset Pin Handling Update' () from mueller/gps-reset-pin-update into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-25 15:20:12 +02:00
ae434853aa bump number stored packets 2022-05-25 13:14:36 +02:00
bb1e1d80cc resolve merge conflict 2022-05-25 11:00:18 +02:00
01bac87afb update reset pin handling 2022-05-25 10:59:20 +02:00
ffdd6bbc3c Merge branch 'develop' into mueller/add-schedule-pus-11 2022-05-25 10:27:36 +02:00
d870f5ab10 Merge pull request 'Core Controller Remount SD Handling' () from mueller/core-controller-remount-sd-handling into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-25 10:27:10 +02:00
0b3fd65c9a Merge remote-tracking branch 'origin/develop' into mueller/add-schedule-pus-11 2022-05-25 10:16:31 +02:00
0ac38e8490 Merge remote-tracking branch 'origin/develop' into mueller/split-acu-hk 2022-05-25 10:16:14 +02:00
d79177e544 Merge remote-tracking branch 'origin/develop' into mueller/core-controller-remount-sd-handling 2022-05-25 10:15:48 +02:00
addcb2b21f Merge pull request 'IMTQ improvements' () from meier/imtq into develop
Reviewed-on: 
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-05-25 10:15:13 +02:00
7646b683b2 Merge remote-tracking branch 'origin/develop' into mueller/split-acu-hk 2022-05-25 09:59:14 +02:00
3eca96fef5 Merge remote-tracking branch 'origin/develop' into mueller/core-controller-remount-sd-handling 2022-05-25 09:58:06 +02:00
43fc1ab780 Merge remote-tracking branch 'origin/develop' into mueller/add-schedule-pus-11 2022-05-25 09:57:34 +02:00
2bf044422f Merge remote-tracking branch 'origin/develop' into meier/imtq 2022-05-25 09:56:41 +02:00
7f180ebc45 Merge pull request 'Reboot Command' () from mueller/reboot-cmd into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-24 19:11:07 +02:00
1ccd12e2e1 enable hk in imtq 2022-05-24 19:08:00 +02:00
b878508fec Thermal COntroller collecting Sus Temperatures 2022-05-24 16:52:21 +02:00
88faf8f87d bump fsfw 2022-05-24 16:23:00 +02:00
c0da8aef2e delete obsolete folder 2022-05-24 15:50:39 +02:00
59d0d880bb bump fsfw 2022-05-24 15:45:12 +02:00
3eb8525419 update changelog 2022-05-24 15:22:45 +02:00
3fff3ba21e add and schedule PUS11 2022-05-24 15:21:37 +02:00
3e9b337e31 changelog 2022-05-24 01:14:47 +02:00
633fe00cd6 run afmt, minor improvements 2022-05-24 01:14:04 +02:00
23d7b8f2fb repoint tmtc 2022-05-24 00:55:17 +02:00
d088d728b1 Merge branch 'mueller/reboot-cmd' of https://egit.irs.uni-stuttgart.de/eive/eive-obsw into mueller/reboot-cmd 2022-05-24 00:54:55 +02:00
237dd00216 Merge branch 'develop' into mueller/reboot-cmd 2022-05-24 00:54:49 +02:00
f7075a1397 Merge remote-tracking branch 'origin/develop' into mueller/reboot-cmd 2022-05-24 00:54:39 +02:00
2ebdb5c797 tweak sd card check countdown 2022-05-24 00:53:29 +02:00
1519b13b78 appears to work now 2022-05-24 00:52:08 +02:00
b2c286cd7e improve and optimize SD card handling 2022-05-24 00:20:23 +02:00
a1d2ec3db4 Merge remote-tracking branch 'origin/develop' into mueller/split-acu-hk 2022-05-23 22:24:28 +02:00
b66a91da2e Merge branch 'develop' into mueller/core-controller-remount-sd-handling 2022-05-23 21:32:27 +02:00
72305cc4c2 Merge pull request 'rtd bugfixes' () from mueller/rtd-bugfixes into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-23 19:36:13 +02:00
f111001572 bump tmtc 2022-05-23 18:59:31 +02:00
5df905182c these brackets are less confusing 2022-05-23 18:40:17 +02:00
2f155d8350 bump changelog 2022-05-23 18:39:13 +02:00
e9908139e7 Merge branch 'develop' into mueller/core-controller-remount-sd-handling 2022-05-23 18:37:50 +02:00
43269d4add Merge branch 'develop' into mueller/rtd-bugfixes 2022-05-23 18:37:40 +02:00
40b02aa46b Merge remote-tracking branch 'origin/develop' into mueller/split-acu-hk 2022-05-23 18:37:28 +02:00
7d9ef6f887 run afmt 2022-05-23 18:37:04 +02:00
a2fad6061a repoint tmtc 2022-05-23 18:36:38 +02:00
62ef9c7e70 set datapool entries of rad sensor valid 2022-05-23 18:25:39 +02:00
1f62d8284c Merge remote-tracking branch 'origin/develop' into mueller/split-acu-hk 2022-05-23 18:01:37 +02:00
a4de3e9eb1 Merge remote-tracking branch 'origin/develop' into mueller/rtd-bugfixes 2022-05-23 18:00:45 +02:00
cc008623b6 Merge pull request 'PLOC handler improvements' () from meier/ploc into develop
Reviewed-on: 
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-05-23 17:53:55 +02:00
10e075efaf update changelog 2022-05-23 17:52:44 +02:00
8aa664b49f rtd bugfixes 2022-05-23 17:50:54 +02:00
f18507d278 boot image select memory default argument 2022-05-23 17:05:06 +02:00
e365b36ecd tmtc update 2022-05-23 17:04:03 +02:00
990759fbc6 commented in core controller file write 2022-05-23 16:54:18 +02:00
d808a12c31 fixed conflicts 2022-05-23 16:53:20 +02:00
379c5f06ba supervisor command to continue interrupted mpsoc update 2022-05-23 16:43:46 +02:00
a2eabdce01 Merge pull request 'RTD Update' () from mueller/rtds-update into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-23 16:20:37 +02:00
01ca80fa30 bump submodules 2022-05-23 16:12:03 +02:00
660f0d2dcd some minor fixes 2022-05-23 14:19:57 +02:00
e522aadd44 set HKs valid 2022-05-23 14:04:46 +02:00
8ae6fe0be5 moved HK defs 2022-05-23 12:39:10 +02:00
fb5c6c4c17 continuation of failed mpsoc update 2022-05-23 12:05:42 +02:00
4e62f3b112 bugfixes for cp script 2022-05-23 11:35:55 +02:00
99e27a5a63 run afmt 2022-05-23 11:25:58 +02:00
3bdad61ac0 split ACU HK set 2022-05-23 10:42:57 +02:00
d960c371b9 bump submodules 2022-05-23 09:37:16 +02:00
c024756540 WIP extending thermal controller 2022-05-23 00:37:49 +02:00
dc6fa57c03 Merge branch 'develop' into mueller/core-controller-remount-sd-handling 2022-05-20 08:20:13 +02:00
49a06772d2 Merge remote-tracking branch 'origin/develop' into mueller/rtds-update 2022-05-20 08:18:57 +02:00
0119f3f8a6 Merge remote-tracking branch 'origin/develop' into mohr/thermal_controller 2022-05-19 23:15:39 +02:00
93cb07238a fixing task initialization (produced warnings) 2022-05-19 23:13:29 +02:00
2f8f5ce79b thermal controller is reading pt1000 values from datapool 2022-05-19 23:08:54 +02:00
4a0aa6443b dummy faking the PT1000 Temperature Sensors for host build 2022-05-19 23:06:56 +02:00
e9725e3093 gcc 12 complained... 2022-05-19 23:06:18 +02:00
79d3755c16 Merge pull request 'fixed for new SPI HAL API' () from mueller/fixes-for-spi-update into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-19 19:09:54 +02:00
a63e87f5f4 subscribe for periodic core ctrl packet 2022-05-19 18:46:49 +02:00
eb20dda221 small fix for yocto script 2022-05-19 17:52:46 +02:00
ef14fa3789 Merge remote-tracking branch 'origin/mueller/fixes-for-spi-update' into mohr/thermal_controller 2022-05-19 16:29:30 +02:00
e73bfc2c64 dev string for FM/EM 2022-05-19 16:00:26 +02:00
Uli
710bd58ee1 Merge branch 'develop' into mohr/thermal_controller 2022-05-19 15:31:13 +02:00
d274f5647d fix EM cofig 2022-05-19 15:28:02 +02:00
377f762ca5 fixed for new SPI HAL API 2022-05-19 14:54:44 +02:00
847aadc7bf update shell script helper to support EM installation 2022-05-19 14:48:16 +02:00
90a92feee1 some thermal controller code to test TM chain 2022-05-19 00:40:42 +02:00
e49a1af9b7 bump fsfw 2022-05-18 14:51:33 +02:00
cf49d98524 bump fsfw 2022-05-17 18:15:21 +02:00
28a4f782f9 Merge remote-tracking branch 'origin/develop' into mueller/rtds-update 2022-05-17 17:55:25 +02:00
8eaae461b4 Merge pull request 'apply new auto-formatter on all files' () from mueller/update-aformatters into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-17 14:53:20 +02:00
140bbcb7b8 Merge remote-tracking branch 'origin/develop' into mueller/rtds-update 2022-05-17 13:43:21 +02:00
d4dd75acae Merge remote-tracking branch 'origin/develop' into mueller/core-controller-remount-sd-handling 2022-05-17 13:42:08 +02:00
8a5090b8ee apply new auto-formatter on all files 2022-05-17 13:40:19 +02:00
e2cfce634b GenericFactory bugfix 2022-05-17 13:35:21 +02:00
8b875e13c5 repoint fsfw 2022-05-16 15:46:20 +02:00
7080758c67 Merge remote-tracking branch 'origin/develop' into mueller/core-controller-remount-sd-handling 2022-05-16 15:18:55 +02:00
a26b1bb311 Merge remote-tracking branch 'origin/develop' into mueller/rtds-update 2022-05-16 15:17:29 +02:00
5f165f666b Merge pull request 'PLOC Handler Improvements' () from meier/ploc into develop
Reviewed-on: 
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-05-16 15:12:28 +02:00
a6abeb697f comment 2022-05-16 15:09:02 +02:00
a92024a858 now supports auto mode as well 2022-05-14 17:32:33 +02:00
036024db7e perm loop not necessary anymore 2022-05-14 17:22:57 +02:00
e040f6b218 bump tmtc 2022-05-14 17:12:29 +02:00
f20fcd9a72 Merge remote-tracking branch 'origin/develop' into mueller/rtds-update 2022-05-14 17:07:27 +02:00
017cfb9d56 a lot of fixes, but some stuff doesnt work.. 2022-05-14 17:04:51 +02:00
2cfd2cc1fc switch to new dev handlers completely 2022-05-14 15:26:08 +02:00
478975db26 spi setup more stable now 2022-05-14 11:34:25 +02:00
1c9f411e75 new RTD handler working 2022-05-14 09:41:28 +02:00
d60e7a706a fixed conflicts 2022-05-13 18:44:52 +02:00
45f34df6b9 Merge branch 'develop' of https://egit.irs.uni-stuttgart.de/eive/eive-obsw into develop 2022-05-13 18:38:26 +02:00
4cbe732087 Merge pull request 'Heater Health IF' () from mueller/heater-health-if into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-13 18:38:12 +02:00
54d7392467 improved mpsoc update handling 2022-05-13 18:37:16 +02:00
8715683d6b enable periodic reply for eie RTD 2022-05-13 17:25:06 +02:00
2c684643b3 some smaller fixed for new rtd handler 2022-05-13 16:29:57 +02:00
b12a634b81 typo 2022-05-13 15:16:48 +02:00
3ae1812c32 some renaming 2022-05-13 15:16:10 +02:00
80eeebfaf5 Merge remote-tracking branch 'origin/develop' into mueller/core-controller-remount-sd-handling 2022-05-13 11:21:06 +02:00
e6ec6bcfa4 Merge remote-tracking branch 'origin/develop' into mueller/reboot-cmd 2022-05-13 11:15:09 +02:00
bb397a58de event with packet number for which mpsoc update failed 2022-05-13 10:47:10 +02:00
44e7f06c2e shorter debug string 2022-05-13 10:33:35 +02:00
f3b473ea99 some more rtd tweaks 2022-05-13 10:27:26 +02:00
706e3d458b switch to direct handler again 2022-05-13 10:13:16 +02:00
d999f57fef apply afmt 2022-05-13 10:10:56 +02:00
6b54a4dea9 cleaning up, better fault status handling 2022-05-13 10:10:02 +02:00
fd0de9426f Merge remote-tracking branch 'origin/develop' into mueller/rtds-update 2022-05-13 09:51:22 +02:00
bf7acf83ff update .cproject file 2022-05-13 09:51:11 +02:00
23f37e19af bump fsfw 2022-05-13 09:39:49 +02:00
b5821ec6dc changelog update 2022-05-13 09:35:47 +02:00
be1c26ddf7 rtd testing 2022-05-13 01:17:23 +02:00
da4d3e4891 update changelog 2022-05-12 20:47:19 +02:00
ac34bcbb3d Merge remote-tracking branch 'origin/develop' into mueller/heater-health-if 2022-05-12 20:46:00 +02:00
e81ddaa1a5 added auto-shutdown for faulty heaters 2022-05-12 20:44:36 +02:00
21ba8c95ff additional parameter to identify cmd source 2022-05-12 20:12:01 +02:00
e25c492aa4 create and schedule health PUS service 2022-05-12 19:22:20 +02:00
82f75bde97 fix for heater creation call 2022-05-12 19:12:12 +02:00
919141ae10 ccsds handler sending command to enable transmitter 2022-05-12 18:32:19 +02:00
e48aa64766 repoint fsfw 2022-05-12 17:48:18 +02:00
3c3884476b Merge branch 'develop' into meier/ccsds 2022-05-12 15:57:26 +02:00
569754bdad Merge branch 'develop' into meier/ploc 2022-05-12 15:48:56 +02:00
5fe814e972 Merge remote-tracking branch 'origin/develop' into mueller/rtds-update 2022-05-12 15:48:26 +02:00
06219744ea Merge branch 'meier/ploc' of https://egit.irs.uni-stuttgart.de/eive/eive-obsw into meier/ploc 2022-05-12 15:47:16 +02:00
9db58210b8 Merge branch 'develop' into meier/ploc 2022-05-12 15:47:06 +02:00
ee99c3312e Merge pull request 'Update EIVE OBSW' () from mueller/update-eive-obsw into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-12 15:34:07 +02:00
3a6beafae5 commented time file writing in again 2022-05-12 15:31:52 +02:00
d7316eff66 remove merge conflict markers 2022-05-12 14:23:10 +02:00
51466e68d7 Merge remote-tracking branch 'origin/develop' into mueller/heater-health-if 2022-05-12 14:11:46 +02:00
e6f55ba2c1 increased execution timeout of prepare update command 2022-05-12 14:04:55 +02:00
c1faf65409 schedule new rtd reader component 2022-05-12 12:35:05 +02:00
382d93863f create and pass correct comIF 2022-05-12 12:21:47 +02:00
a173ef4308 create low level rtd handler in obj factory 2022-05-12 12:12:47 +02:00
6b9e49e632 continued low level MAX31865 handler 2022-05-12 11:27:30 +02:00
0dd0af73a1 change in mpsoc status codes 2022-05-12 10:50:12 +02:00
23f209fb07 added eive specific max31865 handler 2022-05-12 09:48:41 +02:00
e5710784b9 Merge branch 'develop' into meier/ccsds 2022-05-12 07:47:28 +02:00
56f491befb compile fix 2022-05-12 00:48:49 +02:00
93f605bc0a Merge remote-tracking branch 'origin/develop' into mueller/rtds-update 2022-05-12 00:45:57 +02:00
d1d365c76d bump tmtc again 2022-05-11 18:00:11 +02:00
38d03dbe57 bump deps, regenerate translation files 2022-05-11 17:59:08 +02:00
af52b90abe fsfwgen update 2022-05-11 17:16:40 +02:00
a315a8b529 fixed conflicts 2022-05-11 17:08:44 +02:00
5f96d157a7 repoint fsfw 2022-05-11 17:04:31 +02:00
c1992f59d6 Merge remote-tracking branch 'origin/develop' into mueller/reboot-cmd 2022-05-11 17:04:19 +02:00
658acb0554 Merge pull request 'RW Assembly' () from mueller/rw-ass into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-11 17:03:32 +02:00
5a82fe93d9 core ctrl remount sd handling 2022-05-11 17:02:57 +02:00
8a90f0025b commented in time file write 2022-05-11 17:01:03 +02:00
beba258a77 update fsfw 2022-05-11 16:57:23 +02:00
c7e2cc22af init sequence count 2022-05-11 16:49:07 +02:00
835a10e538 sequence count init 2022-05-11 16:11:17 +02:00
1d1f04f57b Merge branch 'develop' into mueller/reboot-cmd 2022-05-11 15:48:34 +02:00
625abcfd5b important bugfixes 2022-05-11 15:45:38 +02:00
914acd9925 fixed conflicts 2022-05-11 14:37:36 +02:00
c7e4704234 fixed merge conflict 2022-05-11 14:36:23 +02:00
c5bccb661e Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-05-11 13:54:04 +02:00
37002b47b3 sequence count init value 2022-05-11 12:46:04 +02:00
c043375ae3 RW Refactoring
- FSFW update: SPI device is part of ComIF now
- Only set RW mode (speed is set a side effect but not necessary) once
- Release SPI bus in the 70 ms delay duration
2022-05-11 11:13:00 +02:00
62c885e1de re-point tmtc 2022-05-11 10:17:49 +02:00
cf98d446f9 Merge branch 'develop' into mueller/rw-ass 2022-05-11 10:11:55 +02:00
96710159b8 added missing eclipse instructions 2022-05-11 10:09:58 +02:00
17802aaa55 fix images in README 2022-05-11 10:07:19 +02:00
f5b1427c38 fix images in README 2022-05-11 10:06:56 +02:00
543ec5dfff Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-05-11 10:05:23 +02:00
3924430ea7 update .cproject file again 2022-05-11 10:04:25 +02:00
4120befef0 update changelog 2022-05-11 01:50:49 +02:00
91b69eacf6 A lot of stuff
- refactored and simplified RW assemblies
- create separate SPI Com IF for RWs
- Update .cproject file: Fixed to decrease indexer parsing times
2022-05-11 01:48:26 +02:00
df7e0007d0 schedule RW ASS 2022-05-11 01:02:29 +02:00
95fd3238e7 another .cproject update 2022-05-11 01:00:21 +02:00
8ccd55dd06 update .cproject file 2022-05-11 00:58:19 +02:00
7e87bd713d Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-05-11 00:54:37 +02:00
4e78ee85c8 continued rw ass creation 2022-05-11 00:54:29 +02:00
cb8f0e61be Merge pull request 'Init ACS Test files' () from mueller/acs-test-init into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-11 00:54:00 +02:00
1904cc168d catch exceptions 2022-05-11 00:42:32 +02:00
924f114fb3 sth crashes CI.. 2022-05-11 00:36:31 +02:00
604dbea372 Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-05-11 00:28:57 +02:00
ca640ea18f hmm 2022-05-11 00:24:58 +02:00
491736335b Merge remote-tracking branch 'origin/develop' into mueller/acs-test-init 2022-05-11 00:19:40 +02:00
de0872072f Merge pull request 'Add yocto helper scripts' () from mueller/yocto-helper-scripts into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-10 18:45:54 +02:00
db7dcc7e32 start creating rw ass in obj factory 2022-05-10 18:39:23 +02:00
75d19790b8 another .cproject file update 2022-05-10 18:36:00 +02:00
1893e87f5f update .cproject file again 2022-05-10 18:35:44 +02:00
b021590103 update .cproject file 2022-05-10 18:35:03 +02:00
45c1ac0f61 update 2022-05-10 18:34:39 +02:00
0bd20ac9fd init acs test files 2022-05-10 17:49:10 +02:00
9d63eb837a added void cast 2022-05-10 17:02:40 +02:00
49d21fef2a Merge branch 'develop' into meier/ccsds 2022-05-10 07:49:05 +02:00
907b8f4a5d ccsds config for te0720-1cfa 2022-05-10 07:48:36 +02:00
50c363fb6f new RTD reader module handling all RTD SPI Communication 2022-05-09 21:29:54 +02:00
4864394590 renamed heaters 2022-05-09 16:13:33 +02:00
71d9553f90 Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-05-08 13:11:56 +02:00
646925c571 removed redundant SUS OBJ ID defs 2022-05-08 13:08:49 +02:00
d9085e81a1 Merge remote-tracking branch 'origin/develop' into mueller/heater-health-if 2022-05-08 13:06:47 +02:00
54a36ac275 added back deleted part 2022-05-08 12:57:24 +02:00
e59026d87c update README 2022-05-08 12:55:17 +02:00
7de968937e repoint tmtc 2022-05-08 12:33:49 +02:00
a66632c040 Merge remote-tracking branch 'origin/develop' into mueller/yocto-helper-scripts 2022-05-08 12:33:17 +02:00
9f9fa9b41b Merge pull request 'PLOC Handler Update' () from meier/plocSupv into develop
Reviewed-on: 
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-05-08 12:32:47 +02:00
421237bfb7 fixed ploc supervisor build error which was hidden by prerocessor define 2022-05-08 12:01:35 +02:00
37e81d34c9 Merge branch 'develop' into mueller/heater-health-if 2022-05-07 22:50:13 +02:00
1fea619ac0 Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-05-07 22:44:23 +02:00
2bc2325b1f removed unused includes 2022-05-07 13:59:53 +02:00
d9024b6c22 adaption in DummyGpioIF due to API change in GpioIF 2022-05-07 13:50:36 +02:00
f8addd9365 preprocessor define fixes 2022-05-07 13:38:09 +02:00
2ff8923c81 fixed reorder warning in imtq handler 2022-05-07 13:19:59 +02:00
a4e36ebdb6 update changelog 2022-05-07 12:55:48 +02:00
9884ea225e update CHANGELOG 2022-05-07 12:54:25 +02:00
3cca73ae9f update other helper scripts as well 2022-05-07 12:51:47 +02:00
631bc61d6c changed set ids 2022-05-07 12:01:05 +02:00
43b0ed4b04 preprocessor define adjustments 2022-05-06 20:33:46 +02:00
d9c7cccf76 run clang format script 2022-05-06 19:53:33 +02:00
322db3d617 removed ploc updater 2022-05-06 19:52:43 +02:00
6dd57a3f5e fixed merge conflicts 2022-05-06 19:44:18 +02:00
4ba26f057d Merge branch 'meier/ploc' into meier/plocSupv 2022-05-06 19:36:03 +02:00
97222cafd9 increased mram dump execution timeout 2022-05-06 19:34:12 +02:00
cbb3c92885 tmtc update 2022-05-06 19:31:09 +02:00
132751893b bugfix in missed reply hanling of supervsior MRAM dump 2022-05-06 19:30:20 +02:00
a5a79da723 install non-stripped files now 2022-05-06 16:47:09 +02:00
7ab0a3683c this works better 2022-05-06 16:46:22 +02:00
08dc8630d6 create generic OBSW by default and copy to unique 2022-05-06 16:43:12 +02:00
cc25489e75 important bugfix 2022-05-06 15:54:45 +02:00
e4bbdbc532 copy version file as well 2022-05-06 15:53:16 +02:00
2f182a5e21 docs 2022-05-06 15:41:29 +02:00
bacce95881 corrections for install script 2022-05-06 15:38:50 +02:00
9383a6088b build script bugfixes 2022-05-06 15:33:05 +02:00
338cb9d502 Merge remote-tracking branch 'origin/develop' into mueller/yocto-helper-scripts 2022-05-06 15:29:25 +02:00
fe4315666b added helper script for yocto installation
- Installs compiled binaries into yocto repo for rootfs rebuild
2022-05-06 15:27:56 +02:00
576f71304c updated eclipse launch files 2022-05-06 10:45:53 +02:00
385d8df466 fix .cproject file 2022-05-06 10:43:04 +02:00
bfd7d9d82d bump fsfw (hotfix) 2022-05-06 10:37:54 +02:00
e6cbe3068d Merge branch 'develop' into mueller/heater-health-if 2022-05-06 10:12:23 +02:00
99a8cd0f2d Merge branch 'develop' into mueller/reboot-cmd 2022-05-06 10:11:58 +02:00
1c2f80f48e Merge branch 'develop' into mueller/rw-ass 2022-05-06 10:11:32 +02:00
9918aae94a Merge pull request 'install Catch2 for CI/CD' () from mueller/install-catch2-docker into develop
Reviewed-on: 
Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
2022-05-06 10:00:12 +02:00
22060b9b16 Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-05-06 01:12:07 +02:00
68938c3b42 remove duplicate object ID 2022-05-05 20:27:20 +02:00
a11a8c493d Merge remote-tracking branch 'origin/develop' into mueller/heater-health-if 2022-05-05 19:53:18 +02:00
5c7c5b468a tmtc update 2022-05-05 19:21:42 +02:00
fabd81365b supervisor do startup set time 2022-05-05 19:20:14 +02:00
5911ca79b5 nvm enable command 2022-05-05 19:18:39 +02:00
cf4edac604 maybe this fixes the timing issue? 2022-05-05 16:32:09 +02:00
c1dc5846cd bump submodules 2022-05-05 16:24:23 +02:00
4c809e354d better heater obj id names 2022-05-05 16:23:46 +02:00
1f6aab8124 apply afmt, some more renaming 2022-05-05 13:40:43 +02:00
590fe6ca39 Some RW improvements
- Moved Events to definitions file
- Added new event if reset occurs
- Deliver state if there is an error (going to be 0, still deliver it)
2022-05-05 12:48:56 +02:00
9bd5595999 no time command sent during startup of supervisor 2022-05-05 10:50:23 +02:00
e5fdf23dd7 tmtc update 2022-05-05 09:15:05 +02:00
8832d06d03 improvements for mram dump 2022-05-05 08:55:45 +02:00
28c9e33d1c separate PST for RWs 2022-05-05 02:00:56 +02:00
95a634ea7f update .cproject file 2022-05-05 01:33:18 +02:00
3a0cf0cb38 Merge branch 'develop' into mueller/rw-ass 2022-05-05 00:51:30 +02:00
e4ebd87875 Merge branch 'develop' into mueller/reboot-cmd 2022-05-05 00:51:11 +02:00
bcb6df87b0 update tmtc, gen files and formatting in config file 2022-05-05 00:47:50 +02:00
5441520369 tmtc update 2022-05-04 19:11:01 +02:00
8aacbc2b40 cam cmd reply handling 2022-05-04 19:08:37 +02:00
79d48d9630 Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-05-04 17:25:11 +02:00
9c888e75bc bump tmtc again 2022-05-04 17:23:56 +02:00
0d15694fc3 Merge remote-tracking branch 'origin/develop' into mueller/heater-health-if 2022-05-04 17:23:34 +02:00
be7cab6032 Merge remote-tracking branch 'origin/develop' into mueller/reboot-cmd 2022-05-04 17:22:19 +02:00
d108f7bbda Merge remote-tracking branch 'origin/develop' into mueller/reboot-cmd 2022-05-04 16:54:39 +02:00
3458c272ad Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-05-04 16:47:49 +02:00
73e4b0cc81 bump tmtc 2022-05-04 16:38:02 +02:00
4311c5b6a7 Merge remote-tracking branch 'origin/develop' into mueller/heater-health-if 2022-05-04 16:37:53 +02:00
d59e71b056 Merge remote-tracking branch 'origin/develop' into mueller/heater-health-if 2022-05-04 16:37:47 +02:00
a3e33bb627 Merge remote-tracking branch 'origin/develop' into mueller/heater-health-if 2022-05-04 14:37:36 +02:00
92f95b2b97 comment out debug printout 2022-05-04 13:25:42 +02:00
475f6f1687 removed unused ploc commands, fix in logging report reply 2022-05-04 12:49:43 +02:00
d0e18f8b35 add mutex protections for switcher states 2022-05-04 11:11:29 +02:00
86dd67bf06 bump fsfw 2022-05-04 10:36:45 +02:00
50ca378318 update for updated gpio API 2022-05-04 10:34:11 +02:00
5f5c996cfd bump tmtc IF 2022-05-04 09:26:11 +02:00
1536a0f94b named heaters 2022-05-03 18:17:10 +02:00
d79323c6ca small fix for generic factory header 2022-05-03 17:45:39 +02:00
ae0120f3ef Merge branch 'mueller/refactoring-conf-handling' into mueller/heater-health-if 2022-05-03 17:44:02 +02:00
8f9e8fe3fb ignore new build folder name 2022-05-03 17:39:02 +02:00
bc28ae4d1f bump submodules 2022-05-03 17:38:37 +02:00
2470039dfb Merge remote-tracking branch 'origin/develop' into mueller/heater-health-if 2022-05-03 17:38:10 +02:00
06df558be0 Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-05-03 16:01:09 +02:00
88842d4f07 Merge remote-tracking branch 'origin/develop' into mueller/heater-health-if 2022-05-03 15:59:28 +02:00
5380ed216b supervisor do startup fix 2022-05-03 15:36:38 +02:00
70884d3a46 tmtc update 2022-05-03 15:28:11 +02:00
464821cc6f supervisor set time during start up 2022-05-03 14:59:23 +02:00
0172351e89 additional try catch block 2022-05-02 22:58:06 +02:00
1f8a68dabe re-use existing enum 2022-05-02 22:55:39 +02:00
9449919b2b Heaters are own objects with HealthIF now 2022-05-02 22:45:27 +02:00
b98c691c2b added health helper to heater handler 2022-05-02 17:51:00 +02:00
238afbaa8b add health IF to heater handler 2022-05-02 17:37:00 +02:00
0abb726b30 bump submodules 2022-05-02 16:15:43 +02:00
a54d89c90f Merge branch 'develop' into mueller/rw-ass 2022-05-02 15:55:41 +02:00
7a6b45b102 removed debug print 2022-05-02 14:43:53 +02:00
d1a9924acc tmtc update 2022-05-02 14:43:17 +02:00
690b41777b bugfix pcdu handler command queue reading 2022-05-02 13:48:34 +02:00
3c858d26f1 tmtc update 2022-05-02 13:47:59 +02:00
eb6b166662 bump fsfw 2022-05-02 12:56:42 +02:00
3a52540d0e bump tmtc 2022-05-02 12:53:43 +02:00
bab8412f10 Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-05-02 12:41:45 +02:00
9e2eca3e36 re-generate event list 2022-05-02 12:41:20 +02:00
49b0825f63 added doSendReadHook to prevent com if polling when com if is used by helper task 2022-05-02 09:56:15 +02:00
be752997eb fixed merge conflicts 2022-04-30 19:12:21 +02:00
3ff709a814 removed changes can rx task 2022-04-30 16:52:22 +02:00
03b7b802c5 removed ptme test data sending 2022-04-30 16:33:34 +02:00
20138d52b1 decreased stack size of supervisor helper task 2022-04-30 16:23:51 +02:00
6d322c6e78 run clang format script 2022-04-30 16:21:59 +02:00
016ca8cb7e decreased acs handler task stack size 2022-04-30 16:20:33 +02:00
729b8f547c time file writing commended in again 2022-04-30 16:19:00 +02:00
6636f42dc2 tmtc update 2022-04-30 15:34:28 +02:00
cf4305be55 tmtc update 2022-04-30 11:10:56 +02:00
e1ffa97232 improved acknowledgment and execution handling in supervisor handler 2022-04-30 11:08:36 +02:00
6524f924c9 run generator scripts 2022-04-30 09:53:42 +02:00
6f53c39485 fix conflict 2022-04-30 09:28:22 +02:00
8ecbeb058c tmtc update 2022-04-30 09:26:55 +02:00
1635e40c79 tmtc update 2022-04-29 23:36:09 +02:00
816dc43214 restructuring execution report handling 2022-04-29 23:34:28 +02:00
7afb8e9070 execution status codes 2022-04-29 23:22:44 +02:00
cedc6bec23 gpio state sent with execution report 2022-04-29 22:55:01 +02:00
cf20d8e94d commented in time file writing again 2022-04-29 18:23:31 +02:00
02f352e51f tmtc update 2022-04-29 18:22:03 +02:00
9d4cb2ea8d xecution status code parsing 2022-04-29 13:31:58 +02:00
5888d90fbc continued reboot command 2022-04-29 11:16:53 +02:00
fe28588875 repoint tmtc submodule 2022-04-29 10:56:43 +02:00
bf281343c6 fixed conflicts 2022-04-29 09:04:49 +02:00
73c653d21d execution status code wip 2022-04-29 09:03:13 +02:00
09fc8babc4 fsfw update 2022-04-29 08:35:06 +02:00
f0884c0096 read gpio tm handling 2022-04-29 08:34:23 +02:00
0b64999ce2 added generic GPIO checker 2022-04-28 18:38:38 +02:00
7c770b5aec fixed conflicts 2022-04-28 18:33:27 +02:00
794ed04761 prevent sending boot command when mpsoc booted via jtag 2022-04-28 18:30:40 +02:00
73fbdfeb25 remove etl::pair usage 2022-04-28 18:27:40 +02:00
31fa2f0d8d include fix 2022-04-28 18:27:13 +02:00
1527b60fd6 Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-04-28 18:26:34 +02:00
e18661bb59 update fsfw 2022-04-28 14:30:35 +02:00
582d2db05f fixed conflicts 2022-04-28 14:29:23 +02:00
4f72fb355c update fsfwgen 2022-04-28 13:08:44 +02:00
ca1365df5b Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-04-28 13:08:34 +02:00
898753f6e3 supervisor reset pl command 2022-04-28 11:27:28 +02:00
7682a1d214 fixed conflicts 2022-04-27 16:56:16 +02:00
7543a92dd9 added test code 2022-04-27 16:44:03 +02:00
20a2aa73ae tmtc update 2022-04-27 16:09:07 +02:00
8610e48b19 countdown based timeout 2022-04-27 16:08:17 +02:00
42194abb4a commented in read function again 2022-04-25 13:36:30 +02:00
3e8429b34b warning print when memory check command fails 2022-04-25 13:36:06 +02:00
311ec7b194 mpsoc shutdown after running update procedure 2022-04-25 11:03:02 +02:00
6876952bbd regenerated events 2022-04-24 12:34:08 +02:00
6bdb13b6a0 submodule update 2022-04-23 12:37:40 +02:00
9f3a56e5e6 Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-04-23 12:37:25 +02:00
9301206485 fixes identified during tests 2022-04-22 18:05:03 +02:00
ce41e4c219 tmtc update 2022-04-22 14:21:41 +02:00
4a2ba043cb fixed conflicts 2022-04-22 14:20:17 +02:00
b63c3bb9c3 increased delay cycles of execution report 2022-04-22 14:17:16 +02:00
8b612d9116 include fix 2022-04-22 14:16:40 +02:00
974ff0a13e make RW handler more generic 2022-04-22 11:29:51 +02:00
d29dd48d1e update project file: changed default unix sysroot 2022-04-22 11:18:10 +02:00
1069762903 update config.h.in file 2022-04-22 11:11:04 +02:00
88249cd5be update changelog 2022-04-22 11:07:40 +02:00
165a4ef814 continued RW Assembly 2022-04-22 10:28:29 +02:00
3fbebd6a9f Merge remote-tracking branch 'origin/develop' into mueller/rw-ass 2022-04-22 10:28:14 +02:00
2ee9b09b27 logging command 2022-04-22 08:55:57 +02:00
a8f5a4054f Merge branch 'develop' into meier/plocSupvUpdate 2022-04-21 17:34:26 +02:00
afc0f37e8a rw assembly 2022-04-21 16:56:46 +02:00
23b2d895bb submodule updates 2022-04-21 16:40:28 +02:00
836a2327f9 tmtc update 2022-04-21 16:31:14 +02:00
cf37d74728 adc report 2022-04-21 16:30:23 +02:00
0bcb332ce9 tmtc update 2022-04-21 14:26:46 +02:00
52c539bc6b fsfw update 2022-04-21 14:26:15 +02:00
4895f940f3 tmtc update 2022-04-19 14:26:21 +02:00
ffd64d0463 improvements in supervisor helper 2022-04-19 13:33:37 +02:00
1ce45acba3 merged develop 2022-04-17 14:52:43 +02:00
7b54855397 supervisor fixes detected during testing 2022-04-16 17:19:32 +02:00
285ec9be6a tmtc update 2022-04-14 07:53:44 +02:00
10343a0dab supervisor event buffer request 2022-04-14 07:52:21 +02:00
f679461164 tmtc update 2022-04-13 15:31:54 +02:00
bd8cd49117 event buffer request wip 2022-04-13 11:56:37 +02:00
7f51ffc8fb use structs instead of classes 2022-04-12 17:42:41 +02:00
0fba1b6494 tmtc update 2022-04-11 16:53:38 +02:00
05a85ab8a1 implemeted ICD changes 2022-04-11 16:52:50 +02:00
b440fc3df6 ploc update 2022-04-10 18:46:39 +02:00
dbe4f70d8e Merge branch 'meier/plocSupv' into meier/plocSupvUpdate 2022-04-07 12:26:30 +02:00
c0fd9aee6f update helper wip 2022-04-07 11:00:07 +02:00
df2295b430 tmtc update 2022-04-06 17:53:23 +02:00
d51a73f15b tmtc update 2022-04-06 17:51:31 +02:00
3f6a534db5 fixes identified during tests 2022-04-06 17:27:44 +02:00
f058cf5e31 supervisor udpate wip 2022-04-06 08:36:34 +02:00
9837a1b62c changes in supervisor commands 2022-04-06 07:10:20 +02:00
258 changed files with 11340 additions and 6749 deletions
.gitmodulesCHANGELOG.mdCMakeLists.txtREADME.md
bsp_egse
bsp_hosted
bsp_linux_board
bsp_q7s
bsp_te0720_1cfa
cmake
common/config
dummies
fsfw
generators
linux
misc/eclipse
mission
scripts
test
thirdparty
tmtc
unittest

5
.gitmodules vendored

@ -11,7 +11,7 @@
path = thirdparty/lwgps path = thirdparty/lwgps
url = https://github.com/rmspacefish/lwgps.git url = https://github.com/rmspacefish/lwgps.git
[submodule "generators/fsfwgen"] [submodule "generators/fsfwgen"]
path = generators/fsfwgen path = generators/deps/fsfwgen
url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw-gen.git url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw-gen.git
[submodule "thirdparty/arcsec_star_tracker"] [submodule "thirdparty/arcsec_star_tracker"]
path = thirdparty/arcsec_star_tracker path = thirdparty/arcsec_star_tracker
@ -19,3 +19,6 @@
[submodule "thirdparty/json"] [submodule "thirdparty/json"]
path = thirdparty/json path = thirdparty/json
url = https://github.com/nlohmann/json.git url = https://github.com/nlohmann/json.git
[submodule "thirdparty/rapidcsv"]
path = thirdparty/rapidcsv
url = https://github.com/d99kris/rapidcsv.git

@ -10,10 +10,56 @@ list yields a list of all related PRs for each release.
# [unreleased] # [unreleased]
# [v1.12.0] # [v1.12.1] 05.07.2022
- Disable periodic TCS controller HK generation by default
# [v1.12.0] 04.07.2022
## Added
- Dummy components to run OBSW without relying on external hardware
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/266
- Basic Thermal Controller
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/266
- PUS11 TC scheduler
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/259
- Regular reboot command
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/242
- Commands for individual RTD devices
PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/84
- `RwAssembly` added to system components. Assembly works in principle,
issues making 4 consecutives RWs communicate at once..
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/224
- Adds a yocto helper script which is able to install the release build binaries
(OBSW and Watchdog) into the `q7s-yocto` repository as long as the `q7s-package`
or `q7s-yocto` repo was cloned in the same directory the EIVE OBSW repo.
This makes updating the root filesystem a lot easier. It also creates and installs a
version file.
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/248
- Create the generic image by default for the Q7S build. The unique binary with the
username appended at the end is created as a side-product now
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/248
## Fixed
- `q7s-cp.py` bugfix
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/256
- Generator scripts output now produce platform-independent artifacts
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/267
### Heater
- Adds `HealthIF` to heaters. Heaters are own system object with queues now which allows to set them faulty.
- SW will attempt to shut down heaters which are on but marked faulty
- Some simplifications for `HeaterHandler`, use `std::vector` instead of `std::unordered_map` for primary container. Using the heater indexes 0 to 7 allows to use natural array indexing
- Some additional input sanity checks in `executeAction`
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/236
## Changed ## Changed
- CCSDS handler improvements
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/268
- Build unittest as default side product of hosted builds - Build unittest as default side product of hosted builds
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/244 PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/244
- Let CI/CD build host build and run unittest side product in same step - Let CI/CD build host build and run unittest side product in same step

@ -1,12 +1,12 @@
################################################################################ # ##############################################################################
# CMake support for the EIVE OBSW # CMake support for the EIVE OBSW
# #
# Author: R. Mueller # Author: R. Mueller
################################################################################ # ##############################################################################
################################################################################ # ##############################################################################
# Pre-Project preparation # Pre-Project preparation
################################################################################ # ##############################################################################
cmake_minimum_required(VERSION 3.13) cmake_minimum_required(VERSION 3.13)
set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0) set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0)
@ -15,28 +15,36 @@ set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0)
# set(CMAKE_VERBOSE TRUE) # set(CMAKE_VERBOSE TRUE)
option(EIVE_HARDCODED_TOOLCHAIN_FILE "\ option(
EIVE_HARDCODED_TOOLCHAIN_FILE
"\
For Linux Board Target BSPs, a default toolchain file will be set. Should be set to OFF \ For Linux Board Target BSPs, a default toolchain file will be set. Should be set to OFF \
if a different toolchain file is set externally" ON if a different toolchain file is set externally"
) ON)
if(NOT FSFW_OSAL) if(NOT FSFW_OSAL)
set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.") set(FSFW_OSAL
linux
CACHE STRING "OS for the FSFW.")
endif() endif()
if(TGT_BSP) if(TGT_BSP)
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack") if(TGT_BSP MATCHES "arm/q7s"
option(LINUX_CROSS_COMPILE ON) OR TGT_BSP MATCHES "arm/raspberrypi"
endif() OR TGT_BSP MATCHES "arm/beagleboneblack")
if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack") option(LINUX_CROSS_COMPILE ON)
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" OFF) endif()
elseif(TGT_BSP MATCHES "arm/q7s") if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
option(EIVE_Q7S_EM "Build configuration for the EM" OFF) option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" OFF)
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" ON) elseif(TGT_BSP MATCHES "arm/q7s")
endif() option(EIVE_Q7S_EM "Build configuration for the EM" OFF)
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON) option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" ON)
endif()
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name"
ON)
else() else()
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" OFF) option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name"
OFF)
endif() endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@ -56,61 +64,99 @@ include(EiveHelpers)
option(EIVE_ADD_ETL_LIB "Add ETL library" ON) option(EIVE_ADD_ETL_LIB "Add ETL library" ON)
option(EIVE_ADD_JSON_LIB "Add JSON library" ON) option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
if(EIVE_Q7S_EM) set(OBSW_MAX_SCHEDULED_TCS 500)
set(OBSW_Q7S_EM 1 CACHE STRING "Q7S EM configuration")
set(INIT_VAL 0)
else()
set(OBSW_Q7S_EM 0 CACHE STRING "Q7S EM configuration")
set(INIT_VAL 1)
endif()
set(OBSW_ADD_MGT ${INIT_VAL} CACHE STRING "Add MGT module" )
set(OBSW_ADD_BPX_BATTERY_HANDLER ${INIT_VAL} CACHE STRING "Add MGT module")
set(OBSW_ADD_STAR_TRACKER ${INIT_VAL} CACHE STRING "Add Startracker module")
set(OBSW_ADD_SUN_SENSORS ${INIT_VAL} CACHE STRING "Add sun sensor module")
set(OBSW_ADD_SUS_BOARD_ASS ${INIT_VAL} CACHE STRING "Add sun sensor board assembly")
set(OBSW_ADD_ACS_BOARD ${INIT_VAL} CACHE STRING "Add ACS board module")
set(OBSW_ADD_ACS_HANDLERS ${INIT_VAL} CACHE STRING "Add ACS handlers")
set(OBSW_ADD_RTD_DEVICES ${INIT_VAL} CACHE STRING "Add RTD devices")
set(OBSW_ADD_RAD_SENSORS ${INIT_VAL} CACHE STRING "Add Rad Sensor module")
set(OBSW_ADD_PL_PCDU ${INIT_VAL} CACHE STRING "Add Payload PCDU modukle")
set(OBSW_ADD_SYRLINKS ${INIT_VAL} CACHE STRING "Add Syrlinks module")
set(OBSW_ADD_TMP_DEVICES ${INIT_VAL} CACHE STRING "Add TMP devices")
set(OBSW_ADD_GOMSPACE_PCDU ${INIT_VAL} CACHE STRING "Add GomSpace PCDU modules")
set(OBSW_ADD_RW ${INIT_VAL} CACHE STRING "Add RW modules")
################################################################################ if(EIVE_Q7S_EM)
set(OBSW_Q7S_EM
1
CACHE STRING "Q7S EM configuration")
set(INIT_VAL 0)
else()
set(OBSW_Q7S_EM
0
CACHE STRING "Q7S EM configuration")
set(INIT_VAL 1)
endif()
set(OBSW_ADD_MGT
${INIT_VAL}
CACHE STRING "Add MGT module")
set(OBSW_ADD_BPX_BATTERY_HANDLER
${INIT_VAL}
CACHE STRING "Add MGT module")
set(OBSW_ADD_STAR_TRACKER
${INIT_VAL}
CACHE STRING "Add Startracker module")
set(OBSW_ADD_SUN_SENSORS
${INIT_VAL}
CACHE STRING "Add sun sensor module")
set(OBSW_ADD_SUS_BOARD_ASS
${INIT_VAL}
CACHE STRING "Add sun sensor board assembly")
set(OBSW_ADD_ACS_BOARD
${INIT_VAL}
CACHE STRING "Add ACS board module")
set(OBSW_ADD_ACS_HANDLERS
${INIT_VAL}
CACHE STRING "Add ACS handlers")
set(OBSW_ADD_RTD_DEVICES
${INIT_VAL}
CACHE STRING "Add RTD devices")
set(OBSW_ADD_RAD_SENSORS
${INIT_VAL}
CACHE STRING "Add Rad Sensor module")
set(OBSW_ADD_PL_PCDU
${INIT_VAL}
CACHE STRING "Add Payload PCDU modukle")
set(OBSW_ADD_SYRLINKS
${INIT_VAL}
CACHE STRING "Add Syrlinks module")
set(OBSW_ADD_TMP_DEVICES
${INIT_VAL}
CACHE STRING "Add TMP devices")
set(OBSW_ADD_GOMSPACE_PCDU
${INIT_VAL}
CACHE STRING "Add GomSpace PCDU modules")
set(OBSW_ADD_RW
${INIT_VAL}
CACHE STRING "Add RW modules")
# ##############################################################################
# Pre-Sources preparation # Pre-Sources preparation
################################################################################ # ##############################################################################
# Version handling # Version handling
set(GIT_VER_HANDLING_OK FALSE) set(GIT_VER_HANDLING_OK FALSE)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
determine_version_with_git("--exclude" "docker_*") determine_version_with_git("--exclude" "docker_*")
set(GIT_INFO ${GIT_INFO} CACHE STRING "Version information retrieved with git describe") set(GIT_INFO
if(GIT_INFO) ${GIT_INFO}
set(GIT_INFO ${GIT_INFO} CACHE STRING "Version information retrieved with git describe") CACHE STRING "Version information retrieved with git describe")
list(GET GIT_INFO 1 OBSW_VERSION_MAJOR) if(GIT_INFO)
list(GET GIT_INFO 2 OBSW_VERSION_MINOR) set(GIT_INFO
list(GET GIT_INFO 3 OBSW_VERSION_REVISION) ${GIT_INFO}
list(GET GIT_INFO 4 OBSW_VERSION_CST_GIT_SHA1) CACHE STRING "Version information retrieved with git describe")
if(NOT OBSW_VERSION_MAJOR) list(GET GIT_INFO 1 OBSW_VERSION_MAJOR)
set(OBSW_VERSION_MAJOR ${OBSW_VERSION_MAJOR_IF_GIT_FAILS}) list(GET GIT_INFO 2 OBSW_VERSION_MINOR)
endif() list(GET GIT_INFO 3 OBSW_VERSION_REVISION)
if(NOT OBSW_VERSION_MINOR) list(GET GIT_INFO 4 OBSW_VERSION_CST_GIT_SHA1)
set(FSFW_SUBVERSION ${OBSW_VERSION_MINOR_IF_GIT_FAILS}) if(NOT OBSW_VERSION_MAJOR)
endif() set(OBSW_VERSION_MAJOR ${OBSW_VERSION_MAJOR_IF_GIT_FAILS})
if(NOT OBSW_VERSION_REVISION) endif()
set(FSFW_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS}) if(NOT OBSW_VERSION_MINOR)
endif() set(FSFW_SUBVERSION ${OBSW_VERSION_MINOR_IF_GIT_FAILS})
set(GIT_VER_HANDLING_OK TRUE) endif()
else() if(NOT OBSW_VERSION_REVISION)
set(GIT_VER_HANDLING_OK FALSE) set(FSFW_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS})
endif() endif()
set(GIT_VER_HANDLING_OK TRUE)
else()
set(GIT_VER_HANDLING_OK FALSE)
endif()
endif() endif()
if(NOT GIT_VER_HANDLING_OK) if(NOT GIT_VER_HANDLING_OK)
set(OBSW_VERSION_MAJOR ${OBSW_VERSION_MAJOR_IF_GIT_FAILS}) set(OBSW_VERSION_MAJOR ${OBSW_VERSION_MAJOR_IF_GIT_FAILS})
set(OBSW_VERSION_MINOR ${OBSW_VERSION_MINOR_IF_GIT_FAILS}) set(OBSW_VERSION_MINOR ${OBSW_VERSION_MINOR_IF_GIT_FAILS})
set(OBSW_VERSION_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS}) set(OBSW_VERSION_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS})
endif() endif()
# Set names and variables # Set names and variables
@ -129,6 +175,7 @@ set(LIB_CXX_FS -lstdc++fs)
set(LIB_CATCH2 Catch2) set(LIB_CATCH2 Catch2)
set(LIB_GPS gps) set(LIB_GPS gps)
set(LIB_JSON_NAME nlohmann_json::nlohmann_json) set(LIB_JSON_NAME nlohmann_json::nlohmann_json)
set(LIB_DUMMIES dummies)
# Set path names # Set path names
set(FSFW_PATH fsfw) set(FSFW_PATH fsfw)
@ -136,6 +183,7 @@ set(TEST_PATH test)
set(UNITTEST_PATH unittest) set(UNITTEST_PATH unittest)
set(LINUX_PATH linux) set(LINUX_PATH linux)
set(COMMON_PATH common) set(COMMON_PATH common)
set(DUMMY_PATH dummies)
set(WATCHDOG_PATH watchdog) set(WATCHDOG_PATH watchdog)
set(COMMON_CONFIG_PATH ${COMMON_PATH}/config) set(COMMON_CONFIG_PATH ${COMMON_PATH}/config)
set(UNITTEST_CFG_PATH ${UNITTEST_PATH}/testcfg) set(UNITTEST_CFG_PATH ${UNITTEST_PATH}/testcfg)
@ -156,171 +204,163 @@ set(EIVE_ADD_LINUX_FILES False)
pre_source_hw_os_config() pre_source_hw_os_config()
if(TGT_BSP) if(TGT_BSP)
set(LIBGPS_VERSION_MAJOR 3)
# I assume a newer version than 3.17 will be installed on other Linux board
# than the Q7S
set(LIBGPS_VERSION_MINOR 20)
if(TGT_BSP MATCHES "arm/q7s"
OR TGT_BSP MATCHES "arm/raspberrypi"
OR TGT_BSP MATCHES "arm/beagleboneblack"
OR TGT_BSP MATCHES "arm/egse"
OR TGT_BSP MATCHES "arm/te0720-1cfa")
find_library(${LIB_GPS} gps)
set(FSFW_CONFIG_PATH "linux/fsfwconfig")
if(NOT BUILD_Q7S_SIMPLE_MODE)
set(EIVE_ADD_LINUX_FILES TRUE)
set(ADD_CSP_LIB TRUE)
set(FSFW_HAL_ADD_LINUX ON)
endif()
endif()
if(TGT_BSP MATCHES "arm/raspberrypi")
# Used by configure file
set(RASPBERRY_PI ON)
set(FSFW_HAL_ADD_RASPBERRY_PI ON)
endif()
if(TGT_BSP MATCHES "arm/egse")
# Used by configure file
set(EGSE ON)
set(FSFW_HAL_LINUX_ADD_LIBGPIOD OFF)
set(OBSW_ADD_STAR_TRACKER 1)
set(OBSW_DEBUG_STARTRACKER 1)
endif()
if(TGT_BSP MATCHES "arm/beagleboneblack")
# Used by configure file
set(BEAGLEBONEBLACK ON)
endif()
if(TGT_BSP MATCHES "arm/q7s")
# Used by configure file
set(XIPHOS_Q7S ON)
set(LIBGPS_VERSION_MAJOR 3) set(LIBGPS_VERSION_MAJOR 3)
# I assume a newer version than 3.17 will be installed on other Linux board than the Q7S set(LIBGPS_VERSION_MINOR 17)
set(LIBGPS_VERSION_MINOR 20) endif()
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/raspberrypi"
OR TGT_BSP MATCHES "arm/beagleboneblack" OR TGT_BSP MATCHES "arm/egse"
OR TGT_BSP MATCHES "arm/te0720-1cfa"
)
find_library(${LIB_GPS} gps)
set(FSFW_CONFIG_PATH "linux/fsfwconfig")
if(NOT BUILD_Q7S_SIMPLE_MODE)
set(EIVE_ADD_LINUX_FILES TRUE)
set(ADD_CSP_LIB TRUE)
set(FSFW_HAL_ADD_LINUX ON)
endif()
endif()
if(TGT_BSP MATCHES "arm/raspberrypi" )
# Used by configure file
set(RASPBERRY_PI ON)
set(FSFW_HAL_ADD_RASPBERRY_PI ON)
endif()
if(TGT_BSP MATCHES "arm/egse") if(TGT_BSP MATCHES "arm/te0720-1cfa")
# Used by configure file set(TE0720_1CFA ON)
set(EGSE ON) endif()
set(FSFW_HAL_LINUX_ADD_LIBGPIOD OFF)
set(OBSW_ADD_STAR_TRACKER 1)
set(OBSW_DEBUG_STARTRACKER 1)
endif()
if(TGT_BSP MATCHES "arm/beagleboneblack")
# Used by configure file
set(BEAGLEBONEBLACK ON)
endif()
if(TGT_BSP MATCHES "arm/q7s")
# Used by configure file
set(XIPHOS_Q7S ON)
set(LIBGPS_VERSION_MAJOR 3)
set(LIBGPS_VERSION_MINOR 17)
endif()
if(TGT_BSP MATCHES "arm/te0720-1cfa")
set(TE0720_1CFA ON)
endif()
else() else()
# Required by FSFW library # Required by FSFW library
set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig") set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
endif() endif()
# Configuration files # Configuration files
configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h) configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h)
configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h) configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h)
configure_file(${BSP_PATH}/OBSWConfig.h.in OBSWConfig.h) configure_file(${BSP_PATH}/OBSWConfig.h.in OBSWConfig.h)
if(TGT_BSP MATCHES "arm/q7s") if(TGT_BSP MATCHES "arm/q7s")
configure_file(${BSP_PATH}/boardconfig/q7sConfig.h.in q7sConfig.h) configure_file(${BSP_PATH}/boardconfig/q7sConfig.h.in q7sConfig.h)
elseif(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/egse") elseif(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/egse")
configure_file(${BSP_PATH}/boardconfig/rpiConfig.h.in rpiConfig.h) configure_file(${BSP_PATH}/boardconfig/rpiConfig.h.in rpiConfig.h)
endif() endif()
configure_file(${WATCHDOG_PATH}/watchdogConf.h.in watchdogConf.h) configure_file(${WATCHDOG_PATH}/watchdogConf.h.in watchdogConf.h)
# Set common config path for FSFW # Set common config path for FSFW
set(FSFW_ADDITIONAL_INC_PATHS set(FSFW_ADDITIONAL_INC_PATHS "${COMMON_PATH}/config"
"${COMMON_PATH}/config" ${CMAKE_CURRENT_BINARY_DIR})
${CMAKE_CURRENT_BINARY_DIR}
)
################################################################################ # ##############################################################################
# Executable and Sources # Executable and Sources
################################################################################ # ##############################################################################
#global compiler options need to be set before adding executables # global compiler options need to be set before adding executables
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options( add_compile_options(
"-Wall" "-Wall"
"-Wextra" "-Wextra"
"-Wimplicit-fallthrough=1" "-Wimplicit-fallthrough=1"
"-Wno-unused-parameter" "-Wno-unused-parameter"
"-Wno-psabi" "-Wno-psabi"
"-Wduplicated-cond" # check for duplicate conditions "-Wduplicated-cond" # check for duplicate conditions
"-Wduplicated-branches" # check for duplicate branches "-Wduplicated-branches" # check for duplicate branches
"-Wlogical-op" # Search for bitwise operations instead of logical "-Wlogical-op" # Search for bitwise operations instead of logical
"-Wnull-dereference" # Search for NULL dereference "-Wnull-dereference" # Search for NULL dereference
"-Wundef" # Warn if undefind marcos are used "-Wundef" # Warn if undefind marcos are used
"-Wformat=2" # Format string problem detection "-Wformat=2" # Format string problem detection
"-Wformat-overflow=2" # Formatting issues in printf "-Wformat-overflow=2" # Formatting issues in printf
"-Wformat-truncation=2" # Formatting issues in printf "-Wformat-truncation=2" # Formatting issues in printf
"-Wformat-security" # Search for dangerous printf operations "-Wformat-security" # Search for dangerous printf operations
"-Wstrict-overflow=3" # Warn if integer overflows might happen "-Wstrict-overflow=3" # Warn if integer overflows might happen
"-Warray-bounds=2" # Some array bounds violations will be found "-Warray-bounds=2" # Some array bounds violations will be found
"-Wshift-overflow=2" # Search for bit left shift overflows (<c++14) "-Wshift-overflow=2" # Search for bit left shift overflows (<c++14)
"-Wcast-qual" # Warn if the constness is cast away "-Wcast-qual" # Warn if the constness is cast away
"-Wstringop-overflow=4" "-Wstringop-overflow=4"
# -Wstack-protector # Emits a few false positives for low level access # -Wstack-protector # Emits a few false positives for low level access
# -Wconversion # Creates many false positives # -Wconversion # Creates many false positives -Warith-conversion # Use with
# -Warith-conversion # Use with Wconversion to find more implicit conversions # Wconversion to find more implicit conversions -fanalyzer # Should be used
# -fanalyzer # Should be used to look through problems # to look through problems
) )
# Remove unused sections. # Remove unused sections.
add_compile_options( add_compile_options("-ffunction-sections" "-fdata-sections")
"-ffunction-sections"
"-fdata-sections"
)
# Removed unused sections. # Removed unused sections.
add_link_options( add_link_options("-Wl,--gc-sections")
"-Wl,--gc-sections"
)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(COMPILER_FLAGS "/permissive-") set(COMPILER_FLAGS "/permissive-")
endif() endif()
add_library(${LIB_EIVE_MISSION}) add_library(${LIB_EIVE_MISSION})
add_library(${LIB_DUMMIES})
# Add main executable # Add main executable
add_executable(${OBSW_NAME}) add_executable(${OBSW_NAME})
if(EIVE_CREATE_UNIQUE_OBSW_BIN) set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME})
set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME}-$ENV{USERNAME})
else()
set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME})
endif()
set_target_properties(${OBSW_NAME} PROPERTIES OUTPUT_NAME ${OBSW_BIN_NAME}) set_target_properties(${OBSW_NAME} PROPERTIES OUTPUT_NAME ${OBSW_BIN_NAME})
# Watchdog # Watchdog
if(TGT_BSP MATCHES "arm/q7s") if(TGT_BSP MATCHES "arm/q7s")
add_executable(${WATCHDOG_NAME}) add_executable(${WATCHDOG_NAME})
else() else()
add_executable(${WATCHDOG_NAME} EXCLUDE_FROM_ALL) add_executable(${WATCHDOG_NAME} EXCLUDE_FROM_ALL)
endif() endif()
add_subdirectory(${WATCHDOG_PATH}) add_subdirectory(${WATCHDOG_PATH})
target_link_libraries(${WATCHDOG_NAME} PUBLIC target_link_libraries(${WATCHDOG_NAME} PUBLIC ${LIB_CXX_FS})
${LIB_CXX_FS} target_include_directories(${WATCHDOG_NAME} PUBLIC ${CMAKE_BINARY_DIR})
)
target_include_directories(${WATCHDOG_NAME} PUBLIC
${CMAKE_BINARY_DIR}
)
# unittests # unittests
if(NOT TGT_BSP) if(NOT TGT_BSP)
add_executable(${UNITTEST_NAME}) add_executable(${UNITTEST_NAME})
else() else()
add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL) add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL)
endif() endif()
if(EIVE_ADD_ETL_LIB) if(EIVE_ADD_ETL_LIB)
endif() endif()
if(EIVE_ADD_JSON_LIB) if(EIVE_ADD_JSON_LIB)
add_subdirectory(${LIB_JSON_PATH}) add_subdirectory(${LIB_JSON_PATH})
endif() endif()
add_subdirectory(thirdparty/rapidcsv)
if(EIVE_ADD_LINUX_FILES) if(EIVE_ADD_LINUX_FILES)
add_subdirectory(${LIB_ARCSEC_PATH}) add_subdirectory(${LIB_ARCSEC_PATH})
add_subdirectory(${LINUX_PATH}) add_subdirectory(${LINUX_PATH})
endif() endif()
add_subdirectory(${BSP_PATH}) add_subdirectory(${BSP_PATH})
if(ADD_CSP_LIB) if(ADD_CSP_LIB)
add_subdirectory(${LIB_CSP_PATH}) add_subdirectory(${LIB_CSP_PATH})
endif() endif()
add_subdirectory(${COMMON_PATH}) add_subdirectory(${COMMON_PATH})
add_subdirectory(${DUMMY_PATH})
add_subdirectory(${LIB_LWGPS_PATH}) add_subdirectory(${LIB_LWGPS_PATH})
add_subdirectory(${FSFW_PATH}) add_subdirectory(${FSFW_PATH})
@ -329,174 +369,150 @@ add_subdirectory(${TEST_PATH})
add_subdirectory(${UNITTEST_PATH}) add_subdirectory(${UNITTEST_PATH})
# This should have already been downloaded by the FSFW # This should have already been downloaded by the FSFW Still include it to be
# Still include it to be safe # safe
find_package(etl ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET) find_package(etl ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET)
# Not installed, so use FetchContent to download and provide etl # Not installed, so use FetchContent to download and provide etl
if(NOT etl_FOUND) if(NOT etl_FOUND)
message(STATUS message(
"No ETL installation was found with find_package. Installing and providing " STATUS
"etl with FindPackage" "No ETL installation was found with find_package. Installing and providing "
) "etl with FindPackage")
include(FetchContent) include(FetchContent)
FetchContent_Declare( FetchContent_Declare(
etl etl
GIT_REPOSITORY https://github.com/ETLCPP/etl GIT_REPOSITORY https://github.com/ETLCPP/etl
GIT_TAG ${FSFW_ETL_LIB_VERSION} GIT_TAG ${FSFW_ETL_LIB_VERSION})
) list(APPEND FSFW_FETCH_CONTENT_TARGETS etl)
list(APPEND FSFW_FETCH_CONTENT_TARGETS etl)
endif() endif()
# Use same Catch2 version as framework # Use same Catch2 version as framework
if (NOT(TGT_BSP MATCHES "arm/te0720-1cfa") AND NOT(TGT_BSP MATCHES "arm/q7s") if(NOT (TGT_BSP MATCHES "arm/te0720-1cfa")
AND NOT (TGT_BSP MATCHES "arm/raspberrypi")) AND NOT (TGT_BSP MATCHES "arm/q7s")
# Check whether the user has already installed Catch2 first AND NOT (TGT_BSP MATCHES "arm/raspberrypi"))
find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} CONFIG QUIET) # Check whether the user has already installed Catch2 first
# Not installed, so use FetchContent to download and provide Catch2 find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} CONFIG QUIET)
if(NOT Catch2_FOUND) # Not installed, so use FetchContent to download and provide Catch2
message(STATUS "${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent") if(NOT Catch2_FOUND)
include(FetchContent) message(
STATUS
"${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent"
)
include(FetchContent)
FetchContent_Declare( FetchContent_Declare(
Catch2 Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG ${FSFW_CATCH2_LIB_VERSION} GIT_TAG ${FSFW_CATCH2_LIB_VERSION})
)
list(APPEND FSFW_FETCH_CONTENT_TARGETS Catch2) list(APPEND FSFW_FETCH_CONTENT_TARGETS Catch2)
endif() endif()
endif() endif()
# The documentation for FetchContent recommends declaring all the dependencies # The documentation for FetchContent recommends declaring all the dependencies
# before making them available. We make all declared dependency available here # before making them available. We make all declared dependency available here
# after their declaration # after their declaration
if(FSFW_FETCH_CONTENT_TARGETS) if(FSFW_FETCH_CONTENT_TARGETS)
FetchContent_MakeAvailable(${FSFW_FETCH_CONTENT_TARGETS}) FetchContent_MakeAvailable(${FSFW_FETCH_CONTENT_TARGETS})
if(TARGET etl) if(TARGET etl)
add_library(${LIB_ETL_TARGET} ALIAS etl) add_library(${LIB_ETL_TARGET} ALIAS etl)
endif() endif()
if(TARGET Catch2) if(TARGET Catch2)
# Fixes regression -preview4, to be confirmed in later releases # Fixes regression -preview4, to be confirmed in later releases Related
# Related GitHub issue: https://github.com/catchorg/Catch2/issues/2417 # GitHub issue: https://github.com/catchorg/Catch2/issues/2417
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "") set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "")
set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true") set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true")
set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true") set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true")
endif() endif()
endif() endif()
################################################################################ # ##############################################################################
# Post-Sources preparation # Post-Sources preparation
################################################################################ # ##############################################################################
# Add libraries # Add libraries
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC target_link_libraries(${LIB_EIVE_MISSION}
${LIB_FSFW_NAME} PUBLIC ${LIB_FSFW_NAME} ${LIB_LWGPS_NAME} ${LIB_OS_NAME})
${LIB_LWGPS_NAME}
${LIB_OS_NAME}
)
target_link_libraries(${OBSW_NAME} PRIVATE target_link_libraries(${LIB_DUMMIES} PUBLIC ${LIB_FSFW_NAME} ${LIB_JSON_NAME})
${LIB_EIVE_MISSION}
) target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_EIVE_MISSION} ${LIB_DUMMIES})
if(TGT_BSP MATCHES "arm/q7s") if(TGT_BSP MATCHES "arm/q7s")
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_GPS} ${LIB_ARCSEC})
${LIB_GPS}
${LIB_ARCSEC}
)
endif() endif()
target_link_libraries(${UNITTEST_NAME} PRIVATE target_link_libraries(${UNITTEST_NAME} PRIVATE Catch2 ${LIB_EIVE_MISSION}
Catch2 rapidcsv ${LIB_DUMMIES})
${LIB_EIVE_MISSION}
)
if(TGT_BSP MATCHES "arm/egse") if(TGT_BSP MATCHES "arm/egse")
target_link_libraries(${OBSW_NAME} PRIVATE target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_ARCSEC})
${LIB_ARCSEC}
)
endif() endif()
if(ADD_CSP_LIB) if(ADD_CSP_LIB)
target_link_libraries(${OBSW_NAME} PRIVATE target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_CSP_NAME})
${LIB_CSP_NAME}
)
endif() endif()
if(EIVE_ADD_ETL_LIB) if(EIVE_ADD_ETL_LIB)
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_ETL_TARGET})
${LIB_ETL_TARGET}
)
endif() endif()
if(EIVE_ADD_JSON_LIB) if(EIVE_ADD_JSON_LIB)
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_JSON_NAME})
${LIB_JSON_NAME}
)
endif() endif()
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_CXX_FS})
${LIB_CXX_FS}
)
# Add include paths for all sources. # Add include paths for all sources.
target_include_directories(${LIB_EIVE_MISSION} PUBLIC target_include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${LIB_EIVE_MISSION} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${FSFW_CONFIG_PATH}
${FSFW_CONFIG_PATH} ${CMAKE_CURRENT_BINARY_DIR} ${LIB_ARCSEC_PATH})
${CMAKE_CURRENT_BINARY_DIR}
${LIB_ARCSEC_PATH} target_include_directories(
) ${LIB_DUMMIES} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${FSFW_CONFIG_PATH}
${CMAKE_CURRENT_BINARY_DIR})
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/egse") if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/egse")
target_include_directories(${LIB_EIVE_MISSION} PUBLIC target_include_directories(${LIB_EIVE_MISSION} PUBLIC ${ARCSEC_LIB_PATH})
${ARCSEC_LIB_PATH}
)
endif() endif()
if(CMAKE_VERBOSE) if(CMAKE_VERBOSE)
message(STATUS "Warning flags: ${WARNING_FLAGS}") message(STATUS "Warning flags: ${WARNING_FLAGS}")
endif() endif()
if(CMAKE_CROSSCOMPILING) if(CMAKE_CROSSCOMPILING)
include (HardwareOsPostConfig) include(HardwareOsPostConfig)
post_source_hw_os_config() post_source_hw_os_config()
endif() endif()
if(NOT CMAKE_SIZE) if(NOT CMAKE_SIZE)
set(CMAKE_SIZE size) set(CMAKE_SIZE size)
if(WIN32) if(WIN32)
set(FILE_SUFFIX ".exe") set(FILE_SUFFIX ".exe")
endif() endif()
endif() endif()
if(EIVE_BUILD_WATCHDOG) if(EIVE_BUILD_WATCHDOG)
set(TARGET_STRING "OBSW Watchdog") set(TARGET_STRING "OBSW Watchdog")
else() else()
if(TGT_BSP) if(TGT_BSP)
set(TARGET_STRING "Target BSP: ${TGT_BSP}") set(TARGET_STRING "Target BSP: ${TGT_BSP}")
else() else()
set(TARGET_STRING "Target BSP: Hosted") set(TARGET_STRING "Target BSP: Hosted")
endif() endif()
endif() endif()
install(TARGETS ${OBSW_NAME} RUNTIME DESTINATION bin) install(TARGETS ${OBSW_NAME} RUNTIME DESTINATION bin)
string(CONCAT POST_BUILD_COMMENT string(CONCAT POST_BUILD_COMMENT "Build directory: ${CMAKE_BINARY_DIR}\n"
"Build directory: ${CMAKE_BINARY_DIR}\n" "Target OSAL: ${FSFW_OSAL}\n"
"Target OSAL: ${FSFW_OSAL}\n" "Target Build Type: ${CMAKE_BUILD_TYPE}\n" "${TARGET_STRING}")
"Target Build Type: ${CMAKE_BUILD_TYPE}\n"
"${TARGET_STRING}"
)
add_custom_command( add_custom_command(
TARGET ${OBSW_NAME} TARGET ${OBSW_NAME}
POST_BUILD POST_BUILD
COMMAND ${CMAKE_SIZE} ${OBSW_BIN_NAME}${FILE_SUFFIX} COMMAND ${CMAKE_SIZE} ${OBSW_BIN_NAME}${FILE_SUFFIX}
COMMENT ${POST_BUILD_COMMENT} COMMENT ${POST_BUILD_COMMENT})
)
include (BuildType) include(BuildType)
set_build_type() set_build_type()

129
README.md

@ -70,8 +70,9 @@ prerequisites.
## Building the OBSW and flashing it on the Q7S ## Building the OBSW and flashing it on the Q7S
1. ARM cross-compiler installed, either as part of [Vivado 2018.2 installation](#vivado) or 1. ARM cross-compiler installed, either as part of [Vivado 2018.2 installation](#vivado) or
as a [separate download](#arm-toolchain) as a [separate download](#arm-toolchain). The Xiphos SDK also installs a cross-compiler,
2. [Q7S sysroot](#sysroot) on local development machine but its version is currently too old to compile the OBSW (7.3.0).
2. [Q7S sysroot](#sysroot) on local development machine. It is installed by the Xiphos SDK
3. Recommended: Eclipse or [Vivado 2018.2 SDK](#vivado) for OBSW development 3. Recommended: Eclipse or [Vivado 2018.2 SDK](#vivado) for OBSW development
3. [TCF agent](https://wiki.eclipse.org/TCF) running on Q7S 3. [TCF agent](https://wiki.eclipse.org/TCF) running on Q7S
@ -88,7 +89,7 @@ When using Windows, run theses steps in MSYS2.
1. Clone the repository with 1. Clone the repository with
```sh ```sh
git clone https://egit.irs.uni-stuttgart.de/eive/eive_obsw.git git clone https://egit.irs.uni-stuttgart.de/eive/eive-obsw.git
``` ```
2. Update all the submodules 2. Update all the submodules
@ -143,7 +144,7 @@ When using Windows, run theses steps in MSYS2.
There are also different values for `-DTGT_BSP` to build for the Raspberry Pi There are also different values for `-DTGT_BSP` to build for the Raspberry Pi
or the Beagle Bone Black: `arm/raspberrypi` and `arm/beagleboneblack`. or the Beagle Bone Black: `arm/raspberrypi` and `arm/beagleboneblack`.
5. Build the software with 5. Build the software with
```sh ```sh
@ -151,6 +152,53 @@ When using Windows, run theses steps in MSYS2.
cmake --build . -j cmake --build . -j
``` ```
## Build for the Q7S target root filesystem with `yocto`
The EIVE root filesystem will contain the EIVE OBSW and the Watchdog component.
It is currently generated with `yocto`, but the tool can not compile the primary
OBSW due to toolchain version incompatibility. Therefore, the OBSW components
are currently compiled using the toolchain specified in this README (e.g. installed by Vivado).
However, it is still possible to install the two components using yocto. A few helper files were
provided to make this process easier. The following steps can be used to install the OBSW
components and a version file to the yocto sources for the generation of the complete EIVE root
file system image. The steps here are shown for Ubuntu, you can use the according Windows
helper scripts as well.
1. Copy the `q7s-env.sh` script to the same layer as the `eive-obsw`.
```sh
cp scripts/q7s-env.sh ..
cd ..
./q7s-env.sh
q7s-make-release.sh
```
2. Compile the OBSW components in release mode
```sh
cd cmake-build-release-q7s
cmake --build . -j
```
3. Make sure the [`q7s-yocto`](https://egit.irs.uni-stuttgart.de/eive/q7s-yocto)
repository or the [`q7s-package`](https://egit.irs.uni-stuttgart.de/eive/q7s-package.git)
repository and its `q7s-yocto` submodule were cloned in the same directory layer as
the `eive-obsw`.
4. Run the install script to install the files into `q7s-yocto`.
```sh
install-obsw-yocto.sh
```
5. Navigate into the `q7s-yocto` repo and review the changes. You can then add and push those
changes.
6. You can now rebuild the root filesystem with the updated OBSW using `yocto`. This probably needs
to be done on another machine or in a VM. The [`q7s-yocto`](https://egit.irs.uni-stuttgart.de/eive/q7s-yocto)
repository contains details on how to best do this.
## Building in Xilinx SDK 2018.2 ## Building in Xilinx SDK 2018.2
1. Open Xilinx SDK 2018.2 1. Open Xilinx SDK 2018.2
@ -326,7 +374,7 @@ If you are comiling for the Raspberry Pi, you have to set the `LINUX_ROOTFS` env
variable instead. You can find a base root filesystem for the Raspberry Pi variable instead. You can find a base root filesystem for the Raspberry Pi
[here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/rootfs). [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/rootfs).
## <a id="vivado"></a> Installing Vivado the the Xilinx development tools ## <a id="vivado"></a> Installing Vivado and the Xilinx development tools
It's also possible to perform debugging with a normal Eclipse installation by installing It's also possible to perform debugging with a normal Eclipse installation by installing
the TCF plugin and downloading the cross-compiler as specified in the section below. However, the TCF plugin and downloading the cross-compiler as specified in the section below. However,
@ -342,9 +390,9 @@ installed Vivado with the SDK core tools.
<img src="https://egit.irs.uni-stuttgart.de/eive/eive-obsw/raw/branch/develop/doc/img/vivado-edition.png" width="50%"> <br> <img src="https://egit.irs.uni-stuttgart.de/eive/eive-obsw/raw/branch/develop/doc/img/vivado-edition.png" width="50%"> <br>
<img src="https://egit.irs.uni-stuttgart.de/eive/eive-obsw/raw/branch/mueller/master/doc/img/vivado-hl-design.png" width="50%"> <br> <img src="https://egit.irs.uni-stuttgart.de/eive/eive-obsw/raw/branch/develop/doc/img/vivado-hl-design.png" width="50%"> <br>
<img src="https://egit.irs.uni-stuttgart.de/eive/eive-obsw/raw/branch/mueller/master/doc/img/xilinx-install.PNG" width="50%"> <br> <img src="https://egit.irs.uni-stuttgart.de/eive/eive-obsw/raw/branch/develop/doc/img/xilinx-install.PNG" width="50%"> <br>
* For supported OS refer to https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_2/ug973-vivado-release-notes-install-license.pdf . * For supported OS refer to https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_2/ug973-vivado-release-notes-install-license.pdf .
Installation was tested on Windows and Ubuntu 21.04. Installation was tested on Windows and Ubuntu 21.04.
@ -661,35 +709,7 @@ Thus the replies are received with a larger delay compared to a direct TCP conne
3. Make sure the netmask of the ehternet interface of the workstation matches the netmask of the Q7S 3. Make sure the netmask of the ehternet interface of the workstation matches the netmask of the Q7S
* When IP address is set to 192.168.133.10 and the netmask is 255.255.255.0, an example IP address for the workstation * When IP address is set to 192.168.133.10 and the netmask is 255.255.255.0, an example IP address for the workstation
is 192.168.133.2 is 192.168.133.2
4. Make sure th `tcf-agent` is running by checking `systemctl status tcf-agent`
4. Run tcf-agent on Q7S
* Tcf-agent is not yet integrated in the rootfs of the Q7S. Therefore build tcf-agent manually
```sh
git clone git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git
cd org.eclipse.tcf.agent/agent
make CC=arm-linux-gnueabihf-gcc LD=arm-linux-gnueabihf-ld MACHINE=arm NO_SSL=1 NO_UUID=1
```
* Transfer executable agent from org.eclipse.tcf.agent/agent/obj/GNU/Linux/arm/Debug to /tmp of Q7S
```sh
cd obj/GNU/Linux/arm/Debug
scp agent root@192.168.133.10:/tmp
```
* On Q7S
```sh
cd /tmp
chmod +x agent
```
* Run agent
```sh
./agent
```
5. In Xilinx SDK 2018.2 right click on project &rarr; Debug As &rarr; Debug Configurations 5. In Xilinx SDK 2018.2 right click on project &rarr; Debug As &rarr; Debug Configurations
6. Right click Xilinx C/C++ applicaton (System Debugger) &rarr; New &rarr; 6. Right click Xilinx C/C++ applicaton (System Debugger) &rarr; New &rarr;
7. Set Debug Type to Linux Application Debug and Connectin to Linux Agent 7. Set Debug Type to Linux Application Debug and Connectin to Linux Agent
@ -699,8 +719,8 @@ Thus the replies are received with a larger delay compared to a direct TCP conne
11. Test connection (This ensures the TCF Agent is running on the Q7S) 11. Test connection (This ensures the TCF Agent is running on the Q7S)
12. Select Application tab 12. Select Application tab
* Project Name: eive_obsw * Project Name: eive_obsw
* Local File Path: Path to eiveobsw-linux.elf (in `_bin\linux\devel`) * Local File Path: Path to OBSW application image with debug symbols (non-stripped)
* Remote File Path: `/tmp/eive_obsw.elf` * Remote File Path: `/tmp/<OBSW NAME>`
# <a id="file-transfer"></a> Transfering Files to the Q7S # <a id="file-transfer"></a> Transfering Files to the Q7S
@ -726,7 +746,8 @@ From a windows machine files can be copied with putty tools (note: use IPv4 addr
pscp -scp -P 22 eive@192.168.199.227:</directory-to-example-file/>/example-file </windows-machine-path/> pscp -scp -P 22 eive@192.168.199.227:</directory-to-example-file/>/example-file </windows-machine-path/>
```` ````
More detailed information about the used q7s commands can be found in the Q7S user manual. A helper script named `q7s-cp.py` can be used together with the `q7s-port.sh`
script to make this process easier.
# <a id="q7s"></a> Q7S OBC # <a id="q7s"></a> Q7S OBC
@ -1106,16 +1127,28 @@ Eclipse indexer.
The [TCF agent](https://wiki.eclipse.org/TCF) can be used to perform remote debugging on the Q7S. The [TCF agent](https://wiki.eclipse.org/TCF) can be used to perform remote debugging on the Q7S.
1. Install the TCF agent plugin in Eclipse from 1. Copy the `.cproject` file and the `.project` file inside the `misc/eclipse` folder into the
repo root
```sh
cd eive-obsw
cp misc/eclipse/.cproject .
cp misc/eclipse/.project .
```
2. Open the repo in Eclipse as a folder.
3. Install the TCF agent plugin in Eclipse from
the [releases](https://www.eclipse.org/tcf/downloads.php). Go to the [releases](https://www.eclipse.org/tcf/downloads.php). Go to
Help &rarr; Install New Software and use the download page, for Help &rarr; Install New Software and use the download page, for
example https://download.eclipse.org/tools/tcf/releases/1.7/1.7.0/ to search for the plugin and install it. You can find the newest version [here](https://www.eclipse.org/tcf/downloads.php) example https://download.eclipse.org/tools/tcf/releases/1.7/1.7.0/ to search for the plugin and
install it. You can find the newest version [here](https://www.eclipse.org/tcf/downloads.php)
2. Go to Window &rarr; Perspective &rarr; Open Perspective and open the **Target Explorer Perspective**. 4. Go to Window &rarr; Perspective &rarr; Open Perspective and open the **Target Explorer Perspective**.
Here, the Q7S should show up if the local port forwarding was set up as explained previously. Here, the Q7S should show up if the local port forwarding was set up as explained previously.
Please note that you have to connect to `localhost` and port `1534` with port forwaring set up. Please note that you have to connect to `localhost` and port `1534` with port forwaring set up.
3. A launch configuration was provided, but it might be necessary to adapt it for your own needs. 5. A launch configuration was provided, but it might be necessary to adapt it for your own needs.
Alternatively: Alternatively:
- Create a new **TCF Remote Application** by pressing the cogs button at the top or going to - Create a new **TCF Remote Application** by pressing the cogs button at the top or going to
@ -1204,7 +1237,7 @@ in the same way.
* the formatting is based on the clang-format tools * the formatting is based on the clang-format tools
## Setting up eclipse auto-fromatter with clang-format ## Setting up auto-formatter with clang-format in Xilinx SDK
1. Help &rarr; Install New Software &rarr; Add 1. Help &rarr; Install New Software &rarr; Add
2. In location insert the link http://www.cppstyle.com/luna 2. In location insert the link http://www.cppstyle.com/luna
@ -1214,3 +1247,11 @@ in the same way.
6. Insert the path to the clang-format executable 6. Insert the path to the clang-format executable
7. Under C/C++ &rarr; Code Style &rarr; Formatter, change the formatter to CppStyle (clang-format) 7. Under C/C++ &rarr; Code Style &rarr; Formatter, change the formatter to CppStyle (clang-format)
8. Code can now be formatted with the clang tool by using the key combination Ctrl + Shift + f 8. Code can now be formatted with the clang tool by using the key combination Ctrl + Shift + f
## Setting up auto-fromatter with clang-format in eclipse
1. Help &rarr; Eclipse market place &rarr; Search for "Cppstyle" and install
2. On windows download the clang-formatting tools from https://llvm.org/builds/. On linux clang-format can be installed with the package manager.
3. Navigate to Preferences &rarr; C/C++ &rarr; CppStyle
4. Insert the path to the clang-format executable
5. Under C/C++ &rarr; Code Style &rarr; Formatter, change the formatter to CppStyle (clang-format)
6. Code can now be formatted with the clang tool by using the key combination Ctrl + Shift + f

@ -1,7 +1,3 @@
target_sources(${OBSW_NAME} PUBLIC target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp)
InitMission.cpp
main.cpp
ObjectFactory.cpp
)
add_subdirectory(boardconfig) add_subdirectory(boardconfig)

@ -1,7 +1,3 @@
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE print.c)
print.c
)
target_include_directories(${OBSW_NAME} PUBLIC target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
${CMAKE_CURRENT_SOURCE_DIR}
)

@ -1,8 +1,4 @@
target_sources(${OBSW_NAME} PUBLIC target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp)
InitMission.cpp
main.cpp
ObjectFactory.cpp
)
add_subdirectory(fsfwconfig) add_subdirectory(fsfwconfig)
add_subdirectory(boardconfig) add_subdirectory(boardconfig)

@ -1,6 +1,7 @@
#include "InitMission.h" #include "InitMission.h"
#include <OBSWConfig.h> #include <OBSWConfig.h>
#include <bsp_hosted/fsfwconfig/pollingsequence/DummyPst.h>
#include <fsfw/objectmanager/ObjectManager.h> #include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/objectmanager/ObjectManagerIF.h> #include <fsfw/objectmanager/ObjectManagerIF.h>
#include <fsfw/returnvalues/HasReturnvaluesIF.h> #include <fsfw/returnvalues/HasReturnvaluesIF.h>
@ -89,9 +90,13 @@ void initmission::initTasks() {
sif::error << "Object add component failed" << std::endl; sif::error << "Object add component failed" << std::endl;
} }
PeriodicTaskIF* pusEvents = factory->createPeriodicTask( PeriodicTaskIF* eventHandling = factory->createPeriodicTask(
"PUS_EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc); "EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
result = pusVerification->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING); result = eventHandling->addComponent(objects::EVENT_MANAGER);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("EVENT_MNGR", objects::EVENT_MANAGER);
}
result = eventHandling->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS5", objects::PUS_SERVICE_5_EVENT_REPORTING); initmission::printAddObjectError("PUS5", objects::PUS_SERVICE_5_EVENT_REPORTING);
} }
@ -106,6 +111,10 @@ void initmission::initTasks() {
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS9", objects::PUS_SERVICE_9_TIME_MGMT); initmission::printAddObjectError("PUS9", objects::PUS_SERVICE_9_TIME_MGMT);
} }
result = pusHighPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS3", objects::PUS_SERVICE_3_HOUSEKEEPING);
}
PeriodicTaskIF* pusMedPrio = factory->createPeriodicTask( PeriodicTaskIF* pusMedPrio = factory->createPeriodicTask(
"PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); "PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
@ -129,8 +138,34 @@ void initmission::initTasks() {
initmission::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST); initmission::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST);
} }
PeriodicTaskIF* testTask = factory->createPeriodicTask( PeriodicTaskIF* thermalTask = factory->createPeriodicTask(
"TEST_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); "THERMAL_CTL_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc);
result = thermalTask->addComponent(objects::RTD_0_IC3_PLOC_HEATSPREADER);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("RTD_0_dummy", objects::RTD_0_IC3_PLOC_HEATSPREADER);
}
result = thermalTask->addComponent(objects::SUS_0_N_LOC_XFYFZM_PT_XF);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("SUS_0_dummy", objects::SUS_0_N_LOC_XFYFZM_PT_XF);
}
result = thermalTask->addComponent(objects::CORE_CONTROLLER);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("Core controller dummy", objects::CORE_CONTROLLER);
}
result = thermalTask->addComponent(objects::THERMAL_CONTROLLER);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER);
}
FixedTimeslotTaskIF* pstTask = factory->createFixedTimeslotTask(
"DUMMY_PST", 75, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc);
result = dummy_pst::pst(pstTask);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Failed to add dummy pst to fixed timeslot task" << std::endl;
}
#if OBSW_ADD_TEST_CODE == 1 #if OBSW_ADD_TEST_CODE == 1
result = testTask->addComponent(objects::TEST_TASK); result = testTask->addComponent(objects::TEST_TASK);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
@ -144,11 +179,14 @@ void initmission::initTasks() {
tmtcPollingTask->startTask(); tmtcPollingTask->startTask();
pusVerification->startTask(); pusVerification->startTask();
pusEvents->startTask(); eventHandling->startTask();
pusHighPrio->startTask(); pusHighPrio->startTask();
pusMedPrio->startTask(); pusMedPrio->startTask();
pusLowPrio->startTask(); pusLowPrio->startTask();
pstTask->startTask();
thermalTask->startTask();
#if OBSW_ADD_TEST_CODE == 1 #if OBSW_ADD_TEST_CODE == 1
testTask->startTask(); testTask->startTask();
#endif /* OBSW_ADD_TEST_CODE == 1 */ #endif /* OBSW_ADD_TEST_CODE == 1 */

@ -2,8 +2,9 @@
#include <fsfw/tmtcservices/CommandingServiceBase.h> #include <fsfw/tmtcservices/CommandingServiceBase.h>
#include <fsfw/tmtcservices/PusServiceBase.h> #include <fsfw/tmtcservices/PusServiceBase.h>
#include <mission/controller/ThermalController.h>
#include <mission/core/GenericFactory.h> #include <mission/core/GenericFactory.h>
#include <mission/utility/TmFunnel.h> #include <mission/tmtc/TmFunnel.h>
#include <objects/systemObjectList.h> #include <objects/systemObjectList.h>
#include <tmtc/apid.h> #include <tmtc/apid.h>
#include <tmtc/pusIds.h> #include <tmtc/pusIds.h>
@ -25,6 +26,24 @@
#include <test/testtasks/TestTask.h> #include <test/testtasks/TestTask.h>
#endif #endif
#include <dummies/AcuDummy.h>
#include <dummies/BpxDummy.h>
#include <dummies/ComCookieDummy.h>
#include <dummies/ComIFDummy.h>
#include <dummies/CoreControllerDummy.h>
#include <dummies/GyroAdisDummy.h>
#include <dummies/GyroL3GD20Dummy.h>
#include <dummies/ImtqDummy.h>
#include <dummies/MgmLIS3MDLDummy.h>
#include <dummies/P60DockDummy.h>
#include <dummies/PduDummy.h>
#include <dummies/PlPcduDummy.h>
#include <dummies/RwDummy.h>
#include <dummies/StarTrackerDummy.h>
#include <dummies/SusDummy.h>
#include <dummies/SyrlinksDummy.h>
#include <dummies/TemperatureSensorsDummy.h>
void Factory::setStaticFrameworkObjectIds() { void Factory::setStaticFrameworkObjectIds() {
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR; PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
PusServiceBase::packetDestination = objects::TM_FUNNEL; PusServiceBase::packetDestination = objects::TM_FUNNEL;
@ -44,5 +63,31 @@ void ObjectFactory::produce(void* args) {
Factory::setStaticFrameworkObjectIds(); Factory::setStaticFrameworkObjectIds();
ObjectFactory::produceGenericObjects(); ObjectFactory::produceGenericObjects();
new TestTask(objects::TEST_TASK); new ComIFDummy(objects::DUMMY_COM_IF);
ComCookieDummy* comCookieDummy = new ComCookieDummy();
new BpxDummy(objects::BPX_BATT_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new CoreControllerDummy(objects::CORE_CONTROLLER);
new RwDummy(objects::RW1, objects::DUMMY_COM_IF, comCookieDummy);
new RwDummy(objects::RW2, objects::DUMMY_COM_IF, comCookieDummy);
new RwDummy(objects::RW3, objects::DUMMY_COM_IF, comCookieDummy);
new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy);
new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy);
new SyrlinksDummy(objects::SYRLINKS_HK_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new ImtqDummy(objects::IMTQ_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new PduDummy(objects::PDU1_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new PduDummy(objects::PDU2_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new P60DockDummy(objects::P60DOCK_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new GyroAdisDummy(objects::GYRO_0_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new GyroL3GD20Dummy(objects::GYRO_1_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new GyroAdisDummy(objects::GYRO_2_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new GyroL3GD20Dummy(objects::GYRO_3_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new MgmLIS3MDLDummy(objects::MGM_0_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new MgmLIS3MDLDummy(objects::MGM_2_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new TemperatureSensorsDummy();
new SusDummy();
new ThermalController(objects::THERMAL_CONTROLLER, objects::NO_OBJECT);
// new TestTask(objects::TEST_TASK);
} }

@ -1,10 +1,3 @@
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE print.c)
print.c
)
target_include_directories(${OBSW_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

@ -1,8 +1 @@
target_sources(${TARGET_NAME} PUBLIC target_sources(${OBSW_NAME} PUBLIC ArduinoComIF.cpp ArduinoCookie.cpp)
ArduinoComIF.cpp
ArduinoCookie.cpp
)

@ -1,27 +1,17 @@
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE ipc/MissionMessageTypes.cpp)
ipc/MissionMessageTypes.cpp
)
target_include_directories(${OBSW_NAME} PUBLIC target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
${CMAKE_CURRENT_SOURCE_DIR}
)
# If a special translation file for object IDs exists, compile it. # If a special translation file for object IDs exists, compile it.
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp") if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE objects/translateObjects.cpp)
objects/translateObjects.cpp target_sources(${UNITTEST_NAME} PRIVATE objects/translateObjects.cpp)
)
target_sources(${UNITTEST_NAME} PRIVATE
objects/translateObjects.cpp
)
endif() endif()
# If a special translation file for events exists, compile it. # If a special translation file for events exists, compile it.
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp") if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE events/translateEvents.cpp)
events/translateEvents.cpp target_sources(${UNITTEST_NAME} PRIVATE events/translateEvents.cpp)
)
target_sources(${UNITTEST_NAME} PRIVATE
events/translateEvents.cpp
)
endif() endif()
add_subdirectory(pollingsequence)

@ -7,41 +7,41 @@
//! Used to determine whether C++ ostreams are used which can increase //! Used to determine whether C++ ostreams are used which can increase
//! the binary size significantly. If this is disabled, //! the binary size significantly. If this is disabled,
//! the C stdio functions can be used alternatively //! the C stdio functions can be used alternatively
#define FSFW_CPP_OSTREAM_ENABLED 1 #define FSFW_CPP_OSTREAM_ENABLED 1
//! More FSFW related printouts depending on level. Useful for development. //! More FSFW related printouts depending on level. Useful for development.
#define FSFW_VERBOSE_LEVEL 1 #define FSFW_VERBOSE_LEVEL 1
//! Can be used to completely disable printouts, even the C stdio ones. //! Can be used to completely disable printouts, even the C stdio ones.
#if FSFW_CPP_OSTREAM_ENABLED == 0 && FSFW_VERBOSE_LEVEL == 0 #if FSFW_CPP_OSTREAM_ENABLED == 0 && FSFW_VERBOSE_LEVEL == 0
#define FSFW_DISABLE_PRINTOUT 0 #define FSFW_DISABLE_PRINTOUT 0
#endif #endif
#define FSFW_USE_PUS_C_TELEMETRY 1 #define FSFW_USE_PUS_C_TELEMETRY 1
#define FSFW_USE_PUS_C_TELECOMMANDS 1 #define FSFW_USE_PUS_C_TELECOMMANDS 1
//! Can be used to disable the ANSI color sequences for C stdio. //! Can be used to disable the ANSI color sequences for C stdio.
#define FSFW_COLORED_OUTPUT 1 #define FSFW_COLORED_OUTPUT 1
//! If FSFW_OBJ_EVENT_TRANSLATION is set to one, //! If FSFW_OBJ_EVENT_TRANSLATION is set to one,
//! additional output which requires the translation files translateObjects //! additional output which requires the translation files translateObjects
//! and translateEvents (and their compiled source files) //! and translateEvents (and their compiled source files)
#define FSFW_OBJ_EVENT_TRANSLATION 1 #define FSFW_OBJ_EVENT_TRANSLATION 1
#if FSFW_OBJ_EVENT_TRANSLATION == 1 #if FSFW_OBJ_EVENT_TRANSLATION == 1
//! Specify whether info events are printed too. //! Specify whether info events are printed too.
#define FSFW_DEBUG_INFO 1 #define FSFW_DEBUG_INFO 1
#include "objects/translateObjects.h"
#include "events/translateEvents.h" #include "events/translateEvents.h"
#include "objects/translateObjects.h"
#else #else
#endif #endif
//! When using the newlib nano library, C99 support for stdio facilities //! When using the newlib nano library, C99 support for stdio facilities
//! will not be provided. This define should be set to 1 if this is the case. //! will not be provided. This define should be set to 1 if this is the case.
#define FSFW_NO_C99_IO 1 #define FSFW_NO_C99_IO 1
//! Specify whether a special mode store is used for Subsystem components. //! Specify whether a special mode store is used for Subsystem components.
#define FSFW_USE_MODESTORE 0 #define FSFW_USE_MODESTORE 0
//! Defines if the real time scheduler for linux should be used. //! Defines if the real time scheduler for linux should be used.
//! If set to 0, this will also disable priority settings for linux //! If set to 0, this will also disable priority settings for linux
@ -58,7 +58,7 @@ static constexpr uint8_t FSFW_MISSION_TIMESTAMP_SIZE = 7;
//! Configure the allocated pool sizes for the event manager. //! Configure the allocated pool sizes for the event manager.
static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240; static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240;
static constexpr size_t FSFW_EVENTMGMT_EVENTIDMATCHERS = 120; static constexpr size_t FSFW_EVENTMGMT_EVENTIDMATCHERS = 120;
static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120; static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120;
//! Defines the FIFO depth of each commanding service base which //! Defines the FIFO depth of each commanding service base which
//! also determines how many commands a CSB service can handle in one cycle //! also determines how many commands a CSB service can handle in one cycle
@ -70,6 +70,6 @@ static constexpr size_t FSFW_PRINT_BUFFER_SIZE = 124;
static constexpr size_t FSFW_MAX_TM_PACKET_SIZE = 2048; static constexpr size_t FSFW_MAX_TM_PACKET_SIZE = 2048;
} } // namespace fsfwconfig
#endif /* CONFIG_FSFWCONFIG_H_ */ #endif /* CONFIG_FSFWCONFIG_H_ */

@ -22,10 +22,11 @@ enum sourceObjects : uint32_t {
TEST_TASK = 0x42694269, TEST_TASK = 0x42694269,
DUMMY_INTERFACE = 0xCAFECAFE, DUMMY_INTERFACE = 0xCAFECAFE,
DUMMY_HANDLER = 0x4400AFFE, DUMMY_HANDLER = 0x44000001,
/* 0x49 ('I') for Communication Interfaces **/ /* 0x49 ('I') for Communication Interfaces **/
ARDUINO_COM_IF = 0x49000001 ARDUINO_COM_IF = 0x49000001,
DUMMY_COM_IF = 0x49000002
}; };
} }

@ -6,6 +6,8 @@
*/ */
#include "translateObjects.h" #include "translateObjects.h"
#include "systemObjectList.h"
const char *TEST_TASK_STRING = "TEST_TASK"; const char *TEST_TASK_STRING = "TEST_TASK";
const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER";
const char *ARDUINO_COM_IF_STRING = "ARDUINO_COM_IF"; const char *ARDUINO_COM_IF_STRING = "ARDUINO_COM_IF";
@ -36,6 +38,7 @@ const char *IPC_STORE_STRING = "IPC_STORE";
const char *TIME_STAMPER_STRING = "TIME_STAMPER"; const char *TIME_STAMPER_STRING = "TIME_STAMPER";
const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END"; const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END";
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER";
const char *NO_OBJECT_STRING = "NO_OBJECT"; const char *NO_OBJECT_STRING = "NO_OBJECT";
const char *translateObject(object_id_t object) { const char *translateObject(object_id_t object) {
@ -100,6 +103,8 @@ const char *translateObject(object_id_t object) {
return FSFW_OBJECTS_END_STRING; return FSFW_OBJECTS_END_STRING;
case 0xCAFECAFE: case 0xCAFECAFE:
return DUMMY_INTERFACE_STRING; return DUMMY_INTERFACE_STRING;
case objects::THERMAL_CONTROLLER:
return THERMAL_CONTROLLER_STRING;
case 0xFFFFFFFF: case 0xFFFFFFFF:
return NO_OBJECT_STRING; return NO_OBJECT_STRING;
default: default:

@ -0,0 +1 @@
target_sources(${OBSW_NAME} PRIVATE DummyPst.cpp)

@ -0,0 +1,140 @@
#include "DummyPst.h"
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
#include <objects/systemObjectList.h>
ReturnValue_t dummy_pst::pst(FixedTimeslotTaskIF *thisSequence) {
uint32_t length = thisSequence->getPeriodMs();
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::ACU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::ACU_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::ACU_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::ACU_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::ACU_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::PDU1_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::PDU1_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::PDU1_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::PDU1_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::PDU1_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::PDU2_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::PDU2_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::PDU2_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::PDU2_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::PDU2_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::P60DOCK_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::P60DOCK_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::P60DOCK_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::P60DOCK_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::P60DOCK_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) {
return HasReturnvaluesIF::RETURN_OK;
} else {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!" << std::endl;
#endif
return HasReturnvaluesIF::RETURN_FAILED;
}
}

@ -0,0 +1,14 @@
#ifndef POLLINGSEQUENCEFACTORY_H_
#define POLLINGSEQUENCEFACTORY_H_
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
class FixedTimeslotTaskIF;
namespace dummy_pst {
ReturnValue_t pst(FixedTimeslotTaskIF *thisSequence);
}
#endif /* POLLINGSEQUENCEINIT_H_ */

@ -1,18 +0,0 @@
#ifndef FSFWCONFIG_TMTC_APID_H_
#define FSFWCONFIG_TMTC_APID_H_
#include <stdint.h>
/**
* Application Process Definition: entity, uniquely identified by an
* application process ID (APID), capable of generating telemetry source
* packets and receiving telecommand packets
*
* SOURCE APID: 0x73 / 115 / s
* APID is a 11 bit number
*/
namespace apid {
static const uint16_t EIVE_OBSW = 0x65;
}
#endif /* FSFWCONFIG_TMTC_APID_H_ */

@ -1,9 +1,17 @@
#include <objects/systemObjectList.h>
#include <iostream> #include <iostream>
#include "InitMission.h" #include "InitMission.h"
#include "commonConfig.h" #include "commonConfig.h"
#include "fsfw/FSFWVersion.h" #include "fsfw/FSFWVersion.h"
#include "fsfw/controller/ControllerBase.h"
#include "fsfw/ipc/QueueFactory.h"
#include "fsfw/modes/HasModesIF.h"
#include "fsfw/modes/ModeMessage.h"
#include "fsfw/objectmanager/ObjectManager.h"
#include "fsfw/tasks/TaskFactory.h" #include "fsfw/tasks/TaskFactory.h"
#ifdef WIN32 #ifdef WIN32
static const char* COMPILE_PRINTOUT = "Windows"; static const char* COMPILE_PRINTOUT = "Windows";
#elif LINUX #elif LINUX

@ -1,9 +1,5 @@
target_sources(${OBSW_NAME} PUBLIC target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp gpioInit.cpp
InitMission.cpp ObjectFactory.cpp)
main.cpp
gpioInit.cpp
ObjectFactory.cpp
)
add_subdirectory(boardconfig) add_subdirectory(boardconfig)
add_subdirectory(boardtest) add_subdirectory(boardtest)

@ -3,7 +3,7 @@
#include <vector> #include <vector>
#include "fsfw/tasks/Typedef.h" #include "fsfw/tasks/definitions.h"
class PeriodicTaskIF; class PeriodicTaskIF;
class TaskFactory; class TaskFactory;

@ -67,7 +67,7 @@ void ObjectFactory::produce(void* args) {
GpioCookie* gpioCookie = nullptr; GpioCookie* gpioCookie = nullptr;
static_cast<void>(gpioCookie); static_cast<void>(gpioCookie);
SpiComIF* spiComIF = new SpiComIF(objects::SPI_COM_IF, gpioIF); SpiComIF* spiComIF = new SpiComIF(objects::SPI_MAIN_COM_IF, spi::DEV, gpioIF);
static_cast<void>(spiComIF); static_cast<void>(spiComIF);
auto pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0); auto pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0);
static_cast<void>(pwrSwitcher); static_cast<void>(pwrSwitcher);
@ -116,73 +116,72 @@ void ObjectFactory::createRpiAcsBoard(GpioIF* gpioIF, std::string spiDev) {
gpio::Direction::OUT, gpio::Levels::HIGH); gpio::Direction::OUT, gpio::Levels::HIGH);
gpioIF->addGpios(gpioCookie); gpioIF->addGpios(gpioCookie);
SpiCookie* spiCookie = SpiCookie* spiCookie =
new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev, new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
auto mgmLis3Handler = auto mgmLis3Handler =
new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_COM_IF, spiCookie, 0); new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
mgmLis3Handler->setStartUpImmediately(); mgmLis3Handler->setStartUpImmediately();
#if OBSW_TEST_ACS == 1 #if OBSW_TEST_ACS == 1
mgmLis3Handler->setToGoToNormalMode(true); mgmLis3Handler->setToGoToNormalMode(true);
#endif #endif
spiCookie = spiCookie =
new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev, new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, RM3100::MAX_BUFFER_SIZE,
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
auto mgmRm3100Handler = auto mgmRm3100Handler =
new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_COM_IF, spiCookie, 0); new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setStartUpImmediately();
#if OBSW_TEST_ACS == 1 #if OBSW_TEST_ACS == 1
mgmRm3100Handler->setToGoToNormalMode(true); mgmRm3100Handler->setToGoToNormalMode(true);
#endif #endif
spiCookie = spiCookie =
new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev, new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
mgmLis3Handler = mgmLis3Handler =
new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_COM_IF, spiCookie, 0); new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
mgmLis3Handler->setStartUpImmediately(); mgmLis3Handler->setStartUpImmediately();
#if OBSW_TEST_ACS == 1 #if OBSW_TEST_ACS == 1
mgmLis3Handler->setToGoToNormalMode(true); mgmLis3Handler->setToGoToNormalMode(true);
#endif #endif
spiCookie = spiCookie =
new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, spiDev, new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, RM3100::MAX_BUFFER_SIZE,
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
mgmRm3100Handler = mgmRm3100Handler =
new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_COM_IF, spiCookie, 0); new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setStartUpImmediately();
#if OBSW_TEST_ACS == 1 #if OBSW_TEST_ACS == 1
mgmRm3100Handler->setToGoToNormalMode(true); mgmRm3100Handler->setToGoToNormalMode(true);
#endif #endif
spiCookie = spiCookie =
new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev, new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE,
ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
auto adisHandler = new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF,
spiCookie, ADIS1650X::Type::ADIS16505);
adisHandler->setStartUpImmediately();
spiCookie =
new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
auto adisHandler =
new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie,
ADIS1650X::Type::ADIS16505);
adisHandler->setStartUpImmediately();
spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, L3GD20H::MAX_BUFFER_SIZE,
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
auto gyroL3gHandler = auto gyroL3gHandler =
new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF, spiCookie, 0); new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
gyroL3gHandler->setStartUpImmediately(); gyroL3gHandler->setStartUpImmediately();
#if OBSW_TEST_ACS == 1 #if OBSW_TEST_ACS == 1
gyroL3gHandler->setToGoToNormalMode(true); gyroL3gHandler->setToGoToNormalMode(true);
#endif #endif
spiCookie = spiCookie =
new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, spiDev, new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE,
ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_COM_IF, adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_MAIN_COM_IF,
spiCookie, ADIS1650X::Type::ADIS16505); spiCookie, ADIS1650X::Type::ADIS16505);
adisHandler->setStartUpImmediately(); adisHandler->setStartUpImmediately();
spiCookie = spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, L3GD20H::MAX_BUFFER_SIZE,
new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
gyroL3gHandler = gyroL3gHandler =
new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_COM_IF, spiCookie, 0); new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
gyroL3gHandler->setStartUpImmediately(); gyroL3gHandler->setStartUpImmediately();
#if OBSW_TEST_ACS == 1 #if OBSW_TEST_ACS == 1
gyroL3gHandler->setToGoToNormalMode(true); gyroL3gHandler->setToGoToNormalMode(true);

@ -1,7 +1,3 @@
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE print.c)
print.c
)
target_include_directories(${OBSW_NAME} PUBLIC target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
${CMAKE_CURRENT_SOURCE_DIR}
)

@ -1,6 +1 @@
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE)
)

@ -1,20 +1,13 @@
#simple mode # simple mode
add_executable(${SIMPLE_OBSW_NAME} EXCLUDE_FROM_ALL) add_executable(${SIMPLE_OBSW_NAME} EXCLUDE_FROM_ALL)
target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE") target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE")
target_sources(${SIMPLE_OBSW_NAME} PUBLIC target_sources(${SIMPLE_OBSW_NAME} PUBLIC main.cpp)
main.cpp # I think this is unintentional? (produces linker errors for stuff in /linux)
) target_link_libraries(${SIMPLE_OBSW_NAME} PUBLIC ${LIB_FSFW_NAME})
#I think this is unintentional? (produces linker errors for stuff in /linux)
target_link_libraries(${SIMPLE_OBSW_NAME} PUBLIC
${LIB_FSFW_NAME}
)
target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE") target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE")
add_subdirectory(simple) add_subdirectory(simple)
target_sources(${OBSW_NAME} PUBLIC target_sources(${OBSW_NAME} PUBLIC main.cpp obsw.cpp)
main.cpp
obsw.cpp
)
add_subdirectory(boardtest) add_subdirectory(boardtest)
@ -23,9 +16,9 @@ add_subdirectory(comIF)
add_subdirectory(core) add_subdirectory(core)
if(EIVE_Q7S_EM) if(EIVE_Q7S_EM)
add_subdirectory(em) add_subdirectory(em)
else() else()
add_subdirectory(fm) target_sources(${OBSW_NAME} PUBLIC fmObjectFactory.cpp)
endif() endif()
add_subdirectory(memory) add_subdirectory(memory)

@ -25,8 +25,8 @@
#define OBSW_ADD_MGT @OBSW_ADD_MGT@ #define OBSW_ADD_MGT @OBSW_ADD_MGT@
#define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@ #define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@
#define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@ #define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@
#define OBSW_ADD_PLOC_SUPERVISOR 0 #define OBSW_ADD_PLOC_SUPERVISOR 1
#define OBSW_ADD_PLOC_MPSOC 0 #define OBSW_ADD_PLOC_MPSOC 1
#define OBSW_ADD_SUN_SENSORS @OBSW_ADD_SUN_SENSORS@ #define OBSW_ADD_SUN_SENSORS @OBSW_ADD_SUN_SENSORS@
#define OBSW_ADD_SUS_BOARD_ASS @OBSW_ADD_SUS_BOARD_ASS@ #define OBSW_ADD_SUS_BOARD_ASS @OBSW_ADD_SUS_BOARD_ASS@
#define OBSW_ADD_ACS_BOARD @OBSW_ADD_ACS_BOARD@ #define OBSW_ADD_ACS_BOARD @OBSW_ADD_ACS_BOARD@
@ -38,6 +38,7 @@
#define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@ #define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@
#define OBSW_ADD_SYRLINKS @OBSW_ADD_SYRLINKS@ #define OBSW_ADD_SYRLINKS @OBSW_ADD_SYRLINKS@
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 #define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
#define OBSW_MPSOC_JTAG_BOOT 0
// This is a really tricky switch.. It initializes the PCDU switches to their default states // This is a really tricky switch.. It initializes the PCDU switches to their default states
// at powerup. I think it would be better // at powerup. I think it would be better

@ -1,12 +1,5 @@
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE print.c)
print.c
)
target_sources(${SIMPLE_OBSW_NAME} PRIVATE target_sources(${SIMPLE_OBSW_NAME} PRIVATE print.c)
print.c
)
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(${OBSW_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)

@ -4,6 +4,8 @@
namespace q7s { namespace q7s {
static constexpr char SPI_DEFAULT_DEV[] = "/dev/spi-main"; static constexpr char SPI_DEFAULT_DEV[] = "/dev/spi-main";
static constexpr uint32_t SPI_MAIN_BUS_LOCK_TIMEOUT = 50;
static constexpr char SPI_RW_DEV[] = "/dev/spi-rw"; static constexpr char SPI_RW_DEV[] = "/dev/spi-rw";
static constexpr char I2C_DEFAULT_DEV[] = "/dev/i2c-eive"; static constexpr char I2C_DEFAULT_DEV[] = "/dev/i2c-eive";
@ -15,9 +17,9 @@ static constexpr char UART_SYRLINKS_DEV[] = "/dev/ul-syrlinks";
static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ul-str"; static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ul-str";
static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0"; static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0";
static constexpr char UIO_PTME[] = "/dev/uio1";
static constexpr char UIO_PDEC_CONFIG_MEMORY[] = "/dev/uio2"; static constexpr char UIO_PDEC_CONFIG_MEMORY[] = "/dev/uio2";
static constexpr char UIO_PDEC_RAM[] = "/dev/uio3"; static constexpr char UIO_PDEC_RAM[] = "/dev/uio3";
static constexpr char UIO_PTME[] = "/dev/uio1";
static constexpr int MAP_ID_PTME_CONFIG = 3; static constexpr int MAP_ID_PTME_CONFIG = 3;
namespace uiomapids { namespace uiomapids {

@ -34,5 +34,6 @@ SOFTWARE.
#define ETL_CPP11_SUPPORTED 1 #define ETL_CPP11_SUPPORTED 1
#define ETL_NO_NULLPTR_SUPPORT 0 #define ETL_NO_NULLPTR_SUPPORT 0
#define ETL_HAS_ERROR_ON_STRING_TRUNCATION 1
#endif #endif

@ -1,10 +1,5 @@
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE FileSystemTest.cpp Q7STestTask.cpp)
FileSystemTest.cpp
Q7STestTask.cpp
)
if(EIVE_BUILD_Q7S_SIMPLE_MODE) if(EIVE_BUILD_Q7S_SIMPLE_MODE)
target_sources(${SIMPLE_OBSW_NAME} PRIVATE target_sources(${SIMPLE_OBSW_NAME} PRIVATE FileSystemTest.cpp)
FileSystemTest.cpp endif()
)
endif()

@ -1,6 +1,2 @@
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE rwSpiCallback.cpp gnssCallback.cpp
rwSpiCallback.cpp pcduSwitchCb.cpp q7sGpioCallbacks.cpp)
gnssCallback.cpp
pcduSwitchCb.cpp
q7sGpioCallbacks.cpp
)

@ -1,9 +1,14 @@
#include "gnssCallback.h" #include "gnssCallback.h"
#include "devices/gpioIds.h" #include "devices/gpioIds.h"
#include "fsfw/action/HasActionsIF.h"
#include "fsfw/tasks/TaskFactory.h" #include "fsfw/tasks/TaskFactory.h"
ReturnValue_t gps::triggerGpioResetPin(void* args) { ReturnValue_t gps::triggerGpioResetPin(const uint8_t* actionData, size_t len, void* args) {
// At least one byte which denotes which GPS to reset is required
if (len < 1 or actionData == nullptr) {
return HasActionsIF::INVALID_PARAMETERS;
}
ResetArgs* resetArgs = reinterpret_cast<ResetArgs*>(args); ResetArgs* resetArgs = reinterpret_cast<ResetArgs*>(args);
if (args == nullptr) { if (args == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED; return HasReturnvaluesIF::RETURN_FAILED;
@ -12,11 +17,10 @@ ReturnValue_t gps::triggerGpioResetPin(void* args) {
return HasReturnvaluesIF::RETURN_FAILED; return HasReturnvaluesIF::RETURN_FAILED;
} }
gpioId_t gpioId; gpioId_t gpioId;
if (resetArgs->gnss1) { if (actionData[0] == 0) {
gpioId = gpioIds::GNSS_1_NRESET;
} else {
gpioId = gpioIds::GNSS_0_NRESET; gpioId = gpioIds::GNSS_0_NRESET;
} else {
gpioId = gpioIds::GNSS_1_NRESET;
} }
resetArgs->gpioComIF->pullLow(gpioId); resetArgs->gpioComIF->pullLow(gpioId);
TaskFactory::delayTask(resetArgs->waitPeriodMs); TaskFactory::delayTask(resetArgs->waitPeriodMs);

@ -5,14 +5,13 @@
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h" #include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
struct ResetArgs { struct ResetArgs {
bool gnss1 = false;
LinuxLibgpioIF* gpioComIF = nullptr; LinuxLibgpioIF* gpioComIF = nullptr;
uint32_t waitPeriodMs = 100; uint32_t waitPeriodMs = 100;
}; };
namespace gps { namespace gps {
ReturnValue_t triggerGpioResetPin(void* args); ReturnValue_t triggerGpioResetPin(const uint8_t* actionData, size_t len, void* args);
} }

@ -48,7 +48,7 @@ void q7s::gpioCallbacks::initSpiCsDecoder(GpioIF* gpioComIF) {
result = gpioComIF->addGpios(spiMuxGpios); result = gpioComIF->addGpios(spiMuxGpios);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "initSpiCsDecoder: Failed to add mux bit gpios to gpioComIF" << std::endl; sif::error << "initSpiCsDecoder: Failed to add SPI MUX bit GPIOs" << std::endl;
return; return;
} }
} }

@ -1,5 +1,7 @@
#include "rwSpiCallback.h" #include "rwSpiCallback.h"
#include <fsfw/timemanager/Stopwatch.h>
#include "devices/gpioIds.h" #include "devices/gpioIds.h"
#include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
#include "fsfw_hal/linux/UnixFileGuard.h" #include "fsfw_hal/linux/UnixFileGuard.h"
@ -8,8 +10,25 @@
namespace rwSpiCallback { namespace rwSpiCallback {
namespace {
static bool MODE_SET = false;
ReturnValue_t openSpi(const std::string& devname, int flags, GpioIF* gpioIF, gpioId_t gpioId,
MutexIF* mutex, MutexIF::TimeoutType timeoutType, uint32_t timeoutMs,
int& fd);
/**
* @brief This function closes a spi session. Pulls the chip select to high an releases the
* mutex.
* @param gpioId Gpio ID of chip select
* @param gpioIF Pointer to gpio interface to drive the chip select
* @param mutex The spi mutex
*/
void closeSpi(int fd, gpioId_t gpioId, GpioIF* gpioIF, MutexIF* mutex);
} // namespace
ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData, ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData,
size_t sendLen, void* args) { size_t sendLen, void* args) {
// Stopwatch watch;
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
RwHandler* handler = reinterpret_cast<RwHandler*>(args); RwHandler* handler = reinterpret_cast<RwHandler*>(args);
@ -18,51 +37,45 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
return HasReturnvaluesIF::RETURN_FAILED; return HasReturnvaluesIF::RETURN_FAILED;
} }
uint8_t writeBuffer[2]; uint8_t writeBuffer[2] = {};
uint8_t writeSize = 0; uint8_t writeSize = 0;
gpioId_t gpioId = cookie->getChipSelectPin(); gpioId_t gpioId = cookie->getChipSelectPin();
GpioIF* gpioIF = comIf->getGpioInterface(); GpioIF* gpioIF = comIf->getGpioInterface();
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING; MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
uint32_t timeoutMs = 0; uint32_t timeoutMs = 0;
MutexIF* mutex = comIf->getMutex(&timeoutType, &timeoutMs); MutexIF* mutex = comIf->getCsMutex();
cookie->getMutexParams(timeoutType, timeoutMs);
if (mutex == nullptr or gpioIF == nullptr) { if (mutex == nullptr or gpioIF == nullptr) {
sif::debug << "rwSpiCallback::spiCallback: Mutex or GPIO interface invalid" << std::endl; sif::debug << "rwSpiCallback::spiCallback: Mutex or GPIO interface invalid" << std::endl;
return HasReturnvaluesIF::RETURN_FAILED; return HasReturnvaluesIF::RETURN_FAILED;
} }
int fileDescriptor = 0; int fileDescriptor = 0;
std::string device = cookie->getSpiDevice(); const std::string& dev = comIf->getSpiDev();
UnixFileGuard fileHelper(device, &fileDescriptor, O_RDWR, "rwSpiCallback::spiCallback"); result = openSpi(dev, O_RDWR, gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor);
if (fileHelper.getOpenResult() != HasReturnvaluesIF::RETURN_OK) {
sif::error << "rwSpiCallback::spiCallback: Failed to open device file" << std::endl;
return SpiComIF::OPENING_FILE_FAILED;
}
spi::SpiModes spiMode = spi::SpiModes::MODE_0;
uint32_t spiSpeed = 0;
cookie->getSpiParameters(spiMode, spiSpeed, nullptr);
comIf->setSpiSpeedAndMode(fileDescriptor, spiMode, spiSpeed);
result = mutex->lockMutex(timeoutType, timeoutMs);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
sif::debug << "rwSpiCallback::spiCallback: Failed to lock mutex" << std::endl;
return result; return result;
} }
/** Sending frame start sign */ spi::SpiModes spiMode = spi::SpiModes::MODE_0;
writeBuffer[0] = 0x7E; uint32_t spiSpeed = 0;
writeSize = 1; cookie->getSpiParameters(spiMode, spiSpeed, nullptr);
// We are in protected section, so we can use the static variable here without issues.
// Pull SPI CS low. For now, no support for active high given // We don't need to set the speed because a SPI core is used, but the mode has to be set once
if (gpioId != gpio::NO_GPIO) { // correctly for all RWs
if (gpioIF->pullLow(gpioId) != HasReturnvaluesIF::RETURN_OK) { if (not MODE_SET) {
sif::error << "rwSpiCallback::spiCallback: Failed to pull chip select low" << std::endl; comIf->setSpiSpeedAndMode(fileDescriptor, spiMode, spiSpeed);
} MODE_SET = true;
} }
/** Sending frame start sign */
writeBuffer[0] = FLAG_BYTE;
writeSize = 1;
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) { if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl; sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
closeSpi(gpioId, gpioIF, mutex); closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
return RwHandler::SPI_WRITE_FAILURE; return RwHandler::SPI_WRITE_FAILURE;
} }
@ -87,33 +100,39 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
} }
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) { if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl; sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
closeSpi(gpioId, gpioIF, mutex); closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
return RwHandler::SPI_WRITE_FAILURE; return RwHandler::SPI_WRITE_FAILURE;
} }
idx++; idx++;
} }
/** Sending frame end sign */ /** Sending frame end sign */
writeBuffer[0] = 0x7E; writeBuffer[0] = FLAG_BYTE;
writeSize = 1; writeSize = 1;
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) { if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl; sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
closeSpi(gpioId, gpioIF, mutex); closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
return RwHandler::SPI_WRITE_FAILURE; return RwHandler::SPI_WRITE_FAILURE;
} }
uint8_t* rxBuf = nullptr; uint8_t* rxBuf = nullptr;
result = comIf->getReadBuffer(cookie->getSpiAddress(), &rxBuf); result = comIf->getReadBuffer(cookie->getSpiAddress(), &rxBuf);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
closeSpi(gpioId, gpioIF, mutex); closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
return result; return result;
} }
size_t replyBufferSize = cookie->getMaxBufferSize(); size_t replyBufferSize = cookie->getMaxBufferSize();
/** There must be a delay of at least 20 ms after sending the command */ // There must be a delay of at least 20 ms after sending the command.
// Delay for 70 ms here and release the SPI bus for that duration.
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
usleep(RwDefinitions::SPI_REPLY_DELAY); usleep(RwDefinitions::SPI_REPLY_DELAY);
result = openSpi(dev, O_RDWR, gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
/** /**
* The reaction wheel responds with empty frames while preparing the reply data. * The reaction wheel responds with empty frames while preparing the reply data.
@ -123,13 +142,13 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
for (int idx = 0; idx < 10; idx++) { for (int idx = 0; idx < 10; idx++) {
if (read(fileDescriptor, &byteRead, 1) != 1) { if (read(fileDescriptor, &byteRead, 1) != 1) {
sif::error << "rwSpiCallback::spiCallback: Read failed" << std::endl; sif::error << "rwSpiCallback::spiCallback: Read failed" << std::endl;
closeSpi(gpioId, gpioIF, mutex); closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
return RwHandler::SPI_READ_FAILURE; return RwHandler::SPI_READ_FAILURE;
} }
if (idx == 0) { if (idx == 0) {
if (byteRead != FLAG_BYTE) { if (byteRead != FLAG_BYTE) {
sif::error << "Invalid data, expected start marker" << std::endl; sif::error << "Invalid data, expected start marker" << std::endl;
closeSpi(gpioId, gpioIF, mutex); closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
return RwHandler::NO_START_MARKER; return RwHandler::NO_START_MARKER;
} }
} }
@ -140,7 +159,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
if (idx == 9) { if (idx == 9) {
sif::error << "rwSpiCallback::spiCallback: Empty frame timeout" << std::endl; sif::error << "rwSpiCallback::spiCallback: Empty frame timeout" << std::endl;
closeSpi(gpioId, gpioIF, mutex); closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
return RwHandler::NO_REPLY; return RwHandler::NO_REPLY;
} }
} }
@ -180,7 +199,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
continue; continue;
} else { } else {
sif::error << "rwSpiCallback::spiCallback: Invalid substitute" << std::endl; sif::error << "rwSpiCallback::spiCallback: Invalid substitute" << std::endl;
closeSpi(gpioId, gpioIF, mutex); closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
result = RwHandler::INVALID_SUBSTITUTE; result = RwHandler::INVALID_SUBSTITUTE;
break; break;
} }
@ -201,8 +220,9 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
result = RwHandler::SPI_READ_FAILURE; result = RwHandler::SPI_READ_FAILURE;
break; break;
} }
if (byteRead != 0x7E) { if (byteRead != FLAG_BYTE) {
sif::error << "rwSpiCallback::spiCallback: Missing end sign 0x7E" << std::endl; sif::error << "rwSpiCallback::spiCallback: Missing end sign " << static_cast<int>(FLAG_BYTE)
<< std::endl;
decodedFrameLen--; decodedFrameLen--;
result = RwHandler::MISSING_END_SIGN; result = RwHandler::MISSING_END_SIGN;
break; break;
@ -213,12 +233,40 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
cookie->setTransferSize(decodedFrameLen); cookie->setTransferSize(decodedFrameLen);
closeSpi(gpioId, gpioIF, mutex); closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
return result; return result;
} }
void closeSpi(gpioId_t gpioId, GpioIF* gpioIF, MutexIF* mutex) { namespace {
ReturnValue_t openSpi(const std::string& devname, int flags, GpioIF* gpioIF, gpioId_t gpioId,
MutexIF* mutex, MutexIF::TimeoutType timeoutType, uint32_t timeoutMs,
int& fd) {
ReturnValue_t result = mutex->lockMutex(timeoutType, timeoutMs);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::debug << "rwSpiCallback::spiCallback: Failed to lock mutex" << std::endl;
return result;
}
fd = open(devname.c_str(), flags);
if (fd < 0) {
sif::error << "rwSpiCallback::spiCallback: Failed to open device file" << std::endl;
return SpiComIF::OPENING_FILE_FAILED;
}
// Pull SPI CS low. For now, no support for active high given
if (gpioId != gpio::NO_GPIO) {
result = gpioIF->pullLow(gpioId);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "rwSpiCallback::spiCallback: Failed to pull chip select low" << std::endl;
return result;
}
}
return HasReturnvaluesIF::RETURN_OK;
}
void closeSpi(int fd, gpioId_t gpioId, GpioIF* gpioIF, MutexIF* mutex) {
close(fd);
if (gpioId != gpio::NO_GPIO) { if (gpioId != gpio::NO_GPIO) {
if (gpioIF->pullHigh(gpioId) != HasReturnvaluesIF::RETURN_OK) { if (gpioIF->pullHigh(gpioId) != HasReturnvaluesIF::RETURN_OK) {
sif::error << "closeSpi: Failed to pull chip select high" << std::endl; sif::error << "closeSpi: Failed to pull chip select high" << std::endl;
@ -229,4 +277,7 @@ void closeSpi(gpioId_t gpioId, GpioIF* gpioIF, MutexIF* mutex) {
; ;
} }
} }
} // namespace
} // namespace rwSpiCallback } // namespace rwSpiCallback

@ -33,14 +33,5 @@ static constexpr uint8_t FLAG_BYTE = 0x7E;
ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData, ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData,
size_t sendLen, void* args); size_t sendLen, void* args);
/**
* @brief This function closes a spi session. Pulls the chip select to high an releases the
* mutex.
* @param gpioId Gpio ID of chip select
* @param gpioIF Pointer to gpio interface to drive the chip select
* @param mutex The spi mutex
*/
void closeSpi(gpioId_t gpioId, GpioIF* gpioIF, MutexIF* mutex);
} // namespace rwSpiCallback } // namespace rwSpiCallback
#endif /* BSP_Q7S_RW_SPI_CALLBACK_H_ */ #endif /* BSP_Q7S_RW_SPI_CALLBACK_H_ */

@ -1,6 +1 @@
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE)
)

@ -1,8 +1,4 @@
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE CoreController.cpp InitMission.cpp
CoreController.cpp ObjectFactory.cpp)
InitMission.cpp
)
target_sources(${SIMPLE_OBSW_NAME} PRIVATE target_sources(${SIMPLE_OBSW_NAME} PRIVATE InitMission.cpp)
InitMission.cpp
)

@ -56,6 +56,7 @@ CoreController::CoreController(object_id_t objectId)
} catch (const std::filesystem::filesystem_error &e) { } catch (const std::filesystem::filesystem_error &e) {
sif::error << "CoreController::CoreController: Failed with exception " << e.what() << std::endl; sif::error << "CoreController::CoreController: Failed with exception " << e.what() << std::endl;
} }
sdCardCheckCd.timeOut();
eventQueue = QueueFactory::instance()->createMessageQueue(5, EventMessage::MAX_MESSAGE_SIZE); eventQueue = QueueFactory::instance()->createMessageQueue(5, EventMessage::MAX_MESSAGE_SIZE);
} }
@ -77,6 +78,10 @@ void CoreController::performControlOperation() {
performWatchdogControlOperation(); performWatchdogControlOperation();
sdStateMachine(); sdStateMachine();
performMountedSdCardOperations(); performMountedSdCardOperations();
if (sdCardCheckCd.hasTimedOut()) {
performSdCardCheck();
sdCardCheckCd.resetTimer();
}
readHkData(); readHkData();
opDivider5.checkAndIncrement(); opDivider5.checkAndIncrement();
opDivider10.checkAndIncrement(); opDivider10.checkAndIncrement();
@ -87,6 +92,7 @@ ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &local
localDataPoolMap.emplace(core::TEMPERATURE, new PoolEntry<float>({0})); localDataPoolMap.emplace(core::TEMPERATURE, new PoolEntry<float>({0}));
localDataPoolMap.emplace(core::PS_VOLTAGE, new PoolEntry<float>({0})); localDataPoolMap.emplace(core::PS_VOLTAGE, new PoolEntry<float>({0}));
localDataPoolMap.emplace(core::PL_VOLTAGE, new PoolEntry<float>({0})); localDataPoolMap.emplace(core::PL_VOLTAGE, new PoolEntry<float>({0}));
poolManager.subscribeForPeriodicPacket(hkSet.getSid(), false, 10.0, false);
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }
@ -133,6 +139,9 @@ ReturnValue_t CoreController::initialize() {
ReturnValue_t CoreController::initializeAfterTaskCreation() { ReturnValue_t CoreController::initializeAfterTaskCreation() {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
sdInfo.pref = sdcMan->getPreferredSdCard();
sdcMan->setActiveSdCard(sdInfo.pref);
currMntPrefix = sdcMan->getCurrentMountPrefix();
if (BLOCKING_SD_INIT) { if (BLOCKING_SD_INIT) {
ReturnValue_t result = initSdCardBlocking(); ReturnValue_t result = initSdCardBlocking();
if (result != HasReturnvaluesIF::RETURN_OK and result != SdCardManager::ALREADY_MOUNTED) { if (result != HasReturnvaluesIF::RETURN_OK and result != SdCardManager::ALREADY_MOUNTED) {
@ -164,7 +173,7 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
if (size < 1) { if (size < 1) {
return HasActionsIF::INVALID_PARAMETERS; return HasActionsIF::INVALID_PARAMETERS;
} }
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE; std::string path = sdcMan->getCurrentMountPrefix() + REBOOT_FILE;
// Disable the reboot file mechanism // Disable the reboot file mechanism
parseRebootFile(path, rebootFile); parseRebootFile(path, rebootFile);
if (data[0] == 0) { if (data[0] == 0) {
@ -204,15 +213,20 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
if (size < 1) { if (size < 1) {
return HasActionsIF::INVALID_PARAMETERS; return HasActionsIF::INVALID_PARAMETERS;
} }
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE; std::string path = sdcMan->getCurrentMountPrefix() + REBOOT_FILE;
// Disable the reboot file mechanism // Disable the reboot file mechanism
parseRebootFile(path, rebootFile); parseRebootFile(path, rebootFile);
rebootFile.maxCount = data[0]; rebootFile.maxCount = data[0];
rewriteRebootFile(rebootFile); rewriteRebootFile(rebootFile);
return HasActionsIF::EXECUTION_FINISHED; return HasActionsIF::EXECUTION_FINISHED;
} }
case (XSC_REBOOT_OBC): {
// Warning: This function will never return, because it reboots the system
return actionXscReboot(data, size);
}
case (REBOOT_OBC): { case (REBOOT_OBC): {
return actionPerformReboot(data, size); // Warning: This function will never return, because it reboots the system
return actionReboot(data, size);
} }
default: { default: {
return HasActionsIF::INVALID_ACTION_ID; return HasActionsIF::INVALID_ACTION_ID;
@ -236,13 +250,12 @@ ReturnValue_t CoreController::initSdCardBlocking() {
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
#else #else
result = sdcMan->getSdCardActiveStatus(sdInfo.currentState); result = sdcMan->getSdCardsStatus(sdInfo.currentState);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "Getting SD card activity status failed" << std::endl; sif::warning << "Getting SD card activity status failed" << std::endl;
} }
#if Q7S_SD_CARD_CONFIG == Q7S_SD_COLD_REDUNDANT #if Q7S_SD_CARD_CONFIG == Q7S_SD_COLD_REDUNDANT
determinePreferredSdCard();
updateSdInfoOther(); updateSdInfoOther();
sif::info << "Cold redundant SD card configuration, preferred SD card: " sif::info << "Cold redundant SD card configuration, preferred SD card: "
<< static_cast<int>(sdInfo.pref) << std::endl; << static_cast<int>(sdInfo.pref) << std::endl;
@ -323,8 +336,8 @@ ReturnValue_t CoreController::sdStateMachine() {
if (sdInfo.state == SdStates::SET_STATE_SELF) { if (sdInfo.state == SdStates::SET_STATE_SELF) {
if (not sdInfo.commandExecuted) { if (not sdInfo.commandExecuted) {
result = sdcMan->getSdCardActiveStatus(sdInfo.currentState); result = sdcMan->getSdCardsStatus(sdInfo.currentState);
determinePreferredSdCard(); sdInfo.pref = sdcMan->getPreferredSdCard();
updateSdInfoOther(); updateSdInfoOther();
if (sdInfo.pref != sd::SdCard::SLOT_0 and sdInfo.pref != sd::SdCard::SLOT_1) { if (sdInfo.pref != sd::SdCard::SLOT_0 and sdInfo.pref != sd::SdCard::SLOT_1) {
sif::warning << "Preferred SD card invalid. Setting to card 0.." << std::endl; sif::warning << "Preferred SD card invalid. Setting to card 0.." << std::endl;
@ -467,7 +480,7 @@ ReturnValue_t CoreController::sdStateMachine() {
sdInfo.state = SdStates::IDLE; sdInfo.state = SdStates::IDLE;
sdInfo.cycleCount = 0; sdInfo.cycleCount = 0;
sdcMan->setBlocking(false); sdcMan->setBlocking(false);
sdcMan->getSdCardActiveStatus(sdInfo.currentState); sdcMan->getSdCardsStatus(sdInfo.currentState);
if (not sdInfo.initFinished) { if (not sdInfo.initFinished) {
updateSdInfoOther(); updateSdInfoOther();
sdInfo.initFinished = true; sdInfo.initFinished = true;
@ -844,25 +857,18 @@ void CoreController::initPrint() {
#endif #endif
} }
ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t size) { ReturnValue_t CoreController::actionXscReboot(const uint8_t *data, size_t size) {
if (size < 1) { if (size < 1) {
return HasActionsIF::INVALID_PARAMETERS; return HasActionsIF::INVALID_PARAMETERS;
} }
bool rebootSameBootCopy = data[0]; bool rebootSameBootCopy = data[0];
bool protOpPerformed; bool protOpPerformed = false;
SdCardManager::instance()->setBlocking(true);
if (rebootSameBootCopy) { if (rebootSameBootCopy) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "CoreController::actionPerformReboot: Rebooting on current image" << std::endl; sif::info << "CoreController::actionPerformReboot: Rebooting on current image" << std::endl;
#endif #endif
// Attempt graceful shutdown by unmounting and switching off SD cards gracefulShutdownTasks(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, protOpPerformed);
SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_0);
SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_1);
// If any boot copies are unprotected
ReturnValue_t retval = setBootCopyProtection(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, true,
protOpPerformed, false);
if (retval == HasReturnvaluesIF::RETURN_OK and protOpPerformed) {
sif::info << "Running slot was writeprotected before reboot" << std::endl;
}
int result = std::system("xsc_boot_copy -r"); int result = std::system("xsc_boot_copy -r");
if (result != 0) { if (result != 0) {
utility::handleSystemError(result, "CoreController::executeAction"); utility::handleSystemError(result, "CoreController::executeAction");
@ -884,12 +890,8 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si
auto tgtChip = static_cast<xsc::Chip>(data[1]); auto tgtChip = static_cast<xsc::Chip>(data[1]);
auto tgtCopy = static_cast<xsc::Copy>(data[2]); auto tgtCopy = static_cast<xsc::Copy>(data[2]);
ReturnValue_t retval = // This function can not really fail
setBootCopyProtection(static_cast<xsc::Chip>(data[1]), static_cast<xsc::Copy>(data[2]), true, gracefulShutdownTasks(tgtChip, tgtCopy, protOpPerformed);
protOpPerformed, false);
if (retval == HasReturnvaluesIF::RETURN_OK and protOpPerformed) {
sif::info << "Target slot was writeprotected before reboot" << std::endl;
}
switch (tgtChip) { switch (tgtChip) {
case (xsc::Chip::CHIP_0): { case (xsc::Chip::CHIP_0): {
@ -930,27 +932,32 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si
return HasReturnvaluesIF::RETURN_FAILED; return HasReturnvaluesIF::RETURN_FAILED;
} }
CoreController::~CoreController() {} ReturnValue_t CoreController::actionReboot(const uint8_t *data, size_t size) {
bool protOpPerformed = false;
void CoreController::determinePreferredSdCard() { gracefulShutdownTasks(xsc::Chip::CHIP_0, xsc::Copy::COPY_0, protOpPerformed);
if (sdInfo.pref == sd::SdCard::NONE) { std::system("reboot");
ReturnValue_t result = sdcMan->getPreferredSdCard(sdInfo.pref); return RETURN_OK;
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result == scratch::KEY_NOT_FOUND) {
sif::warning << "CoreController::sdCardInit: "
"Preferred SD card not set. Setting to 0"
<< std::endl;
sdcMan->setPreferredSdCard(sd::SdCard::SLOT_0);
sdInfo.pref = sd::SdCard::SLOT_0;
} else {
sif::warning << "CoreController::sdCardInit: Could not get preferred SD card"
"information from the scratch buffer"
<< std::endl;
}
}
}
} }
ReturnValue_t CoreController::gracefulShutdownTasks(xsc::Chip chip, xsc::Copy copy,
bool &protOpPerformed) {
sdcMan->setBlocking(true);
// Attempt graceful shutdown by unmounting and switching off SD cards
sdcMan->switchOffSdCard(sd::SdCard::SLOT_0);
sdcMan->switchOffSdCard(sd::SdCard::SLOT_1);
// If any boot copies are unprotected
ReturnValue_t result = setBootCopyProtection(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, true,
protOpPerformed, false);
if (result == HasReturnvaluesIF::RETURN_OK and protOpPerformed) {
// TODO: Would be nice to notify operator. But we can't use the filesystem anymore
// and a reboot is imminent. Use scratch buffer?
sif::info << "Running slot was writeprotected before reboot" << std::endl;
}
return result;
}
CoreController::~CoreController() {}
void CoreController::updateSdInfoOther() { void CoreController::updateSdInfoOther() {
if (sdInfo.pref == sd::SdCard::SLOT_0) { if (sdInfo.pref == sd::SdCard::SLOT_0) {
sdInfo.prefChar = "0"; sdInfo.prefChar = "0";
@ -1234,24 +1241,73 @@ void CoreController::performWatchdogControlOperation() {
} }
void CoreController::performMountedSdCardOperations() { void CoreController::performMountedSdCardOperations() {
currMntPrefix = sdcMan->getCurrentMountPrefix(); auto mountedSdCardOp = [&](bool &mntSwitch, sd::SdCard sdCard, std::string mntPoint) {
if (doPerformMountedSdCardOps) { if (mntSwitch) {
bool sdCardMounted = false; bool sdCardMounted = sdcMan->isSdCardMounted(sdCard);
sdCardMounted = sdcMan->isSdCardMounted(sdInfo.pref); if (sdCardMounted and not performOneShotSdCardOpsSwitch) {
if (sdCardMounted) { std::ostringstream path;
std::string path = currMntPrefix + "/" + CONF_FOLDER; path << mntPoint << "/" << CONF_FOLDER;
if (not std::filesystem::exists(path)) { if (not std::filesystem::exists(path.str())) {
std::filesystem::create_directory(path); std::filesystem::create_directory(path.str());
}
initVersionFile();
initClockFromTimeFile();
performRebootFileHandling(false);
performOneShotSdCardOpsSwitch = true;
} }
initVersionFile(); mntSwitch = false;
initClockFromTimeFile();
performRebootFileHandling(false);
doPerformMountedSdCardOps = false;
} }
};
if (sdInfo.pref == sd::SdCard::SLOT_1) {
mountedSdCardOp(sdInfo.mountSwitch.second, sd::SdCard::SLOT_1, SdCardManager::SD_1_MOUNT_POINT);
mountedSdCardOp(sdInfo.mountSwitch.first, sd::SdCard::SLOT_0, SdCardManager::SD_0_MOUNT_POINT);
} else {
mountedSdCardOp(sdInfo.mountSwitch.first, sd::SdCard::SLOT_0, SdCardManager::SD_0_MOUNT_POINT);
mountedSdCardOp(sdInfo.mountSwitch.second, sd::SdCard::SLOT_1, SdCardManager::SD_1_MOUNT_POINT);
} }
timeFileHandler(); timeFileHandler();
} }
ReturnValue_t CoreController::performSdCardCheck() {
bool mountedReadOnly = false;
SdCardManager::SdStatePair active;
sdcMan->getSdCardsStatus(active);
auto sdCardCheck = [&](sd::SdCard sdCard) {
ReturnValue_t result = sdcMan->isSdCardMountedReadOnly(sdCard, mountedReadOnly);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "CoreController::performSdCardCheck: Could not check "
"read-only mount state"
<< std::endl;
mountedReadOnly = true;
}
if (mountedReadOnly) {
int linuxErrno = 0;
result = sdcMan->performFsck(sdCard, true, linuxErrno);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "CoreController::performSdCardCheck: fsck command on SD Card "
<< static_cast<uint8_t>(sdCard) << " failed with code " << linuxErrno << " | "
<< strerror(linuxErrno);
}
result = sdcMan->remountReadWrite(sdCard);
if (result == HasReturnvaluesIF::RETURN_OK) {
sif::warning << "CoreController::performSdCardCheck: Remounted SD Card "
<< static_cast<uint8_t>(sdCard) << " read-write";
} else {
sif::error << "CoreController::performSdCardCheck: Remounting SD Card "
<< static_cast<uint8_t>(sdCard) << " read-write failed";
}
}
};
if (active.first == sd::SdState::MOUNTED) {
sdCardCheck(sd::SdCard::SLOT_0);
}
if (active.second == sd::SdState::MOUNTED) {
sdCardCheck(sd::SdCard::SLOT_1);
}
return RETURN_OK;
}
void CoreController::performRebootFileHandling(bool recreateFile) { void CoreController::performRebootFileHandling(bool recreateFile) {
using namespace std; using namespace std;
std::string path = currMntPrefix + REBOOT_FILE; std::string path = currMntPrefix + REBOOT_FILE;
@ -1677,7 +1733,7 @@ void CoreController::rewriteRebootFile(RebootFile file) {
} }
void CoreController::setRebootMechanismLock(bool lock, xsc::Chip tgtChip, xsc::Copy tgtCopy) { void CoreController::setRebootMechanismLock(bool lock, xsc::Chip tgtChip, xsc::Copy tgtCopy) {
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE; std::string path = currMntPrefix + REBOOT_FILE;
// Disable the reboot file mechanism // Disable the reboot file mechanism
parseRebootFile(path, rebootFile); parseRebootFile(path, rebootFile);
if (tgtChip == xsc::CHIP_0) { if (tgtChip == xsc::CHIP_0) {

@ -67,13 +67,16 @@ class CoreController : public ExtendedControllerBase {
static constexpr ActionId_t SWITCH_IMG_LOCK = 7; static constexpr ActionId_t SWITCH_IMG_LOCK = 7;
static constexpr ActionId_t SET_MAX_REBOOT_CNT = 8; static constexpr ActionId_t SET_MAX_REBOOT_CNT = 8;
static constexpr ActionId_t REBOOT_OBC = 32; //! Reboot using the xsc_boot_copy command
static constexpr ActionId_t XSC_REBOOT_OBC = 32;
static constexpr ActionId_t MOUNT_OTHER_COPY = 33; static constexpr ActionId_t MOUNT_OTHER_COPY = 33;
//! Reboot using the reboot command
static constexpr ActionId_t REBOOT_OBC = 34;
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::CORE; static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::CORE;
static constexpr Event ALLOC_FAILURE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); static constexpr Event ALLOC_FAILURE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
//! [EXPORT] : [COMMENT] Software reboot occured. Can also be a systemd reboot. //! [EXPORT] : [COMMENT] Software reboot occurred. Can also be a systemd reboot.
//! P1: Current Chip, P2: Current Copy //! P1: Current Chip, P2: Current Copy
static constexpr Event REBOOT_SW = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM); static constexpr Event REBOOT_SW = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM);
//! [EXPORT] : [COMMENT] The reboot mechanism was triggered. //! [EXPORT] : [COMMENT] The reboot mechanism was triggered.
@ -159,11 +162,12 @@ class CoreController : public ExtendedControllerBase {
struct SdInfo { struct SdInfo {
sd::SdCard pref = sd::SdCard::NONE; sd::SdCard pref = sd::SdCard::NONE;
sd::SdState prefState = sd::SdState::OFF;
sd::SdCard other = sd::SdCard::NONE; sd::SdCard other = sd::SdCard::NONE;
sd::SdState prefState = sd::SdState::OFF;
sd::SdState otherState = sd::SdState::OFF; sd::SdState otherState = sd::SdState::OFF;
std::string prefChar = "0"; std::string prefChar = "0";
std::string otherChar = "1"; std::string otherChar = "1";
std::pair<bool, bool> mountSwitch = {true, true};
SdStates state = SdStates::START; SdStates state = SdStates::START;
// Used to track whether a command was executed // Used to track whether a command was executed
bool commandExecuted = true; bool commandExecuted = true;
@ -179,7 +183,7 @@ class CoreController : public ExtendedControllerBase {
} sdInfo; } sdInfo;
RebootFile rebootFile = {}; RebootFile rebootFile = {};
std::string currMntPrefix; std::string currMntPrefix;
bool doPerformMountedSdCardOps = true; bool performOneShotSdCardOpsSwitch = true;
/** /**
* Index 0: Chip 0 Copy 0 * Index 0: Chip 0 Copy 0
@ -195,12 +199,14 @@ class CoreController : public ExtendedControllerBase {
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override; LocalDataPoolManager& poolManager) override;
Countdown sdCardCheckCd = Countdown(120000);
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode); ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode);
void performMountedSdCardOperations(); void performMountedSdCardOperations();
ReturnValue_t initVersionFile(); ReturnValue_t initVersionFile();
ReturnValue_t initClockFromTimeFile(); ReturnValue_t initClockFromTimeFile();
ReturnValue_t performSdCardCheck();
ReturnValue_t timeFileHandler(); ReturnValue_t timeFileHandler();
ReturnValue_t initBootCopy(); ReturnValue_t initBootCopy();
ReturnValue_t initWatchdogFifo(); ReturnValue_t initWatchdogFifo();
@ -214,14 +220,16 @@ class CoreController : public ExtendedControllerBase {
ReturnValue_t sdColdRedundantBlockingInit(); ReturnValue_t sdColdRedundantBlockingInit();
void currentStateSetter(sd::SdCard sdCard, sd::SdState newState); void currentStateSetter(sd::SdCard sdCard, sd::SdState newState);
void determinePreferredSdCard();
void executeNextExternalSdCommand(); void executeNextExternalSdCommand();
void checkExternalSdCommandStatus(); void checkExternalSdCommandStatus();
void performRebootFileHandling(bool recreateFile); void performRebootFileHandling(bool recreateFile);
ReturnValue_t actionListDirectoryIntoFile(ActionId_t actionId, MessageQueueId_t commandedBy, ReturnValue_t actionListDirectoryIntoFile(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t* data, size_t size); const uint8_t* data, size_t size);
ReturnValue_t actionPerformReboot(const uint8_t* data, size_t size); ReturnValue_t actionXscReboot(const uint8_t* data, size_t size);
ReturnValue_t actionReboot(const uint8_t* data, size_t size);
ReturnValue_t gracefulShutdownTasks(xsc::Chip chip, xsc::Copy copy, bool& protOpPerformed);
void performWatchdogControlOperation(); void performWatchdogControlOperation();

@ -1,5 +1,7 @@
#include "bsp_q7s/core/InitMission.h" #include "bsp_q7s/core/InitMission.h"
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
@ -13,6 +15,7 @@
#include "fsfw/tasks/FixedTimeslotTaskIF.h" #include "fsfw/tasks/FixedTimeslotTaskIF.h"
#include "fsfw/tasks/PeriodicTaskIF.h" #include "fsfw/tasks/PeriodicTaskIF.h"
#include "fsfw/tasks/TaskFactory.h" #include "fsfw/tasks/TaskFactory.h"
#include "mission/devices/devicedefinitions/Max31865Definitions.h"
#include "mission/utility/InitMission.h" #include "mission/utility/InitMission.h"
#include "pollingsequence/pollingSequenceFactory.h" #include "pollingsequence/pollingSequenceFactory.h"
@ -33,8 +36,16 @@ ObjectManagerIF* objectManager = nullptr;
void initmission::initMission() { void initmission::initMission() {
sif::info << "Building global objects.." << std::endl; sif::info << "Building global objects.." << std::endl;
/* Instantiate global object manager and also create all objects */ try {
ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr); /* Instantiate global object manager and also create all objects */
ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
} catch (const std::invalid_argument& e) {
sif::error << "initmission::initMission: Object Construction failed with an "
"invalid argument: "
<< e.what();
std::exit(1);
}
sif::info << "Initializing all objects.." << std::endl; sif::info << "Initializing all objects.." << std::endl;
ObjectManager::instance()->initialize(); ObjectManager::instance()->initialize();
@ -115,30 +126,72 @@ void initmission::initTasks() {
#if OBSW_ADD_ACS_HANDLERS == 1 #if OBSW_ADD_ACS_HANDLERS == 1
PeriodicTaskIF* acsTask = factory->createPeriodicTask( PeriodicTaskIF* acsTask = factory->createPeriodicTask(
"ACS_CTRL", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); "ACS_TASK", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc);
result = acsTask->addComponent(objects::GPS_CONTROLLER); result = acsTask->addComponent(objects::GPS_CONTROLLER);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER); initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER);
} }
#endif /* OBSW_ADD_ACS_HANDLERS */ #endif /* OBSW_ADD_ACS_HANDLERS */
PeriodicTaskIF* sysTask = factory->createPeriodicTask( PeriodicTaskIF* sysTask = factory->createPeriodicTask(
"SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc);
static_cast<void>(sysTask);
#if OBSW_ADD_ACS_HANDLERS == 1
result = sysTask->addComponent(objects::ACS_BOARD_ASS); result = sysTask->addComponent(objects::ACS_BOARD_ASS);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS); initmission::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS);
} }
#endif /* OBSW_ADD_ACS_HANDLERS */
#if OBSW_ADD_RW == 1
result = sysTask->addComponent(objects::RW_ASS);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("RW_ASS", objects::RW_ASS);
}
#endif
#if OBSW_ADD_SUS_BOARD_ASS == 1 #if OBSW_ADD_SUS_BOARD_ASS == 1
result = sysTask->addComponent(objects::SUS_BOARD_ASS); result = sysTask->addComponent(objects::SUS_BOARD_ASS);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS); initmission::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS);
} }
#endif #endif
result = sysTask->addComponent(objects::TCS_BOARD_ASS);
#if OBSW_ADD_RTD_DEVICES == 1
PeriodicTaskIF* tcsPollingTask = factory->createPeriodicTask(
"TCS_POLLING_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc);
result = tcsPollingTask->addComponent(objects::SPI_RTD_COM_IF);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS); initmission::printAddObjectError("SPI_RTD_POLLING", objects::SPI_RTD_COM_IF);
} }
PeriodicTaskIF* tcsTask = factory->createPeriodicTask(
"TCS_TASK", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
std::array<object_id_t, EiveMax31855::NUM_RTDS> rtdIds = {
objects::RTD_0_IC3_PLOC_HEATSPREADER,
objects::RTD_1_IC4_PLOC_MISSIONBOARD,
objects::RTD_2_IC5_4K_CAMERA,
objects::RTD_3_IC6_DAC_HEATSPREADER,
objects::RTD_4_IC7_STARTRACKER,
objects::RTD_5_IC8_RW1_MX_MY,
objects::RTD_6_IC9_DRO,
objects::RTD_7_IC10_SCEX,
objects::RTD_8_IC11_X8,
objects::RTD_9_IC12_HPA,
objects::RTD_10_IC13_PL_TX,
objects::RTD_11_IC14_MPA,
objects::RTD_12_IC15_ACU,
objects::RTD_13_IC16_PLPCDU_HEATSPREADER,
objects::RTD_14_IC17_TCS_BOARD,
objects::RTD_15_IC18_IMTQ,
};
tcsTask->addComponent(objects::TCS_BOARD_ASS);
tcsTask->addComponent(objects::THERMAL_CONTROLLER);
for (const auto& rtd : rtdIds) {
tcsTask->addComponent(rtd, DeviceHandlerIF::PERFORM_OPERATION);
tcsTask->addComponent(rtd, DeviceHandlerIF::SEND_WRITE);
tcsTask->addComponent(rtd, DeviceHandlerIF::GET_WRITE);
tcsTask->addComponent(rtd, DeviceHandlerIF::SEND_READ);
tcsTask->addComponent(rtd, DeviceHandlerIF::GET_READ);
}
#endif /* OBSW_ADD_RTD_DEVICES */
// FS task, task interval does not matter because it runs in permanent loop, priority low // FS task, task interval does not matter because it runs in permanent loop, priority low
// because it is a non-essential background task // because it is a non-essential background task
@ -167,6 +220,15 @@ void initmission::initTasks() {
} }
#endif /* OBSW_ADD_PLOC_MPSOC */ #endif /* OBSW_ADD_PLOC_MPSOC */
#if OBSW_ADD_PLOC_SUPERVISOR == 1
PeriodicTaskIF* supvHelperTask = factory->createPeriodicTask(
"PLOC_SUPV_HELPER", 10, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc);
result = supvHelperTask->addComponent(objects::PLOC_SUPERVISOR_HELPER);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PLOC_SUPV_HELPER", objects::PLOC_SUPERVISOR_HELPER);
}
#endif /* OBSW_ADD_PLOC_SUPERVISOR */
#if OBSW_TEST_CCSDS_BRIDGE == 1 #if OBSW_TEST_CCSDS_BRIDGE == 1
PeriodicTaskIF* ptmeTestTask = factory->createPeriodicTask( PeriodicTaskIF* ptmeTestTask = factory->createPeriodicTask(
"PTME_TEST", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); "PTME_TEST", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
@ -228,9 +290,15 @@ void initmission::initTasks() {
#if OBSW_ADD_ACS_HANDLERS == 1 #if OBSW_ADD_ACS_HANDLERS == 1
acsTask->startTask(); acsTask->startTask();
#endif #endif /* OBSW_ADD_ACS_HANDLERS == 1 */
sysTask->startTask(); sysTask->startTask();
#if OBSW_ADD_RTD_DEVICES == 1
tcsPollingTask->startTask();
tcsTask->startTask();
#endif /* OBSW_ADD_RTD_DEVICES == 1 */
#if OBSW_ADD_PLOC_SUPERVISOR == 1
supvHelperTask->startTask();
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
sif::info << "Tasks started.." << std::endl; sif::info << "Tasks started.." << std::endl;
} }
@ -241,7 +309,7 @@ void initmission::createPstTasks(TaskFactory& factory,
/* Polling Sequence Table Default */ /* Polling Sequence Table Default */
#if OBSW_ADD_SPI_TEST_CODE == 0 #if OBSW_ADD_SPI_TEST_CODE == 0
FixedTimeslotTaskIF* spiPst = factory.createFixedTimeslotTask( FixedTimeslotTaskIF* spiPst = factory.createFixedTimeslotTask(
"PST_TASK_DEFAULT", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc); "MAIN_SPI", 75, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc);
result = pst::pstSpi(spiPst); result = pst::pstSpi(spiPst);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
@ -254,8 +322,23 @@ void initmission::createPstTasks(TaskFactory& factory,
} }
#endif #endif
#if OBSW_ADD_RW == 1
FixedTimeslotTaskIF* rwPstTask = factory.createFixedTimeslotTask(
"RW_SPI", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 1.0, missedDeadlineFunc);
result = pst::pstSpiRw(rwPstTask);
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
sif::warning << "InitMission::initTasks: SPI PST is empty" << std::endl;
} else {
sif::error << "InitMission::initTasks: Creating SPI PST failed!" << std::endl;
}
} else {
taskVec.push_back(rwPstTask);
}
#endif
FixedTimeslotTaskIF* uartPst = factory.createFixedTimeslotTask( FixedTimeslotTaskIF* uartPst = factory.createFixedTimeslotTask(
"UART_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); "UART_PST", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc);
result = pst::pstUart(uartPst); result = pst::pstUart(uartPst);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
@ -268,7 +351,7 @@ void initmission::createPstTasks(TaskFactory& factory,
} }
FixedTimeslotTaskIF* gpioPst = factory.createFixedTimeslotTask( FixedTimeslotTaskIF* gpioPst = factory.createFixedTimeslotTask(
"GPIO_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); "GPIO_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.2, missedDeadlineFunc);
result = pst::pstGpio(gpioPst); result = pst::pstGpio(gpioPst);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
@ -281,7 +364,7 @@ void initmission::createPstTasks(TaskFactory& factory,
} }
#if OBSW_ADD_I2C_TEST_CODE == 0 #if OBSW_ADD_I2C_TEST_CODE == 0
FixedTimeslotTaskIF* i2cPst = factory.createFixedTimeslotTask( FixedTimeslotTaskIF* i2cPst = factory.createFixedTimeslotTask(
"I2C_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); "I2C_PST", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc);
result = pst::pstI2c(i2cPst); result = pst::pstI2c(i2cPst);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
@ -346,21 +429,30 @@ void initmission::createPusTasks(TaskFactory& factory,
PeriodicTaskIF* pusMedPrio = factory.createPeriodicTask( PeriodicTaskIF* pusMedPrio = factory.createPeriodicTask(
"PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); "PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS_3", objects::PUS_SERVICE_3_HOUSEKEEPING);
}
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT); result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS_8", objects::PUS_SERVICE_8_FUNCTION_MGMT); initmission::printAddObjectError("PUS_8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
} }
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING); result = pusMedPrio->addComponent(objects::PUS_SERVICE_11_TC_SCHEDULER);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Object add component failed" << std::endl; initmission::printAddObjectError("PUS_11", objects::PUS_SERVICE_11_TC_SCHEDULER);
}
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS_20", objects::PUS_SERVICE_20_PARAMETERS);
} }
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT); result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS_200", objects::PUS_SERVICE_200_MODE_MGMT); initmission::printAddObjectError("PUS_200", objects::PUS_SERVICE_200_MODE_MGMT);
} }
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS); result = pusMedPrio->addComponent(objects::PUS_SERVICE_201_HEALTH);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PUS_20", objects::PUS_SERVICE_20_PARAMETERS); initmission::printAddObjectError("PUS_201", objects::PUS_SERVICE_201_HEALTH);
} }
taskVec.push_back(pusMedPrio); taskVec.push_back(pusMedPrio);

@ -3,7 +3,7 @@
#include <vector> #include <vector>
#include "fsfw/tasks/Typedef.h" #include "fsfw/tasks/definitions.h"
class PeriodicTaskIF; class PeriodicTaskIF;
class TaskFactory; class TaskFactory;

@ -1,5 +1,4 @@
#include <mission/system/fdir/GomspacePowerFdir.h> #include "ObjectFactory.h"
#include <mission/system/fdir/SyrlinksFdir.h>
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "bsp_q7s/boardtest/Q7STestTask.h" #include "bsp_q7s/boardtest/Q7STestTask.h"
@ -7,8 +6,6 @@
#include "bsp_q7s/callbacks/pcduSwitchCb.h" #include "bsp_q7s/callbacks/pcduSwitchCb.h"
#include "bsp_q7s/callbacks/q7sGpioCallbacks.h" #include "bsp_q7s/callbacks/q7sGpioCallbacks.h"
#include "bsp_q7s/callbacks/rwSpiCallback.h" #include "bsp_q7s/callbacks/rwSpiCallback.h"
#include "bsp_q7s/core/CoreController.h"
#include "bsp_q7s/core/ObjectFactory.h"
#include "bsp_q7s/memory/FileSystemHandler.h" #include "bsp_q7s/memory/FileSystemHandler.h"
#include "busConf.h" #include "busConf.h"
#include "ccsdsConfig.h" #include "ccsdsConfig.h"
@ -31,7 +28,6 @@
#include "linux/devices/ploc/PlocMPSoCHelper.h" #include "linux/devices/ploc/PlocMPSoCHelper.h"
#include "linux/devices/ploc/PlocMemoryDumper.h" #include "linux/devices/ploc/PlocMemoryDumper.h"
#include "linux/devices/ploc/PlocSupervisorHandler.h" #include "linux/devices/ploc/PlocSupervisorHandler.h"
#include "linux/devices/ploc/PlocUpdater.h"
#include "linux/devices/startracker/StarTrackerHandler.h" #include "linux/devices/startracker/StarTrackerHandler.h"
#include "linux/devices/startracker/StrHelper.h" #include "linux/devices/startracker/StrHelper.h"
#include "linux/obc/AxiPtmeConfig.h" #include "linux/obc/AxiPtmeConfig.h"
@ -39,11 +35,12 @@
#include "linux/obc/PdecHandler.h" #include "linux/obc/PdecHandler.h"
#include "linux/obc/Ptme.h" #include "linux/obc/Ptme.h"
#include "linux/obc/PtmeConfig.h" #include "linux/obc/PtmeConfig.h"
#include "mission/system/SusAssembly.h" #include "mission/system/RwAssembly.h"
#include "mission/system/TcsBoardAssembly.h"
#include "mission/system/fdir/AcsBoardFdir.h" #include "mission/system/fdir/AcsBoardFdir.h"
#include "mission/system/fdir/GomspacePowerFdir.h"
#include "mission/system/fdir/RtdFdir.h" #include "mission/system/fdir/RtdFdir.h"
#include "mission/system/fdir/SusFdir.h" #include "mission/system/fdir/SusFdir.h"
#include "mission/system/fdir/SyrlinksFdir.h"
#include "tmtc/apid.h" #include "tmtc/apid.h"
#include "tmtc/pusIds.h" #include "tmtc/pusIds.h"
#if OBSW_TEST_LIBGPIOD == 1 #if OBSW_TEST_LIBGPIOD == 1
@ -82,24 +79,20 @@
#include "mission/devices/RadiationSensorHandler.h" #include "mission/devices/RadiationSensorHandler.h"
#include "mission/devices/RwHandler.h" #include "mission/devices/RwHandler.h"
#include "mission/devices/SolarArrayDeploymentHandler.h" #include "mission/devices/SolarArrayDeploymentHandler.h"
#include "mission/devices/SusHandler.h"
#include "mission/devices/SyrlinksHkHandler.h" #include "mission/devices/SyrlinksHkHandler.h"
#include "mission/devices/Tmp1075Handler.h" #include "mission/devices/Tmp1075Handler.h"
#include "mission/devices/devicedefinitions/GomspaceDefinitions.h" #include "mission/devices/devicedefinitions/GomspaceDefinitions.h"
#include "mission/devices/devicedefinitions/Max31865Definitions.h" #include "mission/devices/devicedefinitions/Max31865Definitions.h"
#include "mission/devices/devicedefinitions/RadSensorDefinitions.h" #include "mission/devices/devicedefinitions/RadSensorDefinitions.h"
#include "mission/devices/devicedefinitions/RwDefinitions.h" #include "mission/devices/devicedefinitions/RwDefinitions.h"
#include "mission/devices/devicedefinitions/SusDefinitions.h"
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" #include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
#include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" #include "mission/devices/devicedefinitions/payloadPcduDefinitions.h"
#include "mission/system/AcsBoardAssembly.h" #include "mission/system/AcsBoardAssembly.h"
#include "mission/tmtc/CCSDSHandler.h" #include "mission/tmtc/CCSDSHandler.h"
#include "mission/tmtc/TmFunnel.h"
#include "mission/tmtc/VirtualChannel.h" #include "mission/tmtc/VirtualChannel.h"
#include "mission/utility/TmFunnel.h"
ResetArgs resetArgsGnss0;
ResetArgs resetArgsGnss1;
void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); } ResetArgs RESET_ARGS_GNSS;
void Factory::setStaticFrameworkObjectIds() { void Factory::setStaticFrameworkObjectIds() {
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR; PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
@ -108,8 +101,12 @@ void Factory::setStaticFrameworkObjectIds() {
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
#if OBSW_Q7S_EM == 1
DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
#else
DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER; DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER;
// DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT; #endif /* OBSW_Q7S_EM == 1 */
#if OBSW_TM_TO_PTME == 1 #if OBSW_TM_TO_PTME == 1
TmFunnel::downlinkDestination = objects::CCSDS_HANDLER; TmFunnel::downlinkDestination = objects::CCSDS_HANDLER;
#else #else
@ -124,87 +121,7 @@ void Factory::setStaticFrameworkObjectIds() {
TmPacketBase::timeStamperId = objects::TIME_STAMPER; TmPacketBase::timeStamperId = objects::TIME_STAMPER;
} }
void ObjectFactory::produce(void* args) { void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); }
ObjectFactory::setStatics();
ObjectFactory::produceGenericObjects();
LinuxLibgpioIF* gpioComIF = nullptr;
UartComIF* uartComIF = nullptr;
SpiComIF* spiComIF = nullptr;
I2cComIF* i2cComIF = nullptr;
PowerSwitchIF* pwrSwitcher = nullptr;
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiComIF, &i2cComIF);
createTmpComponents();
new CoreController(objects::CORE_CONTROLLER);
gpioCallbacks::disableAllDecoder(gpioComIF);
createPcduComponents(gpioComIF, &pwrSwitcher);
createRadSensorComponent(gpioComIF);
createSunSensorComponents(gpioComIF, spiComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
#if OBSW_ADD_ACS_BOARD == 1
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
#endif
createHeaterComponents();
createSolarArrayDeploymentComponents();
createPlPcduComponents(gpioComIF, spiComIF, pwrSwitcher);
#if OBSW_ADD_SYRLINKS == 1
createSyrlinksComponents(pwrSwitcher);
#endif /* OBSW_ADD_SYRLINKS == 1 */
createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher);
createPayloadComponents(gpioComIF);
#if OBSW_ADD_MGT == 1
I2cCookie* imtqI2cCookie =
new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV);
auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie,
pcdu::Switches::PDU1_CH3_MGT_5V);
imtqHandler->setPowerSwitcher(pwrSwitcher);
static_cast<void>(imtqHandler);
#if OBSW_TEST_IMTQ == 1
imtqHandler->setStartUpImmediately();
imtqHandler->setToGoToNormal(true);
#endif
#if OBSW_DEBUG_IMTQ == 1
imtqHandler->setDebugMode(true);
#endif
#endif
createReactionWheelComponents(gpioComIF);
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
I2cCookie* bpxI2cCookie = new I2cCookie(addresses::BPX_BATTERY, 100, q7s::I2C_DEFAULT_DEV);
BpxBatteryHandler* bpxHandler =
new BpxBatteryHandler(objects::BPX_BATT_HANDLER, objects::I2C_COM_IF, bpxI2cCookie);
bpxHandler->setStartUpImmediately();
bpxHandler->setToGoToNormalMode(true);
#if OBSW_DEBUG_BPX_BATT == 1
bpxHandler->setDebugMode(true);
#endif
#endif
new FileSystemHandler(objects::FILE_SYSTEM_HANDLER);
#if OBSW_ADD_STAR_TRACKER == 1
UartCookie* starTrackerCookie =
new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, uart::STAR_TRACKER_BAUD,
startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL);
starTrackerCookie->setNoFixedSizeReply();
StrHelper* strHelper = new StrHelper(objects::STR_HELPER);
auto starTracker =
new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie,
strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V);
starTracker->setPowerSwitcher(pwrSwitcher);
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
#if OBSW_USE_CCSDS_IP_CORE == 1
createCcsdsComponents(gpioComIF);
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
/* Test Task */
#if OBSW_ADD_TEST_CODE == 1
createTestComponents(gpioComIF);
#endif /* OBSW_ADD_TEST_CODE == 1 */
new PlocUpdater(objects::PLOC_UPDATER);
new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER);
}
void ObjectFactory::createTmpComponents() { void ObjectFactory::createTmpComponents() {
I2cCookie* i2cCookieTmp1075tcs1 = I2cCookie* i2cCookieTmp1075tcs1 =
@ -222,8 +139,10 @@ void ObjectFactory::createTmpComponents() {
} }
void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF, void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
SpiComIF** spiComIF, I2cComIF** i2cComIF) { SpiComIF** spiMainComIF, I2cComIF** i2cComIF,
if (gpioComIF == nullptr or uartComIF == nullptr or spiComIF == nullptr) { SpiComIF** spiRWComIF) {
if (gpioComIF == nullptr or uartComIF == nullptr or spiMainComIF == nullptr or
spiRWComIF == nullptr) {
sif::error << "ObjectFactory::createCommunicationInterfaces: Invalid passed ComIF pointer" sif::error << "ObjectFactory::createCommunicationInterfaces: Invalid passed ComIF pointer"
<< std::endl; << std::endl;
} }
@ -233,8 +152,8 @@ void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, Ua
new CspComIF(objects::CSP_COM_IF); new CspComIF(objects::CSP_COM_IF);
*i2cComIF = new I2cComIF(objects::I2C_COM_IF); *i2cComIF = new I2cComIF(objects::I2C_COM_IF);
*uartComIF = new UartComIF(objects::UART_COM_IF); *uartComIF = new UartComIF(objects::UART_COM_IF);
*spiComIF = new SpiComIF(objects::SPI_COM_IF, *gpioComIF); *spiMainComIF = new SpiComIF(objects::SPI_MAIN_COM_IF, q7s::SPI_DEFAULT_DEV, *gpioComIF);
*spiRWComIF = new SpiComIF(objects::SPI_RW_COM_IF, q7s::SPI_RW_DEV, *gpioComIF);
/* Adding gpios for chip select decoding to the gpioComIf */ /* Adding gpios for chip select decoding to the gpioComIf */
q7s::gpioCallbacks::initSpiCsDecoder(*gpioComIF); q7s::gpioCallbacks::initSpiCsDecoder(*gpioComIF);
} }
@ -292,12 +211,13 @@ void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) {
gpio = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_RADFET, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_RADFET, consumer.str(), Direction::OUT,
Levels::LOW); Levels::LOW);
gpioCookieRadSensor->addGpio(gpioIds::ENABLE_RADFET, gpio); gpioCookieRadSensor->addGpio(gpioIds::ENABLE_RADFET, gpio);
gpioComIF->addGpios(gpioCookieRadSensor); gpioChecker(gpioComIF->addGpios(gpioCookieRadSensor), "RAD sensor");
SpiCookie* spiCookieRadSensor = new SpiCookie( SpiCookie* spiCookieRadSensor =
addresses::RAD_SENSOR, gpioIds::CS_RAD_SENSOR, std::string(q7s::SPI_DEFAULT_DEV), new SpiCookie(addresses::RAD_SENSOR, gpioIds::CS_RAD_SENSOR, RAD_SENSOR::READ_SIZE,
RAD_SENSOR::READ_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED); spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED);
auto radSensor = new RadiationSensorHandler(objects::RAD_SENSOR, objects::SPI_COM_IF, spiCookieRadSensor->setMutexParams(MutexIF::TimeoutType::WAITING, spi::RAD_SENSOR_CS_TIMEOUT);
auto radSensor = new RadiationSensorHandler(objects::RAD_SENSOR, objects::SPI_MAIN_COM_IF,
spiCookieRadSensor, gpioComIF); spiCookieRadSensor, gpioComIF);
static_cast<void>(radSensor); static_cast<void>(radSensor);
// The radiation sensor ADC is powered by the 5V stack connector which should always be on // The radiation sensor ADC is powered by the 5V stack connector which should always be on
@ -408,16 +328,16 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_SELECT, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_SELECT, consumer.str(), Direction::OUT,
Levels::LOW); Levels::LOW);
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_SELECT, gpio); gpioCookieAcsBoard->addGpio(gpioIds::GNSS_SELECT, gpio);
gpioComIF->addGpios(gpioCookieAcsBoard); gpioChecker(gpioComIF->addGpios(gpioCookieAcsBoard), "ACS Board");
AcsBoardFdir* fdir = nullptr; AcsBoardFdir* fdir = nullptr;
static_cast<void>(fdir); static_cast<void>(fdir);
#if OBSW_ADD_ACS_HANDLERS == 1 #if OBSW_ADD_ACS_HANDLERS == 1
std::string spiDev = q7s::SPI_DEFAULT_DEV; std::string spiDev = q7s::SPI_DEFAULT_DEV;
SpiCookie* spiCookie = SpiCookie* spiCookie =
new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev, new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
auto mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_COM_IF, auto mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF,
spiCookie, spi::LIS3_TRANSITION_DELAY); spiCookie, spi::LIS3_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER); fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER);
mgmLis3Handler->setCustomFdir(fdir); mgmLis3Handler->setCustomFdir(fdir);
@ -430,10 +350,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
mgmLis3Handler->enablePeriodicPrintouts(true, 10); mgmLis3Handler->enablePeriodicPrintouts(true, 10);
#endif #endif
spiCookie = spiCookie =
new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev, new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, RM3100::MAX_BUFFER_SIZE,
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
auto mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_COM_IF, auto mgmRm3100Handler =
spiCookie, spi::RM3100_TRANSITION_DELAY); new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie,
spi::RM3100_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::MGM_1_RM3100_HANDLER); fdir = new AcsBoardFdir(objects::MGM_1_RM3100_HANDLER);
mgmRm3100Handler->setCustomFdir(fdir); mgmRm3100Handler->setCustomFdir(fdir);
mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS); mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS);
@ -446,9 +367,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
mgmRm3100Handler->enablePeriodicPrintouts(true, 10); mgmRm3100Handler->enablePeriodicPrintouts(true, 10);
#endif #endif
spiCookie = spiCookie =
new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev, new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_COM_IF, mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF,
spiCookie, spi::LIS3_TRANSITION_DELAY); spiCookie, spi::LIS3_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER); fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER);
mgmLis3Handler->setCustomFdir(fdir); mgmLis3Handler->setCustomFdir(fdir);
@ -462,9 +383,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
mgmLis3Handler->enablePeriodicPrintouts(true, 10); mgmLis3Handler->enablePeriodicPrintouts(true, 10);
#endif #endif
spiCookie = spiCookie =
new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, spiDev, new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, RM3100::MAX_BUFFER_SIZE,
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_COM_IF, mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF,
spiCookie, spi::RM3100_TRANSITION_DELAY); spiCookie, spi::RM3100_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER); fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER);
mgmRm3100Handler->setCustomFdir(fdir); mgmRm3100Handler->setCustomFdir(fdir);
@ -478,11 +399,12 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
#endif #endif
// Commented until ACS board V2 in in clean room again // Commented until ACS board V2 in in clean room again
// Gyro 0 Side A // Gyro 0 Side A
spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev, spiCookie =
ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE, new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE,
spi::DEFAULT_ADIS16507_SPEED); spi::DEFAULT_ADIS16507_MODE, spi::DEFAULT_ADIS16507_SPEED);
auto adisHandler = new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF, auto adisHandler =
spiCookie, ADIS1650X::Type::ADIS16505); new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie,
ADIS1650X::Type::ADIS16505);
fdir = new AcsBoardFdir(objects::GYRO_0_ADIS_HANDLER); fdir = new AcsBoardFdir(objects::GYRO_0_ADIS_HANDLER);
adisHandler->setCustomFdir(fdir); adisHandler->setCustomFdir(fdir);
adisHandler->setParent(objects::ACS_BOARD_ASS); adisHandler->setParent(objects::ACS_BOARD_ASS);
@ -495,11 +417,10 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
adisHandler->enablePeriodicPrintouts(true, 10); adisHandler->enablePeriodicPrintouts(true, 10);
#endif #endif
// Gyro 1 Side A // Gyro 1 Side A
spiCookie = spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, L3GD20H::MAX_BUFFER_SIZE,
new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); auto gyroL3gHandler = new GyroHandlerL3GD20H(
auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF, objects::GYRO_1_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY);
spiCookie, spi::L3G_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER); fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER);
gyroL3gHandler->setCustomFdir(fdir); gyroL3gHandler->setCustomFdir(fdir);
gyroL3gHandler->setParent(objects::ACS_BOARD_ASS); gyroL3gHandler->setParent(objects::ACS_BOARD_ASS);
@ -512,10 +433,10 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
gyroL3gHandler->enablePeriodicPrintouts(true, 10); gyroL3gHandler->enablePeriodicPrintouts(true, 10);
#endif #endif
// Gyro 2 Side B // Gyro 2 Side B
spiCookie = new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, spiDev, spiCookie =
ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE, new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE,
spi::DEFAULT_ADIS16507_SPEED); spi::DEFAULT_ADIS16507_MODE, spi::DEFAULT_ADIS16507_SPEED);
adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_COM_IF, adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_MAIN_COM_IF,
spiCookie, ADIS1650X::Type::ADIS16505); spiCookie, ADIS1650X::Type::ADIS16505);
fdir = new AcsBoardFdir(objects::GYRO_2_ADIS_HANDLER); fdir = new AcsBoardFdir(objects::GYRO_2_ADIS_HANDLER);
adisHandler->setCustomFdir(fdir); adisHandler->setCustomFdir(fdir);
@ -525,10 +446,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
adisHandler->setToGoToNormalModeImmediately(); adisHandler->setToGoToNormalModeImmediately();
#endif #endif
// Gyro 3 Side B // Gyro 3 Side B
spiCookie = spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, L3GD20H::MAX_BUFFER_SIZE,
new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF,
gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_COM_IF,
spiCookie, spi::L3G_TRANSITION_DELAY); spiCookie, spi::L3G_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER); fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER);
gyroL3gHandler->setCustomFdir(fdir); gyroL3gHandler->setCustomFdir(fdir);
@ -544,15 +464,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
#if OBSW_DEBUG_GPS == 1 #if OBSW_DEBUG_GPS == 1
debugGps = true; debugGps = true;
#endif #endif
resetArgsGnss1.gnss1 = true; RESET_ARGS_GNSS.gpioComIF = gpioComIF;
resetArgsGnss1.gpioComIF = gpioComIF; RESET_ARGS_GNSS.waitPeriodMs = 100;
resetArgsGnss1.waitPeriodMs = 100; auto gpsCtrl =
resetArgsGnss0.gnss1 = false;
resetArgsGnss0.gpioComIF = gpioComIF;
resetArgsGnss0.waitPeriodMs = 100;
auto gpsHandler0 =
new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps); new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps);
gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0); gpsCtrl->setResetPinTriggerFunction(gps::triggerGpioResetPin, &RESET_ARGS_GNSS);
AcsBoardHelper acsBoardHelper = AcsBoardHelper( AcsBoardHelper acsBoardHelper = AcsBoardHelper(
objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER, objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER,
@ -562,9 +478,14 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
acsBoardHelper, gpioComIF); acsBoardHelper, gpioComIF);
static_cast<void>(acsAss); static_cast<void>(acsAss);
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */ #endif /* OBSW_ADD_ACS_HANDLERS == 1 */
#if OBSW_USE_CCSDS_IP_CORE == 1
createCcsdsComponents(gpioComIF);
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
} }
void ObjectFactory::createHeaterComponents() { void ObjectFactory::createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher,
HealthTableIF* healthTable) {
using namespace gpio; using namespace gpio;
GpioCookie* heaterGpiosCookie = new GpioCookie; GpioCookie* heaterGpiosCookie = new GpioCookie;
GpiodRegularByLineName* gpio = nullptr; GpiodRegularByLineName* gpio = nullptr;
@ -605,8 +526,21 @@ void ObjectFactory::createHeaterComponents() {
Levels::LOW); Levels::LOW);
heaterGpiosCookie->addGpio(gpioIds::HEATER_7, gpio); heaterGpiosCookie->addGpio(gpioIds::HEATER_7, gpio);
new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, heaterGpiosCookie, gpioIF->addGpios(heaterGpiosCookie);
objects::PCDU_HANDLER, pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V);
HeaterHelper helper({{
{new HealthDevice(objects::HEATER_0_PLOC_PROC_BRD, MessageQueueIF::NO_QUEUE),
gpioIds::HEATER_0},
{new HealthDevice(objects::HEATER_1_PCDU_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_1},
{new HealthDevice(objects::HEATER_2_ACS_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_2},
{new HealthDevice(objects::HEATER_3_OBC_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_3},
{new HealthDevice(objects::HEATER_4_CAMERA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_4},
{new HealthDevice(objects::HEATER_5_STR, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_5},
{new HealthDevice(objects::HEATER_6_DRO, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_6},
{new HealthDevice(objects::HEATER_7_HPA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_7},
}});
new HeaterHandler(objects::HEATER_HANDLER, gpioIF, helper, pwrSwitcher,
pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V);
} }
void ObjectFactory::createSolarArrayDeploymentComponents() { void ObjectFactory::createSolarArrayDeploymentComponents() {
@ -655,7 +589,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
consumer.str(), Direction::OUT, Levels::HIGH); consumer.str(), Direction::OUT, Levels::HIGH);
auto mpsocGpioCookie = new GpioCookie; auto mpsocGpioCookie = new GpioCookie;
mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC); mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC);
gpioComIF->addGpios(mpsocGpioCookie); gpioChecker(gpioComIF->addGpios(mpsocGpioCookie), "PLOC MPSoC");
auto mpsocCookie = auto mpsocCookie =
new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, uart::PLOC_MPSOC_BAUD, new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, uart::PLOC_MPSOC_BAUD,
mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL); mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
@ -668,22 +602,24 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
#if OBSW_ADD_PLOC_SUPERVISOR == 1 #if OBSW_ADD_PLOC_SUPERVISOR == 1
consumer << "0x" << std::hex << objects::PLOC_SUPERVISOR_HANDLER; consumer << "0x" << std::hex << objects::PLOC_SUPERVISOR_HANDLER;
auto gpioConfigSupv = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_SUPV_UART, consumer.str(), auto gpioConfigSupv = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_SUPV_UART, consumer.str(),
Direction::OUT, Levels::HIGH); Direction::OUT, Levels::LOW);
auto supvGpioCookie = new GpioCookie; auto supvGpioCookie = new GpioCookie;
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv); supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
gpioComIF->addGpios(supvGpioCookie); gpioComIF->addGpios(supvGpioCookie);
auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, auto supervisorCookie =
q7s::UART_PLOC_SUPERVSIOR_DEV, uart::PLOC_SUPERVISOR_BAUD, new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV,
supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL); uart::PLOC_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL);
supervisorCookie->setNoFixedSizeReply(); supervisorCookie->setNoFixedSizeReply();
auto supvHelper = new PlocSupvHelper(objects::PLOC_SUPERVISOR_HELPER);
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF), supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF),
pcdu::PDU1_CH6_PLOC_12V); pcdu::PDU1_CH6_PLOC_12V, supvHelper);
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
static_cast<void>(consumer); static_cast<void>(consumer);
} }
void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) { void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF,
PowerSwitchIF* pwrSwitcher) {
using namespace gpio; using namespace gpio;
GpioCookie* gpioCookieRw = new GpioCookie; GpioCookie* gpioCookieRw = new GpioCookie;
GpioCallback* csRw1 = GpioCallback* csRw1 =
@ -725,50 +661,38 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
Levels::LOW); Levels::LOW);
gpioCookieRw->addGpio(gpioIds::EN_RW4, gpio); gpioCookieRw->addGpio(gpioIds::EN_RW4, gpio);
gpioComIF->addGpios(gpioCookieRw); gpioChecker(gpioComIF->addGpios(gpioCookieRw), "RWs");
#if OBSW_ADD_RW == 1 #if OBSW_ADD_RW == 1
auto rw1SpiCookie = std::array<std::pair<address_t, gpioId_t>, 4> rwCookieParams = {
new SpiCookie(addresses::RW1, gpioIds::CS_RW1, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE, {{addresses::RW1, gpioIds::CS_RW1},
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr); {addresses::RW2, gpioIds::CS_RW2},
auto rw2SpiCookie = {addresses::RW3, gpioIds::CS_RW3},
new SpiCookie(addresses::RW2, gpioIds::CS_RW2, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE, {addresses::RW4, gpioIds::CS_RW4}}};
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr); std::array<SpiCookie*, 4> rwCookies = {};
auto rw3SpiCookie = std::array<object_id_t, 4> rwIds = {objects::RW1, objects::RW2, objects::RW3, objects::RW4};
new SpiCookie(addresses::RW3, gpioIds::CS_RW3, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE, std::array<gpioId_t, 4> rwGpioIds = {gpioIds::EN_RW1, gpioIds::EN_RW2, gpioIds::EN_RW3,
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr); gpioIds::EN_RW4};
auto rw4SpiCookie = std::array<RwHandler*, 4> rws = {};
new SpiCookie(addresses::RW4, gpioIds::CS_RW4, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE, for (uint8_t idx = 0; idx < rwCookies.size(); idx++) {
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr); rwCookies[idx] = new SpiCookie(rwCookieParams[idx].first, rwCookieParams[idx].second,
RwDefinitions::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED,
&rwSpiCallback::spiCallback, nullptr);
rws[idx] = new RwHandler(rwIds[idx], objects::SPI_RW_COM_IF, rwCookies[idx], gpioComIF,
rwGpioIds[idx]);
rwCookies[idx]->setCallbackArgs(rws[idx]);
#if OBSW_TEST_RW == 1
rws[idx]->setStartUpImmediately();
#endif
#if OBSW_DEBUG_RW == 1
rws[idx]->setDebugMode(true);
#endif
}
auto rwHandler1 = RwHelper rwHelper(rwIds);
new RwHandler(objects::RW1, objects::SPI_COM_IF, rw1SpiCookie, gpioComIF, gpioIds::EN_RW1); auto* rwAss = new RwAssembly(objects::RW_ASS, objects::NO_OBJECT, pwrSwitcher,
rw1SpiCookie->setCallbackArgs(rwHandler1); pcdu::Switches::PDU2_CH2_RW_5V, rwHelper);
#if OBSW_DEBUG_RW == 1 static_cast<void>(rwAss);
rwHandler1->setStartUpImmediately();
rwHandler1->setDebugMode(true);
#endif
auto rwHandler2 =
new RwHandler(objects::RW2, objects::SPI_COM_IF, rw2SpiCookie, gpioComIF, gpioIds::EN_RW2);
rw2SpiCookie->setCallbackArgs(rwHandler2);
#if OBSW_DEBUG_RW == 1
rwHandler2->setStartUpImmediately();
rwHandler2->setDebugMode(true);
#endif
auto rwHandler3 =
new RwHandler(objects::RW3, objects::SPI_COM_IF, rw3SpiCookie, gpioComIF, gpioIds::EN_RW3);
rw3SpiCookie->setCallbackArgs(rwHandler3);
#if OBSW_DEBUG_RW == 1
rwHandler3->setStartUpImmediately();
rwHandler3->setDebugMode(true);
#endif
auto rwHandler4 =
new RwHandler(objects::RW4, objects::SPI_COM_IF, rw4SpiCookie, gpioComIF, gpioIds::EN_RW4);
rw4SpiCookie->setCallbackArgs(rwHandler4);
#if OBSW_DEBUG_RW == 1
rwHandler4->setStartUpImmediately();
rwHandler4->setDebugMode(true);
#endif
#endif /* OBSW_ADD_RW == 1 */ #endif /* OBSW_ADD_RW == 1 */
} }
@ -806,9 +730,7 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
consumer.str("PAPB VC 3"); consumer.str("PAPB VC 3");
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC3, consumer.str()); gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC3, consumer.str());
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio); gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio);
gpioChecker(gpioComIF->addGpios(gpioCookiePtmeIp), "PTME PAPB VCs");
gpioComIF->addGpios(gpioCookiePtmeIp);
// Creating virtual channel interfaces // Creating virtual channel interfaces
VcInterfaceIF* vc0 = VcInterfaceIF* vc0 =
new PapbVcInterface(gpioComIF, gpioIds::VC0_PAPB_BUSY, gpioIds::VC0_PAPB_EMPTY, q7s::UIO_PTME, new PapbVcInterface(gpioComIF, gpioIds::VC0_PAPB_BUSY, gpioIds::VC0_PAPB_EMPTY, q7s::UIO_PTME,
@ -822,14 +744,12 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
VcInterfaceIF* vc3 = VcInterfaceIF* vc3 =
new PapbVcInterface(gpioComIF, gpioIds::VC3_PAPB_BUSY, gpioIds::VC3_PAPB_EMPTY, q7s::UIO_PTME, new PapbVcInterface(gpioComIF, gpioIds::VC3_PAPB_BUSY, gpioIds::VC3_PAPB_EMPTY, q7s::UIO_PTME,
q7s::uiomapids::PTME_VC3); q7s::uiomapids::PTME_VC3);
// Creating ptme object and adding virtual channel interfaces // Creating ptme object and adding virtual channel interfaces
Ptme* ptme = new Ptme(objects::PTME); Ptme* ptme = new Ptme(objects::PTME);
ptme->addVcInterface(ccsds::VC0, vc0); ptme->addVcInterface(ccsds::VC0, vc0);
ptme->addVcInterface(ccsds::VC1, vc1); ptme->addVcInterface(ccsds::VC1, vc1);
ptme->addVcInterface(ccsds::VC2, vc2); ptme->addVcInterface(ccsds::VC2, vc2);
ptme->addVcInterface(ccsds::VC3, vc3); ptme->addVcInterface(ccsds::VC3, vc3);
AxiPtmeConfig* axiPtmeConfig = AxiPtmeConfig* axiPtmeConfig =
new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG); new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG);
PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig); PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig);
@ -842,7 +762,6 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
CCSDSHandler* ccsdsHandler = new CCSDSHandler( CCSDSHandler* ccsdsHandler = new CCSDSHandler(
objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig, objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig,
gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA, TRANSMITTER_TIMEOUT); gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA, TRANSMITTER_TIMEOUT);
VirtualChannel* vc = nullptr; VirtualChannel* vc = nullptr;
vc = new VirtualChannel(ccsds::VC0, common::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER); vc = new VirtualChannel(ccsds::VC0, common::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER);
ccsdsHandler->addVirtualChannel(ccsds::VC0, vc); ccsdsHandler->addVirtualChannel(ccsds::VC0, vc);
@ -852,7 +771,6 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
ccsdsHandler->addVirtualChannel(ccsds::VC2, vc); ccsdsHandler->addVirtualChannel(ccsds::VC2, vc);
vc = new VirtualChannel(ccsds::VC3, common::VC3_QUEUE_SIZE, objects::CCSDS_HANDLER); vc = new VirtualChannel(ccsds::VC3, common::VC3_QUEUE_SIZE, objects::CCSDS_HANDLER);
ccsdsHandler->addVirtualChannel(ccsds::VC3, vc); ccsdsHandler->addVirtualChannel(ccsds::VC3, vc);
GpioCookie* gpioCookiePdec = new GpioCookie; GpioCookie* gpioCookiePdec = new GpioCookie;
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::PDEC_HANDLER; consumer << "0x" << std::hex << objects::PDEC_HANDLER;
@ -860,12 +778,9 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
gpio = new GpiodRegularByLineName(q7s::gpioNames::PDEC_RESET, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::PDEC_RESET, consumer.str(), Direction::OUT,
Levels::LOW); Levels::LOW);
gpioCookiePdec->addGpio(gpioIds::PDEC_RESET, gpio); gpioCookiePdec->addGpio(gpioIds::PDEC_RESET, gpio);
gpioChecker(gpioComIF->addGpios(gpioCookiePdec), "PDEC");
gpioComIF->addGpios(gpioCookiePdec);
new PdecHandler(objects::PDEC_HANDLER, objects::CCSDS_HANDLER, gpioComIF, gpioIds::PDEC_RESET, new PdecHandler(objects::PDEC_HANDLER, objects::CCSDS_HANDLER, gpioComIF, gpioIds::PDEC_RESET,
q7s::UIO_PDEC_CONFIG_MEMORY, q7s::UIO_PDEC_RAM, q7s::UIO_PDEC_REGISTERS); q7s::UIO_PDEC_CONFIG_MEMORY, q7s::UIO_PDEC_RAM, q7s::UIO_PDEC_REGISTERS);
GpioCookie* gpioRS485Chip = new GpioCookie; GpioCookie* gpioRS485Chip = new GpioCookie;
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_CLOCK, "RS485 Transceiver", gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_CLOCK, "RS485 Transceiver",
Direction::OUT, Levels::LOW); Direction::OUT, Levels::LOW);
@ -873,7 +788,6 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_DATA, "RS485 Transceiver", gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_DATA, "RS485 Transceiver",
Direction::OUT, Levels::LOW); Direction::OUT, Levels::LOW);
gpioRS485Chip->addGpio(gpioIds::RS485_EN_TX_DATA, gpio); gpioRS485Chip->addGpio(gpioIds::RS485_EN_TX_DATA, gpio);
// Default configuration enables RX channels (RXEN = LOW) // Default configuration enables RX channels (RXEN = LOW)
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_RX_CLOCK, "RS485 Transceiver", gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_RX_CLOCK, "RS485 Transceiver",
Direction::OUT, Levels::LOW); Direction::OUT, Levels::LOW);
@ -881,8 +795,7 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_RX_DATA, "RS485 Transceiver", gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_RX_DATA, "RS485 Transceiver",
Direction::OUT, Levels::LOW); Direction::OUT, Levels::LOW);
gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_DATA, gpio); gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_DATA, gpio);
gpioChecker(gpioComIF->addGpios(gpioRS485Chip), "RS485 Transceiver");
gpioComIF->addGpios(gpioRS485Chip);
} }
void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF, void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
@ -927,14 +840,14 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF*
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ADC_CS, consumer, Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ADC_CS, consumer, Direction::OUT,
gpio::Levels::HIGH); gpio::Levels::HIGH);
plPcduGpios->addGpio(gpioIds::PLPCDU_ADC_CS, gpio); plPcduGpios->addGpio(gpioIds::PLPCDU_ADC_CS, gpio);
gpioComIF->addGpios(plPcduGpios); gpioChecker(gpioComIF->addGpios(plPcduGpios), "PL PCDU");
SpiCookie* spiCookie = new SpiCookie(addresses::PLPCDU_ADC, gpioIds::PLPCDU_ADC_CS, SpiCookie* spiCookie =
q7s::SPI_DEFAULT_DEV, plpcdu::MAX_ADC_REPLY_SIZE, new SpiCookie(addresses::PLPCDU_ADC, gpioIds::PLPCDU_ADC_CS, plpcdu::MAX_ADC_REPLY_SIZE,
spi::DEFAULT_MAX_1227_MODE, spi::PL_PCDU_MAX_1227_SPEED); spi::DEFAULT_MAX_1227_MODE, spi::PL_PCDU_MAX_1227_SPEED);
// Create device handler components // Create device handler components
auto plPcduHandler = new PayloadPcduHandler( auto plPcduHandler = new PayloadPcduHandler(
objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie, gpioComIF, SdCardManager::instance(), objects::PLPCDU_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, gpioComIF,
pwrSwitcher, pcdu::Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8, SdCardManager::instance(), pwrSwitcher, pcdu::Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8,
pcdu::Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, false); pcdu::Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, false);
spiCookie->setCallbackMode(PayloadPcduHandler::extConvAsTwoCallback, plPcduHandler); spiCookie->setCallbackMode(PayloadPcduHandler::extConvAsTwoCallback, plPcduHandler);
// plPcduHandler->enablePeriodicPrintout(true, 5); // plPcduHandler->enablePeriodicPrintout(true, 5);
@ -961,6 +874,50 @@ void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
#endif #endif
} }
void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) {
UartCookie* starTrackerCookie =
new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, uart::STAR_TRACKER_BAUD,
startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL);
starTrackerCookie->setNoFixedSizeReply();
StrHelper* strHelper = new StrHelper(objects::STR_HELPER);
auto starTracker =
new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie,
strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V);
starTracker->setPowerSwitcher(pwrSwitcher);
}
void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) {
I2cCookie* imtqI2cCookie =
new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV);
auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie,
pcdu::Switches::PDU1_CH3_MGT_5V);
imtqHandler->setPowerSwitcher(pwrSwitcher);
static_cast<void>(imtqHandler);
#if OBSW_TEST_IMTQ == 1
imtqHandler->setStartUpImmediately();
imtqHandler->setToGoToNormal(true);
#endif
#if OBSW_DEBUG_IMTQ == 1
imtqHandler->setDebugMode(true);
#endif
}
void ObjectFactory::createBpxBatteryComponent() {
I2cCookie* bpxI2cCookie = new I2cCookie(addresses::BPX_BATTERY, 100, q7s::I2C_DEFAULT_DEV);
BpxBatteryHandler* bpxHandler =
new BpxBatteryHandler(objects::BPX_BATT_HANDLER, objects::I2C_COM_IF, bpxI2cCookie);
bpxHandler->setStartUpImmediately();
bpxHandler->setToGoToNormalMode(true);
#if OBSW_DEBUG_BPX_BATT == 1
bpxHandler->setDebugMode(true);
#endif
}
void ObjectFactory::createMiscComponents() {
new FileSystemHandler(objects::FILE_SYSTEM_HANDLER);
new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER);
}
void ObjectFactory::testAcsBrdAss(AcsBoardAssembly* acsAss) { void ObjectFactory::testAcsBrdAss(AcsBoardAssembly* acsAss) {
CommandMessage msg; CommandMessage msg;
ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND, DeviceHandlerIF::MODE_NORMAL, ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND, DeviceHandlerIF::MODE_NORMAL,

@ -1,12 +1,18 @@
#ifndef BSP_Q7S_OBJECTFACTORY_H_ #ifndef BSP_Q7S_OBJECTFACTORY_H_
#define BSP_Q7S_OBJECTFACTORY_H_ #define BSP_Q7S_OBJECTFACTORY_H_
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
#include <string>
class LinuxLibgpioIF; class LinuxLibgpioIF;
class UartComIF; class UartComIF;
class SpiComIF; class SpiComIF;
class I2cComIF; class I2cComIF;
class PowerSwitchIF; class PowerSwitchIF;
class HealthTableIF;
class AcsBoardAssembly; class AcsBoardAssembly;
class GpioIF;
namespace ObjectFactory { namespace ObjectFactory {
@ -14,7 +20,8 @@ void setStatics();
void produce(void* args); void produce(void* args);
void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF, void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
SpiComIF** spiComIF, I2cComIF** i2cComIF); SpiComIF** spiMainComIF, I2cComIF** i2cComIF,
SpiComIF** spiRwComIF);
void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher); void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher);
void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF, void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
PowerSwitchIF* pwrSwitcher); PowerSwitchIF* pwrSwitcher);
@ -22,12 +29,17 @@ void createTmpComponents();
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF); void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
PowerSwitchIF* pwrSwitcher); PowerSwitchIF* pwrSwitcher);
void createHeaterComponents(); void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable);
void createImtqComponents(PowerSwitchIF* pwrSwitcher);
void createBpxBatteryComponent();
void createStrComponents(PowerSwitchIF* pwrSwitcher);
void createSolarArrayDeploymentComponents(); void createSolarArrayDeploymentComponents();
void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher); void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher);
void createPayloadComponents(LinuxLibgpioIF* gpioComIF); void createPayloadComponents(LinuxLibgpioIF* gpioComIF);
void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF); void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher);
void createCcsdsComponents(LinuxLibgpioIF* gpioComIF); void createCcsdsComponents(LinuxLibgpioIF* gpioComIF);
void createMiscComponents();
void createTestComponents(LinuxLibgpioIF* gpioComIF); void createTestComponents(LinuxLibgpioIF* gpioComIF);
void testAcsBrdAss(AcsBoardAssembly* assAss); void testAcsBrdAss(AcsBoardAssembly* assAss);

@ -1,3 +1 @@
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE emObjectFactory.cpp)
emObjectFactory.cpp
)

@ -1,199 +1,63 @@
#include <mission/system/fdir/GomspacePowerFdir.h> #include <fsfw/health/HealthTableIF.h>
#include <mission/system/fdir/SyrlinksFdir.h>
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "bsp_q7s/boardtest/Q7STestTask.h"
#include "bsp_q7s/callbacks/gnssCallback.h"
#include "bsp_q7s/callbacks/pcduSwitchCb.h"
#include "bsp_q7s/callbacks/q7sGpioCallbacks.h"
#include "bsp_q7s/callbacks/rwSpiCallback.h"
#include "bsp_q7s/core/CoreController.h" #include "bsp_q7s/core/CoreController.h"
#include "bsp_q7s/core/ObjectFactory.h" #include "bsp_q7s/core/ObjectFactory.h"
#include "bsp_q7s/memory/FileSystemHandler.h"
#include "busConf.h" #include "busConf.h"
#include "ccsdsConfig.h" #include "commonObjects.h"
#include "devConf.h" #include "devConf.h"
#include "devices/addresses.h"
#include "devices/gpioIds.h"
#include "devices/powerSwitcherList.h"
#include "fsfw/ipc/QueueFactory.h"
#include "linux/ObjectFactory.h"
#include "linux/boardtest/I2cTestClass.h"
#include "linux/boardtest/SpiTestClass.h"
#include "linux/boardtest/UartTestClass.h"
#include "linux/callbacks/gpioCallbacks.h"
#include "linux/csp/CspComIF.h"
#include "linux/csp/CspCookie.h"
#include "linux/devices/GPSHyperionLinuxController.h"
#include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h"
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
#include "linux/devices/ploc/PlocMPSoCHandler.h"
#include "linux/devices/ploc/PlocMPSoCHelper.h"
#include "linux/devices/ploc/PlocMemoryDumper.h"
#include "linux/devices/ploc/PlocSupervisorHandler.h"
#include "linux/devices/ploc/PlocUpdater.h"
#include "linux/devices/startracker/StarTrackerHandler.h"
#include "linux/devices/startracker/StrHelper.h"
#include "linux/obc/AxiPtmeConfig.h"
#include "linux/obc/PapbVcInterface.h"
#include "linux/obc/PdecHandler.h"
#include "linux/obc/Ptme.h"
#include "linux/obc/PtmeConfig.h"
#include "mission/system/SusAssembly.h"
#include "mission/system/TcsBoardAssembly.h"
#include "mission/system/fdir/AcsBoardFdir.h"
#include "mission/system/fdir/RtdFdir.h"
#include "mission/system/fdir/SusFdir.h"
#include "tmtc/apid.h"
#include "tmtc/pusIds.h"
#if OBSW_TEST_LIBGPIOD == 1
#include "linux/boardtest/LibgpiodTest.h"
#endif
#include <sstream>
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
#include "fsfw/tmtcpacket/pus/tm.h"
#include "fsfw/tmtcservices/CommandingServiceBase.h"
#include "fsfw/tmtcservices/PusServiceBase.h"
#include "fsfw_hal/common/gpio/GpioCookie.h"
#include "fsfw_hal/common/gpio/gpioDefinitions.h"
#include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h"
#include "fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h"
#include "fsfw_hal/devicehandlers/MgmRM3100Handler.h"
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h" #include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
#include "fsfw_hal/linux/i2c/I2cComIF.h" #include "linux/ObjectFactory.h"
#include "fsfw_hal/linux/i2c/I2cCookie.h" #include "linux/callbacks/gpioCallbacks.h"
#include "fsfw_hal/linux/spi/SpiComIF.h"
#include "fsfw_hal/linux/spi/SpiCookie.h"
#include "fsfw_hal/linux/uart/UartComIF.h"
#include "fsfw_hal/linux/uart/UartCookie.h"
#include "mission/core/GenericFactory.h" #include "mission/core/GenericFactory.h"
#include "mission/devices/ACUHandler.h"
#include "mission/devices/BpxBatteryHandler.h"
#include "mission/devices/GyroADIS1650XHandler.h"
#include "mission/devices/HeaterHandler.h"
#include "mission/devices/IMTQHandler.h"
#include "mission/devices/Max31865PT1000Handler.h"
#include "mission/devices/P60DockHandler.h"
#include "mission/devices/PCDUHandler.h"
#include "mission/devices/PDU1Handler.h"
#include "mission/devices/PDU2Handler.h"
#include "mission/devices/PayloadPcduHandler.h"
#include "mission/devices/RadiationSensorHandler.h"
#include "mission/devices/RwHandler.h"
#include "mission/devices/SolarArrayDeploymentHandler.h"
#include "mission/devices/SusHandler.h"
#include "mission/devices/SyrlinksHkHandler.h"
#include "mission/devices/Tmp1075Handler.h"
#include "mission/devices/devicedefinitions/GomspaceDefinitions.h"
#include "mission/devices/devicedefinitions/Max31865Definitions.h"
#include "mission/devices/devicedefinitions/RadSensorDefinitions.h"
#include "mission/devices/devicedefinitions/RwDefinitions.h"
#include "mission/devices/devicedefinitions/SusDefinitions.h"
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
#include "mission/devices/devicedefinitions/payloadPcduDefinitions.h"
#include "mission/system/AcsBoardAssembly.h"
#include "mission/tmtc/CCSDSHandler.h"
#include "mission/tmtc/VirtualChannel.h"
#include "mission/utility/TmFunnel.h"
ResetArgs resetArgsGnss0;
ResetArgs resetArgsGnss1;
void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); }
void Factory::setStaticFrameworkObjectIds() {
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
PusServiceBase::packetDestination = objects::TM_FUNNEL;
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER;
// DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
#if OBSW_TM_TO_PTME == 1
TmFunnel::downlinkDestination = objects::CCSDS_HANDLER;
#else
TmFunnel::downlinkDestination = objects::TMTC_BRIDGE;
#endif /* OBSW_TM_TO_PTME == 1 */
// No storage object for now.
TmFunnel::storageDestination = objects::NO_OBJECT;
LocalDataPoolManager::defaultHkDestination = objects::PUS_SERVICE_3_HOUSEKEEPING;
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
TmPacketBase::timeStamperId = objects::TIME_STAMPER;
}
void ObjectFactory::produce(void* args) { void ObjectFactory::produce(void* args) {
ObjectFactory::setStatics(); ObjectFactory::setStatics();
ObjectFactory::produceGenericObjects(); HealthTableIF* healthTable = nullptr;
ObjectFactory::produceGenericObjects(&healthTable);
LinuxLibgpioIF* gpioComIF = nullptr; LinuxLibgpioIF* gpioComIF = nullptr;
UartComIF* uartComIF = nullptr; UartComIF* uartComIF = nullptr;
SpiComIF* spiComIF = nullptr; SpiComIF* spiMainComIF = nullptr;
I2cComIF* i2cComIF = nullptr; I2cComIF* i2cComIF = nullptr;
PowerSwitchIF* pwrSwitcher = nullptr; PowerSwitchIF* pwrSwitcher = nullptr;
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiComIF, &i2cComIF); SpiComIF* spiRwComIF = nullptr;
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiMainComIF, &i2cComIF, &spiRwComIF);
createTmpComponents(); createTmpComponents();
new CoreController(objects::CORE_CONTROLLER); new CoreController(objects::CORE_CONTROLLER);
gpioCallbacks::disableAllDecoder(gpioComIF); gpioCallbacks::disableAllDecoder(gpioComIF);
createPcduComponents(gpioComIF, &pwrSwitcher); createPcduComponents(gpioComIF, &pwrSwitcher);
createRadSensorComponent(gpioComIF); createRadSensorComponent(gpioComIF);
createSunSensorComponents(gpioComIF, spiComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV); createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
#if OBSW_ADD_ACS_BOARD == 1 #if OBSW_ADD_ACS_BOARD == 1
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
#endif #endif
createHeaterComponents(); createHeaterComponents(gpioComIF, pwrSwitcher, healthTable);
createSolarArrayDeploymentComponents(); createSolarArrayDeploymentComponents();
createPlPcduComponents(gpioComIF, spiComIF, pwrSwitcher); createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher);
#if OBSW_ADD_SYRLINKS == 1 #if OBSW_ADD_SYRLINKS == 1
#if OBSW_Q7S_EM == 1
createSyrlinksComponents(nullptr);
#else
createSyrlinksComponents(pwrSwitcher); createSyrlinksComponents(pwrSwitcher);
#endif /* OBSW_Q7S_EM == 1 */
#endif /* OBSW_ADD_SYRLINKS == 1 */ #endif /* OBSW_ADD_SYRLINKS == 1 */
createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher); createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF);
createPayloadComponents(gpioComIF); createPayloadComponents(gpioComIF);
#if OBSW_ADD_MGT == 1 #if OBSW_ADD_MGT == 1
I2cCookie* imtqI2cCookie = createImtqComponents(pwrSwitcher);
new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV);
auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie,
pcdu::Switches::PDU1_CH3_MGT_5V);
imtqHandler->setPowerSwitcher(pwrSwitcher);
static_cast<void>(imtqHandler);
#if OBSW_TEST_IMTQ == 1
imtqHandler->setStartUpImmediately();
imtqHandler->setToGoToNormal(true);
#endif #endif
#if OBSW_DEBUG_IMTQ == 1 createReactionWheelComponents(gpioComIF, pwrSwitcher);
imtqHandler->setDebugMode(true);
#endif
#endif
createReactionWheelComponents(gpioComIF);
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1 #if OBSW_ADD_BPX_BATTERY_HANDLER == 1
I2cCookie* bpxI2cCookie = new I2cCookie(addresses::BPX_BATTERY, 100, q7s::I2C_DEFAULT_DEV); createBpxBatteryComponent();
BpxBatteryHandler* bpxHandler =
new BpxBatteryHandler(objects::BPX_BATT_HANDLER, objects::I2C_COM_IF, bpxI2cCookie);
bpxHandler->setStartUpImmediately();
bpxHandler->setToGoToNormalMode(true);
#if OBSW_DEBUG_BPX_BATT == 1
bpxHandler->setDebugMode(true);
#endif #endif
#endif
new FileSystemHandler(objects::FILE_SYSTEM_HANDLER);
#if OBSW_ADD_STAR_TRACKER == 1 #if OBSW_ADD_STAR_TRACKER == 1
UartCookie* starTrackerCookie = createStrComponents(pwrSwitcher);
new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, uart::STAR_TRACKER_BAUD,
startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL);
starTrackerCookie->setNoFixedSizeReply();
StrHelper* strHelper = new StrHelper(objects::STR_HELPER);
auto starTracker =
new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie,
strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V);
starTracker->setPowerSwitcher(pwrSwitcher);
#endif /* OBSW_ADD_STAR_TRACKER == 1 */ #endif /* OBSW_ADD_STAR_TRACKER == 1 */
#if OBSW_USE_CCSDS_IP_CORE == 1 #if OBSW_USE_CCSDS_IP_CORE == 1
createCcsdsComponents(gpioComIF); createCcsdsComponents(gpioComIF);
@ -202,771 +66,6 @@ void ObjectFactory::produce(void* args) {
#if OBSW_ADD_TEST_CODE == 1 #if OBSW_ADD_TEST_CODE == 1
createTestComponents(gpioComIF); createTestComponents(gpioComIF);
#endif /* OBSW_ADD_TEST_CODE == 1 */ #endif /* OBSW_ADD_TEST_CODE == 1 */
new PlocUpdater(objects::PLOC_UPDATER);
new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER); createMiscComponents();
}
void ObjectFactory::createTmpComponents() {
I2cCookie* i2cCookieTmp1075tcs1 =
new I2cCookie(addresses::TMP1075_TCS_1, TMP1075::MAX_REPLY_LENGTH, q7s::I2C_DEFAULT_DEV);
I2cCookie* i2cCookieTmp1075tcs2 =
new I2cCookie(addresses::TMP1075_TCS_2, TMP1075::MAX_REPLY_LENGTH, q7s::I2C_DEFAULT_DEV);
/* Temperature sensors */
Tmp1075Handler* tmp1075Handler_1 =
new Tmp1075Handler(objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1);
(void)tmp1075Handler_1;
Tmp1075Handler* tmp1075Handler_2 =
new Tmp1075Handler(objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2);
(void)tmp1075Handler_2;
}
void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
SpiComIF** spiComIF, I2cComIF** i2cComIF) {
if (gpioComIF == nullptr or uartComIF == nullptr or spiComIF == nullptr) {
sif::error << "ObjectFactory::createCommunicationInterfaces: Invalid passed ComIF pointer"
<< std::endl;
}
*gpioComIF = new LinuxLibgpioIF(objects::GPIO_IF);
/* Communication interfaces */
new CspComIF(objects::CSP_COM_IF);
*i2cComIF = new I2cComIF(objects::I2C_COM_IF);
*uartComIF = new UartComIF(objects::UART_COM_IF);
*spiComIF = new SpiComIF(objects::SPI_COM_IF, *gpioComIF);
/* Adding gpios for chip select decoding to the gpioComIf */
q7s::gpioCallbacks::initSpiCsDecoder(*gpioComIF);
}
void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher) {
CspCookie* p60DockCspCookie = new CspCookie(P60Dock::MAX_REPLY_LENGTH, addresses::P60DOCK);
CspCookie* pdu1CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU1);
CspCookie* pdu2CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU2);
CspCookie* acuCspCookie = new CspCookie(ACU::MAX_REPLY_LENGTH, addresses::ACU);
auto p60Fdir = new GomspacePowerFdir(objects::P60DOCK_HANDLER);
P60DockHandler* p60dockhandler =
new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, p60DockCspCookie, p60Fdir);
auto pdu1Fdir = new GomspacePowerFdir(objects::PDU1_HANDLER);
PDU1Handler* pdu1handler =
new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie, pdu1Fdir);
auto pdu2Fdir = new GomspacePowerFdir(objects::PDU2_HANDLER);
PDU2Handler* pdu2handler =
new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie, pdu2Fdir);
auto acuFdir = new GomspacePowerFdir(objects::ACU_HANDLER);
ACUHandler* acuhandler =
new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie, acuFdir);
auto pcduHandler = new PCDUHandler(objects::PCDU_HANDLER, 50);
/**
* Setting PCDU devices to mode normal immediately after start up because PCDU is always
* running.
*/
p60dockhandler->setModeNormal();
pdu1handler->setModeNormal();
pdu2handler->setModeNormal();
acuhandler->setModeNormal();
if (pwrSwitcher != nullptr) {
*pwrSwitcher = pcduHandler;
}
#if OBSW_DEBUG_P60DOCK == 1
p60dockhandler->setDebugMode(true);
#endif
#if OBSW_DEBUG_ACU == 1
acuhandler->setDebugMode(true);
#endif
}
void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) {
using namespace gpio;
GpioCookie* gpioCookieRadSensor = new GpioCookie;
std::stringstream consumer;
consumer << "0x" << std::hex << objects::RAD_SENSOR;
GpiodRegularByLineName* gpio = new GpiodRegularByLineName(
q7s::gpioNames::RAD_SENSOR_CHIP_SELECT, consumer.str(), Direction::OUT, Levels::HIGH);
gpioCookieRadSensor->addGpio(gpioIds::CS_RAD_SENSOR, gpio);
gpio = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_RADFET, consumer.str(), Direction::OUT,
Levels::LOW);
gpioCookieRadSensor->addGpio(gpioIds::ENABLE_RADFET, gpio);
gpioComIF->addGpios(gpioCookieRadSensor);
SpiCookie* spiCookieRadSensor = new SpiCookie(
addresses::RAD_SENSOR, gpioIds::CS_RAD_SENSOR, std::string(q7s::SPI_DEFAULT_DEV),
RAD_SENSOR::READ_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED);
auto radSensor = new RadiationSensorHandler(objects::RAD_SENSOR, objects::SPI_COM_IF,
spiCookieRadSensor, gpioComIF);
static_cast<void>(radSensor);
// The radiation sensor ADC is powered by the 5V stack connector which should always be on
radSensor->setStartUpImmediately();
// It's a simple sensor, so just to to normal mode immediately
radSensor->setToGoToNormalModeImmediately();
#if OBSW_DEBUG_RAD_SENSOR == 1
radSensor->enablePeriodicDataPrint(true);
#endif
}
void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
PowerSwitchIF* pwrSwitcher) {
using namespace gpio;
GpioCookie* gpioCookieAcsBoard = new GpioCookie();
std::stringstream consumer;
GpiodRegularByLineName* gpio = nullptr;
consumer << "0x" << std::hex << objects::GYRO_0_ADIS_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, consumer.str(), Direction::OUT,
Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::GYRO_1_L3G_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_1_L3G_CS, consumer.str(), Direction::OUT,
Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_1_L3G_CS, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::GYRO_2_ADIS_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ADIS_CS, consumer.str(), Direction::OUT,
Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_2_ADIS_CS, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::GYRO_3_L3G_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_3_L3G_CS, consumer.str(), Direction::OUT,
Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_3_L3G_CS, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::MGM_0_LIS3_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_0_CS, consumer.str(), Direction::OUT,
Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::MGM_0_LIS3_CS, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::MGM_1_RM3100_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, consumer.str(), Direction::OUT,
Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::MGM_1_RM3100_CS, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::MGM_2_LIS3_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_2_CS, consumer.str(), Direction::OUT,
Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::MGM_2_LIS3_CS, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::MGM_3_RM3100_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_3_CS, consumer.str(), Direction::OUT,
Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::MGM_3_RM3100_CS, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
// GNSS reset pins are active low
gpio = new GpiodRegularByLineName(q7s::gpioNames::RESET_GNSS_0, consumer.str(), Direction::OUT,
Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_0_NRESET, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::RESET_GNSS_1, consumer.str(), Direction::OUT,
Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_NRESET, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::GYRO_0_ADIS_HANDLER;
// Enable pins must be pulled low for regular operations
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, consumer.str(), Direction::OUT,
Levels::LOW);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ENABLE, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::GYRO_2_ADIS_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ENABLE, consumer.str(), Direction::OUT,
Levels::LOW);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_2_ENABLE, gpio);
// Enable pins for GNSS
consumer.str("");
consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_0_ENABLE, consumer.str(), Direction::OUT,
Levels::LOW);
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_0_ENABLE, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_1_ENABLE, consumer.str(), Direction::OUT,
Levels::LOW);
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_ENABLE, gpio);
// Select pin. 0 for GPS side A, 1 for GPS side B
consumer.str("");
consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_SELECT, consumer.str(), Direction::OUT,
Levels::LOW);
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_SELECT, gpio);
gpioComIF->addGpios(gpioCookieAcsBoard);
AcsBoardFdir* fdir = nullptr;
static_cast<void>(fdir);
#if OBSW_ADD_ACS_HANDLERS == 1
std::string spiDev = q7s::SPI_DEFAULT_DEV;
SpiCookie* spiCookie =
new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev,
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
auto mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_COM_IF,
spiCookie, spi::LIS3_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER);
mgmLis3Handler->setCustomFdir(fdir);
static_cast<void>(mgmLis3Handler);
#if OBSW_TEST_ACS == 1
mgmLis3Handler->setStartUpImmediately();
mgmLis3Handler->setToGoToNormalMode(true);
#endif
#if OBSW_DEBUG_ACS == 1
mgmLis3Handler->enablePeriodicPrintouts(true, 10);
#endif
spiCookie =
new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev,
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
auto mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_COM_IF,
spiCookie, spi::RM3100_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::MGM_1_RM3100_HANDLER);
mgmRm3100Handler->setCustomFdir(fdir);
mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS);
static_cast<void>(mgmRm3100Handler);
#if OBSW_TEST_ACS == 1
mgmRm3100Handler->setStartUpImmediately();
mgmRm3100Handler->setToGoToNormalMode(true);
#endif
#if OBSW_DEBUG_ACS == 1
mgmRm3100Handler->enablePeriodicPrintouts(true, 10);
#endif
spiCookie =
new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev,
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_COM_IF,
spiCookie, spi::LIS3_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER);
mgmLis3Handler->setCustomFdir(fdir);
mgmLis3Handler->setParent(objects::ACS_BOARD_ASS);
static_cast<void>(mgmLis3Handler);
#if OBSW_TEST_ACS == 1
mgmLis3Handler->setStartUpImmediately();
mgmLis3Handler->setToGoToNormalMode(true);
#endif
#if OBSW_DEBUG_ACS == 1
mgmLis3Handler->enablePeriodicPrintouts(true, 10);
#endif
spiCookie =
new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, spiDev,
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_COM_IF,
spiCookie, spi::RM3100_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER);
mgmRm3100Handler->setCustomFdir(fdir);
mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS);
#if OBSW_TEST_ACS == 1
mgmRm3100Handler->setStartUpImmediately();
mgmRm3100Handler->setToGoToNormalMode(true);
#endif
#if OBSW_DEBUG_ACS == 1
mgmRm3100Handler->enablePeriodicPrintouts(true, 10);
#endif
// Commented until ACS board V2 in in clean room again
// Gyro 0 Side A
spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev,
ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE,
spi::DEFAULT_ADIS16507_SPEED);
auto adisHandler = new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF,
spiCookie, ADIS1650X::Type::ADIS16505);
fdir = new AcsBoardFdir(objects::GYRO_0_ADIS_HANDLER);
adisHandler->setCustomFdir(fdir);
adisHandler->setParent(objects::ACS_BOARD_ASS);
static_cast<void>(adisHandler);
#if OBSW_TEST_ACS == 1
adisHandler->setStartUpImmediately();
adisHandler->setToGoToNormalModeImmediately();
#endif
#if OBSW_DEBUG_ACS == 1
adisHandler->enablePeriodicPrintouts(true, 10);
#endif
// Gyro 1 Side A
spiCookie =
new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF,
spiCookie, spi::L3G_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER);
gyroL3gHandler->setCustomFdir(fdir);
gyroL3gHandler->setParent(objects::ACS_BOARD_ASS);
static_cast<void>(gyroL3gHandler);
#if OBSW_TEST_ACS == 1
gyroL3gHandler->setStartUpImmediately();
gyroL3gHandler->setToGoToNormalMode(true);
#endif
#if OBSW_DEBUG_ACS == 1
gyroL3gHandler->enablePeriodicPrintouts(true, 10);
#endif
// Gyro 2 Side B
spiCookie = new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, spiDev,
ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE,
spi::DEFAULT_ADIS16507_SPEED);
adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_COM_IF,
spiCookie, ADIS1650X::Type::ADIS16505);
fdir = new AcsBoardFdir(objects::GYRO_2_ADIS_HANDLER);
adisHandler->setCustomFdir(fdir);
adisHandler->setParent(objects::ACS_BOARD_ASS);
#if OBSW_TEST_ACS == 1
adisHandler->setStartUpImmediately();
adisHandler->setToGoToNormalModeImmediately();
#endif
// Gyro 3 Side B
spiCookie =
new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_COM_IF,
spiCookie, spi::L3G_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER);
gyroL3gHandler->setCustomFdir(fdir);
gyroL3gHandler->setParent(objects::ACS_BOARD_ASS);
#if OBSW_TEST_ACS == 1
gyroL3gHandler->setStartUpImmediately();
gyroL3gHandler->setToGoToNormalMode(true);
#endif
#if OBSW_DEBUG_ACS == 1
gyroL3gHandler->enablePeriodicPrintouts(true, 10);
#endif
bool debugGps = false;
#if OBSW_DEBUG_GPS == 1
debugGps = true;
#endif
resetArgsGnss1.gnss1 = true;
resetArgsGnss1.gpioComIF = gpioComIF;
resetArgsGnss1.waitPeriodMs = 100;
resetArgsGnss0.gnss1 = false;
resetArgsGnss0.gpioComIF = gpioComIF;
resetArgsGnss0.waitPeriodMs = 100;
auto gpsHandler0 =
new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps);
gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0);
AcsBoardHelper acsBoardHelper = AcsBoardHelper(
objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER,
objects::MGM_3_RM3100_HANDLER, objects::GYRO_0_ADIS_HANDLER, objects::GYRO_1_L3G_HANDLER,
objects::GYRO_2_ADIS_HANDLER, objects::GYRO_3_L3G_HANDLER, objects::GPS_CONTROLLER);
auto acsAss = new AcsBoardAssembly(objects::ACS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher,
acsBoardHelper, gpioComIF);
static_cast<void>(acsAss);
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */
}
void ObjectFactory::createHeaterComponents() {
using namespace gpio;
GpioCookie* heaterGpiosCookie = new GpioCookie;
GpiodRegularByLineName* gpio = nullptr;
std::stringstream consumer;
consumer << "0x" << std::hex << objects::HEATER_HANDLER;
/* Pin H2-11 on stack connector */
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_0, consumer.str(), Direction::OUT,
Levels::LOW);
heaterGpiosCookie->addGpio(gpioIds::HEATER_0, gpio);
/* Pin H2-12 on stack connector */
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_1, consumer.str(), Direction::OUT,
Levels::LOW);
heaterGpiosCookie->addGpio(gpioIds::HEATER_1, gpio);
/* Pin H2-13 on stack connector */
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_2, consumer.str(), Direction::OUT,
Levels::LOW);
heaterGpiosCookie->addGpio(gpioIds::HEATER_2, gpio);
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_3, consumer.str(), Direction::OUT,
Levels::LOW);
heaterGpiosCookie->addGpio(gpioIds::HEATER_3, gpio);
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_4, consumer.str(), Direction::OUT,
Levels::LOW);
heaterGpiosCookie->addGpio(gpioIds::HEATER_4, gpio);
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_5, consumer.str(), Direction::OUT,
Levels::LOW);
heaterGpiosCookie->addGpio(gpioIds::HEATER_5, gpio);
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_6, consumer.str(), Direction::OUT,
Levels::LOW);
heaterGpiosCookie->addGpio(gpioIds::HEATER_6, gpio);
gpio = new GpiodRegularByLineName(q7s::gpioNames::HEATER_7, consumer.str(), Direction::OUT,
Levels::LOW);
heaterGpiosCookie->addGpio(gpioIds::HEATER_7, gpio);
new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, heaterGpiosCookie,
objects::PCDU_HANDLER, pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V);
}
void ObjectFactory::createSolarArrayDeploymentComponents() {
using namespace gpio;
GpioCookie* solarArrayDeplCookie = new GpioCookie;
GpiodRegularByLineName* gpio = nullptr;
std::stringstream consumer;
consumer << "0x" << std::hex << objects::SOLAR_ARRAY_DEPL_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::SA_DPL_PIN_0, consumer.str(), Direction::OUT,
Levels::LOW);
solarArrayDeplCookie->addGpio(gpioIds::DEPLSA1, gpio);
gpio = new GpiodRegularByLineName(q7s::gpioNames::SA_DPL_PIN_1, consumer.str(), Direction::OUT,
Levels::LOW);
solarArrayDeplCookie->addGpio(gpioIds::DEPLSA2, gpio);
// TODO: Find out burn time. For now set to 1000 ms.
new SolarArrayDeploymentHandler(objects::SOLAR_ARRAY_DEPL_HANDLER, objects::GPIO_IF,
solarArrayDeplCookie, objects::PCDU_HANDLER,
pcdu::Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V,
gpioIds::DEPLSA1, gpioIds::DEPLSA2, 1000);
}
void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) {
UartCookie* syrlinksUartCookie =
new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, uart::SYRLINKS_BAUD,
syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
syrlinksUartCookie->setParityEven();
auto syrlinksFdir = new SyrlinksFdir(objects::SYRLINKS_HK_HANDLER);
auto syrlinksHandler =
new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie,
pcdu::PDU1_CH1_SYRLINKS_12V, syrlinksFdir);
syrlinksHandler->setPowerSwitcher(pwrSwitcher);
#if OBSW_DEBUG_SYRLINKS == 1
syrlinksHandler->setDebugMode(true);
#endif
}
void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
using namespace gpio;
std::stringstream consumer;
#if OBSW_ADD_PLOC_MPSOC == 1
consumer << "0x" << std::hex << objects::PLOC_MPSOC_HANDLER;
auto gpioConfigMPSoC = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_MPSOC_UART,
consumer.str(), Direction::OUT, Levels::HIGH);
auto mpsocGpioCookie = new GpioCookie;
mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC);
gpioComIF->addGpios(mpsocGpioCookie);
auto mpsocCookie =
new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, uart::PLOC_MPSOC_BAUD,
mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
mpsocCookie->setNoFixedSizeReply();
auto plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER);
new PlocMPSoCHandler(objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocCookie,
plocMpsocHelper, Gpio(gpioIds::ENABLE_MPSOC_UART, gpioComIF),
objects::PLOC_SUPERVISOR_HANDLER);
#endif /* OBSW_ADD_PLOC_MPSOC == 1 */
#if OBSW_ADD_PLOC_SUPERVISOR == 1
consumer << "0x" << std::hex << objects::PLOC_SUPERVISOR_HANDLER;
auto gpioConfigSupv = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_SUPV_UART, consumer.str(),
Direction::OUT, Levels::HIGH);
auto supvGpioCookie = new GpioCookie;
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
gpioComIF->addGpios(supvGpioCookie);
auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER,
q7s::UART_PLOC_SUPERVSIOR_DEV, uart::PLOC_SUPERVISOR_BAUD,
supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL);
supervisorCookie->setNoFixedSizeReply();
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF),
pcdu::PDU1_CH6_PLOC_12V);
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
static_cast<void>(consumer);
}
void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
using namespace gpio;
GpioCookie* gpioCookieRw = new GpioCookie;
GpioCallback* csRw1 =
new GpioCallback("Chip select reaction wheel 1", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieRw->addGpio(gpioIds::CS_RW1, csRw1);
GpioCallback* csRw2 =
new GpioCallback("Chip select reaction wheel 2", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieRw->addGpio(gpioIds::CS_RW2, csRw2);
GpioCallback* csRw3 =
new GpioCallback("Chip select reaction wheel 3", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieRw->addGpio(gpioIds::CS_RW3, csRw3);
GpioCallback* csRw4 =
new GpioCallback("Chip select reaction wheel 4", Direction::OUT, Levels::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieRw->addGpio(gpioIds::CS_RW4, csRw4);
std::stringstream consumer;
GpiodRegularByLineName* gpio = nullptr;
consumer << "0x" << std::hex << objects::RW1;
gpio = new GpiodRegularByLineName(q7s::gpioNames::EN_RW_1, consumer.str(), Direction::OUT,
Levels::LOW);
gpioCookieRw->addGpio(gpioIds::EN_RW1, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::RW2;
gpio = new GpiodRegularByLineName(q7s::gpioNames::EN_RW_2, consumer.str(), Direction::OUT,
Levels::LOW);
gpioCookieRw->addGpio(gpioIds::EN_RW2, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::RW3;
gpio = new GpiodRegularByLineName(q7s::gpioNames::EN_RW_3, consumer.str(), Direction::OUT,
Levels::LOW);
gpioCookieRw->addGpio(gpioIds::EN_RW3, gpio);
consumer.str("");
consumer << "0x" << std::hex << objects::RW4;
gpio = new GpiodRegularByLineName(q7s::gpioNames::EN_RW_4, consumer.str(), Direction::OUT,
Levels::LOW);
gpioCookieRw->addGpio(gpioIds::EN_RW4, gpio);
gpioComIF->addGpios(gpioCookieRw);
#if OBSW_ADD_RW == 1
auto rw1SpiCookie =
new SpiCookie(addresses::RW1, gpioIds::CS_RW1, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE,
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr);
auto rw2SpiCookie =
new SpiCookie(addresses::RW2, gpioIds::CS_RW2, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE,
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr);
auto rw3SpiCookie =
new SpiCookie(addresses::RW3, gpioIds::CS_RW3, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE,
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr);
auto rw4SpiCookie =
new SpiCookie(addresses::RW4, gpioIds::CS_RW4, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE,
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr);
auto rwHandler1 =
new RwHandler(objects::RW1, objects::SPI_COM_IF, rw1SpiCookie, gpioComIF, gpioIds::EN_RW1);
rw1SpiCookie->setCallbackArgs(rwHandler1);
#if OBSW_DEBUG_RW == 1
rwHandler1->setStartUpImmediately();
rwHandler1->setDebugMode(true);
#endif
auto rwHandler2 =
new RwHandler(objects::RW2, objects::SPI_COM_IF, rw2SpiCookie, gpioComIF, gpioIds::EN_RW2);
rw2SpiCookie->setCallbackArgs(rwHandler2);
#if OBSW_DEBUG_RW == 1
rwHandler2->setStartUpImmediately();
rwHandler2->setDebugMode(true);
#endif
auto rwHandler3 =
new RwHandler(objects::RW3, objects::SPI_COM_IF, rw3SpiCookie, gpioComIF, gpioIds::EN_RW3);
rw3SpiCookie->setCallbackArgs(rwHandler3);
#if OBSW_DEBUG_RW == 1
rwHandler3->setStartUpImmediately();
rwHandler3->setDebugMode(true);
#endif
auto rwHandler4 =
new RwHandler(objects::RW4, objects::SPI_COM_IF, rw4SpiCookie, gpioComIF, gpioIds::EN_RW4);
rw4SpiCookie->setCallbackArgs(rwHandler4);
#if OBSW_DEBUG_RW == 1
rwHandler4->setStartUpImmediately();
rwHandler4->setDebugMode(true);
#endif
#endif /* OBSW_ADD_RW == 1 */
}
void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
using namespace gpio;
// GPIO definitions of signals connected to the virtual channel interfaces of the PTME IP Core
GpioCookie* gpioCookiePtmeIp = new GpioCookie;
GpiodRegularByLineName* gpio = nullptr;
std::stringstream consumer;
consumer.str("PAPB VC0");
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC0, consumer.str());
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_BUSY, gpio);
consumer.str("PAPB VC0");
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC0, consumer.str());
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_EMPTY, gpio);
consumer.str("PAPB VC 1");
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC1, consumer.str());
gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_BUSY, gpio);
consumer.str("");
consumer.str("PAPB VC 1");
gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_EMPTY, gpio);
consumer.str("");
consumer.str("PAPB VC 2");
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC2, consumer.str());
gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_BUSY, gpio);
consumer.str("");
consumer.str("PAPB VC 2");
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC2, consumer.str());
gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_EMPTY, gpio);
consumer.str("");
consumer.str("PAPB VC 3");
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC3, consumer.str());
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_BUSY, gpio);
consumer.str("");
consumer.str("PAPB VC 3");
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC3, consumer.str());
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio);
gpioComIF->addGpios(gpioCookiePtmeIp);
// Creating virtual channel interfaces
VcInterfaceIF* vc0 =
new PapbVcInterface(gpioComIF, gpioIds::VC0_PAPB_BUSY, gpioIds::VC0_PAPB_EMPTY, q7s::UIO_PTME,
q7s::uiomapids::PTME_VC0);
VcInterfaceIF* vc1 =
new PapbVcInterface(gpioComIF, gpioIds::VC1_PAPB_BUSY, gpioIds::VC1_PAPB_EMPTY, q7s::UIO_PTME,
q7s::uiomapids::PTME_VC1);
VcInterfaceIF* vc2 =
new PapbVcInterface(gpioComIF, gpioIds::VC2_PAPB_BUSY, gpioIds::VC2_PAPB_EMPTY, q7s::UIO_PTME,
q7s::uiomapids::PTME_VC2);
VcInterfaceIF* vc3 =
new PapbVcInterface(gpioComIF, gpioIds::VC3_PAPB_BUSY, gpioIds::VC3_PAPB_EMPTY, q7s::UIO_PTME,
q7s::uiomapids::PTME_VC3);
// Creating ptme object and adding virtual channel interfaces
Ptme* ptme = new Ptme(objects::PTME);
ptme->addVcInterface(ccsds::VC0, vc0);
ptme->addVcInterface(ccsds::VC1, vc1);
ptme->addVcInterface(ccsds::VC2, vc2);
ptme->addVcInterface(ccsds::VC3, vc3);
AxiPtmeConfig* axiPtmeConfig =
new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG);
PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig);
#if OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT == 1
// Set to high value when not sending via syrlinks
static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day
#else
static const uint32_t TRANSMITTER_TIMEOUT = 900000; // 15 minutes
#endif
CCSDSHandler* ccsdsHandler = new CCSDSHandler(
objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig,
gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA, TRANSMITTER_TIMEOUT);
VirtualChannel* vc = nullptr;
vc = new VirtualChannel(ccsds::VC0, common::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER);
ccsdsHandler->addVirtualChannel(ccsds::VC0, vc);
vc = new VirtualChannel(ccsds::VC1, common::VC1_QUEUE_SIZE, objects::CCSDS_HANDLER);
ccsdsHandler->addVirtualChannel(ccsds::VC1, vc);
vc = new VirtualChannel(ccsds::VC2, common::VC2_QUEUE_SIZE, objects::CCSDS_HANDLER);
ccsdsHandler->addVirtualChannel(ccsds::VC2, vc);
vc = new VirtualChannel(ccsds::VC3, common::VC3_QUEUE_SIZE, objects::CCSDS_HANDLER);
ccsdsHandler->addVirtualChannel(ccsds::VC3, vc);
GpioCookie* gpioCookiePdec = new GpioCookie;
consumer.str("");
consumer << "0x" << std::hex << objects::PDEC_HANDLER;
// GPIO also low after linux boot (specified by device-tree)
gpio = new GpiodRegularByLineName(q7s::gpioNames::PDEC_RESET, consumer.str(), Direction::OUT,
Levels::LOW);
gpioCookiePdec->addGpio(gpioIds::PDEC_RESET, gpio);
gpioComIF->addGpios(gpioCookiePdec);
new PdecHandler(objects::PDEC_HANDLER, objects::CCSDS_HANDLER, gpioComIF, gpioIds::PDEC_RESET,
q7s::UIO_PDEC_CONFIG_MEMORY, q7s::UIO_PDEC_RAM, q7s::UIO_PDEC_REGISTERS);
GpioCookie* gpioRS485Chip = new GpioCookie;
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_CLOCK, "RS485 Transceiver",
Direction::OUT, Levels::LOW);
gpioRS485Chip->addGpio(gpioIds::RS485_EN_TX_CLOCK, gpio);
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_DATA, "RS485 Transceiver",
Direction::OUT, Levels::LOW);
gpioRS485Chip->addGpio(gpioIds::RS485_EN_TX_DATA, gpio);
// Default configuration enables RX channels (RXEN = LOW)
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_RX_CLOCK, "RS485 Transceiver",
Direction::OUT, Levels::LOW);
gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_CLOCK, gpio);
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_RX_DATA, "RS485 Transceiver",
Direction::OUT, Levels::LOW);
gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_DATA, gpio);
gpioComIF->addGpios(gpioRS485Chip);
}
void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
PowerSwitchIF* pwrSwitcher) {
using namespace gpio;
// Create all GPIO components first
GpioCookie* plPcduGpios = new GpioCookie;
GpiodRegularByLineName* gpio = nullptr;
std::string consumer;
// Switch pins are active high
consumer = "PLPCDU_ENB_VBAT_0";
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_VBAT0, consumer, Direction::OUT,
gpio::Levels::LOW);
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_VBAT0, gpio);
consumer = "PLPCDU_ENB_VBAT_1";
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_VBAT1, consumer, Direction::OUT,
gpio::Levels::LOW);
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_VBAT1, gpio);
consumer = "PLPCDU_ENB_DRO";
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_DRO, consumer, Direction::OUT,
gpio::Levels::LOW);
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_DRO, gpio);
consumer = "PLPCDU_ENB_X8";
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_X8, consumer, Direction::OUT,
gpio::Levels::LOW);
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_X8, gpio);
consumer = "PLPCDU_ENB_TX";
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_TX, consumer, Direction::OUT,
gpio::Levels::LOW);
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_TX, gpio);
consumer = "PLPCDU_ENB_MPA";
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_MPA, consumer, Direction::OUT,
gpio::Levels::LOW);
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_MPA, gpio);
consumer = "PLPCDU_ENB_HPA";
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_HPA, consumer, Direction::OUT,
gpio::Levels::LOW);
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_HPA, gpio);
// Chip select pin is active low
consumer = "PLPCDU_ADC_CS";
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ADC_CS, consumer, Direction::OUT,
gpio::Levels::HIGH);
plPcduGpios->addGpio(gpioIds::PLPCDU_ADC_CS, gpio);
gpioComIF->addGpios(plPcduGpios);
SpiCookie* spiCookie = new SpiCookie(addresses::PLPCDU_ADC, gpioIds::PLPCDU_ADC_CS,
q7s::SPI_DEFAULT_DEV, plpcdu::MAX_ADC_REPLY_SIZE,
spi::DEFAULT_MAX_1227_MODE, spi::PL_PCDU_MAX_1227_SPEED);
// Create device handler components
auto plPcduHandler = new PayloadPcduHandler(
objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie, gpioComIF, SdCardManager::instance(),
pwrSwitcher, pcdu::Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8,
pcdu::Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, false);
spiCookie->setCallbackMode(PayloadPcduHandler::extConvAsTwoCallback, plPcduHandler);
// plPcduHandler->enablePeriodicPrintout(true, 5);
// static_cast<void>(plPcduHandler);
#if OBSW_TEST_PL_PCDU == 1
plPcduHandler->setStartUpImmediately();
#endif
#if OBSW_DEBUG_PL_PCDU == 1
plPcduHandler->setToGoToNormalModeImmediately(true);
plPcduHandler->enablePeriodicPrintout(true, 10);
#endif
}
void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
new Q7STestTask(objects::TEST_TASK);
#if OBSW_ADD_SPI_TEST_CODE == 1
new SpiTestClass(objects::SPI_TEST, gpioComIF);
#endif
#if OBSW_ADD_I2C_TEST_CODE == 1
new I2cTestClass(objects::I2C_TEST, q7s::I2C_DEFAULT_DEV);
#endif
#if OBSW_ADD_UART_TEST_CODE == 1
new UartTestClass(objects::UART_TEST);
#endif
}
void ObjectFactory::testAcsBrdAss(AcsBoardAssembly* acsAss) {
CommandMessage msg;
ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND, DeviceHandlerIF::MODE_NORMAL,
duallane::A_SIDE);
ReturnValue_t result = MessageQueueSenderIF::sendMessage(acsAss->getCommandQueue(), &msg);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "Sending mode command failed" << std::endl;
}
} }

@ -1,3 +0,0 @@
target_sources(${OBSW_NAME} PRIVATE
fmObjectFactory.cpp
)

@ -0,0 +1,66 @@
#include "OBSWConfig.h"
#include "bsp_q7s/core/CoreController.h"
#include "bsp_q7s/core/ObjectFactory.h"
#include "busConf.h"
#include "commonObjects.h"
#include "devConf.h"
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
#include "linux/ObjectFactory.h"
#include "linux/callbacks/gpioCallbacks.h"
#include "mission/core/GenericFactory.h"
void ObjectFactory::produce(void* args) {
ObjectFactory::setStatics();
HealthTableIF* healthTable = nullptr;
ObjectFactory::produceGenericObjects(&healthTable);
LinuxLibgpioIF* gpioComIF = nullptr;
UartComIF* uartComIF = nullptr;
SpiComIF* spiMainComIF = nullptr;
I2cComIF* i2cComIF = nullptr;
PowerSwitchIF* pwrSwitcher = nullptr;
SpiComIF* spiRwComIF = nullptr;
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiMainComIF, &i2cComIF, &spiRwComIF);
createTmpComponents();
new CoreController(objects::CORE_CONTROLLER);
gpioCallbacks::disableAllDecoder(gpioComIF);
createPcduComponents(gpioComIF, &pwrSwitcher);
createRadSensorComponent(gpioComIF);
createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
#if OBSW_ADD_ACS_BOARD == 1
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
#endif
createHeaterComponents(gpioComIF, pwrSwitcher, healthTable);
createSolarArrayDeploymentComponents();
createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher);
#if OBSW_ADD_SYRLINKS == 1
createSyrlinksComponents(pwrSwitcher);
#endif /* OBSW_ADD_SYRLINKS == 1 */
createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF);
createPayloadComponents(gpioComIF);
#if OBSW_ADD_MGT == 1
createImtqComponents(pwrSwitcher);
#endif
createReactionWheelComponents(gpioComIF, pwrSwitcher);
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
createBpxBatteryComponent();
#endif
#if OBSW_ADD_STAR_TRACKER == 1
createStrComponents(pwrSwitcher);
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
#if OBSW_USE_CCSDS_IP_CORE == 1
createCcsdsComponents(gpioComIF);
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
/* Test Task */
#if OBSW_ADD_TEST_CODE == 1
createTestComponents(gpioComIF);
#endif /* OBSW_ADD_TEST_CODE == 1 */
createMiscComponents();
createThermalController();
}

@ -1,6 +1,2 @@
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE FileSystemHandler.cpp SdCardManager.cpp
FileSystemHandler.cpp scratchApi.cpp FilesystemHelper.cpp)
SdCardManager.cpp
scratchApi.cpp
FilesystemHelper.cpp
)

@ -70,9 +70,8 @@ void FileSystemHandler::fileSystemHandlerLoop() {
void FileSystemHandler::fileSystemCheckup() { void FileSystemHandler::fileSystemCheckup() {
SdCardManager::SdStatePair statusPair; SdCardManager::SdStatePair statusPair;
sdcMan->getSdCardActiveStatus(statusPair); sdcMan->getSdCardsStatus(statusPair);
sd::SdCard preferredSdCard; sd::SdCard preferredSdCard = sdcMan->getPreferredSdCard();
sdcMan->getPreferredSdCard(preferredSdCard);
if ((preferredSdCard == sd::SdCard::SLOT_0) and (statusPair.first == sd::SdState::MOUNTED)) { if ((preferredSdCard == sd::SdCard::SLOT_0) and (statusPair.first == sd::SdState::MOUNTED)) {
currentMountPrefix = SdCardManager::SD_0_MOUNT_POINT; currentMountPrefix = SdCardManager::SD_0_MOUNT_POINT;
} else if ((preferredSdCard == sd::SdCard::SLOT_1) and } else if ((preferredSdCard == sd::SdCard::SLOT_1) and
@ -109,11 +108,7 @@ ReturnValue_t FileSystemHandler::initialize() {
<< std::endl; << std::endl;
} }
sdcMan = SdCardManager::instance(); sdcMan = SdCardManager::instance();
sd::SdCard preferredSdCard; sd::SdCard preferredSdCard = sdcMan->getPreferredSdCard();
ReturnValue_t result = sdcMan->getPreferredSdCard(preferredSdCard);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
if (preferredSdCard == sd::SdCard::SLOT_0) { if (preferredSdCard == sd::SdCard::SLOT_0) {
currentMountPrefix = SdCardManager::SD_0_MOUNT_POINT; currentMountPrefix = SdCardManager::SD_0_MOUNT_POINT;
} else if (preferredSdCard == sd::SdCard::SLOT_1) { } else if (preferredSdCard == sd::SdCard::SLOT_1) {

@ -8,8 +8,6 @@
FilesystemHelper::FilesystemHelper() {} FilesystemHelper::FilesystemHelper() {}
FilesystemHelper::~FilesystemHelper() {}
ReturnValue_t FilesystemHelper::checkPath(std::string path) { ReturnValue_t FilesystemHelper::checkPath(std::string path) {
SdCardManager* sdcMan = SdCardManager::instance(); SdCardManager* sdcMan = SdCardManager::instance();
if (sdcMan == nullptr) { if (sdcMan == nullptr) {

@ -7,7 +7,7 @@
#include "fsfw/returnvalues/HasReturnvaluesIF.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h"
/** /**
* @brief This class implements often used functions concerning the file system management. * @brief This class implements often used functions related to the file system management.
* *
* @author J. Meier * @author J. Meier
*/ */
@ -20,11 +20,8 @@ class FilesystemHelper : public HasReturnvaluesIF {
//! [EXPORT] : [COMMENT] Specified file does not exist on filesystem //! [EXPORT] : [COMMENT] Specified file does not exist on filesystem
static const ReturnValue_t FILE_NOT_EXISTS = MAKE_RETURN_CODE(0xA1); static const ReturnValue_t FILE_NOT_EXISTS = MAKE_RETURN_CODE(0xA1);
FilesystemHelper();
virtual ~FilesystemHelper();
/** /**
* @brief In case the path points to a directory on the sd card the function checks if the * @brief In case the path points to a directory on the sd card, the function checks if the
* appropriate SD card is mounted. * appropriate SD card is mounted.
* *
* @param path Path to check * @param path Path to check
@ -39,11 +36,14 @@ class FilesystemHelper : public HasReturnvaluesIF {
/** /**
* @brief Checks if the file exists on the filesystem. * @brief Checks if the file exists on the filesystem.
* *
* param file File to check * @param file File to check
* *
* @return RETURN_OK if fiel exists, otherwise return error code. * @return RETURN_OK if file exists, otherwise return error code.
*/ */
static ReturnValue_t fileExists(std::string file); static ReturnValue_t fileExists(std::string file);
private:
FilesystemHelper();
}; };
#endif /* BSP_Q7S_MEMORY_FILESYSTEMHELPER_H_ */ #endif /* BSP_Q7S_MEMORY_FILESYSTEMHELPER_H_ */

@ -16,23 +16,51 @@
#include "linux/utility/utility.h" #include "linux/utility/utility.h"
#include "scratchApi.h" #include "scratchApi.h"
SdCardManager* SdCardManager::factoryInstance = nullptr; SdCardManager* SdCardManager::INSTANCE = nullptr;
SdCardManager::SdCardManager() : SystemObject(objects::SDC_MANAGER), cmdExecutor(256) { SdCardManager::SdCardManager() : SystemObject(objects::SDC_MANAGER), cmdExecutor(256) {
mutex = MutexFactory::instance()->createMutex(); mutex = MutexFactory::instance()->createMutex();
ReturnValue_t result = mutex->lockMutex();
if (result != RETURN_OK) {
sif::error << "SdCardManager::SdCardManager: Mutex lock failed" << std::endl;
}
uint8_t prefSdRaw = 0;
result = scratch::readNumber(scratch::PREFERED_SDC_KEY, prefSdRaw);
result = mutex->unlockMutex();
if (result != RETURN_OK) {
sif::error << "SdCardManager::SdCardManager: Mutex unlock failed" << std::endl;
}
if (result != HasReturnvaluesIF::RETURN_OK) {
if (result == scratch::KEY_NOT_FOUND) {
sif::warning << "CoreController::sdCardInit: "
"Preferred SD card not set. Setting to 0"
<< std::endl;
setPreferredSdCard(sd::SdCard::SLOT_0);
sdInfo.pref = sd::SdCard::SLOT_0;
} else {
// Should not happen.
// TODO: Maybe trigger event?
sif::error << "SdCardManager::SdCardManager: Reading preferred SD card from scratch"
"buffer failed"
<< std::endl;
sdInfo.pref = sd::SdCard::SLOT_0;
}
}
sdInfo.pref = static_cast<sd::SdCard>(prefSdRaw);
} }
SdCardManager::~SdCardManager() {} SdCardManager::~SdCardManager() {}
void SdCardManager::create() { void SdCardManager::create() {
if (factoryInstance == nullptr) { if (INSTANCE == nullptr) {
factoryInstance = new SdCardManager(); INSTANCE = new SdCardManager();
} }
} }
SdCardManager* SdCardManager::instance() { SdCardManager* SdCardManager::instance() {
SdCardManager::create(); SdCardManager::create();
return SdCardManager::factoryInstance; return SdCardManager::INSTANCE;
} }
ReturnValue_t SdCardManager::switchOnSdCard(sd::SdCard sdCard, bool doMountSdCard, ReturnValue_t SdCardManager::switchOnSdCard(sd::SdCard sdCard, bool doMountSdCard,
@ -51,7 +79,7 @@ ReturnValue_t SdCardManager::switchOnSdCard(sd::SdCard sdCard, bool doMountSdCar
if (statusPair == nullptr) { if (statusPair == nullptr) {
sdStatusPtr = std::make_unique<SdStatePair>(); sdStatusPtr = std::make_unique<SdStatePair>();
statusPair = sdStatusPtr.get(); statusPair = sdStatusPtr.get();
result = getSdCardActiveStatus(*statusPair); result = getSdCardsStatus(*statusPair);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
return result; return result;
} }
@ -98,7 +126,7 @@ ReturnValue_t SdCardManager::switchOnSdCard(sd::SdCard sdCard, bool doMountSdCar
ReturnValue_t SdCardManager::switchOffSdCard(sd::SdCard sdCard, bool doUnmountSdCard, ReturnValue_t SdCardManager::switchOffSdCard(sd::SdCard sdCard, bool doUnmountSdCard,
SdStatePair* statusPair) { SdStatePair* statusPair) {
std::pair<sd::SdState, sd::SdState> active; std::pair<sd::SdState, sd::SdState> active;
ReturnValue_t result = getSdCardActiveStatus(active); ReturnValue_t result = getSdCardsStatus(active);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
return result; return result;
} }
@ -165,7 +193,7 @@ ReturnValue_t SdCardManager::setSdCardState(sd::SdCard sdCard, bool on) {
return result; return result;
} }
ReturnValue_t SdCardManager::getSdCardActiveStatus(SdStatePair& active) { ReturnValue_t SdCardManager::getSdCardsStatus(SdStatePair& active) {
using namespace std; using namespace std;
MutexGuard mg(mutex); MutexGuard mg(mutex);
if (not filesystem::exists(SD_STATE_FILE)) { if (not filesystem::exists(SD_STATE_FILE)) {
@ -273,14 +301,14 @@ ReturnValue_t SdCardManager::sanitizeState(SdStatePair* statusPair, sd::SdCard p
resetNonBlockingState = true; resetNonBlockingState = true;
} }
if (prefSdCard == sd::SdCard::NONE) { if (prefSdCard == sd::SdCard::NONE) {
result = getPreferredSdCard(prefSdCard); result = getPreferredSdCard();
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
} }
} }
if (statusPair == nullptr) { if (statusPair == nullptr) {
sdStatusPtr = std::make_unique<SdStatePair>(); sdStatusPtr = std::make_unique<SdStatePair>();
statusPair = sdStatusPtr.get(); statusPair = sdStatusPtr.get();
getSdCardActiveStatus(*statusPair); getSdCardsStatus(*statusPair);
} }
if (statusPair->first == sd::SdState::ON) { if (statusPair->first == sd::SdState::ON) {
@ -351,20 +379,21 @@ void SdCardManager::processSdStatusLine(std::pair<sd::SdState, sd::SdState>& act
idx++; idx++;
} }
ReturnValue_t SdCardManager::getPreferredSdCard(sd::SdCard& sdCard) const { sd::SdCard SdCardManager::getPreferredSdCard() const {
uint8_t prefSdCard = 0; MutexGuard mg(mutex);
ReturnValue_t result = scratch::readNumber(scratch::PREFERED_SDC_KEY, prefSdCard); auto res = mg.getLockResult();
if (result != HasReturnvaluesIF::RETURN_OK) { if (res != RETURN_OK) {
return result; sif::error << "SdCardManager::getPreferredSdCard: Lock error" << std::endl;
} }
sdCard = static_cast<sd::SdCard>(prefSdCard); return sdInfo.pref;
return HasReturnvaluesIF::RETURN_OK;
} }
ReturnValue_t SdCardManager::setPreferredSdCard(sd::SdCard sdCard) { ReturnValue_t SdCardManager::setPreferredSdCard(sd::SdCard sdCard) {
MutexGuard mg(mutex);
if (sdCard == sd::SdCard::BOTH) { if (sdCard == sd::SdCard::BOTH) {
return HasReturnvaluesIF::RETURN_FAILED; return HasReturnvaluesIF::RETURN_FAILED;
} }
sdInfo.pref = sdCard;
return scratch::writeNumber(scratch::PREFERED_SDC_KEY, static_cast<uint8_t>(sdCard)); return scratch::writeNumber(scratch::PREFERED_SDC_KEY, static_cast<uint8_t>(sdCard));
} }
@ -383,14 +412,9 @@ ReturnValue_t SdCardManager::updateSdCardStateFile() {
return result; return result;
} }
std::string SdCardManager::getCurrentMountPrefix(sd::SdCard prefSdCard) { std::string SdCardManager::getCurrentMountPrefix() const {
if (prefSdCard == sd::SdCard::NONE) { MutexGuard mg(mutex);
ReturnValue_t result = getPreferredSdCard(prefSdCard); if (sdInfo.active == sd::SdCard::SLOT_0) {
if (result != HasReturnvaluesIF::RETURN_OK) {
return SD_0_MOUNT_POINT;
}
}
if (prefSdCard == sd::SdCard::SLOT_0) {
return SD_0_MOUNT_POINT; return SD_0_MOUNT_POINT;
} else { } else {
return SD_1_MOUNT_POINT; return SD_1_MOUNT_POINT;
@ -443,7 +467,7 @@ void SdCardManager::setPrintCommandOutput(bool print) { this->printCmdOutput = p
bool SdCardManager::isSdCardMounted(sd::SdCard sdCard) { bool SdCardManager::isSdCardMounted(sd::SdCard sdCard) {
SdCardManager::SdStatePair active; SdCardManager::SdStatePair active;
ReturnValue_t result = this->getSdCardActiveStatus(active); ReturnValue_t result = this->getSdCardsStatus(active);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
sif::debug << "SdCardManager::isSdCardMounted: Failed to get SD card active state"; sif::debug << "SdCardManager::isSdCardMounted: Failed to get SD card active state";
@ -466,3 +490,68 @@ bool SdCardManager::isSdCardMounted(sd::SdCard sdCard) {
} }
return false; return false;
} }
ReturnValue_t SdCardManager::isSdCardMountedReadOnly(sd::SdCard sdcard, bool& readOnly) {
std::ostringstream command;
if (sdcard == sd::SdCard::SLOT_0) {
command << "grep -q '" << SD_0_MOUNT_POINT << " vfat ro,' /proc/mounts";
} else {
command << "grep -q '" << SD_1_MOUNT_POINT << " vfat ro,' /proc/mounts";
}
ReturnValue_t result = cmdExecutor.load(command.str(), true, false);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
result = cmdExecutor.execute();
if (result != HasReturnvaluesIF::RETURN_OK) {
int exitStatus = cmdExecutor.getLastError();
if (exitStatus == 1) {
readOnly = false;
return RETURN_OK;
}
return result;
}
auto& readVec = cmdExecutor.getReadVector();
size_t readLen = strnlen(readVec.data(), readVec.size());
if (readLen == 0) {
readOnly = false;
}
readOnly = true;
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t SdCardManager::remountReadWrite(sd::SdCard sdcard) {
std::ostringstream command;
if (sdcard == sd::SdCard::SLOT_0) {
command << "mount -o remount,rw " << SD_0_DEV_NAME << " " << SD_0_MOUNT_POINT;
} else {
command << "mount -o remount,rw " << SD_1_DEV_NAME << " " << SD_1_MOUNT_POINT;
}
ReturnValue_t result = cmdExecutor.load(command.str(), true, false);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
return cmdExecutor.execute();
}
ReturnValue_t SdCardManager::performFsck(sd::SdCard sdcard, bool printOutput, int& linuxError) {
std::ostringstream command;
if (sdcard == sd::SdCard::SLOT_0) {
command << "fsck -y " << SD_0_DEV_NAME;
} else {
command << "fsck -y " << SD_1_DEV_NAME;
}
ReturnValue_t result = cmdExecutor.load(command.str(), true, printOutput);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
result = cmdExecutor.execute();
if (result != HasReturnvaluesIF::RETURN_OK) {
linuxError = cmdExecutor.getLastError();
}
return result;
}
void SdCardManager::setActiveSdCard(sd::SdCard sdCard) { sdInfo.active = sdCard; }
sd::SdCard SdCardManager::getActiveSdCard() const { return sdInfo.active; }

@ -24,7 +24,7 @@ class MutexIF;
* @brief Manages handling of SD cards like switching them on or off or getting the current * @brief Manages handling of SD cards like switching them on or off or getting the current
* state * state
*/ */
class SdCardManager : public SystemObject, public SdCardMountedIF { class SdCardManager : public SystemObject, public HasReturnvaluesIF, public SdCardMountedIF {
friend class SdCardAccess; friend class SdCardAccess;
public: public:
@ -36,6 +36,12 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
using SdStatePair = std::pair<sd::SdState, sd::SdState>; using SdStatePair = std::pair<sd::SdState, sd::SdState>;
struct SdInfo {
sd::SdCard pref = sd::SdCard::NONE;
sd::SdCard other = sd::SdCard::NONE;
sd::SdCard active = sd::SdCard::NONE;
} sdInfo;
static constexpr uint8_t INTERFACE_ID = CLASS_ID::SD_CARD_MANAGER; static constexpr uint8_t INTERFACE_ID = CLASS_ID::SD_CARD_MANAGER;
static constexpr ReturnValue_t OP_ONGOING = HasReturnvaluesIF::makeReturnCode(INTERFACE_ID, 0); static constexpr ReturnValue_t OP_ONGOING = HasReturnvaluesIF::makeReturnCode(INTERFACE_ID, 0);
@ -91,7 +97,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
* @param sdCard * @param sdCard
* @return * @return
*/ */
ReturnValue_t getPreferredSdCard(sd::SdCard& sdCard) const override; sd::SdCard getPreferredSdCard() const override;
/** /**
* Switch on the specified SD card. * Switch on the specified SD card.
@ -138,7 +144,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
* should call #updateSdCardStateFile again in that case * should call #updateSdCardStateFile again in that case
* - STATUS_FILE_NEXISTS if the status file does not exist * - STATUS_FILE_NEXISTS if the status file does not exist
*/ */
ReturnValue_t getSdCardActiveStatus(SdStatePair& active); ReturnValue_t getSdCardsStatus(SdStatePair& active);
/** /**
* Mount the specified SD card. This is necessary to use it. * Mount the specified SD card. This is necessary to use it.
@ -146,6 +152,20 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
* @return * @return
*/ */
ReturnValue_t mountSdCard(sd::SdCard sdCard); ReturnValue_t mountSdCard(sd::SdCard sdCard);
/**
* Set the currently active SD card. This does not necessarily mean that the SD card is on or
* mounted
* @param sdCard
*/
void setActiveSdCard(sd::SdCard sdCard) override;
/**
* Get the currently active SD card. This does not necessarily mean that the SD card is on or
* mounted
* @return
*/
sd::SdCard getActiveSdCard() const override;
/** /**
* Unmount the specified SD card. This is recommended before switching it off. The SD card * Unmount the specified SD card. This is recommended before switching it off. The SD card
* can't be used after it has been unmounted. * can't be used after it has been unmounted.
@ -173,7 +193,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
* @param prefSdCardPtr * @param prefSdCardPtr
* @return * @return
*/ */
std::string getCurrentMountPrefix(sd::SdCard prefSdCardPtr = sd::SdCard::NONE) override; std::string getCurrentMountPrefix() const override;
OpStatus checkCurrentOp(Operations& currentOp); OpStatus checkCurrentOp(Operations& currentOp);
@ -194,6 +214,12 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
*/ */
bool isSdCardMounted(sd::SdCard sdCard) override; bool isSdCardMounted(sd::SdCard sdCard) override;
ReturnValue_t isSdCardMountedReadOnly(sd::SdCard sdcard, bool& readOnly);
ReturnValue_t remountReadWrite(sd::SdCard sdcard);
ReturnValue_t performFsck(sd::SdCard sdcard, bool printOutput, int& linuxError);
private: private:
CommandExecutor cmdExecutor; CommandExecutor cmdExecutor;
Operations currentOp = Operations::IDLE; Operations currentOp = Operations::IDLE;
@ -210,7 +236,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
std::string currentPrefix; std::string currentPrefix;
static SdCardManager* factoryInstance; static SdCardManager* INSTANCE;
}; };
#endif /* BSP_Q7S_MEMORY_SDCARDACCESSMANAGER_H_ */ #endif /* BSP_Q7S_MEMORY_SDCARDACCESSMANAGER_H_ */

@ -76,12 +76,12 @@ ReturnValue_t readToFile(std::string name, std::ifstream& file, std::string& fil
int result = std::system(oss.str().c_str()); int result = std::system(oss.str().c_str());
if (result != 0) { if (result != 0) {
if (WEXITSTATUS(result) == 1) { if (WEXITSTATUS(result) == 1) {
sif::warning << "scratch::readNumber: Key " << name << " does not exist" << std::endl; sif::warning << "scratch::readToFile: Key " << name << " does not exist" << std::endl;
// Could not find value // Could not find value
std::remove(filename.c_str()); std::remove(filename.c_str());
return KEY_NOT_FOUND; return KEY_NOT_FOUND;
} else { } else {
utility::handleSystemError(result, "scratch::readNumber"); utility::handleSystemError(result, "scratch::readToFile");
std::remove(filename.c_str()); std::remove(filename.c_str());
return HasReturnvaluesIF::RETURN_FAILED; return HasReturnvaluesIF::RETURN_FAILED;
} }

@ -8,14 +8,19 @@
#include "core/InitMission.h" #include "core/InitMission.h"
#include "fsfw/tasks/TaskFactory.h" #include "fsfw/tasks/TaskFactory.h"
#include "fsfw/version.h" #include "fsfw/version.h"
#include "q7sConfig.h"
#include "watchdog/definitions.h" #include "watchdog/definitions.h"
static int OBSW_ALREADY_RUNNING = -2; static int OBSW_ALREADY_RUNNING = -2;
#if OBSW_Q7S_EM == 0
static const char* DEV_STRING = "Xiphos Q7S FM";
#else
static const char* DEV_STRING = "Xiphos Q7S EM";
#endif
int obsw::obsw() { int obsw::obsw() {
using namespace fsfw; using namespace fsfw;
std::cout << "-- EIVE OBSW --" << std::endl; std::cout << "-- EIVE OBSW --" << std::endl;
std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl; std::cout << "-- Compiled for Linux (" << DEV_STRING << ") --" << std::endl;
std::cout << "-- OBSW v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --" std::cout << "-- OBSW v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --"
<< std::endl; << std::endl;
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;

@ -1,3 +1 @@
target_sources(${SIMPLE_OBSW_NAME} PRIVATE target_sources(${SIMPLE_OBSW_NAME} PRIVATE simple.cpp)
simple.cpp
)

@ -1,3 +1 @@
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE Xadc.cpp)
Xadc.cpp
)

@ -89,13 +89,42 @@ void initmission::initTasks() {
} }
pstTasks.push_back(pst); pstTasks.push_back(pst);
#if OBSW_ADD_PLOC_MPSOC == 1
PeriodicTaskIF* mpsocHelperTask = factory->createPeriodicTask( PeriodicTaskIF* mpsocHelperTask = factory->createPeriodicTask(
"PLOC_MPSOC_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); "PLOC_MPSOC_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
result = mpsocHelperTask->addComponent(objects::PLOC_MPSOC_HELPER); result = mpsocHelperTask->addComponent(objects::PLOC_MPSOC_HELPER);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PLOC_MPSOC_HELPER", objects::PLOC_MPSOC_HELPER); initmission::printAddObjectError("PLOC_MPSOC_HELPER", objects::PLOC_MPSOC_HELPER);
} }
pstTasks.push_back(mpsocHelperTask); #endif /* OBSW_ADD_PLOC_MPSOC == 1*/
#if OBSW_ADD_PLOC_SUPERVISOR == 1
PeriodicTaskIF* supvHelperTask = factory->createPeriodicTask(
"PLOC_SUPV_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
result = supvHelperTask->addComponent(objects::PLOC_SUPERVISOR_HELPER);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PLOC_SUPV_HELPER", objects::PLOC_SUPERVISOR_HELPER);
}
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
#if OBSW_USE_CCSDS_IP_CORE == 1
PeriodicTaskIF* ccsdsHandlerTask = factory->createPeriodicTask(
"CCSDS_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
result = ccsdsHandlerTask->addComponent(objects::CCSDS_HANDLER);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("CCSDS Handler", objects::CCSDS_HANDLER);
}
// Minimal distance between two received TCs amounts to 0.6 seconds
// If a command has not been read before the next one arrives, the old command will be
// overwritten by the PDEC.
PeriodicTaskIF* pdecHandlerTask = factory->createPeriodicTask(
"PDEC_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc);
result = pdecHandlerTask->addComponent(objects::PDEC_HANDLER);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PDEC Handler", objects::PDEC_HANDLER);
}
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
auto taskStarter = [](std::vector<PeriodicTaskIF*>& taskVector, std::string name) { auto taskStarter = [](std::vector<PeriodicTaskIF*>& taskVector, std::string name) {
for (const auto& task : taskVector) { for (const auto& task : taskVector) {
@ -111,6 +140,16 @@ void initmission::initTasks() {
tmtcDistributor->startTask(); tmtcDistributor->startTask();
tmtcBridgeTask->startTask(); tmtcBridgeTask->startTask();
tmtcPollingTask->startTask(); tmtcPollingTask->startTask();
#if OBSW_USE_CCSDS_IP_CORE == 1
pdecHandlerTask->startTask();
ccsdsHandlerTask->startTask();
#endif /* #if OBSW_USE_CCSDS_IP_CORE == 1 */
#if OBSW_ADD_PLOC_SUPERVISOR == 1
supvHelperTask->startTask();
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
#if OBSW_ADD_PLOC_MPSOC == 1
mpsocHelperTask->startTask();
#endif /* OBSW_ADD_PLOC_MPSOC == 1 */
taskStarter(pstTasks, "PST Tasks"); taskStarter(pstTasks, "PST Tasks");
taskStarter(pusTasks, "PUS Tasks"); taskStarter(pusTasks, "PUS Tasks");

@ -3,7 +3,7 @@
#include <vector> #include <vector>
#include "fsfw/tasks/Typedef.h" #include "fsfw/tasks/definitions.h"
class PeriodicTaskIF; class PeriodicTaskIF;
class TaskFactory; class TaskFactory;

@ -37,7 +37,6 @@
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 #define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
#define OBSW_SYRLINKS_SIMULATED 1 #define OBSW_SYRLINKS_SIMULATED 1
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1 #define OBSW_STAR_TRACKER_GROUND_CONFIG 1
#define OBSW_ENABLE_PERIODIC_HK 0
#define OBSW_PRINT_CORE_HK 0 #define OBSW_PRINT_CORE_HK 0
#define OBSW_INITIALIZE_SWITCHES 0 #define OBSW_INITIALIZE_SWITCHES 0

@ -1,27 +1,38 @@
#include "ObjectFactory.h" #include "ObjectFactory.h"
#include <devConf.h>
#include "fsfw_hal/linux/uart/UartComIF.h"
#include "fsfw_hal/linux/i2c/I2cComIF.h"
#include "fsfw_hal/linux/uart/UartCookie.h"
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "busConf.h" #include "busConf.h"
#include "devConf.h" #include "devConf.h"
#include "ccsdsConfig.h"
#include "devices/addresses.h"
#include "devices/gpioIds.h"
#include "fsfw/datapoollocal/LocalDataPoolManager.h" #include "fsfw/datapoollocal/LocalDataPoolManager.h"
#include "fsfw/tmtcpacket/pus/tm.h" #include "fsfw/tmtcpacket/pus/tm.h"
#include "fsfw/tmtcservices/CommandingServiceBase.h" #include "fsfw/tmtcservices/CommandingServiceBase.h"
#include "fsfw/tmtcservices/PusServiceBase.h" #include "fsfw/tmtcservices/PusServiceBase.h"
#include "fsfw_hal/linux/i2c/I2cComIF.h"
#include "fsfw_hal/linux/i2c/I2cCookie.h" #include "fsfw_hal/linux/i2c/I2cCookie.h"
#include "fsfw_hal/linux/uart/UartComIF.h"
#include "fsfw_hal/linux/uart/UartCookie.h"
#include "fsfw_hal/common/gpio/GpioCookie.h"
#include "linux/ObjectFactory.h"
#include "linux/devices/ploc/PlocMPSoCHandler.h" #include "linux/devices/ploc/PlocMPSoCHandler.h"
#include "linux/devices/ploc/PlocMPSoCHelper.h" #include "linux/devices/ploc/PlocMPSoCHelper.h"
#include "mission/devices/Tmp1075Handler.h" #include "linux/devices/ploc/PlocMemoryDumper.h"
#include "linux/devices/ploc/PlocSupervisorHandler.h"
#include "linux/devices/ploc/PlocSupvHelper.h"
#include "linux/obc/AxiPtmeConfig.h"
#include "linux/obc/PapbVcInterface.h"
#include "linux/obc/PdecHandler.h"
#include "linux/obc/Ptme.h"
#include "linux/obc/PtmeConfig.h"
#include "mission/core/GenericFactory.h" #include "mission/core/GenericFactory.h"
#include "mission/utility/TmFunnel.h" #include "mission/devices/Tmp1075Handler.h"
#include "test/gpio/DummyGpioIF.h" #include "mission/tmtc/TmFunnel.h"
#include "mission/tmtc/CCSDSHandler.h"
#include "mission/tmtc/VirtualChannel.h"
#include "objects/systemObjectList.h" #include "objects/systemObjectList.h"
#include "devices/addresses.h" #include "test/gpio/DummyGpioIF.h"
#include "devices/gpioIds.h"
#include "tmtc/apid.h" #include "tmtc/apid.h"
#include "tmtc/pusIds.h" #include "tmtc/pusIds.h"
@ -32,7 +43,11 @@ void Factory::setStaticFrameworkObjectIds() {
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
#if OBSW_TM_TO_PTME == 1
TmFunnel::downlinkDestination = objects::CCSDS_HANDLER;
#else
TmFunnel::downlinkDestination = objects::TMTC_BRIDGE; TmFunnel::downlinkDestination = objects::TMTC_BRIDGE;
#endif
TmFunnel::storageDestination = objects::NO_OBJECT; TmFunnel::storageDestination = objects::NO_OBJECT;
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION; VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
@ -43,12 +58,14 @@ void ObjectFactory::produce(void* args) {
Factory::setStaticFrameworkObjectIds(); Factory::setStaticFrameworkObjectIds();
ObjectFactory::produceGenericObjects(); ObjectFactory::produceGenericObjects();
LinuxLibgpioIF* gpioComIF = new LinuxLibgpioIF(objects::GPIO_IF);;
new UartComIF(objects::UART_COM_IF);
#if OBSW_ADD_PLOC_MPSOC == 1 #if OBSW_ADD_PLOC_MPSOC == 1
UartCookie* mpsocUartCookie = new UartCookie(objects::PLOC_MPSOC_HANDLER, te0720_1cfa::MPSOC_UART, UartCookie* mpsocUartCookie = new UartCookie(objects::PLOC_MPSOC_HANDLER, te0720_1cfa::MPSOC_UART,
uart::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE); uart::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE);
mpsocUartCookie->setNoFixedSizeReply(); mpsocUartCookie->setNoFixedSizeReply();
PlocMPSoCHelper* plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER); PlocMPSoCHelper* plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER);
new UartComIF(objects::UART_COM_IF);
auto dummyGpioIF = new DummyGpioIF(); auto dummyGpioIF = new DummyGpioIF();
PlocMPSoCHandler* plocMPSoCHandler = new PlocMPSoCHandler( PlocMPSoCHandler* plocMPSoCHandler = new PlocMPSoCHandler(
objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocUartCookie, plocMpsocHelper, objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocUartCookie, plocMpsocHelper,
@ -56,6 +73,21 @@ void ObjectFactory::produce(void* args) {
plocMPSoCHandler->setStartUpImmediately(); plocMPSoCHandler->setStartUpImmediately();
#endif /* OBSW_ADD_PLOC_MPSOC == 1 */ #endif /* OBSW_ADD_PLOC_MPSOC == 1 */
#if OBSW_ADD_PLOC_SUPERVISOR == 1
UartCookie* supervisorCookie =
new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, std::string("/dev/ttyPS1"),
uart::PLOC_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20);
supervisorCookie->setNoFixedSizeReply();
auto supvGpioIF = new DummyGpioIF();
auto supvHelper = new PlocSupvHelper(objects::PLOC_SUPERVISOR_HELPER);
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, supvGpioIF),
pcdu::PDU1_CH6_PLOC_12V, supvHelper);
#endif
new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER);
#if OBSW_TEST_LIBGPIOD == 1 #if OBSW_TEST_LIBGPIOD == 1
#if OBSW_TEST_GPIO_OPEN_BYLABEL == 1 #if OBSW_TEST_GPIO_OPEN_BYLABEL == 1
/* Configure MIO0 as input */ /* Configure MIO0 as input */
@ -86,21 +118,6 @@ void ObjectFactory::produce(void* args) {
new SusHandler(objects::SUS_0, objects::SPI_COM_IF, spiCookieSus, gpioComIF, gpioIds::CS_SUS_0); new SusHandler(objects::SUS_0, objects::SPI_COM_IF, spiCookieSus, gpioComIF, gpioIds::CS_SUS_0);
#endif #endif
#if OBSW_TEST_CCSDS_BRIDGE == 1
GpioCookie* gpioCookieCcsdsIp = new GpioCookie;
GpiodRegular* papbBusyN =
new GpiodRegular(std::string("gpiochip0"), 0, std::string("PAPBBusy_VC0"));
gpioCookieCcsdsIp->addGpio(gpioIds::PAPB_BUSY_N, papbBusyN);
GpiodRegular* papbEmpty =
new GpiodRegular(std::string("gpiochip0"), 1, std::string("PAPBEmpty_VC0"));
gpioCookieCcsdsIp->addGpio(gpioIds::PAPB_EMPTY, papbEmpty);
gpioComIF->addGpios(gpioCookieCcsdsIp);
new CCSDSIPCoreBridge(objects::CCSDS_IP_CORE_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR,
objects::TM_STORE, objects::TC_STORE, gpioComIF, std::string("/dev/uio0"),
gpioIds::PAPB_BUSY_N, gpioIds::PAPB_EMPTY);
#endif
#if OBSW_TEST_RAD_SENSOR == 1 #if OBSW_TEST_RAD_SENSOR == 1
GpioCookie* gpioCookieRadSensor = new GpioCookie; GpioCookie* gpioCookieRadSensor = new GpioCookie;
GpiodRegular* chipSelectRadSensor = new GpiodRegular( GpiodRegular* chipSelectRadSensor = new GpiodRegular(
@ -124,28 +141,19 @@ void ObjectFactory::produce(void* args) {
GpioCookie* gpioCookie = new GpioCookie; GpioCookie* gpioCookie = new GpioCookie;
gpioCookie->addGpio(gpioIds::HEATER_0, heaterGpio); gpioCookie->addGpio(gpioIds::HEATER_0, heaterGpio);
new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, gpioCookie, objects::PCDU_HANDLER, new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, gpioCookie, objects::PCDU_HANDLER,
pcduSwitches::TCS_BOARD_8V_HEATER_IN); pcdu::TCS_BOARD_8V_HEATER_IN);
#endif #endif
#if OBSW_ADD_PLOC_SUPERVISOR == 1 new I2cComIF(objects::I2C_COM_IF);
/* Configuration for MIO0 on TE0720-03-1CFA */
UartCookie* plocSupervisorCookie =
new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, std::string("/dev/ttyPS1"),
UartModes::NON_CANONICAL, 115200, PLOC_SPV::MAX_PACKET_SIZE * 20);
plocSupervisorCookie->setNoFixedSizeReply();
PlocSupervisorHandler* plocSupervisor = new PlocSupervisorHandler(
objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, plocSupervisorCookie);
plocSupervisor->setStartUpImmediately();
#endif
new I2cComIF(objects::I2C_COM_IF); I2cCookie* i2cCookieTmp1075tcs1 =
new I2cCookie(addresses::TMP1075_TCS_1, TMP1075::MAX_REPLY_LENGTH, std::string("/dev/i2c-0"));
I2cCookie* i2cCookieTmp1075tcs2 =
new I2cCookie(addresses::TMP1075_TCS_2, TMP1075::MAX_REPLY_LENGTH, std::string("/dev/i2c-0"));
I2cCookie* i2cCookieTmp1075tcs1 = /* Temperature sensors */
new I2cCookie(addresses::TMP1075_TCS_1, TMP1075::MAX_REPLY_LENGTH, std::string("/dev/i2c-0")); new Tmp1075Handler(objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1);
I2cCookie* i2cCookieTmp1075tcs2 = new Tmp1075Handler(objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2);
new I2cCookie(addresses::TMP1075_TCS_2, TMP1075::MAX_REPLY_LENGTH, std::string("/dev/i2c-0"));
/* Temperature sensors */ static_cast<void>(gpioComIF);
new Tmp1075Handler(objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1);
new Tmp1075Handler(objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2);
} }

@ -1,7 +1,11 @@
#ifndef BSP_LINUX_OBJECTFACTORY_H_ #ifndef BSP_LINUX_OBJECTFACTORY_H_
#define BSP_LINUX_OBJECTFACTORY_H_ #define BSP_LINUX_OBJECTFACTORY_H_
#include <stdint.h>
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
namespace ObjectFactory { namespace ObjectFactory {
static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day
void produce(void* args); void produce(void* args);
}; // namespace ObjectFactory }; // namespace ObjectFactory

@ -3,9 +3,37 @@
namespace te0720_1cfa { namespace te0720_1cfa {
static constexpr char MPSOC_UART[] = "/dev/ttyPS1"; static constexpr char MPSOC_UART[] = "/dev/ttyPS1";
namespace baudrate {
static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0";
static constexpr char UIO_PTME[] = "/dev/uio1";
static constexpr char UIO_PDEC_CONFIG_MEMORY[] = "/dev/uio2";
static constexpr char UIO_PDEC_RAM[] = "/dev/uio3";
static constexpr int MAP_ID_PTME_CONFIG = 3;
namespace uiomapids {
static const int PTME_VC0 = 0;
static const int PTME_VC1 = 1;
static const int PTME_VC2 = 2;
static const int PTME_VC3 = 3;
static const int PTME_CONFIG = 4;
} // namespace uiomapids
namespace gpioNames {
static constexpr char PAPB_BUSY_SIGNAL_VC0[] = "papb_busy_signal_vc0";
static constexpr char PAPB_EMPTY_SIGNAL_VC0[] = "papb_empty_signal_vc0";
static constexpr char PAPB_BUSY_SIGNAL_VC1[] = "papb_busy_signal_vc1";
static constexpr char PAPB_EMPTY_SIGNAL_VC1[] = "papb_empty_signal_vc1";
static constexpr char PAPB_BUSY_SIGNAL_VC2[] = "papb_busy_signal_vc2";
static constexpr char PAPB_EMPTY_SIGNAL_VC2[] = "papb_empty_signal_vc2";
static constexpr char PAPB_BUSY_SIGNAL_VC3[] = "papb_busy_signal_vc3";
static constexpr char PAPB_EMPTY_SIGNAL_VC3[] = "papb_empty_signal_vc3";
static constexpr char RS485_EN_TX_CLOCK[] = "tx_clock_enable_ltc2872";
static constexpr char RS485_EN_TX_DATA[] = "tx_data_enable_ltc2872";
static constexpr char RS485_EN_RX_CLOCK[] = "rx_clock_enable_ltc2872";
static constexpr char RS485_EN_RX_DATA[] = "rx_data_enable_ltc2872";
static constexpr char PDEC_RESET[] = "pdec_reset";
} }
} }
#endif /* BSP_EGSE_BOARDCONFIG_BUSCONF_H_ */ #endif /* BSP_EGSE_BOARDCONFIG_BUSCONF_H_ */

@ -33,6 +33,10 @@ add_compile_options(
set(STRIPPED_OBSW_NAME ${OBSW_BIN_NAME}-stripped) set(STRIPPED_OBSW_NAME ${OBSW_BIN_NAME}-stripped)
set(STRIPPED_WATCHDOG_NAME eive-watchdog-stripped) set(STRIPPED_WATCHDOG_NAME eive-watchdog-stripped)
if(EIVE_CREATE_UNIQUE_OBSW_BIN)
set(UNIQUE_OBSW_BIN_NAME ${OBSW_BIN_NAME}-$ENV{USERNAME})
endif()
add_custom_command( add_custom_command(
TARGET ${OBSW_NAME} TARGET ${OBSW_NAME}
POST_BUILD POST_BUILD
@ -41,6 +45,16 @@ add_custom_command(
COMMENT "Generating stripped executable ${STRIPPED_OBSW_NAME}.." COMMENT "Generating stripped executable ${STRIPPED_OBSW_NAME}.."
) )
if(UNIQUE_OBSW_BIN_NAME)
add_custom_command(
TARGET ${OBSW_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/${OBSW_BIN_NAME}
${CMAKE_CURRENT_BINARY_DIR}/${UNIQUE_OBSW_BIN_NAME}
COMMENT "Generating unique EIVE OBSW binary ${UNIQUE_OBSW_BIN_NAME}")
endif()
add_custom_command( add_custom_command(
TARGET ${WATCHDOG_NAME} TARGET ${WATCHDOG_NAME}
POST_BUILD POST_BUILD

@ -20,7 +20,7 @@ else
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}" cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
fi fi
if [[ -z "${EIVE_Q7S_EM}" ]]; then if [ ! -z "${EIVE_Q7S_EM}" ]; then
build_defs="EIVE_Q7S_EM=ON" build_defs="EIVE_Q7S_EM=ON"
fi fi

@ -20,7 +20,7 @@ else
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}" cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
fi fi
if [[ -z "${EIVE_Q7S_EM}" ]]; then if [ ! -z "${EIVE_Q7S_EM}" ]; then
build_defs="EIVE_Q7S_EM=ON" build_defs="EIVE_Q7S_EM=ON"
fi fi

@ -20,7 +20,7 @@ else
cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}" cfg_script_name="${EIVE_OBSW_ROOT}/cmake/scripts/${cfg_script_name}"
fi fi
if [[ -z "${EIVE_Q7S_EM}" ]]; then if [ ! -z "${EIVE_Q7S_EM}" ]; then
build_defs="EIVE_Q7S_EM=ON" build_defs="EIVE_Q7S_EM=ON"
fi fi

@ -1,7 +1,3 @@
target_include_directories(${OBSW_NAME} PRIVATE target_include_directories(${OBSW_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
${CMAKE_CURRENT_SOURCE_DIR}
)
target_sources(${OBSW_NAME} PRIVATE target_sources(${OBSW_NAME} PRIVATE commonConfig.cpp)
commonConfig.cpp
)

@ -4,7 +4,7 @@
const char* const SW_NAME = "eive"; const char* const SW_NAME = "eive";
#define SW_VERSION 1 #define SW_VERSION 1
#define SW_SUBVERSION 10 #define SW_SUBVERSION 12
#define SW_REVISION 1 #define SW_REVISION 1
#endif /* COMMON_CONFIG_OBSWVERSION_H_ */ #endif /* COMMON_CONFIG_OBSWVERSION_H_ */

@ -2,14 +2,7 @@
#define COMMON_CONFIG_CCSDSCONFIG_H_ #define COMMON_CONFIG_CCSDSCONFIG_H_
namespace ccsds { namespace ccsds {
enum { enum { VC0, VC1, VC2, VC3 };
VC0,
VC1,
VC2,
VC3
};
} }
#endif /* COMMON_CONFIG_CCSDSCONFIG_H_ */ #endif /* COMMON_CONFIG_CCSDSCONFIG_H_ */

@ -2,37 +2,40 @@
#define COMMON_CONFIG_COMMONCLASSIDS_H_ #define COMMON_CONFIG_COMMONCLASSIDS_H_
#include <fsfw/returnvalues/FwClassIds.h> #include <fsfw/returnvalues/FwClassIds.h>
#include <cstdint> #include <cstdint>
namespace CLASS_ID { namespace CLASS_ID {
enum commonClassIds: uint8_t { enum commonClassIds : uint8_t {
COMMON_CLASS_ID_START = FW_CLASS_ID_COUNT, COMMON_CLASS_ID_START = FW_CLASS_ID_COUNT,
PCDU_HANDLER, //PCDU PCDU_HANDLER, // PCDU
HEATER_HANDLER, //HEATER HEATER_HANDLER, // HEATER
SYRLINKS_HANDLER, //SYRLINKS SYRLINKS_HANDLER, // SYRLINKS
IMTQ_HANDLER, //IMTQ IMTQ_HANDLER, // IMTQ
RW_HANDLER, //RWHA RW_HANDLER, // RWHA
STR_HANDLER, //STRH STR_HANDLER, // STRH
DWLPWRON_CMD, //DWLPWRON DWLPWRON_CMD, // DWLPWRON
MPSOC_TM, //MPTM MPSOC_TM, // MPTM
PLOC_SUPERVISOR_HANDLER, //PLSV PLOC_SUPERVISOR_HANDLER, // PLSV
SUS_HANDLER, //SUSS PLOC_SUPV_HELPER, // PLSPVhLP
CCSDS_IP_CORE_BRIDGE, //IPCI SUS_HANDLER, // SUSS
PTME, //PTME CCSDS_IP_CORE_BRIDGE, // IPCI
PLOC_UPDATER, //PLUD PTME, // PTME
STR_HELPER, //STRHLP PLOC_UPDATER, // PLUD
GOM_SPACE_HANDLER, //GOMS STR_HELPER, // STRHLP
PLOC_MEMORY_DUMPER, //PLMEMDUMP GOM_SPACE_HANDLER, // GOMS
PDEC_HANDLER, //PDEC PLOC_MEMORY_DUMPER, // PLMEMDUMP
CCSDS_HANDLER, //CCSDS PDEC_HANDLER, // PDEC
RATE_SETTER, //RS CCSDS_HANDLER, // CCSDS
ARCSEC_JSON_BASE, //JSONBASE RATE_SETTER, // RS
NVM_PARAM_BASE, //NVMB ARCSEC_JSON_BASE, // JSONBASE
FILE_SYSTEM_HELPER, //FSHLP NVM_PARAM_BASE, // NVMB
PLOC_MPSOC_HELPER, // PLMPHLP FILE_SYSTEM_HELPER, // FSHLP
SA_DEPL_HANDLER, //SADPL PLOC_MPSOC_HELPER, // PLMPHLP
MPSOC_RETURN_VALUES_IF, //MPSOCRTVIF SA_DEPL_HANDLER, // SADPL
COMMON_CLASS_ID_END // [EXPORT] : [END] MPSOC_RETURN_VALUES_IF, // MPSOCRTVIF
SUPV_RETURN_VALUES_IF, // SPVRTVIF
COMMON_CLASS_ID_END // [EXPORT] : [END]
}; };
} }

@ -1,6 +1,8 @@
#include "commonConfig.h" #include "commonConfig.h"
#include "tmtc/apid.h"
#include "fsfw/tmtcpacket/SpacePacket.h"
const Version common::OBSW_VERSION { OBSW_VERSION_MAJOR, OBSW_VERSION_MINOR, OBSW_VERSION_REVISION, OBSW_VERSION_CST_GIT_SHA1 }; #include "fsfw/tmtcpacket/SpacePacket.h"
#include "tmtc/apid.h"
const fsfw::Version common::OBSW_VERSION{OBSW_VERSION_MAJOR, OBSW_VERSION_MINOR,
OBSW_VERSION_REVISION, OBSW_VERSION_CST_GIT_SHA1};
const uint16_t common::PUS_PACKET_ID = spacepacket::getTcSpacePacketIdFromApid(apid::EIVE_OBSW); const uint16_t common::PUS_PACKET_ID = spacepacket::getTcSpacePacketIdFromApid(apid::EIVE_OBSW);

@ -33,7 +33,10 @@ static constexpr uint8_t OBSW_VERSION_REVISION = @OBSW_VERSION_REVISION@;
// CST: Commits since tag // CST: Commits since tag
static const char OBSW_VERSION_CST_GIT_SHA1[] = "@OBSW_VERSION_CST_GIT_SHA1@"; static const char OBSW_VERSION_CST_GIT_SHA1[] = "@OBSW_VERSION_CST_GIT_SHA1@";
extern const Version OBSW_VERSION;
static constexpr uint32_t OBSW_MAX_SCHEDULED_TCS = @OBSW_MAX_SCHEDULED_TCS@;
extern const fsfw::Version OBSW_VERSION;
extern const uint16_t PUS_PACKET_ID; extern const uint16_t PUS_PACKET_ID;

@ -4,113 +4,125 @@
#include <cstdint> #include <cstdint>
namespace objects { namespace objects {
enum commonObjects: uint32_t { enum commonObjects : uint32_t {
/* First Byte 0x50-0x52 reserved for PUS Services **/ /* First Byte 0x50-0x52 reserved for PUS Services **/
CCSDS_PACKET_DISTRIBUTOR = 0x50000100, CCSDS_PACKET_DISTRIBUTOR = 0x50000100,
PUS_PACKET_DISTRIBUTOR = 0x50000200, PUS_PACKET_DISTRIBUTOR = 0x50000200,
TMTC_BRIDGE = 0x50000300, TMTC_BRIDGE = 0x50000300,
TMTC_POLLING_TASK = 0x50000400, TMTC_POLLING_TASK = 0x50000400,
FILE_SYSTEM_HANDLER = 0x50000500, FILE_SYSTEM_HANDLER = 0x50000500,
SDC_MANAGER = 0x50000550, SDC_MANAGER = 0x50000550,
PTME = 0x50000600, PTME = 0x50000600,
PDEC_HANDLER = 0x50000700, PDEC_HANDLER = 0x50000700,
CCSDS_HANDLER = 0x50000800, CCSDS_HANDLER = 0x50000800,
/* 0x43 ('C') for Controllers */ /* 0x43 ('C') for Controllers */
THERMAL_CONTROLLER = 0x43400001, THERMAL_CONTROLLER = 0x43400001,
ACS_CONTROLLER = 0x43100002, ACS_CONTROLLER = 0x43100002,
CORE_CONTROLLER = 0x43000003, CORE_CONTROLLER = 0x43000003,
/* 0x44 ('D') for device handlers */ /* 0x44 ('D') for device handlers */
P60DOCK_HANDLER = 0x44250000, MGM_0_LIS3_HANDLER = 0x44120006,
PDU1_HANDLER = 0x44250001, MGM_1_RM3100_HANDLER = 0x44120107,
PDU2_HANDLER = 0x44250002, MGM_2_LIS3_HANDLER = 0x44120208,
ACU_HANDLER = 0x44250003, MGM_3_RM3100_HANDLER = 0x44120309,
BPX_BATT_HANDLER = 0x44260000, GYRO_0_ADIS_HANDLER = 0x44120010,
TMP1075_HANDLER_1 = 0x44420004, GYRO_1_L3G_HANDLER = 0x44120111,
TMP1075_HANDLER_2 = 0x44420005, GYRO_2_ADIS_HANDLER = 0x44120212,
MGM_0_LIS3_HANDLER = 0x44120006, GYRO_3_L3G_HANDLER = 0x44120313,
MGM_1_RM3100_HANDLER = 0x44120107, RW1 = 0x44120047,
MGM_2_LIS3_HANDLER = 0x44120208, RW2 = 0x44120148,
MGM_3_RM3100_HANDLER = 0x44120309, RW3 = 0x44120249,
GYRO_0_ADIS_HANDLER = 0x44120010, RW4 = 0x44120350,
GYRO_1_L3G_HANDLER = 0x44120111, STAR_TRACKER = 0x44130001,
GYRO_2_ADIS_HANDLER = 0x44120212, GPS_CONTROLLER = 0x44130045,
GYRO_3_L3G_HANDLER = 0x44120313,
PLPCDU_HANDLER = 0x44300000,
IMTQ_HANDLER = 0x44140014, IMTQ_HANDLER = 0x44140014,
PLOC_MPSOC_HANDLER = 0x44330015, TMP1075_HANDLER_1 = 0x44420004,
PLOC_SUPERVISOR_HANDLER = 0x44330016, TMP1075_HANDLER_2 = 0x44420005,
PLOC_SUPERVISOR_HELPER = 0x44330017, PCDU_HANDLER = 0x442000A1,
P60DOCK_HANDLER = 0x44250000,
PDU1_HANDLER = 0x44250001,
PDU2_HANDLER = 0x44250002,
ACU_HANDLER = 0x44250003,
BPX_BATT_HANDLER = 0x44260000,
PLPCDU_HANDLER = 0x44300000,
RAD_SENSOR = 0x443200A5,
PLOC_UPDATER = 0x44330000,
PLOC_MEMORY_DUMPER = 0x44330001,
STR_HELPER = 0x44330002,
PLOC_MPSOC_HELPER = 0x44330003,
AXI_PTME_CONFIG = 0x44330004,
PTME_CONFIG = 0x44330005,
PLOC_MPSOC_HANDLER = 0x44330015,
PLOC_SUPERVISOR_HANDLER = 0x44330016,
PLOC_SUPERVISOR_HELPER = 0x44330017,
SOLAR_ARRAY_DEPL_HANDLER = 0x444100A2,
HEATER_HANDLER = 0x444100A4,
/** /**
* Not yet specified which pt1000 will measure which device/location in the satellite. * Not yet specified which pt1000 will measure which device/location in the satellite.
* Therefore object ids are named according to the IC naming of the RTDs in the schematic. * Therefore object ids are named according to the IC naming of the RTDs in the schematic.
*/ */
RTD_0_IC3_PLOC_HEATSPREADER = 0x44420016, RTD_0_IC3_PLOC_HEATSPREADER = 0x44420016,
RTD_1_IC4_PLOC_MISSIONBOARD = 0x44420017, RTD_1_IC4_PLOC_MISSIONBOARD = 0x44420017,
RTD_2_IC5_4K_CAMERA = 0x44420018, RTD_2_IC5_4K_CAMERA = 0x44420018,
RTD_3_IC6_DAC_HEATSPREADER = 0x44420019, RTD_3_IC6_DAC_HEATSPREADER = 0x44420019,
RTD_4_IC7_STARTRACKER = 0x44420020, RTD_4_IC7_STARTRACKER = 0x44420020,
RTD_5_IC8_RW1_MX_MY = 0x44420021, RTD_5_IC8_RW1_MX_MY = 0x44420021,
RTD_6_IC9_DRO = 0x44420022, RTD_6_IC9_DRO = 0x44420022,
RTD_7_IC10_SCEX = 0x44420023, RTD_7_IC10_SCEX = 0x44420023,
RTD_8_IC11_X8 = 0x44420024, RTD_8_IC11_X8 = 0x44420024,
RTD_9_IC12_HPA = 0x44420025, RTD_9_IC12_HPA = 0x44420025,
RTD_10_IC13_PL_TX = 0x44420026, RTD_10_IC13_PL_TX = 0x44420026,
RTD_11_IC14_MPA = 0x44420027, RTD_11_IC14_MPA = 0x44420027,
RTD_12_IC15_ACU = 0x44420028, RTD_12_IC15_ACU = 0x44420028,
RTD_13_IC16_PLPCDU_HEATSPREADER = 0x44420029, RTD_13_IC16_PLPCDU_HEATSPREADER = 0x44420029,
RTD_14_IC17_TCS_BOARD = 0x44420030, RTD_14_IC17_TCS_BOARD = 0x44420030,
RTD_15_IC18_IMTQ = 0x44420031, RTD_15_IC18_IMTQ = 0x44420031,
// Name convention for SUS devices // Name convention for SUS devices
// SUS_<IDX>_<N/R>_LOC_X<F/M/B>Y<F/M/B>Z<F/M/B>_PT_<DIR><F/B> // SUS_<IDX>_<N/R>_LOC_X<F/M/B>Y<F/M/B>Z<F/M/B>_PT_<DIR><F/B>
// LOC: Location // LOC: Location
// PT: Pointing // PT: Pointing
// N/R: Nominal/Redundant // N/R: Nominal/Redundant
// F/M/B: Forward/Middle/Backwards // F/M/B: Forward/Middle/Backwards
SUS_0_N_LOC_XFYFZM_PT_XF = 0x44120032, SUS_0_N_LOC_XFYFZM_PT_XF = 0x44120032,
SUS_6_R_LOC_XFYBZM_PT_XF = 0x44120038, SUS_6_R_LOC_XFYBZM_PT_XF = 0x44120038,
SUS_1_N_LOC_XBYFZM_PT_XB = 0x44120033, SUS_1_N_LOC_XBYFZM_PT_XB = 0x44120033,
SUS_7_R_LOC_XBYBZM_PT_XB = 0x44120039, SUS_7_R_LOC_XBYBZM_PT_XB = 0x44120039,
SUS_2_N_LOC_XFYBZB_PT_YB = 0x44120034, SUS_2_N_LOC_XFYBZB_PT_YB = 0x44120034,
SUS_8_R_LOC_XBYBZB_PT_YB = 0x44120040, SUS_8_R_LOC_XBYBZB_PT_YB = 0x44120040,
SUS_3_N_LOC_XFYBZF_PT_YF = 0x44120035, SUS_3_N_LOC_XFYBZF_PT_YF = 0x44120035,
SUS_9_R_LOC_XBYBZB_PT_YF = 0x44120041, SUS_9_R_LOC_XBYBZB_PT_YF = 0x44120041,
SUS_4_N_LOC_XMYFZF_PT_ZF = 0x44120036, SUS_4_N_LOC_XMYFZF_PT_ZF = 0x44120036,
SUS_10_N_LOC_XMYBZF_PT_ZF = 0x44120042, SUS_10_N_LOC_XMYBZF_PT_ZF = 0x44120042,
SUS_5_N_LOC_XFYMZB_PT_ZB = 0x44120037, SUS_5_N_LOC_XFYMZB_PT_ZB = 0x44120037,
SUS_11_R_LOC_XBYMZB_PT_ZB = 0x44120043, SUS_11_R_LOC_XBYMZB_PT_ZB = 0x44120043,
GPS_CONTROLLER = 0x44130045, SYRLINKS_HK_HANDLER = 0x445300A3,
RW1 = 0x44120047, // 0x60 for other stuff
RW2 = 0x44120148, HEATER_0_PLOC_PROC_BRD = 0x60000000,
RW3 = 0x44120249, HEATER_1_PCDU_BRD = 0x60000001,
RW4 = 0x44120350, HEATER_2_ACS_BRD = 0x60000002,
HEATER_3_OBC_BRD = 0x60000003,
HEATER_4_CAMERA = 0x60000004,
HEATER_5_STR = 0x60000005,
HEATER_6_DRO = 0x60000006,
HEATER_7_HPA = 0x60000007,
STAR_TRACKER = 0x44130001, // 0x73 ('s') for assemblies and system/subsystem components
ACS_BOARD_ASS = 0x73000001,
PLOC_UPDATER = 0x44330000, SUS_BOARD_ASS = 0x73000002,
PLOC_MEMORY_DUMPER = 0x44330001, TCS_BOARD_ASS = 0x73000003,
STR_HELPER = 0x44330002, RW_ASS = 0x73000004
PLOC_MPSOC_HELPER = 0x44330003,
AXI_PTME_CONFIG = 44330004,
PTME_CONFIG = 44330005,
// 0x73 ('s') for assemblies and system/subsystem components
ACS_BOARD_ASS = 0x73000001,
SUS_BOARD_ASS = 0x73000002,
TCS_BOARD_ASS = 0x73000003
}; };
} }
#endif /* COMMON_CONFIG_COMMONOBJECTS_H_ */ #endif /* COMMON_CONFIG_COMMONOBJECTS_H_ */

@ -4,36 +4,36 @@
#include <fsfw/events/fwSubsystemIdRanges.h> #include <fsfw/events/fwSubsystemIdRanges.h>
namespace SUBSYSTEM_ID { namespace SUBSYSTEM_ID {
enum: uint8_t { enum : uint8_t {
COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE, COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE,
ACS_SUBSYSTEM = 112, ACS_SUBSYSTEM = 112,
PCDU_HANDLER = 113, PCDU_HANDLER = 113,
HEATER_HANDLER = 114, HEATER_HANDLER = 114,
SA_DEPL_HANDLER = 115, SA_DEPL_HANDLER = 115,
PLOC_MPSOC_HANDLER = 116, PLOC_MPSOC_HANDLER = 116,
IMTQ_HANDLER = 117, IMTQ_HANDLER = 117,
RW_HANDLER = 118, RW_HANDLER = 118,
STR_HANDLER = 119, STR_HANDLER = 119,
PLOC_SUPERVISOR_HANDLER = 120, PLOC_SUPERVISOR_HANDLER = 120,
FILE_SYSTEM = 121, FILE_SYSTEM = 121,
PLOC_UPDATER = 122, PLOC_UPDATER = 122,
PLOC_MEMORY_DUMPER = 123, PLOC_MEMORY_DUMPER = 123,
PDEC_HANDLER = 124, PDEC_HANDLER = 124,
STR_HELPER = 125, STR_HELPER = 125,
PLOC_MPSOC_HELPER = 126, PLOC_MPSOC_HELPER = 126,
PL_PCDU_HANDLER = 127, PL_PCDU_HANDLER = 127,
ACS_BOARD_ASS = 128, ACS_BOARD_ASS = 128,
SUS_BOARD_ASS = 129, SUS_BOARD_ASS = 129,
TCS_BOARD_ASS = 130, TCS_BOARD_ASS = 130,
GPS_HANDLER = 131, GPS_HANDLER = 131,
P60_DOCK_HANDLER = 132, P60_DOCK_HANDLER = 132,
PDU1_HANDLER = 133, PDU1_HANDLER = 133,
PDU2_HANDLER = 134, PDU2_HANDLER = 134,
ACU_HANDLER = 135, ACU_HANDLER = 135,
SYRLINKS = 136, PLOC_SUPV_HELPER = 136,
COMMON_SUBSYSTEM_ID_END SYRLINKS = 137,
COMMON_SUBSYSTEM_ID_END
}; };
} }
#endif /* COMMON_CONFIG_COMMONSUBSYSTEMIDS_H_ */ #endif /* COMMON_CONFIG_COMMONSUBSYSTEMIDS_H_ */

@ -2,8 +2,10 @@
#define COMMON_CONFIG_DEVCONF_H_ #define COMMON_CONFIG_DEVCONF_H_
#include <cstdint> #include <cstdint>
#include <fsfw_hal/linux/spi/spiDefinitions.h>
#include <fsfw_hal/linux/uart/UartCookie.h> #include "fsfw/timemanager/clockDefinitions.h"
#include "fsfw_hal/linux/spi/spiDefinitions.h"
#include "fsfw_hal/linux/uart/UartCookie.h"
/** /**
* SPI configuration will be contained here to let the device handlers remain independent * SPI configuration will be contained here to let the device handlers remain independent
@ -31,6 +33,7 @@ static constexpr spi::SpiModes DEFAULT_L3G_MODE = spi::SpiModes::MODE_3;
static const uint32_t SUS_MAX1227_SPI_FREQ = 976'000; static const uint32_t SUS_MAX1227_SPI_FREQ = 976'000;
static constexpr spi::SpiModes SUS_MAX_1227_MODE = spi::SpiModes::MODE_3; static constexpr spi::SpiModes SUS_MAX_1227_MODE = spi::SpiModes::MODE_3;
static constexpr dur_millis_t RAD_SENSOR_CS_TIMEOUT = 120;
static constexpr uint32_t DEFAULT_MAX_1227_SPEED = 976'000; static constexpr uint32_t DEFAULT_MAX_1227_SPEED = 976'000;
static constexpr spi::SpiModes DEFAULT_MAX_1227_MODE = spi::SpiModes::MODE_3; static constexpr spi::SpiModes DEFAULT_MAX_1227_MODE = spi::SpiModes::MODE_3;
@ -42,10 +45,11 @@ static constexpr spi::SpiModes DEFAULT_ADIS16507_MODE = spi::SpiModes::MODE_3;
static constexpr uint32_t RW_SPEED = 300'000; static constexpr uint32_t RW_SPEED = 300'000;
static constexpr spi::SpiModes RW_MODE = spi::SpiModes::MODE_0; static constexpr spi::SpiModes RW_MODE = spi::SpiModes::MODE_0;
static constexpr dur_millis_t RTD_CS_TIMEOUT = 50;
static constexpr uint32_t RTD_SPEED = 2'000'000; static constexpr uint32_t RTD_SPEED = 2'000'000;
static constexpr spi::SpiModes RTD_MODE = spi::SpiModes::MODE_3; static constexpr spi::SpiModes RTD_MODE = spi::SpiModes::MODE_3;
} } // namespace spi
namespace uart { namespace uart {
@ -53,9 +57,9 @@ static constexpr size_t HYPERION_GPS_REPLY_MAX_BUFFER = 1024;
static constexpr UartBaudRate SYRLINKS_BAUD = UartBaudRate::RATE_38400; static constexpr UartBaudRate SYRLINKS_BAUD = UartBaudRate::RATE_38400;
static constexpr UartBaudRate GNSS_BAUD = UartBaudRate::RATE_9600; static constexpr UartBaudRate GNSS_BAUD = UartBaudRate::RATE_9600;
static constexpr UartBaudRate PLOC_MPSOC_BAUD = UartBaudRate::RATE_115200; static constexpr UartBaudRate PLOC_MPSOC_BAUD = UartBaudRate::RATE_115200;
static constexpr UartBaudRate PLOC_SUPERVISOR_BAUD = UartBaudRate::RATE_115200; static constexpr UartBaudRate PLOC_SUPV_BAUD = UartBaudRate::RATE_115200;
static constexpr UartBaudRate STAR_TRACKER_BAUD = UartBaudRate::RATE_921600; static constexpr UartBaudRate STAR_TRACKER_BAUD = UartBaudRate::RATE_921600;
} } // namespace uart
#endif /* COMMON_CONFIG_DEVCONF_H_ */ #endif /* COMMON_CONFIG_DEVCONF_H_ */

@ -3,18 +3,18 @@
#include <cstdint> #include <cstdint>
namespace heaterSwitches { namespace heater {
enum switcherList: uint8_t { enum Switchers : uint8_t {
HEATER_0, HEATER_0_OBC_BRD,
HEATER_1, HEATER_1_PLOC_PROC_BRD,
HEATER_2, HEATER_2_ACS_BRD,
HEATER_3, HEATER_3_PCDU_PDU,
HEATER_4, HEATER_4_CAMERA,
HEATER_5, HEATER_5_STR,
HEATER_6, HEATER_6_DRO,
HEATER_7, HEATER_7_HPA,
NUMBER_OF_SWITCHES NUMBER_OF_SWITCHES
}; };
} }
#endif /* FSFWCONFIG_DEVICES_HEATERSWITCHERLIST_H_ */ #endif /* FSFWCONFIG_DEVICES_HEATERSWITCHERLIST_H_ */

@ -19,7 +19,6 @@ static constexpr uint8_t LIVE_TM = 0;
static constexpr uint32_t MAX_PATH_SIZE = 100; static constexpr uint32_t MAX_PATH_SIZE = 100;
static constexpr uint32_t MAX_FILENAME_SIZE = 50; static constexpr uint32_t MAX_FILENAME_SIZE = 50;
} } // namespace config
#endif /* COMMON_CONFIG_DEFINITIONS_H_ */ #endif /* COMMON_CONFIG_DEFINITIONS_H_ */

@ -12,8 +12,7 @@
* APID is a 11 bit number * APID is a 11 bit number
*/ */
namespace apid { namespace apid {
static const uint16_t EIVE_OBSW = 0x65; static const uint16_t EIVE_OBSW = 0x65;
} }
#endif /* FSFWCONFIG_TMTC_APID_H_ */ #endif /* FSFWCONFIG_TMTC_APID_H_ */

@ -1,5 +1,5 @@
#ifndef CONFIG_TMTC_PUSIDS_HPP_ #ifndef COMMON_CONFIG_TMTC_PUSIDS_H_
#define CONFIG_TMTC_PUSIDS_HPP_ #define COMMON_CONFIG_TMTC_PUSIDS_H_
namespace pus { namespace pus {
enum Ids { enum Ids {
@ -11,6 +11,7 @@ enum Ids {
PUS_SERVICE_6 = 6, PUS_SERVICE_6 = 6,
PUS_SERVICE_8 = 8, PUS_SERVICE_8 = 8,
PUS_SERVICE_9 = 9, PUS_SERVICE_9 = 9,
PUS_SERVICE_11 = 11,
PUS_SERVICE_17 = 17, PUS_SERVICE_17 = 17,
PUS_SERVICE_19 = 19, PUS_SERVICE_19 = 19,
PUS_SERVICE_20 = 20, PUS_SERVICE_20 = 20,
@ -20,4 +21,4 @@ enum Ids {
}; };
}; };
#endif /* CONFIG_TMTC_PUSIDS_HPP_ */ #endif /* COMMON_CONFIG_TMTC_PUSIDS_H_ */

42
dummies/AcuDummy.cpp Normal file

@ -0,0 +1,42 @@
#include "AcuDummy.h"
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
AcuDummy::AcuDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie) {}
AcuDummy::~AcuDummy() {}
void AcuDummy::doStartUp() {}
void AcuDummy::doShutDown() {}
ReturnValue_t AcuDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }
ReturnValue_t AcuDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t AcuDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t *commandData, size_t commandDataLen) {
return RETURN_OK;
}
ReturnValue_t AcuDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId,
size_t *foundLen) {
return RETURN_OK;
}
ReturnValue_t AcuDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
return RETURN_OK;
}
void AcuDummy::fillCommandAndReplyMap() {}
uint32_t AcuDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; }
ReturnValue_t AcuDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(P60System::pool::ACU_TEMPERATURES, new PoolEntry<float>(3));
return HasReturnvaluesIF::RETURN_OK;
}

33
dummies/AcuDummy.h Normal file

@ -0,0 +1,33 @@
#ifndef DUMMIES_ACUDUMMY_H_
#define DUMMIES_ACUDUMMY_H_
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
class AcuDummy : public DeviceHandlerBase {
public:
static const DeviceCommandId_t SIMPLE_COMMAND = 1;
static const DeviceCommandId_t PERIODIC_REPLY = 2;
static const uint8_t SIMPLE_COMMAND_DATA = 1;
static const uint8_t PERIODIC_REPLY_DATA = 2;
AcuDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
virtual ~AcuDummy();
protected:
void doStartUp() override;
void doShutDown() override;
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData,
size_t commandDataLen) override;
ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId,
size_t *foundLen) override;
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override;
void fillCommandAndReplyMap() override;
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) override;
};
#endif /* DUMMIES_ACUDUMMY_H_ */

55
dummies/BpxDummy.cpp Normal file

@ -0,0 +1,55 @@
#include "BpxDummy.h"
#include <mission/devices/devicedefinitions/BpxBatteryDefinitions.h>
BpxDummy::BpxDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie) {}
BpxDummy::~BpxDummy() {}
void BpxDummy::doStartUp() {}
void BpxDummy::doShutDown() {}
ReturnValue_t BpxDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }
ReturnValue_t BpxDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t BpxDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t *commandData, size_t commandDataLen) {
return RETURN_OK;
}
ReturnValue_t BpxDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId,
size_t *foundLen) {
return RETURN_OK;
}
ReturnValue_t BpxDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
return RETURN_OK;
}
void BpxDummy::fillCommandAndReplyMap() {}
uint32_t BpxDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; }
ReturnValue_t BpxDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(BpxBattery::BATT_TEMP_1, &battTemp1);
localDataPoolMap.emplace(BpxBattery::BATT_TEMP_2, &battTemp2);
localDataPoolMap.emplace(BpxBattery::BATT_TEMP_3, &battTemp3);
localDataPoolMap.emplace(BpxBattery::BATT_TEMP_4, &battTemp4);
localDataPoolMap.emplace(BpxBattery::CHARGE_CURRENT, &chargeCurrent);
localDataPoolMap.emplace(BpxBattery::DISCHARGE_CURRENT, &dischargeCurrent);
localDataPoolMap.emplace(BpxBattery::HEATER_CURRENT, &heaterCurrent);
localDataPoolMap.emplace(BpxBattery::BATT_VOLTAGE, &battVolt);
localDataPoolMap.emplace(BpxBattery::REBOOT_COUNTER, &rebootCounter);
localDataPoolMap.emplace(BpxBattery::BOOTCAUSE, &bootCause);
localDataPoolMap.emplace(BpxBattery::BATTERY_HEATER_MODE, &battheatMode);
localDataPoolMap.emplace(BpxBattery::BATTHEAT_LOW_LIMIT, &battheatLow);
localDataPoolMap.emplace(BpxBattery::BATTHEAT_HIGH_LIMIT, &battheatHigh);
return HasReturnvaluesIF::RETURN_OK;
}

48
dummies/BpxDummy.h Normal file

@ -0,0 +1,48 @@
#ifndef DUMMIES_BPXDUMMY_H_
#define DUMMIES_BPXDUMMY_H_
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
class BpxDummy : public DeviceHandlerBase {
public:
static const DeviceCommandId_t SIMPLE_COMMAND = 1;
static const DeviceCommandId_t PERIODIC_REPLY = 2;
static const uint8_t SIMPLE_COMMAND_DATA = 1;
static const uint8_t PERIODIC_REPLY_DATA = 2;
BpxDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
virtual ~BpxDummy();
protected:
void doStartUp() override;
void doShutDown() override;
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData,
size_t commandDataLen) override;
ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId,
size_t *foundLen) override;
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override;
void fillCommandAndReplyMap() override;
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) override;
private:
PoolEntry<uint16_t> chargeCurrent = PoolEntry<uint16_t>({0});
PoolEntry<uint16_t> dischargeCurrent = PoolEntry<uint16_t>({0});
PoolEntry<uint16_t> heaterCurrent = PoolEntry<uint16_t>({0});
PoolEntry<uint16_t> battVolt = PoolEntry<uint16_t>({0});
PoolEntry<int16_t> battTemp1 = PoolEntry<int16_t>({0});
PoolEntry<int16_t> battTemp2 = PoolEntry<int16_t>({0});
PoolEntry<int16_t> battTemp3 = PoolEntry<int16_t>({0});
PoolEntry<int16_t> battTemp4 = PoolEntry<int16_t>({0});
PoolEntry<uint32_t> rebootCounter = PoolEntry<uint32_t>({0});
PoolEntry<uint8_t> bootCause = PoolEntry<uint8_t>({0});
PoolEntry<uint8_t> battheatMode = PoolEntry<uint8_t>({0});
PoolEntry<int8_t> battheatLow = PoolEntry<int8_t>({0});
PoolEntry<int8_t> battheatHigh = PoolEntry<int8_t>({0});
};
#endif /* DUMMIES_BPXDUMMY_H_ */

19
dummies/CMakeLists.txt Normal file

@ -0,0 +1,19 @@
target_sources(
${LIB_DUMMIES}
PUBLIC TemperatureSensorsDummy.cpp
SusDummy.cpp
BpxDummy.cpp
ComIFDummy.cpp
ComCookieDummy.cpp
RwDummy.cpp
StarTrackerDummy.cpp
SyrlinksDummy.cpp
ImtqDummy.cpp
AcuDummy.cpp
PduDummy.cpp
P60DockDummy.cpp
GyroAdisDummy.cpp
GyroL3GD20Dummy.cpp
MgmLIS3MDLDummy.cpp
PlPcduDummy.cpp
CoreControllerDummy.cpp)

@ -0,0 +1,5 @@
#include "ComCookieDummy.h"
ComCookieDummy::ComCookieDummy() {}
ComCookieDummy::~ComCookieDummy() {}

12
dummies/ComCookieDummy.h Normal file

@ -0,0 +1,12 @@
#ifndef TESTS_SRC_FSFW_TESTS_UNIT_DEVICEHANDLER_COMCOOKIEDUMMY_H_
#define TESTS_SRC_FSFW_TESTS_UNIT_DEVICEHANDLER_COMCOOKIEDUMMY_H_
#include "fsfw/devicehandlers/CookieIF.h"
class ComCookieDummy : public CookieIF {
public:
ComCookieDummy();
virtual ~ComCookieDummy();
};
#endif /* TESTS_SRC_FSFW_TESTS_UNIT_DEVICEHANDLER_COMCOOKIEDUMMY_H_ */

21
dummies/ComIFDummy.cpp Normal file

@ -0,0 +1,21 @@
#include "ComIFDummy.h"
ComIFDummy::ComIFDummy(object_id_t objectId) : SystemObject(objectId) {}
ComIFDummy::~ComIFDummy() {}
ReturnValue_t ComIFDummy::initializeInterface(CookieIF *cookie) { return RETURN_OK; }
ReturnValue_t ComIFDummy::sendMessage(CookieIF *cookie, const uint8_t *sendData, size_t sendLen) {
return RETURN_OK;
}
ReturnValue_t ComIFDummy::getSendSuccess(CookieIF *cookie) { return RETURN_OK; }
ReturnValue_t ComIFDummy::requestReceiveMessage(CookieIF *cookie, size_t requestLen) {
return RETURN_OK;
}
ReturnValue_t ComIFDummy::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, size_t *size) {
return RETURN_OK;
}

26
dummies/ComIFDummy.h Normal file

@ -0,0 +1,26 @@
#ifndef DUMMIES_COMIFDUMMY_H_
#define DUMMIES_COMIFDUMMY_H_
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
#include <fsfw/objectmanager/SystemObject.h>
/**
* @brief The ComIFMock supports the simulation of various device communication error cases
* like incomplete or wrong replies and can be used to test the
* DeviceHandlerBase.
*/
class ComIFDummy : public DeviceCommunicationIF, public SystemObject {
public:
ComIFDummy(object_id_t objectId);
virtual ~ComIFDummy();
virtual ReturnValue_t initializeInterface(CookieIF *cookie) override;
virtual ReturnValue_t sendMessage(CookieIF *cookie, const uint8_t *sendData,
size_t sendLen) override;
virtual ReturnValue_t getSendSuccess(CookieIF *cookie) override;
virtual ReturnValue_t requestReceiveMessage(CookieIF *cookie, size_t requestLen) override;
virtual ReturnValue_t readReceivedMessage(CookieIF *cookie, uint8_t **buffer,
size_t *size) override;
};
#endif /* DUMMIES_COMIFDUMMY_H_ */

@ -0,0 +1,55 @@
#include "CoreControllerDummy.h"
#include <bsp_q7s/core/CoreDefinitions.h>
#include <objects/systemObjectList.h>
#include <cmath>
#include <cstdlib>
CoreControllerDummy::CoreControllerDummy(object_id_t objectId)
: ExtendedControllerBase(objectId, objects::NO_OBJECT) {}
ReturnValue_t CoreControllerDummy::initialize() {
static bool done = false;
if (not done) {
done = true;
ReturnValue_t result = ExtendedControllerBase::initialize();
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
}
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t CoreControllerDummy::handleCommandMessage(CommandMessage* message) {
return RETURN_FAILED;
}
void CoreControllerDummy::performControlOperation() { return; }
ReturnValue_t CoreControllerDummy::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) {
localDataPoolMap.emplace(core::TEMPERATURE, new PoolEntry<float>({0}));
localDataPoolMap.emplace(core::PS_VOLTAGE, new PoolEntry<float>({0}));
localDataPoolMap.emplace(core::PL_VOLTAGE, new PoolEntry<float>({0}));
return HasReturnvaluesIF::RETURN_OK;
}
LocalPoolDataSetBase* CoreControllerDummy::getDataSetHandle(sid_t sid) {
switch (sid.ownerSetId) {
default:
return nullptr;
}
}
ReturnValue_t CoreControllerDummy::checkModeCommand(Mode_t mode, Submode_t submode,
uint32_t* msToReachTheMode) {
if (submode != SUBMODE_NONE) {
return INVALID_SUBMODE;
}
if ((mode != MODE_OFF) && (mode != MODE_ON) && (mode != MODE_NORMAL)) {
return INVALID_MODE;
}
return RETURN_OK;
}

@ -0,0 +1,21 @@
#pragma once
#include <fsfw/controller/ExtendedControllerBase.h>
#include <mission/devices/devicedefinitions/SusDefinitions.h>
class CoreControllerDummy : public ExtendedControllerBase {
public:
CoreControllerDummy(object_id_t objectId);
ReturnValue_t initialize() override;
protected:
virtual ReturnValue_t handleCommandMessage(CommandMessage* message) override;
virtual void performControlOperation() override;
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
virtual LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
virtual ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
uint32_t* msToReachTheMode) override;
};

45
dummies/GyroAdisDummy.cpp Normal file

@ -0,0 +1,45 @@
#include "GyroAdisDummy.h"
#include "mission/devices/devicedefinitions/GyroADIS1650XDefinitions.h"
GyroAdisDummy::GyroAdisDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie) {}
GyroAdisDummy::~GyroAdisDummy() {}
void GyroAdisDummy::doStartUp() {}
void GyroAdisDummy::doShutDown() {}
ReturnValue_t GyroAdisDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t GyroAdisDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t GyroAdisDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t *commandData,
size_t commandDataLen) {
return RETURN_OK;
}
ReturnValue_t GyroAdisDummy::scanForReply(const uint8_t *start, size_t len,
DeviceCommandId_t *foundId, size_t *foundLen) {
return RETURN_OK;
}
ReturnValue_t GyroAdisDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
return RETURN_OK;
}
void GyroAdisDummy::fillCommandAndReplyMap() {}
uint32_t GyroAdisDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; }
ReturnValue_t GyroAdisDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(ADIS1650X::TEMPERATURE, new PoolEntry<float>({0.0}));
return HasReturnvaluesIF::RETURN_OK;
}

33
dummies/GyroAdisDummy.h Normal file

@ -0,0 +1,33 @@
#ifndef DUMMIES_GYROADISDUMMY_H_
#define DUMMIES_GYROADISDUMMY_H_
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
class GyroAdisDummy : public DeviceHandlerBase {
public:
static const DeviceCommandId_t SIMPLE_COMMAND = 1;
static const DeviceCommandId_t PERIODIC_REPLY = 2;
static const uint8_t SIMPLE_COMMAND_DATA = 1;
static const uint8_t PERIODIC_REPLY_DATA = 2;
GyroAdisDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
virtual ~GyroAdisDummy();
protected:
void doStartUp() override;
void doShutDown() override;
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData,
size_t commandDataLen) override;
ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId,
size_t *foundLen) override;
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override;
void fillCommandAndReplyMap() override;
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) override;
};
#endif /* DUMMIES_GYROADISDUMMY_H_ */

@ -0,0 +1,48 @@
#include "GyroL3GD20Dummy.h"
#include "fsfw_hal/devicehandlers/devicedefinitions/GyroL3GD20Definitions.h"
GyroL3GD20Dummy::GyroL3GD20Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie) {}
GyroL3GD20Dummy::~GyroL3GD20Dummy() {}
void GyroL3GD20Dummy::doStartUp() {}
void GyroL3GD20Dummy::doShutDown() {}
ReturnValue_t GyroL3GD20Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t GyroL3GD20Dummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t GyroL3GD20Dummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t *commandData,
size_t commandDataLen) {
return RETURN_OK;
}
ReturnValue_t GyroL3GD20Dummy::scanForReply(const uint8_t *start, size_t len,
DeviceCommandId_t *foundId, size_t *foundLen) {
return RETURN_OK;
}
ReturnValue_t GyroL3GD20Dummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
return RETURN_OK;
}
void GyroL3GD20Dummy::fillCommandAndReplyMap() {}
uint32_t GyroL3GD20Dummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; }
ReturnValue_t GyroL3GD20Dummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(L3GD20H::ANG_VELOC_X, new PoolEntry<float>({0.0}));
localDataPoolMap.emplace(L3GD20H::ANG_VELOC_Y, new PoolEntry<float>({0.0}));
localDataPoolMap.emplace(L3GD20H::ANG_VELOC_Z, new PoolEntry<float>({0.0}));
localDataPoolMap.emplace(L3GD20H::TEMPERATURE, new PoolEntry<float>({0.0}));
return HasReturnvaluesIF::RETURN_OK;
}

33
dummies/GyroL3GD20Dummy.h Normal file

@ -0,0 +1,33 @@
#ifndef DUMMIES_GYROL3GD20DUMMY_H_
#define DUMMIES_GYROL3GD20DUMMY_H_
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
class GyroL3GD20Dummy : public DeviceHandlerBase {
public:
static const DeviceCommandId_t SIMPLE_COMMAND = 1;
static const DeviceCommandId_t PERIODIC_REPLY = 2;
static const uint8_t SIMPLE_COMMAND_DATA = 1;
static const uint8_t PERIODIC_REPLY_DATA = 2;
GyroL3GD20Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
virtual ~GyroL3GD20Dummy();
protected:
void doStartUp() override;
void doShutDown() override;
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData,
size_t commandDataLen) override;
ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId,
size_t *foundLen) override;
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override;
void fillCommandAndReplyMap() override;
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) override;
};
#endif /* DUMMIES_GYROL3GD20DUMMY_H_ */

43
dummies/ImtqDummy.cpp Normal file

@ -0,0 +1,43 @@
#include "ImtqDummy.h"
#include <mission/devices/devicedefinitions/IMTQHandlerDefinitions.h>
ImtqDummy::ImtqDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie) {}
ImtqDummy::~ImtqDummy() {}
void ImtqDummy::doStartUp() {}
void ImtqDummy::doShutDown() {}
ReturnValue_t ImtqDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }
ReturnValue_t ImtqDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t ImtqDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t *commandData,
size_t commandDataLen) {
return RETURN_OK;
}
ReturnValue_t ImtqDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId,
size_t *foundLen) {
return RETURN_OK;
}
ReturnValue_t ImtqDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
return RETURN_OK;
}
void ImtqDummy::fillCommandAndReplyMap() {}
uint32_t ImtqDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; }
ReturnValue_t ImtqDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(IMTQ::MCU_TEMPERATURE, new PoolEntry<int16_t>({0}));
return HasReturnvaluesIF::RETURN_OK;
}

33
dummies/ImtqDummy.h Normal file

@ -0,0 +1,33 @@
#ifndef DUMMIES_IMTQDUMMY_H_
#define DUMMIES_IMTQDUMMY_H_
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
class ImtqDummy : public DeviceHandlerBase {
public:
static const DeviceCommandId_t SIMPLE_COMMAND = 1;
static const DeviceCommandId_t PERIODIC_REPLY = 2;
static const uint8_t SIMPLE_COMMAND_DATA = 1;
static const uint8_t PERIODIC_REPLY_DATA = 2;
ImtqDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
virtual ~ImtqDummy();
protected:
void doStartUp() override;
void doShutDown() override;
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData,
size_t commandDataLen) override;
ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId,
size_t *foundLen) override;
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override;
void fillCommandAndReplyMap() override;
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) override;
};
#endif /* DUMMIES_IMTQDUMMY_H_ */

@ -0,0 +1,45 @@
#include "MgmLIS3MDLDummy.h"
#include "fsfw_hal/devicehandlers/devicedefinitions/MgmLIS3HandlerDefs.h"
MgmLIS3MDLDummy::MgmLIS3MDLDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie) {}
MgmLIS3MDLDummy::~MgmLIS3MDLDummy() {}
void MgmLIS3MDLDummy::doStartUp() {}
void MgmLIS3MDLDummy::doShutDown() {}
ReturnValue_t MgmLIS3MDLDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t MgmLIS3MDLDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t MgmLIS3MDLDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t *commandData,
size_t commandDataLen) {
return RETURN_OK;
}
ReturnValue_t MgmLIS3MDLDummy::scanForReply(const uint8_t *start, size_t len,
DeviceCommandId_t *foundId, size_t *foundLen) {
return RETURN_OK;
}
ReturnValue_t MgmLIS3MDLDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
return RETURN_OK;
}
void MgmLIS3MDLDummy::fillCommandAndReplyMap() {}
uint32_t MgmLIS3MDLDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; }
ReturnValue_t MgmLIS3MDLDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(MGMLIS3MDL::TEMPERATURE_CELCIUS, new PoolEntry<float>({0.0}));
return HasReturnvaluesIF::RETURN_OK;
}

Some files were not shown because too many files have changed in this diff Show More