Compare commits
867 Commits
Author | SHA1 | Date | |
---|---|---|---|
c6f60fbe82 | |||
269c93a9f3 | |||
2e966aba77 | |||
76a217ffc2 | |||
be7a9af8cd | |||
75e71f7dca | |||
62f725beea | |||
812c814a30 | |||
e092d9bf3d | |||
bf8ffac624 | |||
d78155fd79 | |||
3a93cdc105 | |||
a2e7c6cca6 | |||
b5ff0edbc9 | |||
95da2372c9 | |||
70450041e6 | |||
ed0eb4fe9c | |||
af039c540a | |||
d2a12ea71e | |||
53e556d0b3 | |||
72ab141b41 | |||
c6b00e2448 | |||
d4a1cb9f62 | |||
83c93a9637 | |||
89757c447c | |||
61aa57f021 | |||
0ee912665e | |||
b53bfb9a6f | |||
bd11d13b99 | |||
1133736d48 | |||
9918c7c255 | |||
b0a175610a | |||
d96d3b155b | |||
eff80a58ee | |||
5f796ec1e3 | |||
3825304088 | |||
66d6b6d707 | |||
a787de531b | |||
772ab430e0 | |||
35ea8a50f4 | |||
63c669bc27 | |||
17d17dce06 | |||
1ebae7f938 | |||
8c850614e5 | |||
b8cf825307 | |||
f2d5932883 | |||
917090e39d | |||
67037e2dae | |||
f72dfa255d | |||
b3bb76c75f | |||
6c32ddf864 | |||
b1c20b22c8 | |||
678b22438f | |||
f47712552e | |||
cbb8832fab | |||
b66dcc0a86 | |||
04b7c82501 | |||
5051af82c2 | |||
ba7ac6bab2 | |||
52d94f44d4 | |||
87783b01f5 | |||
593cc68b84 | |||
0e6d2354fc | |||
23cabe4ca6 | |||
3d1e104fa4 | |||
8106722a08 | |||
9e93f1c814 | |||
1f1e1e8eae | |||
6f9d3c2f63 | |||
25070d9543 | |||
bbdfc0427a | |||
97db44e500 | |||
c588ec4a1a | |||
09a6707c6c | |||
ee9a13f59b | |||
e9ccb2fd4f | |||
e5459bb1f7 | |||
335d3ba3b0 | |||
f50682b56a | |||
ad679a810e | |||
686ec4bffa | |||
ae434853aa | |||
bb1e1d80cc | |||
01bac87afb | |||
ffdd6bbc3c | |||
d870f5ab10 | |||
0b3fd65c9a | |||
0ac38e8490 | |||
d79177e544 | |||
addcb2b21f | |||
7646b683b2 | |||
3eca96fef5 | |||
43fc1ab780 | |||
2bf044422f | |||
7f180ebc45 | |||
1ccd12e2e1 | |||
b878508fec | |||
88faf8f87d | |||
c0da8aef2e | |||
59d0d880bb | |||
3eb8525419 | |||
3fff3ba21e | |||
3e9b337e31 | |||
633fe00cd6 | |||
23d7b8f2fb | |||
d088d728b1 | |||
237dd00216 | |||
f7075a1397 | |||
2ebdb5c797 | |||
1519b13b78 | |||
b2c286cd7e | |||
a1d2ec3db4 | |||
b66a91da2e | |||
72305cc4c2 | |||
f111001572 | |||
5df905182c | |||
2f155d8350 | |||
e9908139e7 | |||
43269d4add | |||
40b02aa46b | |||
7d9ef6f887 | |||
a2fad6061a | |||
62ef9c7e70 | |||
1f62d8284c | |||
a4de3e9eb1 | |||
cc008623b6 | |||
10e075efaf | |||
8aa664b49f | |||
f18507d278 | |||
e365b36ecd | |||
990759fbc6 | |||
d808a12c31 | |||
379c5f06ba | |||
a2eabdce01 | |||
01ca80fa30 | |||
660f0d2dcd | |||
e522aadd44 | |||
8ae6fe0be5 | |||
fb5c6c4c17 | |||
4e62f3b112 | |||
99e27a5a63 | |||
3bdad61ac0 | |||
d960c371b9 | |||
c024756540 | |||
dc6fa57c03 | |||
49a06772d2 | |||
0119f3f8a6 | |||
93cb07238a | |||
2f8f5ce79b | |||
4a0aa6443b | |||
e9725e3093 | |||
79d3755c16 | |||
a63e87f5f4 | |||
eb20dda221 | |||
ef14fa3789 | |||
e73bfc2c64 | |||
710bd58ee1 | |||
d274f5647d | |||
377f762ca5 | |||
847aadc7bf | |||
90a92feee1 | |||
e49a1af9b7 | |||
cf49d98524 | |||
28a4f782f9 | |||
8eaae461b4 | |||
140bbcb7b8 | |||
d4dd75acae | |||
8a5090b8ee | |||
e2cfce634b | |||
8b875e13c5 | |||
7080758c67 | |||
a26b1bb311 | |||
5f165f666b | |||
a6abeb697f | |||
a92024a858 | |||
036024db7e | |||
e040f6b218 | |||
f20fcd9a72 | |||
017cfb9d56 | |||
2cfd2cc1fc | |||
478975db26 | |||
1c9f411e75 | |||
d60e7a706a | |||
45f34df6b9 | |||
4cbe732087 | |||
54d7392467 | |||
8715683d6b | |||
2c684643b3 | |||
b12a634b81 | |||
3ae1812c32 | |||
80eeebfaf5 | |||
e6ec6bcfa4 | |||
bb397a58de | |||
44e7f06c2e | |||
f3b473ea99 | |||
706e3d458b | |||
d999f57fef | |||
6b54a4dea9 | |||
fd0de9426f | |||
bf7acf83ff | |||
23f37e19af | |||
b5821ec6dc | |||
be1c26ddf7 | |||
da4d3e4891 | |||
ac34bcbb3d | |||
e81ddaa1a5 | |||
21ba8c95ff | |||
e25c492aa4 | |||
82f75bde97 | |||
919141ae10 | |||
e48aa64766 | |||
3c3884476b | |||
569754bdad | |||
5fe814e972 | |||
06219744ea | |||
9db58210b8 | |||
ee99c3312e | |||
3a6beafae5 | |||
d7316eff66 | |||
51466e68d7 | |||
e6f55ba2c1 | |||
c1faf65409 | |||
382d93863f | |||
a173ef4308 | |||
6b9e49e632 | |||
0dd0af73a1 | |||
23f209fb07 | |||
e5710784b9 | |||
56f491befb | |||
93f605bc0a | |||
d1d365c76d | |||
38d03dbe57 | |||
af52b90abe | |||
a315a8b529 | |||
5f96d157a7 | |||
c1992f59d6 | |||
658acb0554 | |||
5a82fe93d9 | |||
8a90f0025b | |||
beba258a77 | |||
c7e2cc22af | |||
835a10e538 | |||
1d1f04f57b | |||
625abcfd5b | |||
914acd9925 | |||
c7e4704234 | |||
c5bccb661e | |||
37002b47b3 | |||
c043375ae3 | |||
62c885e1de | |||
cf98d446f9 | |||
96710159b8 | |||
17802aaa55 | |||
f5b1427c38 | |||
543ec5dfff | |||
3924430ea7 | |||
4120befef0 | |||
91b69eacf6 | |||
df7e0007d0 | |||
95fd3238e7 | |||
8ccd55dd06 | |||
7e87bd713d | |||
4e78ee85c8 | |||
cb8f0e61be | |||
1904cc168d | |||
924f114fb3 | |||
604dbea372 | |||
ca640ea18f | |||
491736335b | |||
de0872072f | |||
db7dcc7e32 | |||
75d19790b8 | |||
1893e87f5f | |||
b021590103 | |||
45c1ac0f61 | |||
0bd20ac9fd | |||
9d63eb837a | |||
49d21fef2a | |||
907b8f4a5d | |||
50c363fb6f | |||
4864394590 | |||
71d9553f90 | |||
646925c571 | |||
d9085e81a1 | |||
54a36ac275 | |||
e59026d87c | |||
7de968937e | |||
a66632c040 | |||
9f9fa9b41b | |||
421237bfb7 | |||
37e81d34c9 | |||
1fea619ac0 | |||
2bc2325b1f | |||
d9024b6c22 | |||
f8addd9365 | |||
2ff8923c81 | |||
a4e36ebdb6 | |||
9884ea225e | |||
3cca73ae9f | |||
631bc61d6c | |||
43b0ed4b04 | |||
d9c7cccf76 | |||
322db3d617 | |||
6dd57a3f5e | |||
4ba26f057d | |||
97222cafd9 | |||
cbb3c92885 | |||
132751893b | |||
a5a79da723 | |||
7ab0a3683c | |||
08dc8630d6 | |||
cc25489e75 | |||
e4bbdbc532 | |||
2f182a5e21 | |||
bacce95881 | |||
9383a6088b | |||
338cb9d502 | |||
fe4315666b | |||
576f71304c | |||
385d8df466 | |||
bfd7d9d82d | |||
e6cbe3068d | |||
99a8cd0f2d | |||
1c2f80f48e | |||
9918aae94a | |||
22060b9b16 | |||
31425877b4 | |||
09f80f63b5 | |||
68938c3b42 | |||
a945b3cae0 | |||
81b29cfda6 | |||
a11a8c493d | |||
a7b696884c | |||
e98563d834 | |||
a920f60c61 | |||
b54641a2a1 | |||
a2a7313016 | |||
6893b895e3 | |||
8f9d84c293 | |||
0c82d06ec4 | |||
5c7c5b468a | |||
fabd81365b | |||
5911ca79b5 | |||
a3419412cc | |||
cc662738f2 | |||
b426475ca4 | |||
957c8f5298 | |||
4445ac34ca | |||
b9535f46d9 | |||
a232b9bf98 | |||
165963ed2d | |||
cf4edac604 | |||
c1dc5846cd | |||
4c809e354d | |||
1f6aab8124 | |||
590fe6ca39 | |||
9bd5595999 | |||
e5fdf23dd7 | |||
8832d06d03 | |||
28c9e33d1c | |||
95a634ea7f | |||
3a0cf0cb38 | |||
e4ebd87875 | |||
bcb6df87b0 | |||
5441520369 | |||
8aacbc2b40 | |||
54a50beacb | |||
c24d5c05f0 | |||
a2e22302fb | |||
1a6fb52e1d | |||
c83a177061 | |||
79d48d9630 | |||
9c888e75bc | |||
0d15694fc3 | |||
be7cab6032 | |||
4589b3b696 | |||
0271b4970c | |||
4db35e8641 | |||
d108f7bbda | |||
3458c272ad | |||
73e4b0cc81 | |||
4311c5b6a7 | |||
d59e71b056 | |||
8315a03efc | |||
2cf1da5478 | |||
e06f459333 | |||
a3e33bb627 | |||
535da53093 | |||
b10486052e | |||
bb2bd87541 | |||
afaeca7cf7 | |||
86752417f2 | |||
243d38f832 | |||
79efc9de39 | |||
92f95b2b97 | |||
475f6f1687 | |||
d0e18f8b35 | |||
86dd67bf06 | |||
50ca378318 | |||
5f5c996cfd | |||
1536a0f94b | |||
d79323c6ca | |||
ae0120f3ef | |||
8f9e8fe3fb | |||
bc28ae4d1f | |||
2470039dfb | |||
0ad13a473e | |||
4d13743b7f | |||
79aac89f36 | |||
6dde823d4c | |||
4a637e79c6 | |||
42247620c0 | |||
115d2dea88 | |||
47f4aebd15 | |||
fbd9e65398 | |||
f0270b91d9 | |||
06df558be0 | |||
88842d4f07 | |||
08046ef621 | |||
5380ed216b | |||
70884d3a46 | |||
464821cc6f | |||
a9cf5f9ae9 | |||
e088bec582 | |||
5a52155065 | |||
8b4d56cc0d | |||
4fdeccc3a8 | |||
0543f6b425 | |||
fdf7f03242 | |||
9a73637b5e | |||
4035cb1fcb | |||
0d37272feb | |||
b2ec1773e4 | |||
4149b08f3a | |||
f435f7217e | |||
ac0b2e0dce | |||
51bcdafe33 | |||
c131c685a4 | |||
08d7b3b859 | |||
456dac6afd | |||
cce0d5448d | |||
ef4f713883 | |||
0f4fe7694b | |||
7aa900e6d5 | |||
c1d754d8ff | |||
10d0bf1550 | |||
0172351e89 | |||
1f8a68dabe | |||
9449919b2b | |||
b98c691c2b | |||
238afbaa8b | |||
0abb726b30 | |||
a54d89c90f | |||
9dc382706a | |||
7a6b45b102 | |||
d1a9924acc | |||
2f90c3e937 | |||
5f6a8fa37d | |||
690b41777b | |||
3c858d26f1 | |||
eb6b166662 | |||
3a52540d0e | |||
bab8412f10 | |||
9e2eca3e36 | |||
49b0825f63 | |||
be752997eb | |||
2f3d60e974 | |||
3ff709a814 | |||
c1fb7ce0df | |||
e919d3b7ef | |||
03b7b802c5 | |||
20138d52b1 | |||
6d322c6e78 | |||
016ca8cb7e | |||
729b8f547c | |||
52bfcd7039 | |||
6636f42dc2 | |||
cf4305be55 | |||
e1ffa97232 | |||
6524f924c9 | |||
6f53c39485 | |||
8ecbeb058c | |||
1635e40c79 | |||
816dc43214 | |||
7afb8e9070 | |||
cedc6bec23 | |||
3d817363e6 | |||
7e36edc41c | |||
cf20d8e94d | |||
02f352e51f | |||
074e2d8517 | |||
c1248dd4e1 | |||
9d4cb2ea8d | |||
5888d90fbc | |||
fe28588875 | |||
bf281343c6 | |||
73c653d21d | |||
09fc8babc4 | |||
f0884c0096 | |||
0b64999ce2 | |||
7c770b5aec | |||
794ed04761 | |||
73fbdfeb25 | |||
31fa2f0d8d | |||
1527b60fd6 | |||
3a03d6ca55 | |||
f01f63d8e8 | |||
e16f5e68d6 | |||
517aaf2146 | |||
bbe1e996e6 | |||
6d326137fb | |||
b40ceafbe0 | |||
a9e106bb71 | |||
199acec3b5 | |||
d0b7531e48 | |||
b97604d7d2 | |||
7e230b64ea | |||
7e2a993211 | |||
e18661bb59 | |||
582d2db05f | |||
4f72fb355c | |||
ca1365df5b | |||
ab85ebf83e | |||
b40302210f | |||
713bfbd7dc | |||
40168bcd5f | |||
9ce7a28cff | |||
9bb6c41134 | |||
e836ed8a2d | |||
898753f6e3 | |||
a45f298505 | |||
234a6b7ac3 | |||
584700a2ba | |||
a1c3b1786f | |||
7682a1d214 | |||
7543a92dd9 | |||
20a2aa73ae | |||
8610e48b19 | |||
bed58a45e5 | |||
5b2239cee6 | |||
b3f0d19bb9 | |||
00bbc86d39 | |||
49b3120ada | |||
2b33d8772c | |||
42194abb4a | |||
3e8429b34b | |||
311ec7b194 | |||
6876952bbd | |||
6bdb13b6a0 | |||
9f3a56e5e6 | |||
ba2589c8d5 | |||
f421fd4dde | |||
9ac5d0da67 | |||
c5ae12e10b | |||
25570cc631 | |||
baf2e5fb39 | |||
957b067eac | |||
9fe2de5244 | |||
9301206485 | |||
177b4305bb | |||
67ab265645 | |||
ea139d0657 | |||
8bd7d00ab1 | |||
417a6d8ea0 | |||
17fd273d10 | |||
772a829333 | |||
bf1f6887be | |||
3c2092926e | |||
f22644697e | |||
48e0718b76 | |||
6f54129f60 | |||
32f2cd60bb | |||
0638c87f62 | |||
0f80501467 | |||
ce41e4c219 | |||
4a2ba043cb | |||
b63c3bb9c3 | |||
8b612d9116 | |||
a416ca406b | |||
974ff0a13e | |||
aa84175382 | |||
d29dd48d1e | |||
1069762903 | |||
737d18135f | |||
0da74f1bf9 | |||
88249cd5be | |||
85d8c2c471 | |||
4a5ea4450f | |||
1485b14c7d | |||
604d7ab228 | |||
d1814f9a49 | |||
c4b1703b8e | |||
165a4ef814 | |||
3fbebd6a9f | |||
d6532f8181 | |||
2ee9b09b27 | |||
a24464f13e | |||
a8f5a4054f | |||
afc0f37e8a | |||
23b2d895bb | |||
e61fada99e | |||
836a2327f9 | |||
cf37d74728 | |||
333155b1a0 | |||
0bcb332ce9 | |||
52c539bc6b | |||
2c491b27c0 | |||
ae2cd52087 | |||
47b9576c24 | |||
7ae8138a43 | |||
438957c466 | |||
4f4a8930c8 | |||
20bb1d73f5 | |||
6b08659a69 | |||
4325eaa956 | |||
daf50a83fd | |||
34c0ac3f05 | |||
b68c58fd37 | |||
707c318ab9 | |||
9c54696d91 | |||
e5d5af68c1 | |||
0e9300b51c | |||
73ba4a39b0 | |||
77870468d9 | |||
38ecb9e055 | |||
17c440643f | |||
eb0e7c39e4 | |||
f23ba7ab7b | |||
c4220b37e5 | |||
69f39b765b | |||
fa4ee7a84b | |||
0263d3adb5 | |||
67fbabbd7c | |||
ec0a38ad25 | |||
5d8e8a9841 | |||
c3238ab154 | |||
4956161701 | |||
850722eae5 | |||
1fb5b48455 | |||
4895f940f3 | |||
ffd64d0463 | |||
d12b5958b9 | |||
a4c5d8de45 | |||
1ce45acba3 | |||
be2834cb1a | |||
07d345183e | |||
d3403d341f | |||
a14af7f728 | |||
aa95aa185b | |||
2e93d7300a | |||
f6f51665a2 | |||
7b54855397 | |||
f08eb9b5ae | |||
b0006c2272 | |||
f5d88a4b6a | |||
23730349b0 | |||
500c54e430 | |||
cf575f0d70 | |||
1db5d278f6 | |||
9fa745cfb2 | |||
aefd8b696d | |||
0f7f17b591 | |||
6fdf7f704d | |||
17aa70f5e0 | |||
fd9fbe4543 | |||
6c63356edc | |||
94896c9e74 | |||
25138d8931 | |||
285ec9be6a | |||
10343a0dab | |||
655497934b | |||
fd3313fc62 | |||
a72c2f7b7d | |||
3e4d728b10 | |||
f679461164 | |||
9b6f254954 | |||
42b7b4a7c4 | |||
435f8164a1 | |||
a807aab97e | |||
bd8cd49117 | |||
52885919d0 | |||
b618302db0 | |||
7f51ffc8fb | |||
a14ca283cc | |||
2529ed905c | |||
2cd5450333 | |||
604870d1fe | |||
6e33af7a75 | |||
e2e85c19e1 | |||
df38903fe9 | |||
0fba1b6494 | |||
05a85ab8a1 | |||
d96ff72635 | |||
5e8262657f | |||
8a0999851f | |||
5e0e8232df | |||
456f6ad6af | |||
1d98582bbd | |||
f05922e19e | |||
b440fc3df6 | |||
d5bdc00abf | |||
a5881a238b | |||
d144f5bd11 | |||
6a875d5f0b | |||
a9419cd328 | |||
90e8d7ecaf | |||
ff5e271f88 | |||
c83efd149e | |||
6ae9e539a6 | |||
351920aa7b | |||
4a6840f098 | |||
a728a6d04b | |||
26ff40ae0c | |||
8f0d0917ab | |||
59d58da4f2 | |||
cb81798c0c | |||
45007d726d | |||
5801c17509 | |||
796b814b49 | |||
0e7cd7de6f | |||
d570b5c460 | |||
64b3afae22 | |||
5e4c3728ed | |||
dbe4f70d8e | |||
160df15cbf | |||
4e3fa54ae2 | |||
bf849b24e6 | |||
64dce75e09 | |||
66627741f9 | |||
68992e77dc | |||
ca92b85864 | |||
8f4f271331 | |||
1876bbe449 | |||
b5ce035c09 | |||
5c4ae861b1 | |||
b2933f95d7 | |||
1a5196f9d2 | |||
e7e810eb20 | |||
8f391d3a68 | |||
c0fd9aee6f | |||
569735474a | |||
c3aa9fb908 | |||
81e33348bb | |||
a6d20de0a5 | |||
bc47402a6d | |||
c6e16e0866 | |||
042a6b2960 | |||
06a15ccec1 | |||
834e935c64 | |||
df2295b430 | |||
d51a73f15b | |||
3f6a534db5 | |||
d7e899e113 | |||
f325d139da | |||
1d6ae35465 | |||
f058cf5e31 | |||
9837a1b62c | |||
65d504bed1 | |||
36db47466f | |||
3cfd0deb22 | |||
146868da21 | |||
d48ec92d09 | |||
29b7c97892 | |||
1f4328d9a0 | |||
f91efd8c1e | |||
40403b81c3 | |||
6020b20fc9 | |||
5031e78365 | |||
65ce25ec7a | |||
a30e57142a | |||
d2f54f033f | |||
4327fcb92e | |||
d315d6b458 | |||
734972af07 | |||
ec880d4232 | |||
b12ffb6f44 | |||
99f56a89af | |||
5e3e152d8e | |||
50db2fedef | |||
4cb434e750 | |||
007badc324 | |||
36666f214c | |||
189674a9bb | |||
a57f3faafb | |||
04de6c7136 | |||
afb1d22f76 | |||
07c242282d | |||
8a4de72713 | |||
d3050625bb | |||
c55fafee48 | |||
c231a775b3 | |||
2cc14532cd | |||
1eb5a428cb | |||
1a280dd5cf | |||
0fba9cbf7e | |||
d769d3ce22 | |||
ca1e8f3dc1 | |||
61769de4bf | |||
ff86b9bbb3 | |||
487c21f16a | |||
33ec092998 | |||
b29a0cd0fb | |||
053c65b6cd | |||
413f552639 | |||
222f17edcc | |||
f20ad98a52 | |||
ee497ecf2a | |||
0abdf0291e | |||
6d807b3959 | |||
637941e089 | |||
e9b2def10e | |||
387595495e | |||
ac0e1aebba | |||
6052363cdb | |||
d01d6d92f8 | |||
9958b37fba | |||
a4f99b3e78 | |||
44bd42ded6 | |||
c61a29db12 | |||
2c8b691ca4 | |||
53aca633b8 | |||
f1fe115447 | |||
f427d372a7 | |||
dec5dc7c96 | |||
2bb9cdc612 | |||
f2f350116f | |||
61a7f71e80 | |||
9236486a0f | |||
ea23fda599 | |||
cfaba492da | |||
2dca9d598d | |||
9cfb2bad51 | |||
a8457d7966 | |||
0ba2caaf61 | |||
9eaa732644 | |||
69ba11acc1 | |||
9f937781b7 | |||
b5363604bc | |||
2b8728fcd8 | |||
25c3f39c82 | |||
6b543dc7bb | |||
f8c548659f | |||
618d7a3358 | |||
991f864375 | |||
876a13ec37 | |||
50b8bca6b7 | |||
b18cb0cb64 | |||
98ec92a880 | |||
6fa975cc74 | |||
e6ad0978de | |||
d80ef280dd | |||
1f12a249f5 | |||
4447a9d4b1 | |||
39b9ed06c3 | |||
01f601e761 | |||
66029cb47a | |||
6e25cf912f | |||
0c889f9492 | |||
2410c6ccc6 | |||
f88a063d83 | |||
74fa98d161 | |||
0937697637 | |||
184ce2917d | |||
2fb8ca4aaa | |||
f9c8b544ba | |||
c20acfc9c8 | |||
5634f15293 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
/build*
|
||||
/cmake-build*
|
||||
|
||||
# Eclipse
|
||||
.settings
|
||||
|
8
.gitmodules
vendored
8
.gitmodules
vendored
@ -1,6 +1,3 @@
|
||||
[submodule "etl"]
|
||||
path = thirdparty/etl
|
||||
url = https://github.com/ETLCPP/etl.git
|
||||
[submodule "arduino"]
|
||||
path = arduino
|
||||
url = https://egit.irs.uni-stuttgart.de/eive/eive_arduino_interface.git
|
||||
@ -14,7 +11,7 @@
|
||||
path = thirdparty/lwgps
|
||||
url = https://github.com/rmspacefish/lwgps.git
|
||||
[submodule "generators/fsfwgen"]
|
||||
path = generators/fsfwgen
|
||||
path = generators/deps/fsfwgen
|
||||
url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw-gen.git
|
||||
[submodule "thirdparty/arcsec_star_tracker"]
|
||||
path = thirdparty/arcsec_star_tracker
|
||||
@ -22,3 +19,6 @@
|
||||
[submodule "thirdparty/json"]
|
||||
path = thirdparty/json
|
||||
url = https://github.com/nlohmann/json.git
|
||||
[submodule "thirdparty/rapidcsv"]
|
||||
path = thirdparty/rapidcsv
|
||||
url = https://github.com/d99kris/rapidcsv.git
|
||||
|
132
CHANGELOG.md
Normal file
132
CHANGELOG.md
Normal file
@ -0,0 +1,132 @@
|
||||
Change Log
|
||||
=======
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
||||
|
||||
The [milestone](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/milestones)
|
||||
list yields a list of all related PRs for each release.
|
||||
|
||||
# [unreleased]
|
||||
|
||||
# [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
|
||||
|
||||
- CCSDS handler improvements
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/268
|
||||
- Build unittest as default side product of hosted builds
|
||||
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
|
||||
- Catch2 pre-installed in CI/CD docker container, Xiphos SDK installed in CI/CD docker
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/247
|
||||
- Sun Sensors have names denoting their location and poiting in the satellite now
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/245
|
||||
- Better RTD names denoting their purpose (and location consequently)
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/246
|
||||
|
||||
# [v1.11.0]
|
||||
|
||||
## Fixed
|
||||
|
||||
- Host build working again
|
||||
|
||||
## Added
|
||||
|
||||
- Custom Syrlinks FDIR which disabled most of the default FDIR functionality
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/232
|
||||
- Custom Gomspace FDIR which disabled most of the default FDIR functionality
|
||||
- Custom Syrlinks FDIR which disabled most of the default FDIR functionality
|
||||
|
||||
## Changed
|
||||
|
||||
- PCDU handler only called once in PST, but can handle multiple messages now
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/221
|
||||
Bugfix: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/235
|
||||
- Update rootfs base of Linux, all related OBSW changes
|
||||
- Add `/usr/local/bin` to PATH. All shell scripts are there now
|
||||
- Add Syrlinks and TMP devices to Software by default
|
||||
- Update GPS Linux Hyperion Handler to use socket interface. Still allows switching
|
||||
back to SHM interface, but the SHM interface is a possible cause of SW crashes
|
||||
- Updated code for changed FSFW HAL GPIO API: `readGpio` prototype has changed
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/240 and
|
||||
https://egit.irs.uni-stuttgart.de/eive/fsfw/pulls/76
|
||||
|
||||
### GPS
|
||||
|
||||
PRs: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/239
|
||||
|
||||
- Rename GPS device to `/dev/gps0`
|
||||
- Use gpsd version 3.17 now. Includes API changes
|
||||
|
||||
### EM and FM splitup & Build Workflow improvements
|
||||
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/238
|
||||
|
||||
- Split up `bsp_q7s` in separate EM and FM build with module loading set to different
|
||||
default values. The EM object factory is unique which allows building a parallel setup
|
||||
with dummy components
|
||||
- All major BSPs have an own `OBSWConfig.h.in` file which simplifies the file significantly
|
||||
- Renamed Q7S primary build folders:
|
||||
- `cmake-build-debug-q7s` for primary development build
|
||||
- `cmake-build-release-q7s` for primary release build
|
||||
- `cmake-build-debug-q7s-em` for primary development build of the EM software
|
||||
- `cmake-build-release-q7s-em` for primary release build of the EM software
|
||||
- Refactored Q7S helper script handling. It is now intended and preferred to copy the environment
|
||||
script to the same folder level as the `eive-obsw` and source it. This will also
|
||||
add the path containing the shell helper scripts to `PATH`
|
||||
- The actual helper shell scripts were renamed as well to `q7s-<buildSystem>-<buildType>.sh`
|
||||
|
||||
# [v1.10.1]
|
||||
|
||||
Version bump
|
||||
|
||||
# [v1.10.0]
|
||||
|
||||
For all releases equal or prior to v1.10.0,
|
||||
see [milestones](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/milestones)
|
610
CMakeLists.txt
610
CMakeLists.txt
@ -1,60 +1,164 @@
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
# CMake support for the EIVE OBSW
|
||||
#
|
||||
#
|
||||
# Author: R. Mueller
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
# Pre-Project preparation
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0)
|
||||
set(OBSW_VERSION_MINOR_IF_GIT_FAILS 0)
|
||||
set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0)
|
||||
|
||||
# set(CMAKE_VERBOSE TRUE)
|
||||
|
||||
set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
|
||||
option(EIVE_ADD_ETL_LIB "Add ETL library" ON)
|
||||
option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
|
||||
|
||||
option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF)
|
||||
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON)
|
||||
|
||||
set(OBSW_ADD_STAR_TRACKER 0)
|
||||
set(OBSW_DEBUG_STARTRACKER 0)
|
||||
option(
|
||||
EIVE_HARDCODED_TOOLCHAIN_FILE
|
||||
"\
|
||||
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(NOT FSFW_OSAL)
|
||||
set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.")
|
||||
set(FSFW_OSAL
|
||||
linux
|
||||
CACHE STRING "OS for the FSFW.")
|
||||
endif()
|
||||
|
||||
if(TGT_BSP)
|
||||
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)
|
||||
elseif(TGT_BSP MATCHES "arm/q7s")
|
||||
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" ON)
|
||||
endif()
|
||||
if(TGT_BSP MATCHES "arm/q7s"
|
||||
OR TGT_BSP MATCHES "arm/raspberrypi"
|
||||
OR TGT_BSP MATCHES "arm/beagleboneblack")
|
||||
option(LINUX_CROSS_COMPILE ON)
|
||||
endif()
|
||||
if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
|
||||
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" OFF)
|
||||
elseif(TGT_BSP MATCHES "arm/q7s")
|
||||
option(EIVE_Q7S_EM "Build configuration for the EM" OFF)
|
||||
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()
|
||||
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name"
|
||||
OFF)
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
# Perform steps like loading toolchain files where applicable.
|
||||
include(${CMAKE_SCRIPT_PATH}/PreProjectConfig.cmake)
|
||||
include(PreProjectConfig)
|
||||
pre_project_config()
|
||||
|
||||
# Check whether the user has already installed Catch2 first. This has to come before
|
||||
# the project call. We could also exlcude doing this when the Q7S primary OBSW is built..
|
||||
find_package(Catch2 3 CONFIG QUIET)
|
||||
|
||||
# Project Name
|
||||
project(eive-obsw)
|
||||
|
||||
################################################################################
|
||||
# Pre-Sources preparation
|
||||
################################################################################
|
||||
|
||||
# Specify the C++ standard
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
|
||||
include(EiveHelpers)
|
||||
|
||||
option(EIVE_ADD_ETL_LIB "Add ETL library" ON)
|
||||
option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
|
||||
|
||||
set(OBSW_MAX_SCHEDULED_TCS 500)
|
||||
|
||||
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
|
||||
# ##############################################################################
|
||||
|
||||
# Version handling
|
||||
set(GIT_VER_HANDLING_OK FALSE)
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||
determine_version_with_git("--exclude" "docker_*")
|
||||
set(GIT_INFO
|
||||
${GIT_INFO}
|
||||
CACHE STRING "Version information retrieved with git describe")
|
||||
if(GIT_INFO)
|
||||
set(GIT_INFO
|
||||
${GIT_INFO}
|
||||
CACHE STRING "Version information retrieved with git describe")
|
||||
list(GET GIT_INFO 1 OBSW_VERSION_MAJOR)
|
||||
list(GET GIT_INFO 2 OBSW_VERSION_MINOR)
|
||||
list(GET GIT_INFO 3 OBSW_VERSION_REVISION)
|
||||
list(GET GIT_INFO 4 OBSW_VERSION_CST_GIT_SHA1)
|
||||
if(NOT OBSW_VERSION_MAJOR)
|
||||
set(OBSW_VERSION_MAJOR ${OBSW_VERSION_MAJOR_IF_GIT_FAILS})
|
||||
endif()
|
||||
if(NOT OBSW_VERSION_MINOR)
|
||||
set(FSFW_SUBVERSION ${OBSW_VERSION_MINOR_IF_GIT_FAILS})
|
||||
endif()
|
||||
if(NOT OBSW_VERSION_REVISION)
|
||||
set(FSFW_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS})
|
||||
endif()
|
||||
set(GIT_VER_HANDLING_OK TRUE)
|
||||
else()
|
||||
set(GIT_VER_HANDLING_OK FALSE)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT GIT_VER_HANDLING_OK)
|
||||
set(OBSW_VERSION_MAJOR ${OBSW_VERSION_MAJOR_IF_GIT_FAILS})
|
||||
set(OBSW_VERSION_MINOR ${OBSW_VERSION_MINOR_IF_GIT_FAILS})
|
||||
set(OBSW_VERSION_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS})
|
||||
endif()
|
||||
|
||||
# Set names and variables
|
||||
set(OBSW_NAME ${CMAKE_PROJECT_NAME})
|
||||
set(WATCHDOG_NAME eive-watchdog)
|
||||
@ -62,7 +166,7 @@ set(SIMPLE_OBSW_NAME eive-simple)
|
||||
set(UNITTEST_NAME eive-unittest)
|
||||
set(LIB_FSFW_NAME fsfw)
|
||||
set(LIB_EIVE_MISSION eive-mission)
|
||||
set(LIB_ETL_NAME etl)
|
||||
set(LIB_ETL_TARGET etl::etl)
|
||||
set(LIB_CSP_NAME libcsp)
|
||||
set(LIB_LWGPS_NAME lwgps)
|
||||
set(LIB_ARCSEC wire)
|
||||
@ -71,6 +175,7 @@ set(LIB_CXX_FS -lstdc++fs)
|
||||
set(LIB_CATCH2 Catch2)
|
||||
set(LIB_GPS gps)
|
||||
set(LIB_JSON_NAME nlohmann_json::nlohmann_json)
|
||||
set(LIB_DUMMIES dummies)
|
||||
|
||||
# Set path names
|
||||
set(FSFW_PATH fsfw)
|
||||
@ -78,6 +183,7 @@ set(TEST_PATH test)
|
||||
set(UNITTEST_PATH unittest)
|
||||
set(LINUX_PATH linux)
|
||||
set(COMMON_PATH common)
|
||||
set(DUMMY_PATH dummies)
|
||||
set(WATCHDOG_PATH watchdog)
|
||||
set(COMMON_CONFIG_PATH ${COMMON_PATH}/config)
|
||||
set(UNITTEST_CFG_PATH ${UNITTEST_PATH}/testcfg)
|
||||
@ -95,316 +201,318 @@ set(EIVE_ADD_LINUX_FILES False)
|
||||
|
||||
# Analyse different OS and architecture/target options, determine BSP_PATH,
|
||||
# display information about compiler etc.
|
||||
include (${CMAKE_SCRIPT_PATH}/HardwareOsPreConfig.cmake)
|
||||
pre_source_hw_os_config()
|
||||
|
||||
if(TGT_BSP)
|
||||
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"
|
||||
)
|
||||
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)
|
||||
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/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)
|
||||
endif()
|
||||
|
||||
if(TGT_BSP MATCHES "arm/te0720-1cfa")
|
||||
set(TE0720_1CFA ON)
|
||||
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_MINOR 17)
|
||||
endif()
|
||||
|
||||
if(TGT_BSP MATCHES "arm/te0720-1cfa")
|
||||
set(TE0720_1CFA ON)
|
||||
endif()
|
||||
else()
|
||||
# Required by FSFW library
|
||||
set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
|
||||
# Required by FSFW library
|
||||
set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
|
||||
endif()
|
||||
|
||||
|
||||
# Configuration files
|
||||
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}/OBSWConfig.h.in OBSWConfig.h)
|
||||
configure_file(${BSP_PATH}/OBSWConfig.h.in OBSWConfig.h)
|
||||
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")
|
||||
configure_file(${BSP_PATH}/boardconfig/rpiConfig.h.in rpiConfig.h)
|
||||
configure_file(${BSP_PATH}/boardconfig/rpiConfig.h.in rpiConfig.h)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
configure_file(${WATCHDOG_PATH}/watchdogConf.h.in watchdogConf.h)
|
||||
|
||||
# Set common config path for FSFW
|
||||
set(FSFW_ADDITIONAL_INC_PATHS
|
||||
"${COMMON_PATH}/config"
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
set(FSFW_ADDITIONAL_INC_PATHS "${COMMON_PATH}/config"
|
||||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
################################################################################
|
||||
# ##############################################################################
|
||||
# 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")
|
||||
add_compile_options(
|
||||
"-Wall"
|
||||
"-Wextra"
|
||||
"-Wimplicit-fallthrough=1"
|
||||
"-Wno-unused-parameter"
|
||||
"-Wno-psabi"
|
||||
"-Wduplicated-cond" # check for duplicate conditions
|
||||
"-Wduplicated-branches" # check for duplicate branches
|
||||
"-Wlogical-op" # Search for bitwise operations instead of logical
|
||||
"-Wnull-dereference" # Search for NULL dereference
|
||||
"-Wundef" # Warn if undefind marcos are used
|
||||
"-Wformat=2" # Format string problem detection
|
||||
"-Wformat-overflow=2" # Formatting issues in printf
|
||||
"-Wformat-truncation=2" # Formatting issues in printf
|
||||
"-Wformat-security" # Search for dangerous printf operations
|
||||
"-Wstrict-overflow=3" # Warn if integer overflows might happen
|
||||
"-Warray-bounds=2" # Some array bounds violations will be found
|
||||
"-Wshift-overflow=2" # Search for bit left shift overflows (<c++14)
|
||||
"-Wcast-qual" # Warn if the constness is cast away
|
||||
"-Wstringop-overflow=4"
|
||||
# -Wstack-protector # Emits a few false positives for low level access
|
||||
# -Wconversion # Creates many false positives
|
||||
# -Warith-conversion # Use with Wconversion to find more implicit conversions
|
||||
# -fanalyzer # Should be used to look through problems
|
||||
)
|
||||
# Remove unused sections.
|
||||
add_compile_options(
|
||||
"-ffunction-sections"
|
||||
"-fdata-sections"
|
||||
)
|
||||
add_compile_options(
|
||||
"-Wall"
|
||||
"-Wextra"
|
||||
"-Wimplicit-fallthrough=1"
|
||||
"-Wno-unused-parameter"
|
||||
"-Wno-psabi"
|
||||
"-Wduplicated-cond" # check for duplicate conditions
|
||||
"-Wduplicated-branches" # check for duplicate branches
|
||||
"-Wlogical-op" # Search for bitwise operations instead of logical
|
||||
"-Wnull-dereference" # Search for NULL dereference
|
||||
"-Wundef" # Warn if undefind marcos are used
|
||||
"-Wformat=2" # Format string problem detection
|
||||
"-Wformat-overflow=2" # Formatting issues in printf
|
||||
"-Wformat-truncation=2" # Formatting issues in printf
|
||||
"-Wformat-security" # Search for dangerous printf operations
|
||||
"-Wstrict-overflow=3" # Warn if integer overflows might happen
|
||||
"-Warray-bounds=2" # Some array bounds violations will be found
|
||||
"-Wshift-overflow=2" # Search for bit left shift overflows (<c++14)
|
||||
"-Wcast-qual" # Warn if the constness is cast away
|
||||
"-Wstringop-overflow=4"
|
||||
# -Wstack-protector # Emits a few false positives for low level access
|
||||
# -Wconversion # Creates many false positives -Warith-conversion # Use with
|
||||
# Wconversion to find more implicit conversions -fanalyzer # Should be used
|
||||
# to look through problems
|
||||
)
|
||||
# Remove unused sections.
|
||||
add_compile_options("-ffunction-sections" "-fdata-sections")
|
||||
|
||||
# Removed unused sections.
|
||||
add_link_options(
|
||||
"-Wl,--gc-sections"
|
||||
)
|
||||
# Removed unused sections.
|
||||
add_link_options("-Wl,--gc-sections")
|
||||
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set(COMPILER_FLAGS "/permissive-")
|
||||
set(COMPILER_FLAGS "/permissive-")
|
||||
endif()
|
||||
|
||||
if (NOT(TGT_BSP MATCHES "arm/te0720-1cfa") AND NOT(TGT_BSP MATCHES "arm/q7s"))
|
||||
# Not installed, so use FetchContent to download and provide Catch2
|
||||
if(NOT Catch2_FOUND)
|
||||
message(STATUS "Did not find a valid Catch2 installation. Using FetchContent to install it")
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v3.0.0-preview4
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(Catch2)
|
||||
#fixes regression -preview4, to be confirmed in later releases
|
||||
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "")
|
||||
set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true")
|
||||
set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
add_library(${LIB_EIVE_MISSION})
|
||||
|
||||
add_library(${LIB_DUMMIES})
|
||||
|
||||
# Add main executable
|
||||
add_executable(${OBSW_NAME})
|
||||
if(EIVE_CREATE_UNIQUE_OBSW_BIN)
|
||||
set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME}-$ENV{USERNAME})
|
||||
else()
|
||||
set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME})
|
||||
endif()
|
||||
set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME})
|
||||
|
||||
set_target_properties(${OBSW_NAME} PROPERTIES OUTPUT_NAME ${OBSW_BIN_NAME})
|
||||
|
||||
#watchdog
|
||||
add_executable(${WATCHDOG_NAME} EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(${WATCHDOG_PATH})
|
||||
target_link_libraries(${WATCHDOG_NAME} PUBLIC
|
||||
${LIB_CXX_FS}
|
||||
)
|
||||
target_include_directories(${WATCHDOG_NAME} PUBLIC
|
||||
${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
#unittests
|
||||
add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL)
|
||||
# Watchdog
|
||||
if(TGT_BSP MATCHES "arm/q7s")
|
||||
add_executable(${WATCHDOG_NAME})
|
||||
else()
|
||||
add_executable(${WATCHDOG_NAME} EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
add_subdirectory(${WATCHDOG_PATH})
|
||||
target_link_libraries(${WATCHDOG_NAME} PUBLIC ${LIB_CXX_FS})
|
||||
target_include_directories(${WATCHDOG_NAME} PUBLIC ${CMAKE_BINARY_DIR})
|
||||
|
||||
# unittests
|
||||
if(NOT TGT_BSP)
|
||||
add_executable(${UNITTEST_NAME})
|
||||
else()
|
||||
add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
if(EIVE_ADD_ETL_LIB)
|
||||
add_subdirectory(${LIB_ETL_PATH})
|
||||
|
||||
endif()
|
||||
|
||||
if(EIVE_ADD_JSON_LIB)
|
||||
add_subdirectory(${LIB_JSON_PATH})
|
||||
add_subdirectory(${LIB_JSON_PATH})
|
||||
endif()
|
||||
|
||||
add_subdirectory(thirdparty/rapidcsv)
|
||||
|
||||
|
||||
if(EIVE_ADD_LINUX_FILES)
|
||||
add_subdirectory(${LIB_ARCSEC_PATH})
|
||||
add_subdirectory(${LINUX_PATH})
|
||||
add_subdirectory(${LIB_ARCSEC_PATH})
|
||||
add_subdirectory(${LINUX_PATH})
|
||||
endif()
|
||||
add_subdirectory(${BSP_PATH})
|
||||
if(ADD_CSP_LIB)
|
||||
add_subdirectory(${LIB_CSP_PATH})
|
||||
add_subdirectory(${LIB_CSP_PATH})
|
||||
endif()
|
||||
|
||||
|
||||
add_subdirectory(${COMMON_PATH})
|
||||
|
||||
|
||||
add_subdirectory(${DUMMY_PATH})
|
||||
|
||||
add_subdirectory(${LIB_LWGPS_PATH})
|
||||
add_subdirectory(${FSFW_PATH})
|
||||
add_subdirectory(${LIB_EIVE_MISSION_PATH})
|
||||
add_subdirectory(${TEST_PATH})
|
||||
|
||||
|
||||
add_subdirectory(${UNITTEST_PATH})
|
||||
|
||||
|
||||
################################################################################
|
||||
# Post-Sources preparation
|
||||
################################################################################
|
||||
|
||||
|
||||
|
||||
# Add libraries
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||
${LIB_FSFW_NAME}
|
||||
${LIB_LWGPS_NAME}
|
||||
${LIB_OS_NAME}
|
||||
)
|
||||
|
||||
target_link_libraries(${OBSW_NAME} PRIVATE
|
||||
${LIB_EIVE_MISSION}
|
||||
)
|
||||
|
||||
if(TGT_BSP MATCHES "arm/q7s")
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||
${LIB_ARCSEC}
|
||||
${LIB_GPS}
|
||||
)
|
||||
# This should have already been downloaded by the FSFW Still include it to be
|
||||
# safe
|
||||
find_package(etl ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET)
|
||||
# Not installed, so use FetchContent to download and provide etl
|
||||
if(NOT etl_FOUND)
|
||||
message(
|
||||
STATUS
|
||||
"No ETL installation was found with find_package. Installing and providing "
|
||||
"etl with FindPackage")
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
etl
|
||||
GIT_REPOSITORY https://github.com/ETLCPP/etl
|
||||
GIT_TAG ${FSFW_ETL_LIB_VERSION})
|
||||
list(APPEND FSFW_FETCH_CONTENT_TARGETS etl)
|
||||
endif()
|
||||
|
||||
target_link_libraries(${UNITTEST_NAME} PRIVATE
|
||||
Catch2
|
||||
${LIB_EIVE_MISSION}
|
||||
)
|
||||
# Use same Catch2 version as framework
|
||||
if(NOT (TGT_BSP MATCHES "arm/te0720-1cfa")
|
||||
AND NOT (TGT_BSP MATCHES "arm/q7s")
|
||||
AND NOT (TGT_BSP MATCHES "arm/raspberrypi"))
|
||||
# Check whether the user has already installed Catch2 first
|
||||
find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} CONFIG QUIET)
|
||||
# Not installed, so use FetchContent to download and provide Catch2
|
||||
if(NOT Catch2_FOUND)
|
||||
message(
|
||||
STATUS
|
||||
"${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent"
|
||||
)
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG ${FSFW_CATCH2_LIB_VERSION})
|
||||
|
||||
list(APPEND FSFW_FETCH_CONTENT_TARGETS Catch2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# The documentation for FetchContent recommends declaring all the dependencies
|
||||
# before making them available. We make all declared dependency available here
|
||||
# after their declaration
|
||||
if(FSFW_FETCH_CONTENT_TARGETS)
|
||||
FetchContent_MakeAvailable(${FSFW_FETCH_CONTENT_TARGETS})
|
||||
if(TARGET etl)
|
||||
add_library(${LIB_ETL_TARGET} ALIAS etl)
|
||||
endif()
|
||||
if(TARGET Catch2)
|
||||
# Fixes regression -preview4, to be confirmed in later releases Related
|
||||
# GitHub issue: https://github.com/catchorg/Catch2/issues/2417
|
||||
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "")
|
||||
set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true")
|
||||
set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# ##############################################################################
|
||||
# Post-Sources preparation
|
||||
# ##############################################################################
|
||||
|
||||
# Add libraries
|
||||
target_link_libraries(${LIB_EIVE_MISSION}
|
||||
PUBLIC ${LIB_FSFW_NAME} ${LIB_LWGPS_NAME} ${LIB_OS_NAME})
|
||||
|
||||
target_link_libraries(${LIB_DUMMIES} PUBLIC ${LIB_FSFW_NAME} ${LIB_JSON_NAME})
|
||||
|
||||
target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_EIVE_MISSION} ${LIB_DUMMIES})
|
||||
|
||||
if(TGT_BSP MATCHES "arm/q7s")
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_GPS} ${LIB_ARCSEC})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${UNITTEST_NAME} PRIVATE Catch2 ${LIB_EIVE_MISSION}
|
||||
rapidcsv ${LIB_DUMMIES})
|
||||
|
||||
if(TGT_BSP MATCHES "arm/egse")
|
||||
target_link_libraries(${OBSW_NAME} PRIVATE
|
||||
${LIB_ARCSEC}
|
||||
)
|
||||
target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_ARCSEC})
|
||||
endif()
|
||||
|
||||
if(ADD_CSP_LIB)
|
||||
target_link_libraries(${OBSW_NAME} PRIVATE
|
||||
${LIB_CSP_NAME}
|
||||
)
|
||||
target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_CSP_NAME})
|
||||
endif()
|
||||
|
||||
|
||||
if(EIVE_ADD_ETL_LIB)
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||
${LIB_ETL_NAME}
|
||||
)
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_ETL_TARGET})
|
||||
endif()
|
||||
|
||||
if(EIVE_ADD_JSON_LIB)
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||
${LIB_JSON_NAME}
|
||||
)
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_JSON_NAME})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||
${LIB_CXX_FS}
|
||||
)
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_CXX_FS})
|
||||
|
||||
# Add include paths for all sources.
|
||||
target_include_directories(${LIB_EIVE_MISSION} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${FSFW_CONFIG_PATH}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${LIB_ARCSEC_PATH}
|
||||
)
|
||||
target_include_directories(
|
||||
${LIB_EIVE_MISSION} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${FSFW_CONFIG_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")
|
||||
target_include_directories(${LIB_EIVE_MISSION} PUBLIC
|
||||
${ARCSEC_LIB_PATH}
|
||||
)
|
||||
target_include_directories(${LIB_EIVE_MISSION} PUBLIC ${ARCSEC_LIB_PATH})
|
||||
endif()
|
||||
|
||||
if(CMAKE_VERBOSE)
|
||||
message(STATUS "Warning flags: ${WARNING_FLAGS}")
|
||||
message(STATUS "Warning flags: ${WARNING_FLAGS}")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
if(${CMAKE_CROSSCOMPILING})
|
||||
include (${CMAKE_SCRIPT_PATH}/HardwareOsPostConfig.cmake)
|
||||
post_source_hw_os_config()
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
include(HardwareOsPostConfig)
|
||||
post_source_hw_os_config()
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_SIZE)
|
||||
set(CMAKE_SIZE size)
|
||||
if(WIN32)
|
||||
set(FILE_SUFFIX ".exe")
|
||||
endif()
|
||||
set(CMAKE_SIZE size)
|
||||
if(WIN32)
|
||||
set(FILE_SUFFIX ".exe")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EIVE_BUILD_WATCHDOG)
|
||||
set(TARGET_STRING "OBSW Watchdog")
|
||||
set(TARGET_STRING "OBSW Watchdog")
|
||||
else()
|
||||
if(TGT_BSP)
|
||||
set(TARGET_STRING "Target BSP: ${TGT_BSP}")
|
||||
else()
|
||||
set(TARGET_STRING "Target BSP: Hosted")
|
||||
endif()
|
||||
if(TGT_BSP)
|
||||
set(TARGET_STRING "Target BSP: ${TGT_BSP}")
|
||||
else()
|
||||
set(TARGET_STRING "Target BSP: Hosted")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
string(CONCAT POST_BUILD_COMMENT
|
||||
"Build directory: ${CMAKE_BINARY_DIR}\n"
|
||||
"Target OSAL: ${FSFW_OSAL}\n"
|
||||
"Target Build Type: ${CMAKE_BUILD_TYPE}\n"
|
||||
"${TARGET_STRING}"
|
||||
)
|
||||
install(TARGETS ${OBSW_NAME} RUNTIME DESTINATION bin)
|
||||
|
||||
string(CONCAT POST_BUILD_COMMENT "Build directory: ${CMAKE_BINARY_DIR}\n"
|
||||
"Target OSAL: ${FSFW_OSAL}\n"
|
||||
"Target Build Type: ${CMAKE_BUILD_TYPE}\n" "${TARGET_STRING}")
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${OBSW_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_SIZE} ${OBSW_BIN_NAME}${FILE_SUFFIX}
|
||||
COMMENT ${POST_BUILD_COMMENT}
|
||||
)
|
||||
TARGET ${OBSW_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_SIZE} ${OBSW_BIN_NAME}${FILE_SUFFIX}
|
||||
COMMENT ${POST_BUILD_COMMENT})
|
||||
|
||||
|
||||
include (${CMAKE_SCRIPT_PATH}/BuildType.cmake)
|
||||
include(BuildType)
|
||||
set_build_type()
|
||||
|
316
README.md
316
README.md
@ -39,12 +39,14 @@ Target systems:
|
||||
the [Xiphos Traq Platform](https://trac2.xiphos.ca/eive-q7). Press on index to find all
|
||||
relevant pages. The most recent datasheet can be found
|
||||
[here](https://trac2.xiphos.ca/manual/wiki/Q7RevB/UserManual).
|
||||
* Linux OS built with Yocto 2.5
|
||||
* Linux OS built with Yocto 2.5. SDK and root filesystem can be rebuilt with
|
||||
[yocto](https://egit.irs.uni-stuttgart.de/eive/q7s-yocto)
|
||||
* [Linux Kernel](https://github.com/XiphosSystemsCorp/linux-xlnx.git) . EIVE version can be found
|
||||
[here](https://github.com/spacefisch/linux-xlnx) . Pre-compiled files can be
|
||||
found [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/q7s-linux-components&fileid=777299).
|
||||
* Q7S base project can be found [here](https://egit.irs.uni-stuttgart.de/eive/q7s-base)
|
||||
* Minimal base project files can be found [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/xiphos-q7s-sdk&fileid=510908)
|
||||
* Minimal base project files and Xiphos SDK can be found
|
||||
[here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/xiphos-q7s-sdk&fileid=510908)
|
||||
* Host System
|
||||
* Generic software components which are not dependant on hardware can also
|
||||
be run on a host system. All host code is contained in the `bsp_hosted` folder
|
||||
@ -55,7 +57,8 @@ Target systems:
|
||||
The steps in the primary README are related to the main OBC target Q7S.
|
||||
The CMake build system can be used to generate build systems as well (see helper scripts in `cmake/scripts`:
|
||||
|
||||
- Linux (Raspberry Pi): See special section below.
|
||||
- Linux Raspberry Pi: See special section below. Uses the `bsp_linux_board` folder
|
||||
- Linux Trenz TE7020_1CFA: Uses the `bsp_te0720_1cfa` folder
|
||||
- Linux Host: Uses the `bsp_hosted` BSP folder and the CMake Unix Makefiles generator.
|
||||
- Windows Host: Uses the `bsp_hosted` BSP folder, the CMake MinGW Makefiles generator and MSYS2.
|
||||
|
||||
@ -67,8 +70,9 @@ prerequisites.
|
||||
## Building the OBSW and flashing it on the Q7S
|
||||
|
||||
1. ARM cross-compiler installed, either as part of [Vivado 2018.2 installation](#vivado) or
|
||||
as a [separate download](#arm-toolchain)
|
||||
2. [Q7S sysroot](#q7s-sysroot) on local development machine
|
||||
as a [separate download](#arm-toolchain). The Xiphos SDK also installs a cross-compiler,
|
||||
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. [TCF agent](https://wiki.eclipse.org/TCF) running on Q7S
|
||||
|
||||
@ -85,7 +89,7 @@ When using Windows, run theses steps in MSYS2.
|
||||
1. Clone the repository with
|
||||
|
||||
```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
|
||||
@ -96,41 +100,105 @@ When using Windows, run theses steps in MSYS2.
|
||||
git submodule update
|
||||
```
|
||||
|
||||
3. Ensure that the cross-compiler is working with `arm-linux-gnueabihf-gcc --version`.
|
||||
It is recommended to set up a shell script which takes care of setting up the environment
|
||||
for convenience or to set up the
|
||||
[PATH and the CROSS_COMPILE variable permanently](https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path)
|
||||
in the `.profile` file.
|
||||
3. Ensure that the cross-compiler is working with `arm-linux-gnueabihf-gcc --version` and that
|
||||
the sysroot environmental variables have been set like specified in the
|
||||
[root filesystem chapter](#sysroot).
|
||||
|
||||
4. Run the CMake configuration to create the build system in a `build-Debug-Q7S` folder.
|
||||
Add `-G "MinGW Makefiles` in MinGW64 on Windows.
|
||||
|
||||
```sh
|
||||
mkdir build-Debug-Q7S && cd build-Debug-Q7S
|
||||
mkdir cmake-build-debug-q7s && cd cmake-build-debug-q7s
|
||||
cmake -DTGT_BSP="arm/q7s" -DCMAKE_BUILD_TYPE=Debug ..
|
||||
cmake --build . -j
|
||||
```
|
||||
|
||||
You can also use provided shell scripts to perform these commands
|
||||
|
||||
You can also use provided shell scripts to perform these commands.
|
||||
```sh
|
||||
cd cmake/scripts/Q7S
|
||||
./make_debug_cfg.sh
|
||||
cd ../../..
|
||||
cp scripts/q7s-env.sh ..
|
||||
cp scripts/q7s-env-em.sh ..
|
||||
```
|
||||
|
||||
This will invoke a Python script which in turn invokes CMake with the correct
|
||||
arguments to configure CMake for Q7S cross-compilation.
|
||||
Adapt these scripts for your needs by editing the `CROSS_COMPILE_BIN_PATH`
|
||||
and `ZYNQ_7020_SYSROOT`. After that, you can run the following commands to set up
|
||||
the FM build
|
||||
|
||||
```sh
|
||||
cd ..
|
||||
./q7s-env.sh
|
||||
q7s-make-debug.sh
|
||||
```
|
||||
|
||||
You can build the EM setup by running
|
||||
|
||||
```sh
|
||||
export EIVE_Q7S_EM=1
|
||||
```
|
||||
|
||||
or by running the `q7s-env-em.sh` script instead before setting up the build
|
||||
configuration.
|
||||
|
||||
The shell scripts will invoke a Python script which in turn invokes CMake with the correct
|
||||
arguments to configure CMake for Q7S cross-compilation. You can look into the command
|
||||
output to see which commands were run exactly.
|
||||
|
||||
There are also different values for `-DTGT_BSP` to build for the Raspberry Pi
|
||||
or the Beagle Bone Black: `arm/raspberrypi` and `arm/beagleboneblack`.
|
||||
|
||||
|
||||
5. Build the software with
|
||||
|
||||
```sh
|
||||
cd build-Debug-Q7S
|
||||
cd cmake-build-debug-q7s
|
||||
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
|
||||
|
||||
1. Open Xilinx SDK 2018.2
|
||||
@ -163,22 +231,25 @@ automatically.
|
||||
|
||||
The EIVE OBSW is the default target if no target is specified.
|
||||
|
||||
**Debug**
|
||||
|
||||
```sh
|
||||
mkdir build-Debug-Q7S && cd build-Debug-Q7S
|
||||
mkdir cmake-build-debug-q7s && cd cmake-build-debug-q7s
|
||||
cmake -DTGT_BSP=arm/q7s -DCMAKE_BUILD_TYPE=Debug ..
|
||||
cmake --build . -j
|
||||
```
|
||||
|
||||
**Release**
|
||||
|
||||
```sh
|
||||
mkdir cmake-build-release-q7s && cd cmake-build-release-q7s
|
||||
cmake -DTGT_BSP=arm/q7s -DCMAKE_BUILD_TYPE=Release ..
|
||||
cmake --build . -j
|
||||
```
|
||||
|
||||
### Q7S Watchdog
|
||||
|
||||
To build the EIVE watchdog, the corresponding target must be specified in the build command.
|
||||
The configure steps do not need to be repeated if the folder has already been configured.
|
||||
|
||||
```sh
|
||||
mkdir build-Debug-Watchdog && cd build-Debug-Watchdog
|
||||
cmake -DTGT_BSP=arm/q7s -DCMAKE_BUILD_TYPE=Debug ..
|
||||
cmake --build . --target eive-watchdog -j
|
||||
```
|
||||
The watchdog will be built along side the primary OBSW binary.
|
||||
|
||||
### Hosted
|
||||
|
||||
@ -186,7 +257,7 @@ You can also use the FSFW OSAL `host` to build on Windows or for generic OSes.
|
||||
Note: Currently this is not supported.
|
||||
|
||||
```sh
|
||||
mkdir build-Debug-Host && cd build-Debug-Host
|
||||
mkdir cmake-build-debug && cd cmake-build-debug
|
||||
cmake -DFSFW_OSAL=host -DCMAKE_BUILD_TYPE=Debug ..
|
||||
cmake --build . -j
|
||||
```
|
||||
@ -197,7 +268,7 @@ To build the unittests, the corresponding target must be specified in the build
|
||||
The configure steps do not need to be repeated if the folder has already been configured.
|
||||
|
||||
```sh
|
||||
mkdir build-Debug-Unittest && cd build-Debug-Unittest
|
||||
mkdir cmake-build-debug && cd cmake-build-debug
|
||||
cmake ..
|
||||
cmake --build . --target eive-unittests -j
|
||||
```
|
||||
@ -227,18 +298,19 @@ A serial console session is up permanently in a `tmux` session
|
||||
|
||||
### Serial console
|
||||
|
||||
You can check whether the sessions exist with `tmux ls`
|
||||
You can check whether the sessions exist with `tmux ls`.
|
||||
This is the command to connect to the serial interface of the FM using the
|
||||
RS422 interface of the flight preparation panel:
|
||||
|
||||
```sh
|
||||
tmux a -t q7s-serial
|
||||
tmux a -t q7s-fm-fpp
|
||||
```
|
||||
|
||||
If the session does not exist, you can create it like this
|
||||
|
||||
```sh
|
||||
tmux new -s q7s-serial
|
||||
/bin/bash
|
||||
q7s_serial
|
||||
tmux new -s q7s-fm-fpp -t /bin/bash
|
||||
launch-q7s-fpp
|
||||
```
|
||||
|
||||
Other useful tmux commands:
|
||||
@ -258,56 +330,51 @@ Other useful tmux commands:
|
||||
You can use the following command to connect to the Q7S with `ssh`:
|
||||
|
||||
```sh
|
||||
q7s_ssh
|
||||
q7s-fm-ssh
|
||||
```
|
||||
|
||||
## Port forwarding for connection to TCF agent
|
||||
|
||||
This is a required step to connect to the `tcf-agent` on the Q7S, which is required for convenient
|
||||
remote debugging. Assuming the IPv6
|
||||
|
||||
```sh
|
||||
ssh -L 1534:192.168.133.10:1534 eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5 -t /bin/bash
|
||||
```
|
||||
|
||||
You then need to connect to `localhost` with port `1534`.
|
||||
|
||||
## Port forwarding for file transfers with `scp`
|
||||
|
||||
```sh
|
||||
ssh -L 1535:192.168.133.10:22 eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5 -t /bin/bash
|
||||
```
|
||||
|
||||
You then need to run `scp` with the `-P 1535` flag with `localhost` as the target IP address.
|
||||
|
||||
## Port forwarding for TMTC commanding
|
||||
|
||||
You can enable port forwarding for TMTC commanding with the following command:
|
||||
|
||||
```sh
|
||||
ssh -L 1536:192.168.133.10:7301 eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5 -t /bin/bash
|
||||
```
|
||||
|
||||
This forwards TMTC packets on port `1536` of localhost to the TMTC reception port of the Q7S.
|
||||
|
||||
## Set up all port forwarding at once
|
||||
|
||||
Port forwarding is necessary for remote-debugging using the `tcf-agent`, copying files
|
||||
with `scp` & `q7s-cp.py` and sending TMTC commands.
|
||||
You can specify the `-L` option multiple times to set up all port forwarding at once.
|
||||
Example for using the UDP communication interface:
|
||||
|
||||
```sh
|
||||
ssh -L 1534:192.168.133.10:1534 \
|
||||
-L 1535:192.168.133.10:22 \
|
||||
-L 1536:192.168.133.10:7301 \
|
||||
ssh -L 1534:192.168.155.55:1534 \
|
||||
-L 1535:192.168.155.55:22 \
|
||||
-L 1536:192.168.155.55:7301 \
|
||||
-L 1537:127.0.0.1:7100 \
|
||||
-L 1538:192.168.133.10:1534 \
|
||||
-L 1539:192.168.133.10:22 \
|
||||
-L 1540:192.168.133.10:7301 \
|
||||
eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5 \
|
||||
-t 'export CONSOLE_PREFIX="[Q7S Tunnel] /bin/bash'
|
||||
-t 'CONSOLE_PREFIX="[Q7S Tunnel]" /bin/bash'
|
||||
```
|
||||
|
||||
There is also a shell script called `q7s-port.sh` which can be used to achieve the same.
|
||||
|
||||
# <a id="set-up-prereq"></a> Setting up prerequisites
|
||||
|
||||
## <a id="vivado"></a> Installing Vivado the the Xilinx development tools
|
||||
## <a id="sysroot"></a> Getting system root for Linux cross-compilation
|
||||
|
||||
Cross-compiling any program for an embedded Linux board generally required parts of the target root
|
||||
file system on the development/host computer. For the Q7S, you can install the cross-compilation
|
||||
root file system by simply installing the SDK. You can find the most recent SDK
|
||||
[here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/xiphos-q7s-sdk).
|
||||
|
||||
If you are compiling for the Q7S or the TE7020, the `ZYNQ_7020_SYSROOT` environment variable
|
||||
must be set to the location of the SDK compile sysroot. Here is an example on how to do this
|
||||
in Ubuntu, assuming the SDK was installed in the default location
|
||||
|
||||
```sh
|
||||
export ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-linux-gnueabi"
|
||||
```
|
||||
|
||||
If you are comiling for the Raspberry Pi, you have to set the `LINUX_ROOTFS` environmental
|
||||
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).
|
||||
|
||||
## <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
|
||||
the TCF plugin and downloading the cross-compiler as specified in the section below. However,
|
||||
@ -323,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/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 .
|
||||
Installation was tested on Windows and Ubuntu 21.04.
|
||||
@ -345,7 +412,9 @@ twice) and generate this list manually with the following commands, according to
|
||||
sudo apt install libncurses5
|
||||
```
|
||||
|
||||
2. ```sh
|
||||
2. Execute the following command
|
||||
|
||||
```sh
|
||||
sudo <installRoot>/Vivado/2018.2/bin/vivado -nolog -nojournal -mode batch -source
|
||||
<installRoot>/.xinstall/Vivado_2018.2/scripts/xlpartinfo.tcl -tclargs
|
||||
<installRoot>/Vivado/2018.2/data/parts/installed_devices.txt
|
||||
@ -419,21 +488,6 @@ You can download the toolchains for Windows and Linux
|
||||
```sh
|
||||
sudo apt-get install cmake
|
||||
````
|
||||
|
||||
## <a id="q7s-sysroot"></a> Getting the Q7S system root
|
||||
|
||||
It is necessary to copy the Q7S system root to your local development machine for libraries
|
||||
like `libgpio`. You can find the system root for the Q7S, the Raspberry Pi and the
|
||||
Beagle Bone Black for download here
|
||||
[here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/rootfs&fileid=831849).
|
||||
Download it and unzip it somewhere in the Xilinx installation folder.
|
||||
You can use the following command if `wget` can be used or for CI/CD:
|
||||
|
||||
```sh
|
||||
wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/SyXpdBBQX32xPgE/download/cortexa9hf-neon-xiphos-linux-gnueabi.tar.gz
|
||||
```
|
||||
|
||||
Then, create a new environmental variables `Q7S_SYSROOT` and set it to the local system root path.
|
||||
|
||||
### Updating system root for CI
|
||||
|
||||
@ -655,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
|
||||
* 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
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
4. Make sure th `tcf-agent` is running by checking `systemctl status tcf-agent`
|
||||
5. In Xilinx SDK 2018.2 right click on project → Debug As → Debug Configurations
|
||||
6. Right click Xilinx C/C++ applicaton (System Debugger) → New →
|
||||
7. Set Debug Type to Linux Application Debug and Connectin to Linux Agent
|
||||
@ -693,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)
|
||||
12. Select Application tab
|
||||
* Project Name: eive_obsw
|
||||
* Local File Path: Path to eiveobsw-linux.elf (in `_bin\linux\devel`)
|
||||
* Remote File Path: `/tmp/eive_obsw.elf`
|
||||
* Local File Path: Path to OBSW application image with debug symbols (non-stripped)
|
||||
* Remote File Path: `/tmp/<OBSW NAME>`
|
||||
|
||||
# <a id="file-transfer"></a> Transfering Files to the Q7S
|
||||
|
||||
@ -720,11 +746,15 @@ 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/>
|
||||
````
|
||||
|
||||
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
|
||||
|
||||
## Launching an application at start-up
|
||||
## Launching an application at start-up - deprecated
|
||||
|
||||
This way to enable auto-startup is deprecated. It is instead recommended to tweak the yocto
|
||||
recipes file for the related `systemd` service to enable auto-startup with `SYSTEMD_AUTO_ENABLE`.
|
||||
|
||||
You can also do the steps performed here on a host computer inside the `q7s-rootfs` directory
|
||||
of the [Q7S base repository](https://egit.irs.uni-stuttgart.de/eive/q7s-base). This might
|
||||
@ -826,10 +856,9 @@ If a timeout occurs, this special file will be deleted as well.
|
||||
The watchdog and its configuration will be directly integrated into this repostory, which
|
||||
makes adaptions easy.
|
||||
|
||||
### `tcfagent`
|
||||
### `tcf-agent`
|
||||
|
||||
This starts the `/usr/bin/agent` program to allows remote debugging. Might not be part of
|
||||
the mission code
|
||||
This starts the `/usr/bin/tcf-agent` program to allows remote debugging
|
||||
|
||||
### `eive-early-config`
|
||||
|
||||
@ -1098,16 +1127,28 @@ Eclipse indexer.
|
||||
|
||||
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
|
||||
Help → 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 → Perspective → Open Perspective and open the **Target Explorer Perspective**.
|
||||
4. Go to Window → Perspective → 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.
|
||||
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:
|
||||
|
||||
- Create a new **TCF Remote Application** by pressing the cogs button at the top or going to
|
||||
@ -1193,8 +1234,11 @@ Alternatively, changes from other upstreams (forks) and branches can be merged l
|
||||
in the same way.
|
||||
|
||||
# <a id="coding-style"></a> Coding Style
|
||||
|
||||
* 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 → Install New Software → Add
|
||||
2. In location insert the link http://www.cppstyle.com/luna
|
||||
3. The software package CppStyle should now be available for installation
|
||||
@ -1203,3 +1247,11 @@ in the same way.
|
||||
6. Insert the path to the clang-format executable
|
||||
7. Under C/C++ → Code Style → 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
|
||||
|
||||
## Setting up auto-fromatter with clang-format in eclipse
|
||||
1. Help → Eclipse market place → 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 → C/C++ → CppStyle
|
||||
4. Insert the path to the clang-format executable
|
||||
5. Under C/C++ → Code Style → 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
|
||||
|
@ -4,17 +4,24 @@ RUN apt-get update
|
||||
RUN apt-get --yes upgrade
|
||||
#tzdata is a dependency, won't install otherwise
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get --yes install cmake libgpiod-dev xz-utils nano curl git gcc g++ lcov valgrind libgps-dev
|
||||
RUN apt-get --yes install cmake libgpiod-dev xz-utils nano curl git gcc g++ lcov valgrind libgps-dev python3
|
||||
|
||||
# Q7S root filesystem, required for cross-compilation.
|
||||
RUN mkdir -p /usr/rootfs; \
|
||||
curl https://buggy.irs.uni-stuttgart.de/eive/tools/cortexa9hf-neon-xiphos-linux-gnueabi.tar.gz \
|
||||
| tar -xz -C /usr/rootfs
|
||||
ARG XIPHOS_SDK_NAME=sdk-xiphos-eive-v0.2.0
|
||||
# Install Xiphos ARK SDK, which also installs Q7S root filesystem, required for cross-compilation.
|
||||
RUN curl https://buggy.irs.uni-stuttgart.de/eive/tools/${XIPHOS_SDK_NAME}.tar | tar -x && \
|
||||
cd ${XIPHOS_SDK_NAME} && \
|
||||
./ark-glibc-x86_64-eive-image-cortexa9hf-neon-toolchain-nodistro.0.sh -y
|
||||
|
||||
# Cross compiler
|
||||
RUN mkdir -p /usr/tools; \
|
||||
curl https://buggy.irs.uni-stuttgart.de/eive/tools/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.gz \
|
||||
| tar -xz -C /usr/tools
|
||||
|
||||
ENV ZYNQ_7020_SYSROOT="/usr/rootfs/cortexa9hf-neon-xiphos-linux-gnueabi"
|
||||
RUN git clone https://github.com/catchorg/Catch2.git && \
|
||||
cd Catch2 && \
|
||||
git checkout v3.0.0-preview5 && \
|
||||
cmake -Bbuild -H. -DBUILD_TESTING=OFF && \
|
||||
cmake --build build/ --target install
|
||||
|
||||
ENV ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-linux-gnueabi"
|
||||
ENV PATH=$PATH:"/usr/tools/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin"
|
||||
|
6
automation/Jenkinsfile
vendored
6
automation/Jenkinsfile
vendored
@ -5,7 +5,7 @@ pipeline {
|
||||
}
|
||||
agent {
|
||||
docker {
|
||||
image 'eive-obsw-ci:d2'
|
||||
image 'eive-obsw-ci:d5'
|
||||
args '--sysctl fs.mqueue.msg_max=100'
|
||||
}
|
||||
}
|
||||
@ -24,11 +24,11 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Unittests') {
|
||||
stage('Build Host and Tests') {
|
||||
steps {
|
||||
dir(BUILDDIR_LINUX) {
|
||||
sh 'cmake ..'
|
||||
sh 'cmake --build . -t eive-unittest -j4'
|
||||
sh 'cmake --build . -j4'
|
||||
sh './eive-unittest'
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,3 @@
|
||||
target_sources(${OBSW_NAME} PUBLIC
|
||||
InitMission.cpp
|
||||
main.cpp
|
||||
ObjectFactory.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp)
|
||||
|
||||
add_subdirectory(boardconfig)
|
||||
|
@ -1,7 +1,3 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
print.c
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE 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,4 @@
|
||||
target_sources(${OBSW_NAME} PUBLIC
|
||||
InitMission.cpp
|
||||
main.cpp
|
||||
ObjectFactory.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp)
|
||||
|
||||
add_subdirectory(fsfwconfig)
|
||||
add_subdirectory(boardconfig)
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "InitMission.h"
|
||||
|
||||
#include <OBSWConfig.h>
|
||||
#include <bsp_hosted/fsfwconfig/pollingsequence/DummyPst.h>
|
||||
#include <fsfw/objectmanager/ObjectManager.h>
|
||||
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
@ -89,9 +90,13 @@ void initmission::initTasks() {
|
||||
sif::error << "Object add component failed" << std::endl;
|
||||
}
|
||||
|
||||
PeriodicTaskIF* pusEvents = factory->createPeriodicTask(
|
||||
"PUS_EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
||||
result = pusVerification->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||
PeriodicTaskIF* eventHandling = factory->createPeriodicTask(
|
||||
"EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
||||
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) {
|
||||
initmission::printAddObjectError("PUS5", objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||
}
|
||||
@ -106,6 +111,10 @@ void initmission::initTasks() {
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
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(
|
||||
"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);
|
||||
}
|
||||
|
||||
PeriodicTaskIF* testTask = factory->createPeriodicTask(
|
||||
"TEST_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||
PeriodicTaskIF* thermalTask = factory->createPeriodicTask(
|
||||
"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
|
||||
result = testTask->addComponent(objects::TEST_TASK);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
@ -144,11 +179,14 @@ void initmission::initTasks() {
|
||||
tmtcPollingTask->startTask();
|
||||
|
||||
pusVerification->startTask();
|
||||
pusEvents->startTask();
|
||||
eventHandling->startTask();
|
||||
pusHighPrio->startTask();
|
||||
pusMedPrio->startTask();
|
||||
pusLowPrio->startTask();
|
||||
|
||||
pstTask->startTask();
|
||||
thermalTask->startTask();
|
||||
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
testTask->startTask();
|
||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||
|
122
bsp_hosted/OBSWConfig.h.in
Normal file
122
bsp_hosted/OBSWConfig.h.in
Normal file
@ -0,0 +1,122 @@
|
||||
/**
|
||||
* @brief This file can be used to add preprocessor define for conditional
|
||||
* code inclusion exclusion or various other project constants and
|
||||
* properties in one place.
|
||||
*/
|
||||
#ifndef FSFWCONFIG_OBSWCONFIG_H_
|
||||
#define FSFWCONFIG_OBSWCONFIG_H_
|
||||
|
||||
#include "commonConfig.h"
|
||||
#include "OBSWVersion.h"
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be enabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
#define OBSW_ADD_STAR_TRACKER 0
|
||||
#define OBSW_ADD_PLOC_SUPERVISOR 0
|
||||
#define OBSW_ADD_PLOC_MPSOC 0
|
||||
#define OBSW_ADD_SUN_SENSORS 0
|
||||
#define OBSW_ADD_MGT 0
|
||||
#define OBSW_ADD_ACS_BOARD 0
|
||||
#define OBSW_ADD_ACS_HANDLERS 0
|
||||
#define OBSW_ADD_GPS_0 0
|
||||
#define OBSW_ADD_GPS_1 0
|
||||
#define OBSW_ADD_RW 0
|
||||
#define OBSW_ADD_BPX_BATTERY_HANDLER 0
|
||||
#define OBSW_ADD_RTD_DEVICES 0
|
||||
#define OBSW_ADD_PL_PCDU 0
|
||||
#define OBSW_ADD_TMP_DEVICES 0
|
||||
#define OBSW_ADD_RAD_SENSORS 0
|
||||
#define OBSW_ADD_SYRLINKS 0
|
||||
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
|
||||
|
||||
// This is a really tricky switch.. It initializes the PCDU switches to their default states
|
||||
// at powerup. I think it would be better
|
||||
// to leave it off for now. It makes testing a lot more difficult and it might mess with
|
||||
// something the operators might want to do by giving the software too much intelligence
|
||||
// at the wrong place. The system component might command all the Switches accordingly anyway
|
||||
#define OBSW_INITIALIZE_SWITCHES 0
|
||||
#define OBSW_ENABLE_PERIODIC_HK 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be disabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
// Can be used to switch device to NORMAL mode immediately
|
||||
#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1
|
||||
#define OBSW_PRINT_MISSED_DEADLINES 1
|
||||
|
||||
#define OBSW_SYRLINKS_SIMULATED 1
|
||||
#define OBSW_ADD_TEST_CODE 0
|
||||
#define OBSW_ADD_TEST_TASK 0
|
||||
#define OBSW_ADD_TEST_PST 0
|
||||
// If this is enabled, all other SPI code should be disabled
|
||||
#define OBSW_ADD_SPI_TEST_CODE 0
|
||||
// If this is enabled, all other I2C code should be disabled
|
||||
#define OBSW_ADD_I2C_TEST_CODE 0
|
||||
#define OBSW_ADD_UART_TEST_CODE 0
|
||||
|
||||
#define OBSW_TEST_ACS 0
|
||||
#define OBSW_DEBUG_ACS 0
|
||||
#define OBSW_TEST_SUS 0
|
||||
#define OBSW_DEBUG_SUS 0
|
||||
#define OBSW_TEST_RTD 0
|
||||
#define OBSW_DEBUG_RTD 0
|
||||
#define OBSW_TEST_RAD_SENSOR 0
|
||||
#define OBSW_DEBUG_RAD_SENSOR 0
|
||||
#define OBSW_TEST_PL_PCDU 0
|
||||
#define OBSW_DEBUG_PL_PCDU 0
|
||||
#define OBSW_TEST_BPX_BATT 0
|
||||
#define OBSW_DEBUG_BPX_BATT 0
|
||||
#define OBSW_TEST_IMTQ 0
|
||||
#define OBSW_DEBUG_IMTQ 0
|
||||
#define OBSW_TEST_RW 0
|
||||
#define OBSW_DEBUG_RW 0
|
||||
|
||||
#define OBSW_TEST_LIBGPIOD 0
|
||||
#define OBSW_TEST_PLOC_HANDLER 0
|
||||
#define OBSW_TEST_CCSDS_BRIDGE 0
|
||||
#define OBSW_TEST_CCSDS_PTME 0
|
||||
#define OBSW_TEST_TE7020_HEATER 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LABEL 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LINE_NAME 0
|
||||
#define OBSW_DEBUG_P60DOCK 0
|
||||
|
||||
#define OBSW_PRINT_CORE_HK 0
|
||||
#define OBSW_DEBUG_PDU1 0
|
||||
#define OBSW_DEBUG_PDU2 0
|
||||
#define OBSW_DEBUG_GPS 0
|
||||
#define OBSW_DEBUG_ACU 0
|
||||
#define OBSW_DEBUG_SYRLINKS 0
|
||||
|
||||
#define OBSW_DEBUG_PDEC_HANDLER 0
|
||||
#define OBSW_DEBUG_PLOC_SUPERVISOR 0
|
||||
#define OBSW_DEBUG_PLOC_MPSOC 0
|
||||
#define OBSW_DEBUG_STARTRACKER 0
|
||||
#define OBSW_TCP_SERVER_WIRETAPPING 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** CMake Defines */
|
||||
/*******************************************************************/
|
||||
#cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER
|
||||
|
||||
#cmakedefine LIBGPS_VERSION_MAJOR @LIBGPS_VERSION_MAJOR@
|
||||
#cmakedefine LIBGPS_VERSION_MINOR @LIBGPS_VERSION_MINOR@
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
#include "rpiConfig.h"
|
||||
#elif defined(XIPHOS_Q7S)
|
||||
#include "q7sConfig.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "objects/systemObjectList.h"
|
||||
#include "events/subsystemIdRanges.h"
|
||||
#include "returnvalues/classIds.h"
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* FSFWCONFIG_OBSWCONFIG_H_ */
|
@ -2,13 +2,15 @@
|
||||
|
||||
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||
#include <mission/controller/ThermalController.h>
|
||||
#include <mission/core/GenericFactory.h>
|
||||
#include <mission/utility/TmFunnel.h>
|
||||
#include <mission/tmtc/TmFunnel.h>
|
||||
#include <objects/systemObjectList.h>
|
||||
#include <tmtc/apid.h>
|
||||
#include <tmtc/pusIds.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw_tests/integration/task/TestTask.h"
|
||||
|
||||
#if OBSW_USE_TMTC_TCP_BRIDGE == 0
|
||||
#include "fsfw/osal/common/UdpTcPollingTask.h"
|
||||
@ -24,6 +26,24 @@
|
||||
#include <test/testtasks/TestTask.h>
|
||||
#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() {
|
||||
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
PusServiceBase::packetDestination = objects::TM_FUNNEL;
|
||||
@ -43,5 +63,31 @@ void ObjectFactory::produce(void* args) {
|
||||
Factory::setStaticFrameworkObjectIds();
|
||||
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
|
||||
print.c
|
||||
)
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
|
||||
target_sources(${OBSW_NAME} PRIVATE print.c)
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
@ -1,11 +0,0 @@
|
||||
# add main and others
|
||||
CXXSRC += $(wildcard $(CURRENTPATH)/*.cpp)
|
||||
CSRC += $(wildcard $(CURRENTPATH)/*.c)
|
||||
|
||||
CSRC += $(wildcard $(CURRENTPATH)/boardconfig/*.c)
|
||||
|
||||
CXXSRC += $(wildcard $(CURRENTPATH)/comIF/*.cpp)
|
||||
CSRC += $(wildcard $(CURRENTPATH)/comIF/*.c)
|
||||
|
||||
INCLUDES += $(CURRENTPATH)/boardconfig
|
||||
INCLUDES += $(CURRENTPATH)/fsfwconfig
|
@ -1,8 +1 @@
|
||||
target_sources(${TARGET_NAME} PUBLIC
|
||||
ArduinoComIF.cpp
|
||||
ArduinoCookie.cpp
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
target_sources(${OBSW_NAME} PUBLIC ArduinoComIF.cpp ArduinoCookie.cpp)
|
||||
|
@ -1,27 +1,17 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
ipc/MissionMessageTypes.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE ipc/MissionMessageTypes.cpp)
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# If a special translation file for object IDs exists, compile it.
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
objects/translateObjects.cpp
|
||||
)
|
||||
target_sources(${UNITTEST_NAME} PRIVATE
|
||||
objects/translateObjects.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE objects/translateObjects.cpp)
|
||||
target_sources(${UNITTEST_NAME} PRIVATE objects/translateObjects.cpp)
|
||||
endif()
|
||||
|
||||
# If a special translation file for events exists, compile it.
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
events/translateEvents.cpp
|
||||
)
|
||||
target_sources(${UNITTEST_NAME} PRIVATE
|
||||
events/translateEvents.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE events/translateEvents.cpp)
|
||||
target_sources(${UNITTEST_NAME} PRIVATE events/translateEvents.cpp)
|
||||
endif()
|
||||
|
||||
add_subdirectory(pollingsequence)
|
||||
|
@ -7,41 +7,41 @@
|
||||
//! Used to determine whether C++ ostreams are used which can increase
|
||||
//! the binary size significantly. If this is disabled,
|
||||
//! 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.
|
||||
#define FSFW_VERBOSE_LEVEL 1
|
||||
#define FSFW_VERBOSE_LEVEL 1
|
||||
|
||||
//! Can be used to completely disable printouts, even the C stdio ones.
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 0 && FSFW_VERBOSE_LEVEL == 0
|
||||
#define FSFW_DISABLE_PRINTOUT 0
|
||||
#define FSFW_DISABLE_PRINTOUT 0
|
||||
#endif
|
||||
|
||||
#define FSFW_USE_PUS_C_TELEMETRY 1
|
||||
#define FSFW_USE_PUS_C_TELEMETRY 1
|
||||
#define FSFW_USE_PUS_C_TELECOMMANDS 1
|
||||
|
||||
//! 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,
|
||||
//! additional output which requires the translation files translateObjects
|
||||
//! 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
|
||||
//! Specify whether info events are printed too.
|
||||
#define FSFW_DEBUG_INFO 1
|
||||
#include "objects/translateObjects.h"
|
||||
#define FSFW_DEBUG_INFO 1
|
||||
#include "events/translateEvents.h"
|
||||
#include "objects/translateObjects.h"
|
||||
#else
|
||||
#endif
|
||||
|
||||
//! 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.
|
||||
#define FSFW_NO_C99_IO 1
|
||||
#define FSFW_NO_C99_IO 1
|
||||
|
||||
//! 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.
|
||||
//! 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.
|
||||
static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240;
|
||||
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
|
||||
//! 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;
|
||||
|
||||
}
|
||||
} // namespace fsfwconfig
|
||||
|
||||
#endif /* CONFIG_FSFWCONFIG_H_ */
|
||||
|
@ -8,11 +8,13 @@
|
||||
|
||||
#include "commonConfig.h"
|
||||
|
||||
#define OBSW_ADD_TEST_CODE 1
|
||||
#define OBSW_PRINT_MISSED_DEADLINES 1
|
||||
|
||||
#define OBSW_ADD_TEST_CODE 1
|
||||
|
||||
/* These defines should be disabled for mission code but are useful for
|
||||
debugging. */
|
||||
#define OBSW_VEBOSE_LEVEL 1
|
||||
#define OBSW_VEBOSE_LEVEL 1
|
||||
|
||||
#define OBSW_USE_CCSDS_IP_CORE 0
|
||||
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
||||
@ -20,6 +22,12 @@ debugging. */
|
||||
// Set to 1 if telecommands are received via the PDEC IP Core
|
||||
#define OBSW_TC_FROM_PDEC 0
|
||||
|
||||
#define OBSW_SYRLINKS_SIMULATED 0
|
||||
|
||||
#define OBSW_INITIALIZE_SWITCHES 0
|
||||
|
||||
#define OBSW_TCP_SERVER_WIRETAPPING 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "objects/systemObjectList.h"
|
||||
|
@ -22,10 +22,11 @@ enum sourceObjects : uint32_t {
|
||||
|
||||
TEST_TASK = 0x42694269,
|
||||
DUMMY_INTERFACE = 0xCAFECAFE,
|
||||
DUMMY_HANDLER = 0x4400AFFE,
|
||||
|
||||
DUMMY_HANDLER = 0x44000001,
|
||||
/* 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 "systemObjectList.h"
|
||||
|
||||
const char *TEST_TASK_STRING = "TEST_TASK";
|
||||
const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER";
|
||||
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 *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END";
|
||||
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
||||
const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER";
|
||||
const char *NO_OBJECT_STRING = "NO_OBJECT";
|
||||
|
||||
const char *translateObject(object_id_t object) {
|
||||
@ -100,6 +103,8 @@ const char *translateObject(object_id_t object) {
|
||||
return FSFW_OBJECTS_END_STRING;
|
||||
case 0xCAFECAFE:
|
||||
return DUMMY_INTERFACE_STRING;
|
||||
case objects::THERMAL_CONTROLLER:
|
||||
return THERMAL_CONTROLLER_STRING;
|
||||
case 0xFFFFFFFF:
|
||||
return NO_OBJECT_STRING;
|
||||
default:
|
||||
|
1
bsp_hosted/fsfwconfig/pollingsequence/CMakeLists.txt
Normal file
1
bsp_hosted/fsfwconfig/pollingsequence/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE DummyPst.cpp)
|
140
bsp_hosted/fsfwconfig/pollingsequence/DummyPst.cpp
Normal file
140
bsp_hosted/fsfwconfig/pollingsequence/DummyPst.cpp
Normal file
@ -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;
|
||||
}
|
||||
}
|
14
bsp_hosted/fsfwconfig/pollingsequence/DummyPst.h
Normal file
14
bsp_hosted/fsfwconfig/pollingsequence/DummyPst.h
Normal file
@ -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,23 +0,0 @@
|
||||
#ifndef CONFIG_TMTC_PUSIDS_HPP_
|
||||
#define CONFIG_TMTC_PUSIDS_HPP_
|
||||
|
||||
namespace pus {
|
||||
enum Ids {
|
||||
PUS_SERVICE_1 = 1,
|
||||
PUS_SERVICE_2 = 2,
|
||||
PUS_SERVICE_3 = 3,
|
||||
PUS_SERVICE_3_PSB = 3,
|
||||
PUS_SERVICE_5 = 5,
|
||||
PUS_SERVICE_6 = 6,
|
||||
PUS_SERVICE_8 = 8,
|
||||
PUS_SERVICE_9 = 9,
|
||||
PUS_SERVICE_17 = 17,
|
||||
PUS_SERVICE_19 = 19,
|
||||
PUS_SERVICE_20 = 20,
|
||||
PUS_SERVICE_23 = 23,
|
||||
PUS_SERVICE_200 = 200,
|
||||
PUS_SERVICE_201 = 201,
|
||||
};
|
||||
};
|
||||
|
||||
#endif /* CONFIG_TMTC_PUSIDS_HPP_ */
|
@ -1,9 +1,17 @@
|
||||
#include <objects/systemObjectList.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "InitMission.h"
|
||||
#include "OBSWVersion.h"
|
||||
#include "commonConfig.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"
|
||||
|
||||
#ifdef WIN32
|
||||
static const char* COMPILE_PRINTOUT = "Windows";
|
||||
#elif LINUX
|
||||
@ -19,9 +27,9 @@ static const char* COMPILE_PRINTOUT = "unknown OS";
|
||||
int main(void) {
|
||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||
std::cout << "-- Compiled for " << COMPILE_PRINTOUT << " --" << std::endl;
|
||||
std::cout << "-- OBSW " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "."
|
||||
<< SW_REVISION << ", FSFW v" << FSFW_VERSION << "." << FSFW_SUBVERSION << "."
|
||||
<< FSFW_REVISION << "--" << std::endl;
|
||||
std::cout << "-- OBSW "
|
||||
<< "v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --"
|
||||
<< std::endl;
|
||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||
|
||||
initmission::initMission();
|
||||
|
@ -1,8 +1,5 @@
|
||||
target_sources(${OBSW_NAME} PUBLIC
|
||||
InitMission.cpp
|
||||
main.cpp
|
||||
ObjectFactory.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp gpioInit.cpp
|
||||
ObjectFactory.cpp)
|
||||
|
||||
add_subdirectory(boardconfig)
|
||||
add_subdirectory(boardtest)
|
||||
|
@ -192,7 +192,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
#if OBSW_ADD_SPI_TEST_CODE == 0
|
||||
FixedTimeslotTaskIF* spiPst = factory.createFixedTimeslotTask(
|
||||
"SPI_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 3.0, missedDeadlineFunc);
|
||||
"SPI_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc);
|
||||
result = pst::pstSpi(spiPst);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl;
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "fsfw/tasks/Typedef.h"
|
||||
#include "fsfw/tasks/definitions.h"
|
||||
|
||||
class PeriodicTaskIF;
|
||||
class TaskFactory;
|
||||
|
122
bsp_linux_board/OBSWConfig.h.in
Normal file
122
bsp_linux_board/OBSWConfig.h.in
Normal file
@ -0,0 +1,122 @@
|
||||
/**
|
||||
* @brief This file can be used to add preprocessor define for conditional
|
||||
* code inclusion exclusion or various other project constants and
|
||||
* properties in one place.
|
||||
*/
|
||||
#ifndef FSFWCONFIG_OBSWCONFIG_H_
|
||||
#define FSFWCONFIG_OBSWCONFIG_H_
|
||||
|
||||
#include "commonConfig.h"
|
||||
#include "OBSWVersion.h"
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be enabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
#define OBSW_ADD_STAR_TRACKER 0
|
||||
#define OBSW_ADD_PLOC_SUPERVISOR 0
|
||||
#define OBSW_ADD_PLOC_MPSOC 0
|
||||
#define OBSW_ADD_SUN_SENSORS 0
|
||||
#define OBSW_ADD_MGT 0
|
||||
#define OBSW_ADD_ACS_BOARD 0
|
||||
#define OBSW_ADD_ACS_HANDLERS 0
|
||||
#define OBSW_ADD_GPS_0 0
|
||||
#define OBSW_ADD_GPS_1 0
|
||||
#define OBSW_ADD_RW 0
|
||||
#define OBSW_ADD_BPX_BATTERY_HANDLER 0
|
||||
#define OBSW_ADD_RTD_DEVICES 0
|
||||
#define OBSW_ADD_PL_PCDU 0
|
||||
#define OBSW_ADD_TMP_DEVICES 0
|
||||
#define OBSW_ADD_RAD_SENSORS 0
|
||||
#define OBSW_ADD_SYRLINKS 0
|
||||
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
|
||||
|
||||
// This is a really tricky switch.. It initializes the PCDU switches to their default states
|
||||
// at powerup. I think it would be better
|
||||
// to leave it off for now. It makes testing a lot more difficult and it might mess with
|
||||
// something the operators might want to do by giving the software too much intelligence
|
||||
// at the wrong place. The system component might command all the Switches accordingly anyway
|
||||
#define OBSW_INITIALIZE_SWITCHES 0
|
||||
#define OBSW_ENABLE_PERIODIC_HK 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be disabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
// Can be used to switch device to NORMAL mode immediately
|
||||
#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1
|
||||
#define OBSW_PRINT_MISSED_DEADLINES 1
|
||||
|
||||
#define OBSW_SYRLINKS_SIMULATED 1
|
||||
#define OBSW_ADD_TEST_CODE 0
|
||||
#define OBSW_ADD_TEST_TASK 0
|
||||
#define OBSW_ADD_TEST_PST 0
|
||||
// If this is enabled, all other SPI code should be disabled
|
||||
#define OBSW_ADD_SPI_TEST_CODE 0
|
||||
// If this is enabled, all other I2C code should be disabled
|
||||
#define OBSW_ADD_I2C_TEST_CODE 0
|
||||
#define OBSW_ADD_UART_TEST_CODE 0
|
||||
|
||||
#define OBSW_TEST_ACS 0
|
||||
#define OBSW_DEBUG_ACS 0
|
||||
#define OBSW_TEST_SUS 0
|
||||
#define OBSW_DEBUG_SUS 0
|
||||
#define OBSW_TEST_RTD 0
|
||||
#define OBSW_DEBUG_RTD 0
|
||||
#define OBSW_TEST_RAD_SENSOR 0
|
||||
#define OBSW_DEBUG_RAD_SENSOR 0
|
||||
#define OBSW_TEST_PL_PCDU 0
|
||||
#define OBSW_DEBUG_PL_PCDU 0
|
||||
#define OBSW_TEST_BPX_BATT 0
|
||||
#define OBSW_DEBUG_BPX_BATT 0
|
||||
#define OBSW_TEST_IMTQ 0
|
||||
#define OBSW_DEBUG_IMTQ 0
|
||||
#define OBSW_TEST_RW 0
|
||||
#define OBSW_DEBUG_RW 0
|
||||
|
||||
#define OBSW_TEST_LIBGPIOD 0
|
||||
#define OBSW_TEST_PLOC_HANDLER 0
|
||||
#define OBSW_TEST_CCSDS_BRIDGE 0
|
||||
#define OBSW_TEST_CCSDS_PTME 0
|
||||
#define OBSW_TEST_TE7020_HEATER 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LABEL 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LINE_NAME 0
|
||||
#define OBSW_DEBUG_P60DOCK 0
|
||||
|
||||
#define OBSW_PRINT_CORE_HK 0
|
||||
#define OBSW_DEBUG_PDU1 0
|
||||
#define OBSW_DEBUG_PDU2 0
|
||||
#define OBSW_DEBUG_GPS 0
|
||||
#define OBSW_DEBUG_ACU 0
|
||||
#define OBSW_DEBUG_SYRLINKS 0
|
||||
|
||||
#define OBSW_DEBUG_PDEC_HANDLER 0
|
||||
#define OBSW_DEBUG_PLOC_SUPERVISOR 0
|
||||
#define OBSW_DEBUG_PLOC_MPSOC 0
|
||||
#define OBSW_DEBUG_STARTRACKER 0
|
||||
#define OBSW_TCP_SERVER_WIRETAPPING 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** CMake Defines */
|
||||
/*******************************************************************/
|
||||
#cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER
|
||||
|
||||
#cmakedefine LIBGPS_VERSION_MAJOR @LIBGPS_VERSION_MAJOR@
|
||||
#cmakedefine LIBGPS_VERSION_MINOR @LIBGPS_VERSION_MINOR@
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
#include "rpiConfig.h"
|
||||
#elif defined(XIPHOS_Q7S)
|
||||
#include "q7sConfig.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "objects/systemObjectList.h"
|
||||
#include "events/subsystemIdRanges.h"
|
||||
#include "returnvalues/classIds.h"
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* FSFWCONFIG_OBSWCONFIG_H_ */
|
@ -5,10 +5,13 @@
|
||||
#include "devices/addresses.h"
|
||||
#include "devices/gpioIds.h"
|
||||
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
|
||||
#include "fsfw/power/DummyPowerSwitcher.h"
|
||||
#include "fsfw/tasks/TaskFactory.h"
|
||||
#include "fsfw/tmtcpacket/pus/tm.h"
|
||||
#include "fsfw/tmtcservices/CommandingServiceBase.h"
|
||||
#include "fsfw/tmtcservices/PusServiceBase.h"
|
||||
#include "gpioInit.h"
|
||||
#include "linux/ObjectFactory.h"
|
||||
#include "linux/boardtest/LibgpiodTest.h"
|
||||
#include "linux/boardtest/SpiTestClass.h"
|
||||
#include "linux/boardtest/UartTestClass.h"
|
||||
@ -64,116 +67,127 @@ void ObjectFactory::produce(void* args) {
|
||||
GpioCookie* gpioCookie = nullptr;
|
||||
static_cast<void>(gpioCookie);
|
||||
|
||||
new SpiComIF(objects::SPI_COM_IF, gpioIF);
|
||||
SpiComIF* spiComIF = new SpiComIF(objects::SPI_MAIN_COM_IF, spi::DEV, gpioIF);
|
||||
static_cast<void>(spiComIF);
|
||||
auto pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0);
|
||||
static_cast<void>(pwrSwitcher);
|
||||
|
||||
std::string spiDev;
|
||||
SpiCookie* spiCookie = nullptr;
|
||||
static_cast<void>(spiCookie);
|
||||
|
||||
#if OBSW_ADD_ACS_BOARD == 1
|
||||
if (gpioCookie == nullptr) {
|
||||
gpioCookie = new GpioCookie();
|
||||
}
|
||||
// TODO: Missing pin for Gyro 2
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_0_LIS3_CS, gpio::MGM_0_BCM_PIN, "MGM_0_LIS3",
|
||||
gpio::Direction::OUT, 1);
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_1_RM3100_CS, gpio::MGM_1_BCM_PIN,
|
||||
"MGM_1_RM3100", gpio::Direction::OUT, 1);
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_2_LIS3_CS, gpio::MGM_2_BCM_PIN, "MGM_2_LIS3",
|
||||
gpio::Direction::OUT, 1);
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_3_RM3100_CS, gpio::MGM_3_BCM_PIN,
|
||||
"MGM_3_RM3100", gpio::Direction::OUT, 1);
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_0_ADIS_CS, gpio::GYRO_0_BCM_PIN,
|
||||
"GYRO_0_ADIS", gpio::Direction::OUT, 1);
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_1_L3G_CS, gpio::GYRO_1_BCM_PIN, "GYRO_1_L3G",
|
||||
gpio::Direction::OUT, 1);
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_2_ADIS_CS, gpio::GYRO_2_BCM_PIN,
|
||||
"GYRO_2_ADIS", gpio::Direction::OUT, 1);
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_3_L3G_CS, gpio::GYRO_3_BCM_PIN, "GYRO_3_L3G",
|
||||
gpio::Direction::OUT, 1);
|
||||
gpioIF->addGpios(gpioCookie);
|
||||
|
||||
spiDev = "/dev/spidev0.1";
|
||||
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, 0);
|
||||
mgmLis3Handler->setStartUpImmediately();
|
||||
#if FSFW_HAL_LIS3MDL_MGM_DEBUG == 1
|
||||
mgmLis3Handler->setToGoToNormalMode(true);
|
||||
#if OBSW_ADD_ACS_BOARD == 1 && defined(RASPBERRY_PI)
|
||||
createRpiAcsBoard(gpioIF, spiDev);
|
||||
#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, 0);
|
||||
mgmRm3100Handler->setStartUpImmediately();
|
||||
#if FSFW_HAL_RM3100_MGM_DEBUG == 1
|
||||
mgmRm3100Handler->setToGoToNormalMode(true);
|
||||
#if OBSW_ADD_SUN_SENSORS == 1 || defined(OBSW_ADD_RTD_DEVICES)
|
||||
#ifdef RASPBERRY_PI
|
||||
rpi::gpio::initSpiCsDecoder(gpioIF);
|
||||
#endif
|
||||
#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, 0);
|
||||
mgmLis3Handler->setStartUpImmediately();
|
||||
#if FSFW_HAL_LIS3MDL_MGM_DEBUG == 1
|
||||
mgmLis3Handler->setToGoToNormalMode(true);
|
||||
#if OBSW_ADD_SUN_SENSORS == 1
|
||||
createSunSensorComponents(gpioIF, spiComIF, pwrSwitcher, spi::DEV);
|
||||
#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, 0);
|
||||
mgmRm3100Handler->setStartUpImmediately();
|
||||
#if FSFW_HAL_RM3100_MGM_DEBUG == 1
|
||||
mgmRm3100Handler->setToGoToNormalMode(true);
|
||||
#if OBSW_ADD_RTD_DEVICES == 1
|
||||
createRtdComponents(spi::DEV, gpioIF, pwrSwitcher);
|
||||
#endif
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev,
|
||||
ADIS16507::MAXIMUM_REPLY_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
auto adisHandler =
|
||||
new GyroADIS16507Handler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF, spiCookie);
|
||||
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);
|
||||
auto gyroL3gHandler =
|
||||
new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF, spiCookie, 0);
|
||||
gyroL3gHandler->setStartUpImmediately();
|
||||
#if FSFW_HAL_L3GD20_GYRO_DEBUG == 1
|
||||
gyroL3gHandler->setToGoToNormalMode(true);
|
||||
#endif
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, spiDev,
|
||||
ADIS16507::MAXIMUM_REPLY_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
adisHandler =
|
||||
new GyroADIS16507Handler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_COM_IF, spiCookie);
|
||||
adisHandler->setStartUpImmediately();
|
||||
|
||||
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, 0);
|
||||
gyroL3gHandler->setStartUpImmediately();
|
||||
#if FSFW_HAL_L3GD20_GYRO_DEBUG == 1
|
||||
gyroL3gHandler->setToGoToNormalMode(true);
|
||||
#endif
|
||||
|
||||
#endif /* RPI_TEST_ACS_BOARD == 1 */
|
||||
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
createTestTasks();
|
||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||
}
|
||||
|
||||
void ObjectFactory::createRpiAcsBoard(GpioIF* gpioIF, std::string spiDev) {
|
||||
GpioCookie* gpioCookie = new GpioCookie();
|
||||
// TODO: Missing pin for Gyro 2
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_0_LIS3_CS, gpio::MGM_0_BCM_PIN, "MGM_0_LIS3",
|
||||
gpio::Direction::OUT, gpio::Levels::HIGH);
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_1_RM3100_CS, gpio::MGM_1_BCM_PIN,
|
||||
"MGM_1_RM3100", gpio::Direction::OUT, gpio::Levels::HIGH);
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_2_LIS3_CS, gpio::MGM_2_BCM_PIN, "MGM_2_LIS3",
|
||||
gpio::Direction::OUT, gpio::Levels::HIGH);
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_3_RM3100_CS, gpio::MGM_3_BCM_PIN,
|
||||
"MGM_3_RM3100", gpio::Direction::OUT, gpio::Levels::HIGH);
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_0_ADIS_CS, gpio::GYRO_0_BCM_PIN,
|
||||
"GYRO_0_ADIS", gpio::Direction::OUT, gpio::Levels::HIGH);
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_1_L3G_CS, gpio::GYRO_1_BCM_PIN, "GYRO_1_L3G",
|
||||
gpio::Direction::OUT, gpio::Levels::HIGH);
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_2_ADIS_CS, gpio::GYRO_2_BCM_PIN,
|
||||
"GYRO_2_ADIS", gpio::Direction::OUT, gpio::Levels::HIGH);
|
||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_3_L3G_CS, gpio::GYRO_3_BCM_PIN, "GYRO_3_L3G",
|
||||
gpio::Direction::OUT, gpio::Levels::HIGH);
|
||||
gpioIF->addGpios(gpioCookie);
|
||||
SpiCookie* spiCookie =
|
||||
new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||
auto mgmLis3Handler =
|
||||
new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
|
||||
mgmLis3Handler->setStartUpImmediately();
|
||||
#if OBSW_TEST_ACS == 1
|
||||
mgmLis3Handler->setToGoToNormalMode(true);
|
||||
#endif
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, RM3100::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||
auto mgmRm3100Handler =
|
||||
new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
|
||||
mgmRm3100Handler->setStartUpImmediately();
|
||||
#if OBSW_TEST_ACS == 1
|
||||
mgmRm3100Handler->setToGoToNormalMode(true);
|
||||
#endif
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||
mgmLis3Handler =
|
||||
new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
|
||||
mgmLis3Handler->setStartUpImmediately();
|
||||
#if OBSW_TEST_ACS == 1
|
||||
mgmLis3Handler->setToGoToNormalMode(true);
|
||||
#endif
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, RM3100::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||
mgmRm3100Handler =
|
||||
new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
|
||||
mgmRm3100Handler->setStartUpImmediately();
|
||||
#if OBSW_TEST_ACS == 1
|
||||
mgmRm3100Handler->setToGoToNormalMode(true);
|
||||
#endif
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE,
|
||||
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 =
|
||||
new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
|
||||
gyroL3gHandler->setStartUpImmediately();
|
||||
#if OBSW_TEST_ACS == 1
|
||||
gyroL3gHandler->setToGoToNormalMode(true);
|
||||
#endif
|
||||
|
||||
spiCookie =
|
||||
new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE,
|
||||
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_MAIN_COM_IF,
|
||||
spiCookie, ADIS1650X::Type::ADIS16505);
|
||||
adisHandler->setStartUpImmediately();
|
||||
|
||||
spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, L3GD20H::MAX_BUFFER_SIZE,
|
||||
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||
gyroL3gHandler =
|
||||
new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, 0);
|
||||
gyroL3gHandler->setStartUpImmediately();
|
||||
#if OBSW_TEST_ACS == 1
|
||||
gyroL3gHandler->setToGoToNormalMode(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ObjectFactory::createTestTasks() {
|
||||
new TestTask(objects::TEST_TASK);
|
||||
|
||||
|
@ -1,10 +1,15 @@
|
||||
#ifndef BSP_LINUX_OBJECTFACTORY_H_
|
||||
#define BSP_LINUX_OBJECTFACTORY_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
class GpioIF;
|
||||
|
||||
namespace ObjectFactory {
|
||||
void setStatics();
|
||||
void produce(void* args);
|
||||
|
||||
void createRpiAcsBoard(GpioIF* gpioIF, std::string spiDev);
|
||||
void createTestTasks();
|
||||
}; // namespace ObjectFactory
|
||||
|
||||
|
@ -1,7 +1,3 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
print.c
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE print.c)
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
@ -17,16 +17,4 @@
|
||||
|
||||
#define RPI_ADD_UART_TEST 0
|
||||
|
||||
/* Adapt these values accordingly */
|
||||
namespace gpio {
|
||||
static constexpr uint8_t MGM_0_BCM_PIN = 17;
|
||||
static constexpr uint8_t MGM_1_BCM_PIN = 27;
|
||||
static constexpr uint8_t MGM_2_BCM_PIN = 22;
|
||||
static constexpr uint8_t MGM_3_BCM_PIN = 23;
|
||||
static constexpr uint8_t GYRO_0_BCM_PIN = 5;
|
||||
static constexpr uint8_t GYRO_1_BCM_PIN = 6;
|
||||
static constexpr uint8_t GYRO_2_BCM_PIN = 13;
|
||||
static constexpr uint8_t GYRO_3_BCM_PIN = 19;
|
||||
}
|
||||
|
||||
#endif /* BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_ */
|
||||
|
@ -1,6 +1 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
target_sources(${OBSW_NAME} PRIVATE)
|
||||
|
37
bsp_linux_board/definitions.h
Normal file
37
bsp_linux_board/definitions.h
Normal file
@ -0,0 +1,37 @@
|
||||
#ifndef BSP_LINUX_BOARD_DEFINITIONS_H_
|
||||
#define BSP_LINUX_BOARD_DEFINITIONS_H_
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
|
||||
namespace spi {
|
||||
|
||||
static constexpr char DEV[] = "/dev/spidev0.1";
|
||||
|
||||
}
|
||||
|
||||
/* Adapt these values accordingly */
|
||||
namespace gpio {
|
||||
static constexpr uint8_t MGM_0_BCM_PIN = 17;
|
||||
static constexpr uint8_t MGM_1_BCM_PIN = 27;
|
||||
static constexpr uint8_t MGM_2_BCM_PIN = 22;
|
||||
static constexpr uint8_t MGM_3_BCM_PIN = 23;
|
||||
static constexpr uint8_t GYRO_0_BCM_PIN = 5;
|
||||
static constexpr uint8_t GYRO_1_BCM_PIN = 6;
|
||||
static constexpr uint8_t GYRO_2_BCM_PIN = 13;
|
||||
static constexpr uint8_t GYRO_3_BCM_PIN = 19;
|
||||
|
||||
static constexpr uint8_t SPI_MUX_0_BCM = 17;
|
||||
static constexpr uint8_t SPI_MUX_1_BCM = 27;
|
||||
static constexpr uint8_t SPI_MUX_2_BCM = 22;
|
||||
static constexpr uint8_t SPI_MUX_3_BCM = 23;
|
||||
static constexpr uint8_t SPI_MUX_4_BCM = 5;
|
||||
static constexpr uint8_t SPI_MUX_5_BCM = 6;
|
||||
} // namespace gpio
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* BSP_LINUX_BOARD_DEFINITIONS_H_ */
|
56
bsp_linux_board/gpioInit.cpp
Normal file
56
bsp_linux_board/gpioInit.cpp
Normal file
@ -0,0 +1,56 @@
|
||||
#include "gpioInit.h"
|
||||
|
||||
#include <devices/gpioIds.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
#include <fsfw_hal/common/gpio/GpioCookie.h>
|
||||
#include <fsfw_hal/common/gpio/GpioIF.h>
|
||||
|
||||
#include "definitions.h"
|
||||
#include "fsfw_hal/linux/rpi/GpioRPi.h"
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
|
||||
struct MuxInfo {
|
||||
MuxInfo(gpioId_t gpioId, int bcmNum, std::string consumer)
|
||||
: gpioId(gpioId), bcmNum(bcmNum), consumer(consumer) {}
|
||||
gpioId_t gpioId;
|
||||
int bcmNum;
|
||||
std::string consumer;
|
||||
};
|
||||
|
||||
void rpi::gpio::initSpiCsDecoder(GpioIF* gpioComIF) {
|
||||
using namespace ::gpio;
|
||||
ReturnValue_t result;
|
||||
|
||||
if (gpioComIF == nullptr) {
|
||||
sif::debug << "initSpiCsDecoder: Invalid gpioComIF" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
std::array<::MuxInfo, 6> muxInfo{
|
||||
MuxInfo(gpioIds::SPI_MUX_BIT_0, SPI_MUX_0_BCM, "SPI_MUX_0"),
|
||||
MuxInfo(gpioIds::SPI_MUX_BIT_1, SPI_MUX_1_BCM, "SPI_MUX_1"),
|
||||
MuxInfo(gpioIds::SPI_MUX_BIT_2, SPI_MUX_2_BCM, "SPI_MUX_2"),
|
||||
MuxInfo(gpioIds::SPI_MUX_BIT_3, SPI_MUX_3_BCM, "SPI_MUX_3"),
|
||||
MuxInfo(gpioIds::SPI_MUX_BIT_4, SPI_MUX_4_BCM, "SPI_MUX_4"),
|
||||
MuxInfo(gpioIds::SPI_MUX_BIT_5, SPI_MUX_5_BCM, "SPI_MUX_5"),
|
||||
};
|
||||
GpioCookie* spiMuxGpios = new GpioCookie;
|
||||
|
||||
for (const auto& info : muxInfo) {
|
||||
result = createRpiGpioConfig(spiMuxGpios, info.gpioId, info.bcmNum, info.consumer,
|
||||
Direction::OUT, Levels::LOW);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "Creating Raspberry Pi SPI Mux GPIO failed with code " << result << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
result = gpioComIF->addGpios(spiMuxGpios);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "initSpiCsDecoder: Failed to add mux bit gpios to gpioComIF" << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
20
bsp_linux_board/gpioInit.h
Normal file
20
bsp_linux_board/gpioInit.h
Normal file
@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
class GpioIF;
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
namespace rpi {
|
||||
namespace gpio {
|
||||
|
||||
/**
|
||||
* @brief This function initializes the GPIOs used to control the SN74LVC138APWR decoders on
|
||||
* the TCS Board and the interface board.
|
||||
*/
|
||||
void initSpiCsDecoder(GpioIF* gpioComIF);
|
||||
|
||||
} // namespace gpio
|
||||
} // namespace rpi
|
||||
|
||||
#endif
|
@ -22,7 +22,7 @@ int main(void) {
|
||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||
std::cout << "-- Compiled for Linux board " << BOARD_NAME << " --" << std::endl;
|
||||
std::cout << "-- OBSW " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "."
|
||||
<< SW_REVISION << ", FSFW v" << fsfw::FSFW_VERSION << "--" << std::endl;
|
||||
<< SW_REVISION << ", FSFW v" << fsfw::FSFW_VERSION << " --" << std::endl;
|
||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||
|
||||
initmission::initMission();
|
||||
|
@ -1,25 +1,26 @@
|
||||
#simple mode
|
||||
# simple mode
|
||||
add_executable(${SIMPLE_OBSW_NAME} EXCLUDE_FROM_ALL)
|
||||
target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE")
|
||||
target_sources(${SIMPLE_OBSW_NAME} PUBLIC
|
||||
main.cpp
|
||||
)
|
||||
#I think this is unintentional? (produces linker errors for stuff in /linux)
|
||||
target_link_libraries(${SIMPLE_OBSW_NAME} PUBLIC
|
||||
${LIB_FSFW_NAME}
|
||||
)
|
||||
target_sources(${SIMPLE_OBSW_NAME} PUBLIC main.cpp)
|
||||
# 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")
|
||||
add_subdirectory(simple)
|
||||
|
||||
target_sources(${OBSW_NAME} PUBLIC
|
||||
main.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PUBLIC main.cpp obsw.cpp)
|
||||
|
||||
add_subdirectory(boardtest)
|
||||
|
||||
add_subdirectory(boardconfig)
|
||||
add_subdirectory(comIF)
|
||||
add_subdirectory(core)
|
||||
|
||||
if(EIVE_Q7S_EM)
|
||||
add_subdirectory(em)
|
||||
else()
|
||||
target_sources(${OBSW_NAME} PUBLIC fmObjectFactory.cpp)
|
||||
endif()
|
||||
|
||||
add_subdirectory(memory)
|
||||
add_subdirectory(callbacks)
|
||||
add_subdirectory(xadc)
|
||||
|
127
bsp_q7s/OBSWConfig.h.in
Normal file
127
bsp_q7s/OBSWConfig.h.in
Normal file
@ -0,0 +1,127 @@
|
||||
/**
|
||||
* @brief This file can be used to add preprocessor define for conditional
|
||||
* code inclusion exclusion or various other project constants and
|
||||
* properties in one place.
|
||||
*/
|
||||
#ifndef FSFWCONFIG_OBSWCONFIG_H_
|
||||
#define FSFWCONFIG_OBSWCONFIG_H_
|
||||
|
||||
#include "commonConfig.h"
|
||||
#include "q7sConfig.h"
|
||||
#include "OBSWVersion.h"
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be enabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
#define OBSW_USE_CCSDS_IP_CORE 1
|
||||
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
||||
#define OBSW_TM_TO_PTME 0
|
||||
// Set to 1 if telecommands are received via the PDEC IP Core
|
||||
#define OBSW_TC_FROM_PDEC 0
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
#define OBSW_ADD_GOMSPACE_PCDU @OBSW_ADD_GOMSPACE_PCDU@
|
||||
#define OBSW_ADD_MGT @OBSW_ADD_MGT@
|
||||
#define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@
|
||||
#define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@
|
||||
#define OBSW_ADD_PLOC_SUPERVISOR 1
|
||||
#define OBSW_ADD_PLOC_MPSOC 1
|
||||
#define OBSW_ADD_SUN_SENSORS @OBSW_ADD_SUN_SENSORS@
|
||||
#define OBSW_ADD_SUS_BOARD_ASS @OBSW_ADD_SUS_BOARD_ASS@
|
||||
#define OBSW_ADD_ACS_BOARD @OBSW_ADD_ACS_BOARD@
|
||||
#define OBSW_ADD_ACS_HANDLERS @OBSW_ADD_ACS_HANDLERS@
|
||||
#define OBSW_ADD_RW @OBSW_ADD_RW@
|
||||
#define OBSW_ADD_RTD_DEVICES @OBSW_ADD_RTD_DEVICES@
|
||||
#define OBSW_ADD_TMP_DEVICES @OBSW_ADD_TMP_DEVICES@
|
||||
#define OBSW_ADD_RAD_SENSORS @OBSW_ADD_RAD_SENSORS@
|
||||
#define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@
|
||||
#define OBSW_ADD_SYRLINKS @OBSW_ADD_SYRLINKS@
|
||||
#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
|
||||
// at powerup. I think it would be better
|
||||
// to leave it off for now. It makes testing a lot more difficult and it might mess with
|
||||
// something the operators might want to do by giving the software too much intelligence
|
||||
// at the wrong place. The system component might command all the Switches accordingly anyway
|
||||
#define OBSW_INITIALIZE_SWITCHES 0
|
||||
#define OBSW_ENABLE_PERIODIC_HK 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be disabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
// Can be used to switch device to NORMAL mode immediately
|
||||
#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1
|
||||
#define OBSW_PRINT_MISSED_DEADLINES 1
|
||||
|
||||
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
|
||||
#define OBSW_SYRLINKS_SIMULATED 1
|
||||
#define OBSW_ADD_TEST_CODE 0
|
||||
#define OBSW_ADD_TEST_TASK 0
|
||||
#define OBSW_ADD_TEST_PST 0
|
||||
// If this is enabled, all other SPI code should be disabled
|
||||
#define OBSW_ADD_SPI_TEST_CODE 0
|
||||
// If this is enabled, all other I2C code should be disabled
|
||||
#define OBSW_ADD_I2C_TEST_CODE 0
|
||||
#define OBSW_ADD_UART_TEST_CODE 0
|
||||
|
||||
#define OBSW_TEST_ACS 0
|
||||
#define OBSW_DEBUG_ACS 0
|
||||
#define OBSW_TEST_SUS 0
|
||||
#define OBSW_DEBUG_SUS 0
|
||||
#define OBSW_TEST_RTD 0
|
||||
#define OBSW_DEBUG_RTD 0
|
||||
#define OBSW_TEST_RAD_SENSOR 0
|
||||
#define OBSW_DEBUG_RAD_SENSOR 0
|
||||
#define OBSW_TEST_PL_PCDU 0
|
||||
#define OBSW_DEBUG_PL_PCDU 0
|
||||
#define OBSW_TEST_BPX_BATT 0
|
||||
#define OBSW_DEBUG_BPX_BATT 0
|
||||
#define OBSW_TEST_IMTQ 0
|
||||
#define OBSW_DEBUG_IMTQ 0
|
||||
#define OBSW_TEST_RW 0
|
||||
#define OBSW_DEBUG_RW 0
|
||||
|
||||
#define OBSW_TEST_LIBGPIOD 0
|
||||
#define OBSW_TEST_PLOC_HANDLER 0
|
||||
#define OBSW_TEST_CCSDS_BRIDGE 0
|
||||
#define OBSW_TEST_CCSDS_PTME 0
|
||||
#define OBSW_TEST_TE7020_HEATER 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LABEL 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LINE_NAME 0
|
||||
#define OBSW_DEBUG_P60DOCK 0
|
||||
|
||||
#define OBSW_PRINT_CORE_HK 0
|
||||
#define OBSW_DEBUG_PDU1 0
|
||||
#define OBSW_DEBUG_PDU2 0
|
||||
#define OBSW_DEBUG_GPS 0
|
||||
#define OBSW_DEBUG_ACU 0
|
||||
#define OBSW_DEBUG_SYRLINKS 0
|
||||
|
||||
#define OBSW_DEBUG_PDEC_HANDLER 0
|
||||
#define OBSW_DEBUG_PLOC_SUPERVISOR 0
|
||||
#define OBSW_DEBUG_PLOC_MPSOC 0
|
||||
#define OBSW_DEBUG_STARTRACKER 0
|
||||
|
||||
#define OBSW_TCP_SERVER_WIRETAPPING 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** CMake Defines */
|
||||
/*******************************************************************/
|
||||
#cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER
|
||||
|
||||
#cmakedefine LIBGPS_VERSION_MAJOR @LIBGPS_VERSION_MAJOR@
|
||||
#cmakedefine LIBGPS_VERSION_MINOR @LIBGPS_VERSION_MINOR@
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "objects/systemObjectList.h"
|
||||
#include "events/subsystemIdRanges.h"
|
||||
#include "returnvalues/classIds.h"
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* FSFWCONFIG_OBSWCONFIG_H_ */
|
@ -1,12 +1,5 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
print.c
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE print.c)
|
||||
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
|
||||
print.c
|
||||
)
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE print.c)
|
||||
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
@ -4,20 +4,22 @@
|
||||
namespace q7s {
|
||||
|
||||
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 I2C_DEFAULT_DEV[] = "/dev/i2c-eive";
|
||||
|
||||
static constexpr char UART_GNSS_DEV[] = "/dev/ul-gps";
|
||||
static constexpr char UART_GNSS_DEV[] = "/dev/gps0";
|
||||
static constexpr char UART_PLOC_MPSOC_DEV[] = "/dev/ul-plmpsoc";
|
||||
static constexpr char UART_PLOC_SUPERVSIOR_DEV[] = "/dev/ul-plsv";
|
||||
static constexpr char UART_SYRLINKS_DEV[] = "/dev/ul-syrlinks";
|
||||
static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ul-str";
|
||||
|
||||
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 char UIO_PTME[] = "/dev/uio1";
|
||||
static constexpr int MAP_ID_PTME_CONFIG = 3;
|
||||
|
||||
namespace uiomapids {
|
||||
@ -84,6 +86,7 @@ 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";
|
||||
static constexpr char SYRLINKS_FAULT[] = "syrlinks_fault";
|
||||
|
||||
static constexpr char PL_PCDU_ENABLE_VBAT0[] = "enable_plpcdu_vbat0";
|
||||
static constexpr char PL_PCDU_ENABLE_VBAT1[] = "enable_plpcdu_vbat1";
|
||||
|
@ -34,5 +34,6 @@ SOFTWARE.
|
||||
|
||||
#define ETL_CPP11_SUPPORTED 1
|
||||
#define ETL_NO_NULLPTR_SUPPORT 0
|
||||
#define ETL_HAS_ERROR_ON_STRING_TRUNCATION 1
|
||||
|
||||
#endif
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#define OBSW_Q7S_EM @OBSW_Q7S_EM@
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be enabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
@ -1,10 +1,5 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
FileSystemTest.cpp
|
||||
Q7STestTask.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE FileSystemTest.cpp Q7STestTask.cpp)
|
||||
|
||||
if(EIVE_BUILD_Q7S_SIMPLE_MODE)
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
|
||||
FileSystemTest.cpp
|
||||
)
|
||||
endif()
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE FileSystemTest.cpp)
|
||||
endif()
|
||||
|
@ -23,8 +23,9 @@
|
||||
Q7STestTask::Q7STestTask(object_id_t objectId) : TestTask(objectId) {
|
||||
doTestSdCard = false;
|
||||
doTestScratchApi = false;
|
||||
doTestGps = false;
|
||||
doTestXadc = true;
|
||||
doTestGpsShm = false;
|
||||
doTestGpsSocket = false;
|
||||
doTestXadc = false;
|
||||
}
|
||||
|
||||
ReturnValue_t Q7STestTask::performOneShotAction() {
|
||||
@ -36,15 +37,20 @@ ReturnValue_t Q7STestTask::performOneShotAction() {
|
||||
}
|
||||
// testJsonLibDirect();
|
||||
// testDummyParams();
|
||||
// testProtHandler();
|
||||
if (doTestProtHandler) {
|
||||
testProtHandler();
|
||||
}
|
||||
FsOpCodes opCode = FsOpCodes::APPEND_TO_FILE;
|
||||
testFileSystemHandlerDirect(opCode);
|
||||
return TestTask::performOneShotAction();
|
||||
}
|
||||
|
||||
ReturnValue_t Q7STestTask::performPeriodicAction() {
|
||||
if (doTestGps) {
|
||||
testGpsDaemon();
|
||||
if (doTestGpsShm) {
|
||||
testGpsDaemonShm();
|
||||
}
|
||||
if (doTestGpsSocket) {
|
||||
testGpsDaemonSocket();
|
||||
}
|
||||
if (doTestXadc) {
|
||||
xadcTest();
|
||||
@ -238,15 +244,19 @@ void Q7STestTask::testProtHandler() {
|
||||
}
|
||||
}
|
||||
|
||||
void Q7STestTask::testGpsDaemon() {
|
||||
gpsmm gpsmm(GPSD_SHARED_MEMORY, 0);
|
||||
void Q7STestTask::testGpsDaemonShm() {
|
||||
gpsmm gpsmm(GPSD_SHARED_MEMORY, "");
|
||||
gps_data_t* gps;
|
||||
gps = gpsmm.read();
|
||||
if (gps == nullptr) {
|
||||
sif::warning << "Q7STestTask: Reading GPS data failed" << std::endl;
|
||||
}
|
||||
sif::info << "-- Q7STestTask: GPS shared memory read test --" << std::endl;
|
||||
#if LIBGPS_VERSION_MINOR <= 17
|
||||
time_t timeRaw = gps->fix.time;
|
||||
#else
|
||||
time_t timeRaw = gps->fix.time.tv_sec;
|
||||
#endif
|
||||
std::tm* time = gmtime(&timeRaw);
|
||||
sif::info << "Time: " << std::put_time(time, "%c %Z") << std::endl;
|
||||
sif::info << "Visible satellites: " << gps->satellites_visible << std::endl;
|
||||
@ -254,10 +264,76 @@ void Q7STestTask::testGpsDaemon() {
|
||||
sif::info << "Fix (0:Not Seen|1:No Fix|2:2D|3:3D): " << gps->fix.mode << std::endl;
|
||||
sif::info << "Latitude: " << gps->fix.latitude << std::endl;
|
||||
sif::info << "Longitude: " << gps->fix.longitude << std::endl;
|
||||
#if LIBGPS_VERSION_MINOR <= 17
|
||||
sif::info << "Altitude(MSL): " << gps->fix.altitude << std::endl;
|
||||
#else
|
||||
sif::info << "Altitude(MSL): " << gps->fix.altMSL << std::endl;
|
||||
#endif
|
||||
sif::info << "Speed(m/s): " << gps->fix.speed << std::endl;
|
||||
}
|
||||
|
||||
void Q7STestTask::testGpsDaemonSocket() {
|
||||
if (gpsmmShmPtr == nullptr) {
|
||||
gpsmmShmPtr = new gpsmm("localhost", DEFAULT_GPSD_PORT);
|
||||
}
|
||||
// The data from the device will generally be read all at once. Therefore, we
|
||||
// can set all field here
|
||||
if (not gpsmmShmPtr->is_open()) {
|
||||
if (gpsNotOpenSwitch) {
|
||||
// Opening failed
|
||||
#if FSFW_VERBOSE_LEVEL >= 1
|
||||
sif::warning << "Q7STestTask::testGpsDaemonSocket: Opening GPSMM failed | "
|
||||
<< "Error " << errno << " | " << gps_errstr(errno) << std::endl;
|
||||
#endif
|
||||
|
||||
gpsNotOpenSwitch = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Stopwatch watch;
|
||||
gps_data_t* gps = nullptr;
|
||||
gpsmmShmPtr->stream(WATCH_ENABLE | WATCH_JSON);
|
||||
if (not gpsmmShmPtr->waiting(50000000)) {
|
||||
return;
|
||||
}
|
||||
gps = gpsmmShmPtr->read();
|
||||
if (gps == nullptr) {
|
||||
if (gpsReadFailedSwitch) {
|
||||
gpsReadFailedSwitch = false;
|
||||
sif::warning << "Q7STestTask::testGpsDaemonSocket: Reading GPS data failed" << std::endl;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (MODE_SET != (MODE_SET & gps->set)) {
|
||||
if (noModeSetCntr >= 0) {
|
||||
noModeSetCntr++;
|
||||
}
|
||||
if (noModeSetCntr == 10) {
|
||||
// TODO: Trigger event here
|
||||
sif::warning << "Q7STestTask::testGpsDaemonSocket: No mode could be "
|
||||
"read for 10 consecutive reads"
|
||||
<< std::endl;
|
||||
noModeSetCntr = -1;
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
noModeSetCntr = 0;
|
||||
}
|
||||
sif::info << "-- Q7STestTask: GPS socket read test --" << std::endl;
|
||||
#if LIBGPS_VERSION_MINOR <= 17
|
||||
time_t timeRaw = gps->fix.time;
|
||||
#else
|
||||
time_t timeRaw = gps->fix.time.tv_sec;
|
||||
#endif
|
||||
std::tm* time = gmtime(&timeRaw);
|
||||
sif::info << "Time: " << std::put_time(time, "%c %Z") << std::endl;
|
||||
sif::info << "Visible satellites: " << gps->satellites_visible << std::endl;
|
||||
sif::info << "Satellites used: " << gps->satellites_used << std::endl;
|
||||
sif::info << "Fix (0:Not Seen|1:No Fix|2:2D|3:3D): " << gps->fix.mode << std::endl;
|
||||
sif::info << "Latitude: " << gps->fix.latitude << std::endl;
|
||||
sif::info << "Longitude: " << gps->fix.longitude << std::endl;
|
||||
}
|
||||
|
||||
void Q7STestTask::testFileSystemHandlerDirect(FsOpCodes opCode) {
|
||||
auto fsHandler = ObjectManager::instance()->get<FileSystemHandler>(objects::FILE_SYSTEM_HANDLER);
|
||||
if (fsHandler == nullptr) {
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef BSP_Q7S_BOARDTEST_Q7STESTTASK_H_
|
||||
#define BSP_Q7S_BOARDTEST_Q7STESTTASK_H_
|
||||
|
||||
#include <libgpsmm.h>
|
||||
|
||||
#include "test/testtasks/TestTask.h"
|
||||
|
||||
class CoreController;
|
||||
@ -14,14 +16,22 @@ class Q7STestTask : public TestTask {
|
||||
private:
|
||||
bool doTestSdCard = false;
|
||||
bool doTestScratchApi = false;
|
||||
bool doTestGps = false;
|
||||
bool doTestGpsShm = false;
|
||||
bool doTestGpsSocket = false;
|
||||
bool doTestProtHandler = false;
|
||||
bool doTestXadc = false;
|
||||
|
||||
bool gpsNotOpenSwitch = false;
|
||||
bool gpsReadFailedSwitch = false;
|
||||
int32_t noModeSetCntr = 0;
|
||||
gpsmm* gpsmmShmPtr = nullptr;
|
||||
|
||||
CoreController* coreController = nullptr;
|
||||
ReturnValue_t performOneShotAction() override;
|
||||
ReturnValue_t performPeriodicAction() override;
|
||||
|
||||
void testGpsDaemon();
|
||||
void testGpsDaemonShm();
|
||||
void testGpsDaemonSocket();
|
||||
|
||||
void testSdCard();
|
||||
void fileTests();
|
||||
|
@ -1,6 +1,2 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
rwSpiCallback.cpp
|
||||
gnssCallback.cpp
|
||||
pcduSwitchCb.cpp
|
||||
gpioCallbacks.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE rwSpiCallback.cpp gnssCallback.cpp
|
||||
pcduSwitchCb.cpp q7sGpioCallbacks.cpp)
|
||||
|
@ -1,9 +1,14 @@
|
||||
#include "gnssCallback.h"
|
||||
|
||||
#include "devices/gpioIds.h"
|
||||
#include "fsfw/action/HasActionsIF.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);
|
||||
if (args == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
@ -12,11 +17,10 @@ ReturnValue_t gps::triggerGpioResetPin(void* args) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
gpioId_t gpioId;
|
||||
if (resetArgs->gnss1) {
|
||||
gpioId = gpioIds::GNSS_1_NRESET;
|
||||
|
||||
} else {
|
||||
if (actionData[0] == 0) {
|
||||
gpioId = gpioIds::GNSS_0_NRESET;
|
||||
} else {
|
||||
gpioId = gpioIds::GNSS_1_NRESET;
|
||||
}
|
||||
resetArgs->gpioComIF->pullLow(gpioId);
|
||||
TaskFactory::delayTask(resetArgs->waitPeriodMs);
|
||||
|
@ -5,14 +5,13 @@
|
||||
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
|
||||
|
||||
struct ResetArgs {
|
||||
bool gnss1 = false;
|
||||
LinuxLibgpioIF* gpioComIF = nullptr;
|
||||
uint32_t waitPeriodMs = 100;
|
||||
};
|
||||
|
||||
namespace gps {
|
||||
|
||||
ReturnValue_t triggerGpioResetPin(void* args);
|
||||
ReturnValue_t triggerGpioResetPin(const uint8_t* actionData, size_t len, void* args);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,487 +0,0 @@
|
||||
#include "gpioCallbacks.h"
|
||||
|
||||
#include <devices/gpioIds.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
#include <fsfw_hal/common/gpio/GpioCookie.h>
|
||||
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
|
||||
|
||||
#include "busConf.h"
|
||||
|
||||
namespace gpioCallbacks {
|
||||
|
||||
GpioIF* gpioComInterface;
|
||||
|
||||
void initSpiCsDecoder(GpioIF* gpioComIF) {
|
||||
using namespace gpio;
|
||||
ReturnValue_t result;
|
||||
|
||||
if (gpioComIF == nullptr) {
|
||||
sif::debug << "initSpiCsDecoder: Invalid gpioComIF" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
gpioComInterface = gpioComIF;
|
||||
|
||||
GpioCookie* spiMuxGpios = new GpioCookie;
|
||||
|
||||
GpiodRegularByLineName* spiMuxBit = nullptr;
|
||||
/** Setting mux bit 1 to low will disable IC21 on the interface board */
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_0_PIN, "SPI Mux Bit 1",
|
||||
Direction::OUT, Levels::HIGH);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_0, spiMuxBit);
|
||||
/** Setting mux bit 2 to low disables IC1 on the TCS board */
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_1_PIN, "SPI Mux Bit 2",
|
||||
Direction::OUT, Levels::HIGH);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_1, spiMuxBit);
|
||||
/** Setting mux bit 3 to low disables IC2 on the TCS board and IC22 on the interface board */
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_2_PIN, "SPI Mux Bit 3",
|
||||
Direction::OUT, Levels::LOW);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_2, spiMuxBit);
|
||||
|
||||
/** The following gpios can take arbitrary initial values */
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_3_PIN, "SPI Mux Bit 4",
|
||||
Direction::OUT, Levels::LOW);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_3, spiMuxBit);
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_4_PIN, "SPI Mux Bit 5",
|
||||
Direction::OUT, Levels::LOW);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_4, spiMuxBit);
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_5_PIN, "SPI Mux Bit 6",
|
||||
Direction::OUT, Levels::LOW);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_5, spiMuxBit);
|
||||
GpiodRegularByLineName* enRwDecoder = new GpiodRegularByLineName(
|
||||
q7s::gpioNames::EN_RW_CS, "EN_RW_CS", Direction::OUT, Levels::HIGH);
|
||||
spiMuxGpios->addGpio(gpioIds::EN_RW_CS, enRwDecoder);
|
||||
|
||||
result = gpioComInterface->addGpios(spiMuxGpios);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "initSpiCsDecoder: Failed to add mux bit gpios to gpioComIF" << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, gpio::Levels value,
|
||||
void* args) {
|
||||
using namespace gpio;
|
||||
if (gpioComInterface == nullptr) {
|
||||
sif::debug << "spiCsDecoderCallback: No gpioComIF specified. Call initSpiCsDecoder "
|
||||
<< "to specify gpioComIF" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Reading is not supported by the callback function */
|
||||
if (gpioOp == gpio::GpioOperation::READ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (value == Levels::HIGH) {
|
||||
switch (gpioId) {
|
||||
case (gpioIds::RTD_IC_3): {
|
||||
disableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_4): {
|
||||
disableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_5): {
|
||||
disableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_6): {
|
||||
disableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_7): {
|
||||
disableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_8): {
|
||||
disableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_9): {
|
||||
disableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_10): {
|
||||
disableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_11): {
|
||||
disableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_12): {
|
||||
disableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_13): {
|
||||
disableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_14): {
|
||||
disableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_15): {
|
||||
disableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_16): {
|
||||
disableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_17): {
|
||||
disableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_18): {
|
||||
disableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_0): {
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_1): {
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_2): {
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_3): {
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_4): {
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_5): {
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_6): {
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_7): {
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_8): {
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_9): {
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_10): {
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_11): {
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_RW1): {
|
||||
disableRwDecoder();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_RW2): {
|
||||
disableRwDecoder();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_RW3): {
|
||||
disableRwDecoder();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_RW4): {
|
||||
disableRwDecoder();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
sif::debug << "spiCsDecoderCallback: Invalid gpio id " << gpioId << std::endl;
|
||||
}
|
||||
} else if (value == Levels::LOW) {
|
||||
switch (gpioId) {
|
||||
case (gpioIds::RTD_IC_3): {
|
||||
selectY7();
|
||||
enableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_4): {
|
||||
selectY6();
|
||||
enableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_5): {
|
||||
selectY5();
|
||||
enableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_6): {
|
||||
selectY4();
|
||||
enableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_7): {
|
||||
selectY3();
|
||||
enableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_8): {
|
||||
selectY2();
|
||||
enableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_9): {
|
||||
selectY1();
|
||||
enableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_10): {
|
||||
selectY0();
|
||||
enableDecoderTcsIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_11): {
|
||||
selectY7();
|
||||
enableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_12): {
|
||||
selectY6();
|
||||
enableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_13): {
|
||||
selectY5();
|
||||
enableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_14): {
|
||||
selectY4();
|
||||
enableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_15): {
|
||||
selectY3();
|
||||
enableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_16): {
|
||||
selectY2();
|
||||
enableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_17): {
|
||||
selectY1();
|
||||
enableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::RTD_IC_18): {
|
||||
selectY0();
|
||||
enableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_0): {
|
||||
selectY0();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_1): {
|
||||
selectY1();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_2): {
|
||||
selectY2();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_3): {
|
||||
selectY3();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_4): {
|
||||
selectY4();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_5): {
|
||||
selectY5();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_6): {
|
||||
selectY0();
|
||||
enableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_7): {
|
||||
selectY1();
|
||||
enableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_8): {
|
||||
selectY2();
|
||||
enableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_9): {
|
||||
selectY3();
|
||||
enableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_10): {
|
||||
selectY4();
|
||||
enableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_11): {
|
||||
selectY5();
|
||||
enableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_RW1): {
|
||||
selectY0();
|
||||
enableRwDecoder();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_RW2): {
|
||||
selectY1();
|
||||
enableRwDecoder();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_RW3): {
|
||||
selectY2();
|
||||
enableRwDecoder();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_RW4): {
|
||||
selectY3();
|
||||
enableRwDecoder();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
sif::debug << "spiCsDecoderCallback: Invalid gpio id " << gpioId << std::endl;
|
||||
}
|
||||
} else {
|
||||
sif::debug << "spiCsDecoderCallback: Invalid value. Must be 0 or 1" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void enableDecoderTcsIc1() {
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
}
|
||||
|
||||
void enableDecoderTcsIc2() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
|
||||
}
|
||||
|
||||
void enableDecoderInterfaceBoardIc1() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
}
|
||||
|
||||
void enableDecoderInterfaceBoardIc2() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2);
|
||||
}
|
||||
|
||||
void disableDecoderTcsIc1() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
}
|
||||
|
||||
void disableDecoderTcsIc2() {
|
||||
// DO NOT CHANGE THE ORDER HERE
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
|
||||
}
|
||||
|
||||
void disableDecoderInterfaceBoardIc1() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
}
|
||||
|
||||
void disableDecoderInterfaceBoardIc2() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
}
|
||||
|
||||
void enableRwDecoder() { gpioComInterface->pullHigh(gpioIds::EN_RW_CS); }
|
||||
|
||||
void disableRwDecoder() { gpioComInterface->pullLow(gpioIds::EN_RW_CS); }
|
||||
|
||||
void selectY0() {
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5);
|
||||
}
|
||||
|
||||
void selectY1() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5);
|
||||
}
|
||||
|
||||
void selectY2() {
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5);
|
||||
}
|
||||
|
||||
void selectY3() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5);
|
||||
}
|
||||
|
||||
void selectY4() {
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5);
|
||||
}
|
||||
|
||||
void selectY5() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5);
|
||||
}
|
||||
|
||||
void selectY6() {
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5);
|
||||
}
|
||||
|
||||
void selectY7() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5);
|
||||
}
|
||||
|
||||
void disableAllDecoder() {
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullLow(gpioIds::EN_RW_CS);
|
||||
}
|
||||
|
||||
} // namespace gpioCallbacks
|
@ -10,8 +10,8 @@ void pcdu::switchCallback(GOMSPACE::Pdu pdu, uint8_t channel, bool state, void*
|
||||
return;
|
||||
}
|
||||
if (pdu == GOMSPACE::Pdu::PDU1) {
|
||||
PDU1::SwitchChannels typedChannel = static_cast<PDU1::SwitchChannels>(channel);
|
||||
if (typedChannel == PDU1::SwitchChannels::ACS_A_SIDE) {
|
||||
PDU1::Channels typedChannel = static_cast<PDU1::Channels>(channel);
|
||||
if (typedChannel == PDU1::Channels::ACS_A_SIDE) {
|
||||
if (state) {
|
||||
gpioComIF->pullHigh(gpioIds::GNSS_0_NRESET);
|
||||
} else {
|
||||
@ -20,8 +20,8 @@ void pcdu::switchCallback(GOMSPACE::Pdu pdu, uint8_t channel, bool state, void*
|
||||
}
|
||||
|
||||
} else if (pdu == GOMSPACE::Pdu::PDU2) {
|
||||
PDU2::SwitchChannels typedChannel = static_cast<PDU2::SwitchChannels>(channel);
|
||||
if (typedChannel == PDU2::SwitchChannels::ACS_B_SIDE) {
|
||||
PDU2::Channels typedChannel = static_cast<PDU2::Channels>(channel);
|
||||
if (typedChannel == PDU2::Channels::ACS_B_SIDE) {
|
||||
if (state) {
|
||||
gpioComIF->pullHigh(gpioIds::GNSS_1_NRESET);
|
||||
} else {
|
||||
|
54
bsp_q7s/callbacks/q7sGpioCallbacks.cpp
Normal file
54
bsp_q7s/callbacks/q7sGpioCallbacks.cpp
Normal file
@ -0,0 +1,54 @@
|
||||
#include "q7sGpioCallbacks.h"
|
||||
|
||||
#include <devices/gpioIds.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
#include <fsfw_hal/common/gpio/GpioCookie.h>
|
||||
#include <fsfw_hal/common/gpio/GpioIF.h>
|
||||
|
||||
#include "busConf.h"
|
||||
|
||||
void q7s::gpioCallbacks::initSpiCsDecoder(GpioIF* gpioComIF) {
|
||||
using namespace gpio;
|
||||
ReturnValue_t result;
|
||||
|
||||
if (gpioComIF == nullptr) {
|
||||
sif::debug << "initSpiCsDecoder: Invalid gpioComIF" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
GpioCookie* spiMuxGpios = new GpioCookie;
|
||||
|
||||
GpiodRegularByLineName* spiMuxBit = nullptr;
|
||||
/** Setting mux bit 1 to low will disable IC21 on the interface board */
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_0_PIN, "SPI Mux Bit 1",
|
||||
Direction::OUT, Levels::HIGH);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_0, spiMuxBit);
|
||||
/** Setting mux bit 2 to low disables IC1 on the TCS board */
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_1_PIN, "SPI Mux Bit 2",
|
||||
Direction::OUT, Levels::HIGH);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_1, spiMuxBit);
|
||||
/** Setting mux bit 3 to low disables IC2 on the TCS board and IC22 on the interface board */
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_2_PIN, "SPI Mux Bit 3",
|
||||
Direction::OUT, Levels::LOW);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_2, spiMuxBit);
|
||||
|
||||
/** The following gpios can take arbitrary initial values */
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_3_PIN, "SPI Mux Bit 4",
|
||||
Direction::OUT, Levels::LOW);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_3, spiMuxBit);
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_4_PIN, "SPI Mux Bit 5",
|
||||
Direction::OUT, Levels::LOW);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_4, spiMuxBit);
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_5_PIN, "SPI Mux Bit 6",
|
||||
Direction::OUT, Levels::LOW);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_5, spiMuxBit);
|
||||
GpiodRegularByLineName* enRwDecoder = new GpiodRegularByLineName(
|
||||
q7s::gpioNames::EN_RW_CS, "EN_RW_CS", Direction::OUT, Levels::HIGH);
|
||||
spiMuxGpios->addGpio(gpioIds::EN_RW_CS, enRwDecoder);
|
||||
|
||||
result = gpioComIF->addGpios(spiMuxGpios);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "initSpiCsDecoder: Failed to add SPI MUX bit GPIOs" << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
15
bsp_q7s/callbacks/q7sGpioCallbacks.h
Normal file
15
bsp_q7s/callbacks/q7sGpioCallbacks.h
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
class GpioIF;
|
||||
|
||||
namespace q7s {
|
||||
namespace gpioCallbacks {
|
||||
|
||||
/**
|
||||
* @brief This function initializes the GPIOs used to control the SN74LVC138APWR decoders on
|
||||
* the TCS Board and the interface board.
|
||||
*/
|
||||
void initSpiCsDecoder(GpioIF* gpioComIF);
|
||||
|
||||
} // namespace gpioCallbacks
|
||||
} // namespace q7s
|
@ -1,5 +1,7 @@
|
||||
#include "rwSpiCallback.h"
|
||||
|
||||
#include <fsfw/timemanager/Stopwatch.h>
|
||||
|
||||
#include "devices/gpioIds.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
#include "fsfw_hal/linux/UnixFileGuard.h"
|
||||
@ -8,8 +10,25 @@
|
||||
|
||||
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,
|
||||
size_t sendLen, void* args) {
|
||||
// Stopwatch watch;
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
uint8_t writeBuffer[2];
|
||||
uint8_t writeBuffer[2] = {};
|
||||
uint8_t writeSize = 0;
|
||||
|
||||
gpioId_t gpioId = cookie->getChipSelectPin();
|
||||
GpioIF* gpioIF = comIf->getGpioInterface();
|
||||
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
||||
uint32_t timeoutMs = 0;
|
||||
MutexIF* mutex = comIf->getMutex(&timeoutType, &timeoutMs);
|
||||
MutexIF* mutex = comIf->getCsMutex();
|
||||
cookie->getMutexParams(timeoutType, timeoutMs);
|
||||
if (mutex == nullptr or gpioIF == nullptr) {
|
||||
sif::debug << "rwSpiCallback::spiCallback: Mutex or GPIO interface invalid" << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
||||
int fileDescriptor = 0;
|
||||
std::string device = cookie->getSpiDevice();
|
||||
UnixFileGuard fileHelper(device, &fileDescriptor, O_RDWR, "rwSpiCallback::spiCallback");
|
||||
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);
|
||||
const std::string& dev = comIf->getSpiDev();
|
||||
result = openSpi(dev, O_RDWR, gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::debug << "rwSpiCallback::spiCallback: Failed to lock mutex" << std::endl;
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Sending frame start sign */
|
||||
writeBuffer[0] = 0x7E;
|
||||
writeSize = 1;
|
||||
|
||||
// Pull SPI CS low. For now, no support for active high given
|
||||
if (gpioId != gpio::NO_GPIO) {
|
||||
if (gpioIF->pullLow(gpioId) != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Failed to pull chip select low" << std::endl;
|
||||
}
|
||||
spi::SpiModes spiMode = spi::SpiModes::MODE_0;
|
||||
uint32_t spiSpeed = 0;
|
||||
cookie->getSpiParameters(spiMode, spiSpeed, nullptr);
|
||||
// We are in protected section, so we can use the static variable here without issues.
|
||||
// We don't need to set the speed because a SPI core is used, but the mode has to be set once
|
||||
// correctly for all RWs
|
||||
if (not MODE_SET) {
|
||||
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)) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
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)) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
return RwHandler::SPI_WRITE_FAILURE;
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
|
||||
/** Sending frame end sign */
|
||||
writeBuffer[0] = 0x7E;
|
||||
writeBuffer[0] = FLAG_BYTE;
|
||||
writeSize = 1;
|
||||
|
||||
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
return RwHandler::SPI_WRITE_FAILURE;
|
||||
}
|
||||
|
||||
uint8_t* rxBuf = nullptr;
|
||||
result = comIf->getReadBuffer(cookie->getSpiAddress(), &rxBuf);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
return result;
|
||||
}
|
||||
|
||||
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);
|
||||
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.
|
||||
@ -123,13 +142,13 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
||||
for (int idx = 0; idx < 10; idx++) {
|
||||
if (read(fileDescriptor, &byteRead, 1) != 1) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Read failed" << std::endl;
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
return RwHandler::SPI_READ_FAILURE;
|
||||
}
|
||||
if (idx == 0) {
|
||||
if (byteRead != FLAG_BYTE) {
|
||||
sif::error << "Invalid data, expected start marker" << std::endl;
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
return RwHandler::NO_START_MARKER;
|
||||
}
|
||||
}
|
||||
@ -140,7 +159,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
||||
|
||||
if (idx == 9) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Empty frame timeout" << std::endl;
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
return RwHandler::NO_REPLY;
|
||||
}
|
||||
}
|
||||
@ -180,7 +199,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
||||
continue;
|
||||
} else {
|
||||
sif::error << "rwSpiCallback::spiCallback: Invalid substitute" << std::endl;
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
result = RwHandler::INVALID_SUBSTITUTE;
|
||||
break;
|
||||
}
|
||||
@ -201,8 +220,9 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
||||
result = RwHandler::SPI_READ_FAILURE;
|
||||
break;
|
||||
}
|
||||
if (byteRead != 0x7E) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Missing end sign 0x7E" << std::endl;
|
||||
if (byteRead != FLAG_BYTE) {
|
||||
sif::error << "rwSpiCallback::spiCallback: Missing end sign " << static_cast<int>(FLAG_BYTE)
|
||||
<< std::endl;
|
||||
decodedFrameLen--;
|
||||
result = RwHandler::MISSING_END_SIGN;
|
||||
break;
|
||||
@ -213,12 +233,40 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
||||
|
||||
cookie->setTransferSize(decodedFrameLen);
|
||||
|
||||
closeSpi(gpioId, gpioIF, mutex);
|
||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
||||
|
||||
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 (gpioIF->pullHigh(gpioId) != HasReturnvaluesIF::RETURN_OK) {
|
||||
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
|
||||
|
@ -33,14 +33,5 @@ static constexpr uint8_t FLAG_BYTE = 0x7E;
|
||||
ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData,
|
||||
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
|
||||
#endif /* BSP_Q7S_RW_SPI_CALLBACK_H_ */
|
||||
|
@ -1,6 +1 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
target_sources(${OBSW_NAME} PRIVATE)
|
||||
|
@ -1,10 +1,4 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
CoreController.cpp
|
||||
obsw.cpp
|
||||
InitMission.cpp
|
||||
ObjectFactory.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE CoreController.cpp InitMission.cpp
|
||||
ObjectFactory.cpp)
|
||||
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
|
||||
InitMission.cpp
|
||||
)
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE InitMission.cpp)
|
||||
|
@ -1,13 +1,14 @@
|
||||
#include "CoreController.h"
|
||||
|
||||
#include <fsfw/events/EventManager.h>
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "OBSWVersion.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
#include "fsfw/timemanager/Stopwatch.h"
|
||||
#include "fsfw/version.h"
|
||||
#include "watchdogConf.h"
|
||||
#include "watchdog/definitions.h"
|
||||
#if OBSW_USE_TMTC_TCP_BRIDGE == 0
|
||||
#include "fsfw/osal/common/UdpTmTcBridge.h"
|
||||
#else
|
||||
@ -16,17 +17,22 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <filesystem>
|
||||
|
||||
#include "bsp_q7s/memory/SdCardManager.h"
|
||||
#include "bsp_q7s/memory/scratchApi.h"
|
||||
#include "bsp_q7s/xadc/Xadc.h"
|
||||
#include "linux/utility/utility.h"
|
||||
|
||||
xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP;
|
||||
xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY;
|
||||
|
||||
CoreController::CoreController(object_id_t objectId)
|
||||
: ExtendedControllerBase(objectId, objects::NO_OBJECT, 5), opDivider(5), hkSet(this) {
|
||||
: ExtendedControllerBase(objectId, objects::NO_OBJECT, 5),
|
||||
opDivider5(5),
|
||||
opDivider10(10),
|
||||
hkSet(this) {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
try {
|
||||
result = initWatchdogFifo();
|
||||
@ -50,6 +56,8 @@ CoreController::CoreController(object_id_t objectId)
|
||||
} catch (const std::filesystem::filesystem_error &e) {
|
||||
sif::error << "CoreController::CoreController: Failed with exception " << e.what() << std::endl;
|
||||
}
|
||||
sdCardCheckCd.timeOut();
|
||||
eventQueue = QueueFactory::instance()->createMessageQueue(5, EventMessage::MAX_MESSAGE_SIZE);
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) {
|
||||
@ -57,10 +65,26 @@ ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) {
|
||||
}
|
||||
|
||||
void CoreController::performControlOperation() {
|
||||
EventMessage event;
|
||||
for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == RETURN_OK;
|
||||
result = eventQueue->receiveMessage(&event)) {
|
||||
switch (event.getEvent()) {
|
||||
case (GpsHyperion::GPS_FIX_CHANGE): {
|
||||
gpsFix = static_cast<GpsHyperion::FixMode>(event.getParameter2());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
performWatchdogControlOperation();
|
||||
sdStateMachine();
|
||||
performMountedSdCardOperations();
|
||||
if (sdCardCheckCd.hasTimedOut()) {
|
||||
performSdCardCheck();
|
||||
sdCardCheckCd.resetTimer();
|
||||
}
|
||||
readHkData();
|
||||
opDivider5.checkAndIncrement();
|
||||
opDivider10.checkAndIncrement();
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
@ -68,6 +92,7 @@ ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &local
|
||||
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}));
|
||||
poolManager.subscribeForPeriodicPacket(hkSet.getSid(), false, 10.0, false);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
@ -79,8 +104,10 @@ LocalPoolDataSetBase *CoreController::getDataSetHandle(sid_t sid) {
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::initialize() {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
|
||||
ReturnValue_t result = ExtendedControllerBase::initialize();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "CoreController::initialize: Base init failed" << std::endl;
|
||||
}
|
||||
result = scratch::writeNumber(scratch::ALLOC_FAILURE_COUNT, 0);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "CoreController::initialize: Setting up alloc failure "
|
||||
@ -91,11 +118,30 @@ ReturnValue_t CoreController::initialize() {
|
||||
sdStateMachine();
|
||||
|
||||
triggerEvent(REBOOT_SW, CURRENT_CHIP, CURRENT_COPY);
|
||||
return ExtendedControllerBase::initialize();
|
||||
EventManagerIF *eventManager =
|
||||
ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
|
||||
if (eventManager == nullptr or eventQueue == nullptr) {
|
||||
sif::warning << "CoreController::initialize: No valid event manager found or "
|
||||
"queue invalid"
|
||||
<< std::endl;
|
||||
}
|
||||
result = eventManager->registerListener(eventQueue->getId());
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "CoreController::initialize: Registering as event listener failed" << std::endl;
|
||||
}
|
||||
result = eventManager->subscribeToEvent(eventQueue->getId(),
|
||||
event::getEventId(GpsHyperion::GPS_FIX_CHANGE));
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "Subscribing for GPS GPS_FIX_CHANGE event failed" << std::endl;
|
||||
}
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::initializeAfterTaskCreation() {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
sdInfo.pref = sdcMan->getPreferredSdCard();
|
||||
sdcMan->setActiveSdCard(sdInfo.pref);
|
||||
currMntPrefix = sdcMan->getCurrentMountPrefix();
|
||||
if (BLOCKING_SD_INIT) {
|
||||
ReturnValue_t result = initSdCardBlocking();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK and result != SdCardManager::ALREADY_MOUNTED) {
|
||||
@ -109,7 +155,7 @@ ReturnValue_t CoreController::initializeAfterTaskCreation() {
|
||||
}
|
||||
// Add script folder to path
|
||||
char *currentEnvPath = getenv("PATH");
|
||||
std::string updatedEnvPath = std::string(currentEnvPath) + ":/home/root/scripts";
|
||||
std::string updatedEnvPath = std::string(currentEnvPath) + ":/home/root/scripts:/usr/local/bin";
|
||||
setenv("PATH", updatedEnvPath.c_str(), true);
|
||||
updateProtInfo();
|
||||
initPrint();
|
||||
@ -127,7 +173,7 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
|
||||
if (size < 1) {
|
||||
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
|
||||
parseRebootFile(path, rebootFile);
|
||||
if (data[0] == 0) {
|
||||
@ -167,15 +213,20 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
|
||||
if (size < 1) {
|
||||
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
|
||||
parseRebootFile(path, rebootFile);
|
||||
rebootFile.maxCount = data[0];
|
||||
rewriteRebootFile(rebootFile);
|
||||
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): {
|
||||
return actionPerformReboot(data, size);
|
||||
// Warning: This function will never return, because it reboots the system
|
||||
return actionReboot(data, size);
|
||||
}
|
||||
default: {
|
||||
return HasActionsIF::INVALID_ACTION_ID;
|
||||
@ -199,13 +250,12 @@ ReturnValue_t CoreController::initSdCardBlocking() {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
#else
|
||||
|
||||
result = sdcMan->getSdCardActiveStatus(sdInfo.currentState);
|
||||
result = sdcMan->getSdCardsStatus(sdInfo.currentState);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "Getting SD card activity status failed" << std::endl;
|
||||
}
|
||||
|
||||
#if Q7S_SD_CARD_CONFIG == Q7S_SD_COLD_REDUNDANT
|
||||
determinePreferredSdCard();
|
||||
updateSdInfoOther();
|
||||
sif::info << "Cold redundant SD card configuration, preferred SD card: "
|
||||
<< static_cast<int>(sdInfo.pref) << std::endl;
|
||||
@ -286,8 +336,8 @@ ReturnValue_t CoreController::sdStateMachine() {
|
||||
|
||||
if (sdInfo.state == SdStates::SET_STATE_SELF) {
|
||||
if (not sdInfo.commandExecuted) {
|
||||
result = sdcMan->getSdCardActiveStatus(sdInfo.currentState);
|
||||
determinePreferredSdCard();
|
||||
result = sdcMan->getSdCardsStatus(sdInfo.currentState);
|
||||
sdInfo.pref = sdcMan->getPreferredSdCard();
|
||||
updateSdInfoOther();
|
||||
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;
|
||||
@ -430,7 +480,7 @@ ReturnValue_t CoreController::sdStateMachine() {
|
||||
sdInfo.state = SdStates::IDLE;
|
||||
sdInfo.cycleCount = 0;
|
||||
sdcMan->setBlocking(false);
|
||||
sdcMan->getSdCardActiveStatus(sdInfo.currentState);
|
||||
sdcMan->getSdCardsStatus(sdInfo.currentState);
|
||||
if (not sdInfo.initFinished) {
|
||||
updateSdInfoOther();
|
||||
sdInfo.initFinished = true;
|
||||
@ -639,8 +689,7 @@ ReturnValue_t CoreController::initVersionFile() {
|
||||
fsfw::FSFW_VERSION.getVersion(versionString, sizeof(versionString));
|
||||
std::string fullFsfwVersionString = "FSFW: v" + std::string(versionString);
|
||||
std::string systemString = "System: " + unameLine;
|
||||
std::string mountPrefix = SdCardManager::instance()->getCurrentMountPrefix();
|
||||
std::string versionFilePath = mountPrefix + VERSION_FILE;
|
||||
std::string versionFilePath = currMntPrefix + VERSION_FILE;
|
||||
std::fstream versionFile;
|
||||
|
||||
if (not std::filesystem::exists(versionFilePath)) {
|
||||
@ -808,25 +857,18 @@ void CoreController::initPrint() {
|
||||
#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) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
bool rebootSameBootCopy = data[0];
|
||||
bool protOpPerformed;
|
||||
bool protOpPerformed = false;
|
||||
SdCardManager::instance()->setBlocking(true);
|
||||
if (rebootSameBootCopy) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "CoreController::actionPerformReboot: Rebooting on current image" << std::endl;
|
||||
#endif
|
||||
// Attempt graceful shutdown by unmounting and switching off SD cards
|
||||
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;
|
||||
}
|
||||
gracefulShutdownTasks(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, protOpPerformed);
|
||||
int result = std::system("xsc_boot_copy -r");
|
||||
if (result != 0) {
|
||||
utility::handleSystemError(result, "CoreController::executeAction");
|
||||
@ -848,12 +890,8 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si
|
||||
auto tgtChip = static_cast<xsc::Chip>(data[1]);
|
||||
auto tgtCopy = static_cast<xsc::Copy>(data[2]);
|
||||
|
||||
ReturnValue_t retval =
|
||||
setBootCopyProtection(static_cast<xsc::Chip>(data[1]), static_cast<xsc::Copy>(data[2]), true,
|
||||
protOpPerformed, false);
|
||||
if (retval == HasReturnvaluesIF::RETURN_OK and protOpPerformed) {
|
||||
sif::info << "Target slot was writeprotected before reboot" << std::endl;
|
||||
}
|
||||
// This function can not really fail
|
||||
gracefulShutdownTasks(tgtChip, tgtCopy, protOpPerformed);
|
||||
|
||||
switch (tgtChip) {
|
||||
case (xsc::Chip::CHIP_0): {
|
||||
@ -894,27 +932,32 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
||||
CoreController::~CoreController() {}
|
||||
|
||||
void CoreController::determinePreferredSdCard() {
|
||||
if (sdInfo.pref == sd::SdCard::NONE) {
|
||||
ReturnValue_t result = sdcMan->getPreferredSdCard(sdInfo.pref);
|
||||
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::actionReboot(const uint8_t *data, size_t size) {
|
||||
bool protOpPerformed = false;
|
||||
gracefulShutdownTasks(xsc::Chip::CHIP_0, xsc::Copy::COPY_0, protOpPerformed);
|
||||
std::system("reboot");
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
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() {
|
||||
if (sdInfo.pref == sd::SdCard::SLOT_0) {
|
||||
sdInfo.prefChar = "0";
|
||||
@ -1169,7 +1212,7 @@ ReturnValue_t CoreController::handleProtInfoUpdateLine(std::string nextLine) {
|
||||
|
||||
void CoreController::performWatchdogControlOperation() {
|
||||
// Only perform each fifth iteration
|
||||
if (watchdogFifoFd != 0 and opDivider.checkAndIncrement()) {
|
||||
if (watchdogFifoFd != 0 and opDivider5.check()) {
|
||||
if (watchdogFifoFd == RETRY_FIFO_OPEN) {
|
||||
// Open FIFO write only and non-blocking
|
||||
watchdogFifoFd = open(watchdog::FIFO_NAME.c_str(), O_WRONLY | O_NONBLOCK);
|
||||
@ -1198,24 +1241,76 @@ void CoreController::performWatchdogControlOperation() {
|
||||
}
|
||||
|
||||
void CoreController::performMountedSdCardOperations() {
|
||||
if (doPerformMountedSdCardOps) {
|
||||
bool sdCardMounted = false;
|
||||
sdCardMounted = sdcMan->isSdCardMounted(sdInfo.pref);
|
||||
if (sdCardMounted) {
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + "/" + CONF_FOLDER;
|
||||
if (not std::filesystem::exists(path)) {
|
||||
std::filesystem::create_directory(path);
|
||||
auto mountedSdCardOp = [&](bool &mntSwitch, sd::SdCard sdCard, std::string mntPoint) {
|
||||
if (mntSwitch) {
|
||||
bool sdCardMounted = sdcMan->isSdCardMounted(sdCard);
|
||||
if (sdCardMounted and not performOneShotSdCardOpsSwitch) {
|
||||
std::ostringstream path;
|
||||
path << mntPoint << "/" << CONF_FOLDER;
|
||||
if (not std::filesystem::exists(path.str())) {
|
||||
std::filesystem::create_directory(path.str());
|
||||
}
|
||||
initVersionFile();
|
||||
initClockFromTimeFile();
|
||||
performRebootFileHandling(false);
|
||||
performOneShotSdCardOpsSwitch = true;
|
||||
}
|
||||
initVersionFile();
|
||||
performRebootFileHandling(false);
|
||||
doPerformMountedSdCardOps = false;
|
||||
mntSwitch = 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();
|
||||
}
|
||||
|
||||
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) {
|
||||
using namespace std;
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE;
|
||||
std::string path = currMntPrefix + REBOOT_FILE;
|
||||
if (not std::filesystem::exists(path) or recreateFile) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "CoreController::performRebootFileHandling: Recreating reboot file" << std::endl;
|
||||
@ -1594,7 +1689,7 @@ bool CoreController::parseRebootFile(std::string path, RebootFile &rf) {
|
||||
}
|
||||
|
||||
void CoreController::resetRebootCount(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
|
||||
parseRebootFile(path, rebootFile);
|
||||
if (tgtChip == xsc::ALL_CHIP and tgtCopy == xsc::ALL_COPY) {
|
||||
@ -1621,7 +1716,7 @@ void CoreController::resetRebootCount(xsc::Chip tgtChip, xsc::Copy tgtCopy) {
|
||||
}
|
||||
|
||||
void CoreController::rewriteRebootFile(RebootFile file) {
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE;
|
||||
std::string path = currMntPrefix + REBOOT_FILE;
|
||||
std::ofstream rebootFile(path);
|
||||
if (rebootFile.is_open()) {
|
||||
// Initiate reboot file first. Reboot handling will be on on initialization
|
||||
@ -1638,7 +1733,7 @@ void CoreController::rewriteRebootFile(RebootFile file) {
|
||||
}
|
||||
|
||||
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
|
||||
parseRebootFile(path, rebootFile);
|
||||
if (tgtChip == xsc::CHIP_0) {
|
||||
@ -1657,6 +1752,65 @@ void CoreController::setRebootMechanismLock(bool lock, xsc::Chip tgtChip, xsc::C
|
||||
rewriteRebootFile(rebootFile);
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::timeFileHandler() {
|
||||
// Always set time. We could only set it if it is updated by GPS, but then the backup time would
|
||||
// become obsolete on GPS problems.
|
||||
if (opDivider10.check()) {
|
||||
// It is assumed that the system time is set from the GPS time
|
||||
timeval currentTime = {};
|
||||
ReturnValue_t result = Clock::getClock_timeval(¤tTime);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
std::string fileName = currMntPrefix + TIME_FILE;
|
||||
std::ofstream timeFile(fileName);
|
||||
if (not timeFile.good()) {
|
||||
sif::error << "CoreController::timeFileHandler: Error opening time file: " << strerror(errno)
|
||||
<< std::endl;
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
timeFile << "UNIX SECONDS: " << currentTime.tv_sec << std::endl;
|
||||
}
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::initClockFromTimeFile() {
|
||||
using namespace GpsHyperion;
|
||||
using namespace std;
|
||||
std::string fileName = currMntPrefix + TIME_FILE;
|
||||
if (std::filesystem::exists(fileName) and
|
||||
((gpsFix == FixMode::UNKNOWN or gpsFix == FixMode::NOT_SEEN) or
|
||||
not utility::timeSanityCheck())) {
|
||||
ifstream timeFile(fileName);
|
||||
string nextWord;
|
||||
getline(timeFile, nextWord);
|
||||
istringstream iss(nextWord);
|
||||
iss >> nextWord;
|
||||
if (iss.bad() or nextWord != "UNIX") {
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
iss >> nextWord;
|
||||
if (iss.bad() or nextWord != "SECONDS:") {
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
iss >> nextWord;
|
||||
timeval currentTime = {};
|
||||
char *checkPtr;
|
||||
currentTime.tv_sec = strtol(nextWord.c_str(), &checkPtr, 10);
|
||||
if (iss.bad() or *checkPtr) {
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
time_t timeRaw = currentTime.tv_sec;
|
||||
std::tm *time = std::gmtime(&timeRaw);
|
||||
sif::info << "Setting system time from time files: " << std::put_time(time, "%c %Z")
|
||||
<< std::endl;
|
||||
#endif
|
||||
return Clock::setClock(¤tTime);
|
||||
}
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
void CoreController::readHkData() {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
result = hkSet.read(TIMEOUT_TYPE, MUTEX_TIMEOUT);
|
||||
@ -1690,3 +1844,8 @@ void CoreController::readHkData() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool CoreController::isNumber(const std::string &s) {
|
||||
return !s.empty() && std::find_if(s.begin(), s.end(),
|
||||
[](unsigned char c) { return !std::isdigit(c); }) == s.end();
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "bsp_q7s/memory/SdCardManager.h"
|
||||
#include "events/subsystemIdRanges.h"
|
||||
#include "fsfw/controller/ExtendedControllerBase.h"
|
||||
#include "mission/devices/devicedefinitions/GPSDefinitions.h"
|
||||
|
||||
class Timer;
|
||||
class SdCardManager;
|
||||
@ -47,16 +48,18 @@ class CoreController : public ExtendedControllerBase {
|
||||
static xsc::Chip CURRENT_CHIP;
|
||||
static xsc::Copy CURRENT_COPY;
|
||||
|
||||
static constexpr char CHIP_PROT_SCRIPT[] = "/home/root/scripts/get-chip-prot-status.sh";
|
||||
static constexpr char CHIP_PROT_SCRIPT[] = "get-chip-prot-status.sh";
|
||||
static constexpr char CHIP_STATE_FILE[] = "/tmp/chip_prot_status.txt";
|
||||
static constexpr char CURR_COPY_FILE[] = "/tmp/curr_copy.txt";
|
||||
static constexpr char CONF_FOLDER[] = "conf";
|
||||
static constexpr char VERSION_FILE_NAME[] = "version.txt";
|
||||
static constexpr char REBOOT_FILE_NAME[] = "reboot.txt";
|
||||
static constexpr char TIME_FILE_NAME[] = "time.txt";
|
||||
const std::string VERSION_FILE =
|
||||
"/" + std::string(CONF_FOLDER) + "/" + std::string(VERSION_FILE_NAME);
|
||||
const std::string REBOOT_FILE =
|
||||
"/" + std::string(CONF_FOLDER) + "/" + std::string(REBOOT_FILE_NAME);
|
||||
const std::string TIME_FILE = "/" + std::string(CONF_FOLDER) + "/" + std::string(TIME_FILE_NAME);
|
||||
|
||||
static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0;
|
||||
static constexpr ActionId_t SWITCH_REBOOT_FILE_HANDLING = 5;
|
||||
@ -64,13 +67,16 @@ class CoreController : public ExtendedControllerBase {
|
||||
static constexpr ActionId_t SWITCH_IMG_LOCK = 7;
|
||||
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;
|
||||
//! Reboot using the reboot command
|
||||
static constexpr ActionId_t REBOOT_OBC = 34;
|
||||
|
||||
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::CORE;
|
||||
|
||||
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
|
||||
static constexpr Event REBOOT_SW = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM);
|
||||
//! [EXPORT] : [COMMENT] The reboot mechanism was triggered.
|
||||
@ -126,6 +132,7 @@ class CoreController : public ExtendedControllerBase {
|
||||
// Designated value for rechecking FIFO open
|
||||
static constexpr int RETRY_FIFO_OPEN = -2;
|
||||
int watchdogFifoFd = 0;
|
||||
GpsHyperion::FixMode gpsFix = GpsHyperion::FixMode::UNKNOWN;
|
||||
|
||||
// States for SD state machine, which is used in non-blocking mode
|
||||
enum class SdStates {
|
||||
@ -151,14 +158,16 @@ class CoreController : public ExtendedControllerBase {
|
||||
static constexpr bool BLOCKING_SD_INIT = false;
|
||||
|
||||
SdCardManager* sdcMan = nullptr;
|
||||
MessageQueueIF* eventQueue = nullptr;
|
||||
|
||||
struct SdInfo {
|
||||
sd::SdCard pref = sd::SdCard::NONE;
|
||||
sd::SdState prefState = sd::SdState::OFF;
|
||||
sd::SdCard other = sd::SdCard::NONE;
|
||||
sd::SdState prefState = sd::SdState::OFF;
|
||||
sd::SdState otherState = sd::SdState::OFF;
|
||||
std::string prefChar = "0";
|
||||
std::string otherChar = "1";
|
||||
std::pair<bool, bool> mountSwitch = {true, true};
|
||||
SdStates state = SdStates::START;
|
||||
// Used to track whether a command was executed
|
||||
bool commandExecuted = true;
|
||||
@ -173,7 +182,8 @@ class CoreController : public ExtendedControllerBase {
|
||||
sd::SdState commandedState = sd::SdState::OFF;
|
||||
} sdInfo;
|
||||
RebootFile rebootFile = {};
|
||||
bool doPerformMountedSdCardOps = true;
|
||||
std::string currMntPrefix;
|
||||
bool performOneShotSdCardOpsSwitch = true;
|
||||
|
||||
/**
|
||||
* Index 0: Chip 0 Copy 0
|
||||
@ -182,16 +192,22 @@ class CoreController : public ExtendedControllerBase {
|
||||
* Index 3: Chip 1 Copy 1
|
||||
*/
|
||||
std::array<bool, 4> protArray;
|
||||
PeriodicOperationDivider opDivider;
|
||||
PeriodicOperationDivider opDivider5;
|
||||
PeriodicOperationDivider opDivider10;
|
||||
|
||||
core::HkSet hkSet;
|
||||
|
||||
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||
LocalDataPoolManager& poolManager) override;
|
||||
Countdown sdCardCheckCd = Countdown(120000);
|
||||
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
|
||||
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode);
|
||||
void performMountedSdCardOperations();
|
||||
ReturnValue_t initVersionFile();
|
||||
|
||||
ReturnValue_t initClockFromTimeFile();
|
||||
ReturnValue_t performSdCardCheck();
|
||||
ReturnValue_t timeFileHandler();
|
||||
ReturnValue_t initBootCopy();
|
||||
ReturnValue_t initWatchdogFifo();
|
||||
ReturnValue_t initSdCardBlocking();
|
||||
@ -204,14 +220,16 @@ class CoreController : public ExtendedControllerBase {
|
||||
ReturnValue_t sdColdRedundantBlockingInit();
|
||||
|
||||
void currentStateSetter(sd::SdCard sdCard, sd::SdState newState);
|
||||
void determinePreferredSdCard();
|
||||
void executeNextExternalSdCommand();
|
||||
void checkExternalSdCommandStatus();
|
||||
void performRebootFileHandling(bool recreateFile);
|
||||
|
||||
ReturnValue_t actionListDirectoryIntoFile(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||||
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();
|
||||
|
||||
@ -226,6 +244,7 @@ class CoreController : public ExtendedControllerBase {
|
||||
bool parseRebootFile(std::string path, RebootFile& file);
|
||||
void rewriteRebootFile(RebootFile file);
|
||||
void readHkData();
|
||||
bool isNumber(const std::string& s);
|
||||
};
|
||||
|
||||
#endif /* BSP_Q7S_CORE_CORECONTROLLER_H_ */
|
||||
|
@ -1,10 +1,12 @@
|
||||
#include "InitMission.h"
|
||||
#include "bsp_q7s/core/InitMission.h"
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "ObjectFactory.h"
|
||||
#include "bsp_q7s/core/ObjectFactory.h"
|
||||
#include "fsfw/objectmanager/ObjectManager.h"
|
||||
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
||||
#include "fsfw/platform.h"
|
||||
@ -13,6 +15,7 @@
|
||||
#include "fsfw/tasks/FixedTimeslotTaskIF.h"
|
||||
#include "fsfw/tasks/PeriodicTaskIF.h"
|
||||
#include "fsfw/tasks/TaskFactory.h"
|
||||
#include "mission/devices/devicedefinitions/Max31865Definitions.h"
|
||||
#include "mission/utility/InitMission.h"
|
||||
#include "pollingsequence/pollingSequenceFactory.h"
|
||||
|
||||
@ -33,8 +36,16 @@ ObjectManagerIF* objectManager = nullptr;
|
||||
|
||||
void initmission::initMission() {
|
||||
sif::info << "Building global objects.." << std::endl;
|
||||
/* Instantiate global object manager and also create all objects */
|
||||
ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
|
||||
try {
|
||||
/* 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;
|
||||
ObjectManager::instance()->initialize();
|
||||
|
||||
@ -115,28 +126,72 @@ void initmission::initTasks() {
|
||||
|
||||
#if OBSW_ADD_ACS_HANDLERS == 1
|
||||
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);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER);
|
||||
}
|
||||
|
||||
#endif /* OBSW_ADD_ACS_HANDLERS */
|
||||
|
||||
PeriodicTaskIF* sysTask = factory->createPeriodicTask(
|
||||
"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);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("ACS_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
|
||||
result = sysTask->addComponent(objects::SUS_BOARD_ASS);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("SUS_ASS", objects::SUS_BOARD_ASS);
|
||||
initmission::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS);
|
||||
}
|
||||
result = sysTask->addComponent(objects::TCS_BOARD_ASS);
|
||||
#endif
|
||||
|
||||
#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) {
|
||||
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
|
||||
// because it is a non-essential background task
|
||||
@ -165,6 +220,15 @@ void initmission::initTasks() {
|
||||
}
|
||||
#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
|
||||
PeriodicTaskIF* ptmeTestTask = factory->createPeriodicTask(
|
||||
"PTME_TEST", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||
@ -221,14 +285,20 @@ void initmission::initTasks() {
|
||||
|
||||
fsTask->startTask();
|
||||
#if OBSW_ADD_STAR_TRACKER == 1
|
||||
strHelperTask > startTask();
|
||||
strHelperTask->startTask();
|
||||
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
||||
|
||||
#if OBSW_ADD_ACS_HANDLERS == 1
|
||||
acsTask->startTask();
|
||||
#endif
|
||||
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */
|
||||
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;
|
||||
}
|
||||
|
||||
@ -239,7 +309,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
/* Polling Sequence Table Default */
|
||||
#if OBSW_ADD_SPI_TEST_CODE == 0
|
||||
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);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||
@ -252,8 +322,23 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
}
|
||||
#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(
|
||||
"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);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||
@ -266,7 +351,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
}
|
||||
|
||||
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);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||
@ -279,7 +364,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
}
|
||||
#if OBSW_ADD_I2C_TEST_CODE == 0
|
||||
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);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
|
||||
@ -292,6 +377,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_GOMSPACE_PCDU == 1
|
||||
FixedTimeslotTaskIF* gomSpacePstTask = factory.createFixedTimeslotTask(
|
||||
"GS_PST_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc);
|
||||
result = pst::pstGompaceCan(gomSpacePstTask);
|
||||
@ -301,6 +387,7 @@ void initmission::createPstTasks(TaskFactory& factory,
|
||||
}
|
||||
}
|
||||
taskVec.push_back(gomSpacePstTask);
|
||||
#endif
|
||||
}
|
||||
|
||||
void initmission::createPusTasks(TaskFactory& factory,
|
||||
@ -342,21 +429,30 @@ void initmission::createPusTasks(TaskFactory& factory,
|
||||
|
||||
PeriodicTaskIF* pusMedPrio = factory.createPeriodicTask(
|
||||
"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);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
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) {
|
||||
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);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
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) {
|
||||
initmission::printAddObjectError("PUS_20", objects::PUS_SERVICE_20_PARAMETERS);
|
||||
initmission::printAddObjectError("PUS_201", objects::PUS_SERVICE_201_HEALTH);
|
||||
}
|
||||
taskVec.push_back(pusMedPrio);
|
||||
|
||||
@ -413,23 +509,23 @@ void initmission::createTestTasks(TaskFactory& factory,
|
||||
}
|
||||
|
||||
/**
|
||||
â–„ â–„
|
||||
▌▒█ ▄▀▒▌
|
||||
▌▒▒█ ▄▀▒▒▒�
|
||||
�▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒�
|
||||
▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒�
|
||||
▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌
|
||||
�▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌
|
||||
▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒�
|
||||
�░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌
|
||||
▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌
|
||||
▌▒▀�▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒�
|
||||
�▒▒�▀�▀▒░▄▄▒▄▒▒▒▒▒▒░▒░▒░▒▒▒▒▌
|
||||
�▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒�
|
||||
▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒░▒░▒░▒░▒▒▒▌
|
||||
â–?â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–’â–‘â–’â–‘â–’â–‘â–’â–’â–„â–’â–’â–?
|
||||
▀▄▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▄▒▒▒▒▌
|
||||
▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀
|
||||
▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀
|
||||
▒▒▒▒▒▒▒▒▒▒▀▀
|
||||
▄ ▄
|
||||
▌▒█ ▄▀▒▌
|
||||
▌▒▒█ ▄▀▒▒▒▐
|
||||
▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐
|
||||
▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐
|
||||
▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌
|
||||
▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌
|
||||
▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐
|
||||
▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌
|
||||
▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌
|
||||
▌▒▀▐▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒▐
|
||||
▐▒▒▐▀▐▀▒░▄▄▒▄▒▒▒▒▒▒░▒░▒░▒▒▒▒▌
|
||||
▐▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒▐
|
||||
▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒░▒░▒░▒░▒▒▒▌
|
||||
▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▒▄▒▒▐
|
||||
▀▄▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▄▒▒▒▒▌
|
||||
▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀
|
||||
▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀
|
||||
▒▒▒▒▒▒▒▒▒▒▀▀
|
||||
**/
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "fsfw/tasks/Typedef.h"
|
||||
#include "fsfw/tasks/definitions.h"
|
||||
|
||||
class PeriodicTaskIF;
|
||||
class TaskFactory;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,11 +1,18 @@
|
||||
#ifndef BSP_Q7S_OBJECTFACTORY_H_
|
||||
#define BSP_Q7S_OBJECTFACTORY_H_
|
||||
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
class LinuxLibgpioIF;
|
||||
class UartComIF;
|
||||
class SpiComIF;
|
||||
class I2cComIF;
|
||||
class PowerSwitchIF;
|
||||
class HealthTableIF;
|
||||
class AcsBoardAssembly;
|
||||
class GpioIF;
|
||||
|
||||
namespace ObjectFactory {
|
||||
|
||||
@ -13,24 +20,30 @@ void setStatics();
|
||||
void produce(void* args);
|
||||
|
||||
void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
|
||||
SpiComIF** spiComIF, I2cComIF** i2cComIF);
|
||||
SpiComIF** spiMainComIF, I2cComIF** i2cComIF,
|
||||
SpiComIF** spiRwComIF);
|
||||
void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher);
|
||||
void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF);
|
||||
void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
||||
PowerSwitchIF* pwrSwitcher);
|
||||
void createTmpComponents();
|
||||
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
|
||||
void createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
||||
PowerSwitchIF* pwrSwitcher);
|
||||
void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
|
||||
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 createSyrlinksComponents();
|
||||
void createRtdComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher);
|
||||
void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher);
|
||||
void createPayloadComponents(LinuxLibgpioIF* gpioComIF);
|
||||
void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF);
|
||||
void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher);
|
||||
void createCcsdsComponents(LinuxLibgpioIF* gpioComIF);
|
||||
void createMiscComponents();
|
||||
|
||||
void createTestComponents(LinuxLibgpioIF* gpioComIF);
|
||||
|
||||
void testAcsBrdAss(AcsBoardAssembly* assAss);
|
||||
|
||||
}; // namespace ObjectFactory
|
||||
|
||||
#endif /* BSP_Q7S_OBJECTFACTORY_H_ */
|
||||
|
@ -1,5 +0,0 @@
|
||||
#include "ParameterHandler.h"
|
||||
|
||||
ParameterHandler::ParameterHandler(std::string mountPrefix) : mountPrefix(mountPrefix) {}
|
||||
|
||||
void ParameterHandler::setMountPrefix(std::string prefix) { mountPrefix = prefix; }
|
@ -1,20 +0,0 @@
|
||||
#ifndef BSP_Q7S_CORE_PARAMETERHANDLER_H_
|
||||
#define BSP_Q7S_CORE_PARAMETERHANDLER_H_
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <string>
|
||||
|
||||
class ParameterHandler {
|
||||
public:
|
||||
ParameterHandler(std::string mountPrefix);
|
||||
|
||||
void setMountPrefix(std::string prefix);
|
||||
|
||||
void setUpDummyParameter();
|
||||
|
||||
private:
|
||||
std::string mountPrefix;
|
||||
DummyParameter dummyParam;
|
||||
};
|
||||
|
||||
#endif /* BSP_Q7S_CORE_PARAMETERHANDLER_H_ */
|
1
bsp_q7s/em/CMakeLists.txt
Normal file
1
bsp_q7s/em/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE emObjectFactory.cpp)
|
71
bsp_q7s/em/emObjectFactory.cpp
Normal file
71
bsp_q7s/em/emObjectFactory.cpp
Normal file
@ -0,0 +1,71 @@
|
||||
#include <fsfw/health/HealthTableIF.h>
|
||||
|
||||
#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
|
||||
#if OBSW_Q7S_EM == 1
|
||||
createSyrlinksComponents(nullptr);
|
||||
#else
|
||||
createSyrlinksComponents(pwrSwitcher);
|
||||
#endif /* OBSW_Q7S_EM == 1 */
|
||||
#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();
|
||||
}
|
66
bsp_q7s/fmObjectFactory.cpp
Normal file
66
bsp_q7s/fmObjectFactory.cpp
Normal file
@ -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,7 +1,7 @@
|
||||
#include "q7sConfig.h"
|
||||
|
||||
#if Q7S_SIMPLE_MODE == 0
|
||||
#include "core/obsw.h"
|
||||
#include "obsw.h"
|
||||
#else
|
||||
#include "simple/simple.h"
|
||||
#endif
|
||||
|
@ -1,6 +1,2 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
FileSystemHandler.cpp
|
||||
SdCardManager.cpp
|
||||
scratchApi.cpp
|
||||
FilesystemHelper.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE FileSystemHandler.cpp SdCardManager.cpp
|
||||
scratchApi.cpp FilesystemHelper.cpp)
|
||||
|
@ -70,9 +70,8 @@ void FileSystemHandler::fileSystemHandlerLoop() {
|
||||
|
||||
void FileSystemHandler::fileSystemCheckup() {
|
||||
SdCardManager::SdStatePair statusPair;
|
||||
sdcMan->getSdCardActiveStatus(statusPair);
|
||||
sd::SdCard preferredSdCard;
|
||||
sdcMan->getPreferredSdCard(preferredSdCard);
|
||||
sdcMan->getSdCardsStatus(statusPair);
|
||||
sd::SdCard preferredSdCard = sdcMan->getPreferredSdCard();
|
||||
if ((preferredSdCard == sd::SdCard::SLOT_0) and (statusPair.first == sd::SdState::MOUNTED)) {
|
||||
currentMountPrefix = SdCardManager::SD_0_MOUNT_POINT;
|
||||
} else if ((preferredSdCard == sd::SdCard::SLOT_1) and
|
||||
@ -109,11 +108,7 @@ ReturnValue_t FileSystemHandler::initialize() {
|
||||
<< std::endl;
|
||||
}
|
||||
sdcMan = SdCardManager::instance();
|
||||
sd::SdCard preferredSdCard;
|
||||
ReturnValue_t result = sdcMan->getPreferredSdCard(preferredSdCard);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
sd::SdCard preferredSdCard = sdcMan->getPreferredSdCard();
|
||||
if (preferredSdCard == sd::SdCard::SLOT_0) {
|
||||
currentMountPrefix = SdCardManager::SD_0_MOUNT_POINT;
|
||||
} else if (preferredSdCard == sd::SdCard::SLOT_1) {
|
||||
|
@ -8,8 +8,6 @@
|
||||
|
||||
FilesystemHelper::FilesystemHelper() {}
|
||||
|
||||
FilesystemHelper::~FilesystemHelper() {}
|
||||
|
||||
ReturnValue_t FilesystemHelper::checkPath(std::string path) {
|
||||
SdCardManager* sdcMan = SdCardManager::instance();
|
||||
if (sdcMan == nullptr) {
|
||||
|
@ -7,7 +7,7 @@
|
||||
#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
|
||||
*/
|
||||
@ -20,11 +20,8 @@ class FilesystemHelper : public HasReturnvaluesIF {
|
||||
//! [EXPORT] : [COMMENT] Specified file does not exist on filesystem
|
||||
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.
|
||||
*
|
||||
* @param path Path to check
|
||||
@ -39,11 +36,14 @@ class FilesystemHelper : public HasReturnvaluesIF {
|
||||
/**
|
||||
* @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);
|
||||
|
||||
private:
|
||||
FilesystemHelper();
|
||||
};
|
||||
|
||||
#endif /* BSP_Q7S_MEMORY_FILESYSTEMHELPER_H_ */
|
||||
|
@ -16,23 +16,51 @@
|
||||
#include "linux/utility/utility.h"
|
||||
#include "scratchApi.h"
|
||||
|
||||
SdCardManager* SdCardManager::factoryInstance = nullptr;
|
||||
SdCardManager* SdCardManager::INSTANCE = nullptr;
|
||||
|
||||
SdCardManager::SdCardManager() : SystemObject(objects::SDC_MANAGER), cmdExecutor(256) {
|
||||
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() {}
|
||||
|
||||
void SdCardManager::create() {
|
||||
if (factoryInstance == nullptr) {
|
||||
factoryInstance = new SdCardManager();
|
||||
if (INSTANCE == nullptr) {
|
||||
INSTANCE = new SdCardManager();
|
||||
}
|
||||
}
|
||||
|
||||
SdCardManager* SdCardManager::instance() {
|
||||
SdCardManager::create();
|
||||
return SdCardManager::factoryInstance;
|
||||
return SdCardManager::INSTANCE;
|
||||
}
|
||||
|
||||
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) {
|
||||
sdStatusPtr = std::make_unique<SdStatePair>();
|
||||
statusPair = sdStatusPtr.get();
|
||||
result = getSdCardActiveStatus(*statusPair);
|
||||
result = getSdCardsStatus(*statusPair);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
@ -98,7 +126,7 @@ ReturnValue_t SdCardManager::switchOnSdCard(sd::SdCard sdCard, bool doMountSdCar
|
||||
ReturnValue_t SdCardManager::switchOffSdCard(sd::SdCard sdCard, bool doUnmountSdCard,
|
||||
SdStatePair* statusPair) {
|
||||
std::pair<sd::SdState, sd::SdState> active;
|
||||
ReturnValue_t result = getSdCardActiveStatus(active);
|
||||
ReturnValue_t result = getSdCardsStatus(active);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
@ -165,7 +193,7 @@ ReturnValue_t SdCardManager::setSdCardState(sd::SdCard sdCard, bool on) {
|
||||
return result;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::getSdCardActiveStatus(SdStatePair& active) {
|
||||
ReturnValue_t SdCardManager::getSdCardsStatus(SdStatePair& active) {
|
||||
using namespace std;
|
||||
MutexGuard mg(mutex);
|
||||
if (not filesystem::exists(SD_STATE_FILE)) {
|
||||
@ -273,14 +301,14 @@ ReturnValue_t SdCardManager::sanitizeState(SdStatePair* statusPair, sd::SdCard p
|
||||
resetNonBlockingState = true;
|
||||
}
|
||||
if (prefSdCard == sd::SdCard::NONE) {
|
||||
result = getPreferredSdCard(prefSdCard);
|
||||
result = getPreferredSdCard();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
}
|
||||
}
|
||||
if (statusPair == nullptr) {
|
||||
sdStatusPtr = std::make_unique<SdStatePair>();
|
||||
statusPair = sdStatusPtr.get();
|
||||
getSdCardActiveStatus(*statusPair);
|
||||
getSdCardsStatus(*statusPair);
|
||||
}
|
||||
|
||||
if (statusPair->first == sd::SdState::ON) {
|
||||
@ -351,20 +379,21 @@ void SdCardManager::processSdStatusLine(std::pair<sd::SdState, sd::SdState>& act
|
||||
idx++;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::getPreferredSdCard(sd::SdCard& sdCard) const {
|
||||
uint8_t prefSdCard = 0;
|
||||
ReturnValue_t result = scratch::readNumber(scratch::PREFERED_SDC_KEY, prefSdCard);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
sd::SdCard SdCardManager::getPreferredSdCard() const {
|
||||
MutexGuard mg(mutex);
|
||||
auto res = mg.getLockResult();
|
||||
if (res != RETURN_OK) {
|
||||
sif::error << "SdCardManager::getPreferredSdCard: Lock error" << std::endl;
|
||||
}
|
||||
sdCard = static_cast<sd::SdCard>(prefSdCard);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return sdInfo.pref;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::setPreferredSdCard(sd::SdCard sdCard) {
|
||||
MutexGuard mg(mutex);
|
||||
if (sdCard == sd::SdCard::BOTH) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
sdInfo.pref = sdCard;
|
||||
return scratch::writeNumber(scratch::PREFERED_SDC_KEY, static_cast<uint8_t>(sdCard));
|
||||
}
|
||||
|
||||
@ -383,14 +412,9 @@ ReturnValue_t SdCardManager::updateSdCardStateFile() {
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string SdCardManager::getCurrentMountPrefix(sd::SdCard prefSdCard) {
|
||||
if (prefSdCard == sd::SdCard::NONE) {
|
||||
ReturnValue_t result = getPreferredSdCard(prefSdCard);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return SD_0_MOUNT_POINT;
|
||||
}
|
||||
}
|
||||
if (prefSdCard == sd::SdCard::SLOT_0) {
|
||||
std::string SdCardManager::getCurrentMountPrefix() const {
|
||||
MutexGuard mg(mutex);
|
||||
if (sdInfo.active == sd::SdCard::SLOT_0) {
|
||||
return SD_0_MOUNT_POINT;
|
||||
} else {
|
||||
return SD_1_MOUNT_POINT;
|
||||
@ -443,7 +467,7 @@ void SdCardManager::setPrintCommandOutput(bool print) { this->printCmdOutput = p
|
||||
|
||||
bool SdCardManager::isSdCardMounted(sd::SdCard sdCard) {
|
||||
SdCardManager::SdStatePair active;
|
||||
ReturnValue_t result = this->getSdCardActiveStatus(active);
|
||||
ReturnValue_t result = this->getSdCardsStatus(active);
|
||||
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::debug << "SdCardManager::isSdCardMounted: Failed to get SD card active state";
|
||||
@ -466,3 +490,68 @@ bool SdCardManager::isSdCardMounted(sd::SdCard sdCard) {
|
||||
}
|
||||
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
|
||||
* state
|
||||
*/
|
||||
class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
class SdCardManager : public SystemObject, public HasReturnvaluesIF, public SdCardMountedIF {
|
||||
friend class SdCardAccess;
|
||||
|
||||
public:
|
||||
@ -36,6 +36,12 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
|
||||
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 ReturnValue_t OP_ONGOING = HasReturnvaluesIF::makeReturnCode(INTERFACE_ID, 0);
|
||||
@ -91,7 +97,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* @param sdCard
|
||||
* @return
|
||||
*/
|
||||
ReturnValue_t getPreferredSdCard(sd::SdCard& sdCard) const override;
|
||||
sd::SdCard getPreferredSdCard() const override;
|
||||
|
||||
/**
|
||||
* Switch on the specified SD card.
|
||||
@ -138,7 +144,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* should call #updateSdCardStateFile again in that case
|
||||
* - 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.
|
||||
@ -146,6 +152,20 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* @return
|
||||
*/
|
||||
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
|
||||
* can't be used after it has been unmounted.
|
||||
@ -173,7 +193,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* @param prefSdCardPtr
|
||||
* @return
|
||||
*/
|
||||
std::string getCurrentMountPrefix(sd::SdCard prefSdCardPtr = sd::SdCard::NONE) override;
|
||||
std::string getCurrentMountPrefix() const override;
|
||||
|
||||
OpStatus checkCurrentOp(Operations& currentOp);
|
||||
|
||||
@ -194,6 +214,12 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
*/
|
||||
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:
|
||||
CommandExecutor cmdExecutor;
|
||||
Operations currentOp = Operations::IDLE;
|
||||
@ -210,7 +236,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
|
||||
std::string currentPrefix;
|
||||
|
||||
static SdCardManager* factoryInstance;
|
||||
static SdCardManager* INSTANCE;
|
||||
};
|
||||
|
||||
#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());
|
||||
if (result != 0) {
|
||||
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
|
||||
std::remove(filename.c_str());
|
||||
return KEY_NOT_FOUND;
|
||||
} else {
|
||||
utility::handleSystemError(result, "scratch::readNumber");
|
||||
utility::handleSystemError(result, "scratch::readToFile");
|
||||
std::remove(filename.c_str());
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
@ -3,25 +3,26 @@
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
|
||||
#include "InitMission.h"
|
||||
#include "OBSWConfig.h"
|
||||
#include "OBSWVersion.h"
|
||||
#include "commonConfig.h"
|
||||
#include "core/InitMission.h"
|
||||
#include "fsfw/tasks/TaskFactory.h"
|
||||
#include "fsfw/version.h"
|
||||
#include "watchdogConf.h"
|
||||
#include "q7sConfig.h"
|
||||
#include "watchdog/definitions.h"
|
||||
|
||||
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() {
|
||||
using namespace fsfw;
|
||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||
#ifdef TE0720_1CFA
|
||||
std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl;
|
||||
#else
|
||||
std::cout << "-- Compiled for Linux (TE0720) --" << std::endl;
|
||||
#endif
|
||||
std::cout << "-- OBSW v" << SW_VERSION << "." << SW_SUBVERSION << "." << SW_REVISION << ", FSFW v"
|
||||
<< FSFW_VERSION << "--" << std::endl;
|
||||
std::cout << "-- Compiled for Linux (" << DEV_STRING << ") --" << std::endl;
|
||||
std::cout << "-- OBSW v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --"
|
||||
<< std::endl;
|
||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||
|
||||
#if Q7S_CHECK_FOR_ALREADY_RUNNING_IMG == 1
|
@ -1,3 +1 @@
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
|
||||
simple.cpp
|
||||
)
|
||||
target_sources(${SIMPLE_OBSW_NAME} PRIVATE simple.cpp)
|
||||
|
@ -1,3 +1 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
Xadc.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE Xadc.cpp)
|
||||
|
@ -82,20 +82,49 @@ void initmission::initTasks() {
|
||||
|
||||
std::vector<PeriodicTaskIF*> pstTasks;
|
||||
FixedTimeslotTaskIF* pst = factory->createFixedTimeslotTask(
|
||||
"UART_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc);
|
||||
"UART_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc);
|
||||
result = pst::pstUart(pst);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl;
|
||||
}
|
||||
pstTasks.push_back(pst);
|
||||
|
||||
#if OBSW_ADD_PLOC_MPSOC == 1
|
||||
PeriodicTaskIF* mpsocHelperTask = factory->createPeriodicTask(
|
||||
"PLOC_MPSOC_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||
result = mpsocHelperTask->addComponent(objects::PLOC_MPSOC_HELPER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
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) {
|
||||
for (const auto& task : taskVector) {
|
||||
@ -111,6 +140,16 @@ void initmission::initTasks() {
|
||||
tmtcDistributor->startTask();
|
||||
tmtcBridgeTask->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(pusTasks, "PUS Tasks");
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "fsfw/tasks/Typedef.h"
|
||||
#include "fsfw/tasks/definitions.h"
|
||||
|
||||
class PeriodicTaskIF;
|
||||
class TaskFactory;
|
||||
|
@ -6,72 +6,19 @@
|
||||
#ifndef FSFWCONFIG_OBSWCONFIG_H_
|
||||
#define FSFWCONFIG_OBSWCONFIG_H_
|
||||
|
||||
#cmakedefine RASPBERRY_PI
|
||||
#cmakedefine XIPHOS_Q7S
|
||||
#cmakedefine BEAGLEBONEBLACK
|
||||
#cmakedefine EGSE
|
||||
#cmakedefine TE0720_1CFA
|
||||
|
||||
#include "commonConfig.h"
|
||||
#include "OBSWVersion.h"
|
||||
|
||||
/* These defines should be disabled for mission code but are useful for
|
||||
debugging. */
|
||||
#define OBSW_VERBOSE_LEVEL 1
|
||||
|
||||
#define Q7S_EM 0
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be enabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
//! Timers can mess up the code when debugging
|
||||
//! All of this should be enabled for mission code!
|
||||
#if defined XIPHOS_Q7S
|
||||
|
||||
#define Q7S_EM 0
|
||||
|
||||
#define OBSW_USE_CCSDS_IP_CORE 1
|
||||
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
||||
#define OBSW_TM_TO_PTME 0
|
||||
// Set to 1 if telecommands are received via the PDEC IP Core
|
||||
#define OBSW_TC_FROM_PDEC 0
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
#define OBSW_ADD_MGT 1
|
||||
#define OBSW_ADD_BPX_BATTERY_HANDLER 1
|
||||
#define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@
|
||||
#define OBSW_ADD_PLOC_SUPERVISOR 0
|
||||
#define OBSW_ADD_PLOC_MPSOC 0
|
||||
#define OBSW_ADD_SUN_SENSORS 1
|
||||
#define OBSW_ADD_ACS_BOARD 1
|
||||
#define OBSW_ADD_ACS_HANDLERS 1
|
||||
#define OBSW_ADD_RW 0
|
||||
#define OBSW_ADD_RTD_DEVICES 1
|
||||
#define OBSW_ADD_TMP_DEVICES 0
|
||||
#define OBSW_ADD_RAD_SENSORS 1
|
||||
#define OBSW_ADD_PL_PCDU 0
|
||||
#define OBSW_ADD_SYRLINKS 0
|
||||
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
|
||||
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
|
||||
|
||||
#endif // XIPHOS_Q7S
|
||||
|
||||
// This is a really tricky switch.. It initializes the PCDU switches to their default states
|
||||
// at powerup. I think it would be better
|
||||
// to leave it off for now. It makes testing a lot more difficult and it might mess with
|
||||
// something the operators might want to do by giving the software too much intelligence
|
||||
// at the wrong place. The system component might command all the Switches accordingly anyway
|
||||
#define OBSW_INITIALIZE_SWITCHES 0
|
||||
#define OBSW_ENABLE_PERIODIC_HK 0
|
||||
|
||||
#ifdef TE0720_1CFA
|
||||
|
||||
#define OBSW_USE_CCSDS_IP_CORE 0
|
||||
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
||||
#define OBSW_TM_TO_PTME 0
|
||||
// Set to 1 if telecommands are received via the PDEC IP Core
|
||||
#define OBSW_TC_FROM_PDEC 0
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
#define OBSW_ADD_MGT 0
|
||||
#define OBSW_ADD_BPX_BATTERY_HANDLER 0
|
||||
@ -88,13 +35,18 @@ debugging. */
|
||||
#define OBSW_ADD_PL_PCDU 0
|
||||
#define OBSW_ADD_SYRLINKS 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_ENABLE_PERIODIC_HK 0
|
||||
#define OBSW_PRINT_CORE_HK 0
|
||||
#define OBSW_PRINT_CORE_HK 0
|
||||
#define OBSW_INITIALIZE_SWITCHES 0
|
||||
|
||||
#endif
|
||||
// This is a really tricky switch.. It initializes the PCDU switches to their default states
|
||||
// at powerup. I think it would be better
|
||||
// to leave it off for now. It makes testing a lot more difficult and it might mess with
|
||||
// something the operators might want to do by giving the software too much intelligence
|
||||
// at the wrong place. The system component might command all the Switches accordingly anyway
|
||||
#define OBSW_INITIALIZE_SWITCHES 0
|
||||
#define OBSW_ENABLE_PERIODIC_HK 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be disabled for mission code */
|
||||
@ -115,7 +67,6 @@ debugging. */
|
||||
#define OBSW_ADD_UART_TEST_CODE 0
|
||||
|
||||
#define OBSW_TEST_ACS 0
|
||||
#define OBSW_TEST_ACS_BOARD_ASS 0
|
||||
#define OBSW_DEBUG_ACS 0
|
||||
#define OBSW_TEST_SUS 0
|
||||
#define OBSW_DEBUG_SUS 0
|
||||
@ -127,6 +78,10 @@ debugging. */
|
||||
#define OBSW_DEBUG_PL_PCDU 0
|
||||
#define OBSW_TEST_BPX_BATT 0
|
||||
#define OBSW_DEBUG_BPX_BATT 0
|
||||
#define OBSW_TEST_IMTQ 0
|
||||
#define OBSW_DEBUG_IMTQ 0
|
||||
#define OBSW_TEST_RW 0
|
||||
#define OBSW_DEBUG_RW 0
|
||||
|
||||
#define OBSW_TEST_LIBGPIOD 0
|
||||
#define OBSW_TEST_PLOC_HANDLER 0
|
||||
@ -143,58 +98,22 @@ debugging. */
|
||||
#define OBSW_DEBUG_GPS 0
|
||||
#define OBSW_DEBUG_ACU 0
|
||||
#define OBSW_DEBUG_SYRLINKS 0
|
||||
#define OBSW_DEBUG_IMTQ 0
|
||||
#define OBSW_DEBUG_RW 0
|
||||
#define OBSW_DEBUG_PDEC_HANDLER 0
|
||||
|
||||
#ifdef TE0720_1CFA
|
||||
#define OBSW_DEBUG_PDEC_HANDLER 0
|
||||
|
||||
#define OBSW_DEBUG_PLOC_SUPERVISOR 1
|
||||
#define OBSW_DEBUG_PLOC_MPSOC 1
|
||||
#else
|
||||
#define OBSW_DEBUG_PLOC_SUPERVISOR 0
|
||||
#define OBSW_DEBUG_PLOC_MPSOC 0
|
||||
#endif
|
||||
|
||||
#ifdef EGSE
|
||||
#define OBSW_DEBUG_STARTRACKER 1
|
||||
#else
|
||||
#define OBSW_DEBUG_STARTRACKER 0
|
||||
#endif
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
#define OBSW_ADD_STAR_TRACKER 0
|
||||
#define OBSW_ADD_PLOC_SUPERVISOR 0
|
||||
#define OBSW_ADD_PLOC_MPSOC 0
|
||||
#define OBSW_ADD_SUN_SENSORS 0
|
||||
#define OBSW_ADD_MGT 0
|
||||
#define OBSW_ADD_ACS_BOARD 0
|
||||
#define OBSW_ADD_GPS_0 0
|
||||
#define OBSW_ADD_GPS_1 0
|
||||
#define OBSW_ADD_RW 0
|
||||
#define OBSW_ADD_BPX_BATTERY_HANDLER 0
|
||||
#define OBSW_ADD_RTD_DEVICES 0
|
||||
#define OBSW_ADD_PL_PCDU 0
|
||||
#define OBSW_ADD_TMP_DEVICES 0
|
||||
#define OBSW_ADD_RAD_SENSORS 0
|
||||
#define OBSW_ADD_SYRLINKS 0
|
||||
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
|
||||
|
||||
#endif // RASPBERRY_PI
|
||||
|
||||
#define TCP_SERVER_WIRETAPPING 0
|
||||
#define OBSW_TCP_SERVER_WIRETAPPING 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** CMake Defines */
|
||||
/*******************************************************************/
|
||||
#cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
#include "rpiConfig.h"
|
||||
#elif defined(XIPHOS_Q7S)
|
||||
#include "q7sConfig.h"
|
||||
#endif
|
||||
#cmakedefine LIBGPS_VERSION_MAJOR @LIBGPS_VERSION_MAJOR@
|
||||
#cmakedefine LIBGPS_VERSION_MINOR @LIBGPS_VERSION_MINOR@
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -1,27 +1,38 @@
|
||||
#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 "busConf.h"
|
||||
#include "devConf.h"
|
||||
#include "ccsdsConfig.h"
|
||||
#include "devices/addresses.h"
|
||||
#include "devices/gpioIds.h"
|
||||
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
|
||||
#include "fsfw/tmtcpacket/pus/tm.h"
|
||||
#include "fsfw/tmtcservices/CommandingServiceBase.h"
|
||||
#include "fsfw/tmtcservices/PusServiceBase.h"
|
||||
#include "fsfw_hal/linux/i2c/I2cComIF.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/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/utility/TmFunnel.h"
|
||||
#include "test/gpio/DummyGpioIF.h"
|
||||
#include "mission/devices/Tmp1075Handler.h"
|
||||
#include "mission/tmtc/TmFunnel.h"
|
||||
#include "mission/tmtc/CCSDSHandler.h"
|
||||
#include "mission/tmtc/VirtualChannel.h"
|
||||
#include "objects/systemObjectList.h"
|
||||
#include "devices/addresses.h"
|
||||
#include "devices/gpioIds.h"
|
||||
#include "test/gpio/DummyGpioIF.h"
|
||||
#include "tmtc/apid.h"
|
||||
#include "tmtc/pusIds.h"
|
||||
|
||||
@ -32,7 +43,11 @@ void Factory::setStaticFrameworkObjectIds() {
|
||||
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
||||
|
||||
#if OBSW_TM_TO_PTME == 1
|
||||
TmFunnel::downlinkDestination = objects::CCSDS_HANDLER;
|
||||
#else
|
||||
TmFunnel::downlinkDestination = objects::TMTC_BRIDGE;
|
||||
#endif
|
||||
TmFunnel::storageDestination = objects::NO_OBJECT;
|
||||
|
||||
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
||||
@ -43,20 +58,36 @@ void ObjectFactory::produce(void* args) {
|
||||
Factory::setStaticFrameworkObjectIds();
|
||||
ObjectFactory::produceGenericObjects();
|
||||
|
||||
LinuxLibgpioIF* gpioComIF = new LinuxLibgpioIF(objects::GPIO_IF);;
|
||||
new UartComIF(objects::UART_COM_IF);
|
||||
|
||||
#if OBSW_ADD_PLOC_MPSOC == 1
|
||||
UartCookie* mpsocUartCookie =
|
||||
new UartCookie(objects::PLOC_MPSOC_HANDLER, te0720_1cfa::MPSOC_UART, UartModes::NON_CANONICAL,
|
||||
uart::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE);
|
||||
UartCookie* mpsocUartCookie = new UartCookie(objects::PLOC_MPSOC_HANDLER, te0720_1cfa::MPSOC_UART,
|
||||
uart::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE);
|
||||
mpsocUartCookie->setNoFixedSizeReply();
|
||||
PlocMPSoCHelper* plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER);
|
||||
new UartComIF(objects::UART_COM_IF);
|
||||
auto dummyGpioIF = new DummyGpioIF();
|
||||
PlocMPSoCHandler* plocMPSoCHandler =
|
||||
new PlocMPSoCHandler(objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocUartCookie,
|
||||
plocMpsocHelper, Gpio(gpioIds::ENABLE_MPSOC_UART, dummyGpioIF));
|
||||
PlocMPSoCHandler* plocMPSoCHandler = new PlocMPSoCHandler(
|
||||
objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocUartCookie, plocMpsocHelper,
|
||||
Gpio(gpioIds::ENABLE_MPSOC_UART, dummyGpioIF), objects::PLOC_SUPERVISOR_HANDLER);
|
||||
plocMPSoCHandler->setStartUpImmediately();
|
||||
#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_GPIO_OPEN_BYLABEL == 1
|
||||
/* Configure MIO0 as input */
|
||||
@ -87,21 +118,6 @@ void ObjectFactory::produce(void* args) {
|
||||
new SusHandler(objects::SUS_0, objects::SPI_COM_IF, spiCookieSus, gpioComIF, gpioIds::CS_SUS_0);
|
||||
#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
|
||||
GpioCookie* gpioCookieRadSensor = new GpioCookie;
|
||||
GpiodRegular* chipSelectRadSensor = new GpiodRegular(
|
||||
@ -125,28 +141,19 @@ void ObjectFactory::produce(void* args) {
|
||||
GpioCookie* gpioCookie = new GpioCookie;
|
||||
gpioCookie->addGpio(gpioIds::HEATER_0, heaterGpio);
|
||||
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
|
||||
|
||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||
/* 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);
|
||||
|
||||
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 =
|
||||
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"));
|
||||
/* Temperature sensors */
|
||||
new Tmp1075Handler(objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1);
|
||||
new Tmp1075Handler(objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2);
|
||||
|
||||
/* Temperature sensors */
|
||||
new Tmp1075Handler(objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1);
|
||||
new Tmp1075Handler(objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2);
|
||||
static_cast<void>(gpioComIF);
|
||||
}
|
||||
|
@ -1,7 +1,11 @@
|
||||
#ifndef BSP_LINUX_OBJECTFACTORY_H_
|
||||
#define BSP_LINUX_OBJECTFACTORY_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
|
||||
|
||||
namespace ObjectFactory {
|
||||
static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day
|
||||
void produce(void* args);
|
||||
}; // namespace ObjectFactory
|
||||
|
||||
|
@ -3,9 +3,37 @@
|
||||
|
||||
namespace te0720_1cfa {
|
||||
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_ */
|
||||
|
28
cmake/EiveHelpers.cmake
Normal file
28
cmake/EiveHelpers.cmake
Normal file
@ -0,0 +1,28 @@
|
||||
# Determines the git version with git describe and returns it by setting
|
||||
# the GIT_INFO list in the parent scope. The list has the following entries
|
||||
# 1. Full version string
|
||||
# 2. Major version
|
||||
# 3. Minor version
|
||||
# 4. Revision
|
||||
# 5. git SHA hash and commits since tag
|
||||
function(determine_version_with_git)
|
||||
include(GetGitRevisionDescription)
|
||||
git_describe(VERSION ${ARGN})
|
||||
string(FIND ${VERSION} "." VALID_VERSION)
|
||||
if(VALID_VERSION EQUAL -1)
|
||||
message(WARNING "Version string ${VERSION} retrieved with git describe is invalid")
|
||||
return()
|
||||
endif()
|
||||
# Parse the version information into pieces.
|
||||
string(REGEX REPLACE "^v([0-9]+)\\..*" "\\1" _VERSION_MAJOR "${VERSION}")
|
||||
string(REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" _VERSION_MINOR "${VERSION}")
|
||||
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" _VERSION_PATCH "${VERSION}")
|
||||
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+-(.*)" "\\1" VERSION_SHA1 "${VERSION}")
|
||||
set(GIT_INFO ${VERSION})
|
||||
list(APPEND GIT_INFO ${_VERSION_MAJOR})
|
||||
list(APPEND GIT_INFO ${_VERSION_MINOR})
|
||||
list(APPEND GIT_INFO ${_VERSION_PATCH})
|
||||
list(APPEND GIT_INFO ${VERSION_SHA1})
|
||||
set(GIT_INFO ${GIT_INFO} PARENT_SCOPE)
|
||||
message(STATUS "eive | Set git version info into GIT_INFO from the git tag ${VERSION}")
|
||||
endfunction()
|
284
cmake/GetGitRevisionDescription.cmake
Normal file
284
cmake/GetGitRevisionDescription.cmake
Normal file
@ -0,0 +1,284 @@
|
||||
# - Returns a version string from Git
|
||||
#
|
||||
# These functions force a re-configure on each git commit so that you can
|
||||
# trust the values of the variables in your build system.
|
||||
#
|
||||
# get_git_head_revision(<refspecvar> <hashvar> [ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR])
|
||||
#
|
||||
# Returns the refspec and sha hash of the current head revision
|
||||
#
|
||||
# git_describe(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe on the source tree, and adjusting
|
||||
# the output so that it tests false if an error occurs.
|
||||
#
|
||||
# git_describe_working_tree(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe on the working tree (--dirty option),
|
||||
# and adjusting the output so that it tests false if an error occurs.
|
||||
#
|
||||
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe --exact-match on the source tree,
|
||||
# and adjusting the output so that it tests false if there was no exact
|
||||
# matching tag.
|
||||
#
|
||||
# git_local_changes(<var>)
|
||||
#
|
||||
# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes.
|
||||
# Uses the return code of "git diff-index --quiet HEAD --".
|
||||
# Does not regard untracked files.
|
||||
#
|
||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2020 Ryan Pavlik <ryan.pavlik@gmail.com> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
#
|
||||
# Copyright 2009-2013, Iowa State University.
|
||||
# Copyright 2013-2020, Ryan Pavlik
|
||||
# Copyright 2013-2020, Contributors
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
if(__get_git_revision_description)
|
||||
return()
|
||||
endif()
|
||||
set(__get_git_revision_description YES)
|
||||
|
||||
# We must run the following at "include" time, not at function call time,
|
||||
# to find the path to this module rather than the path to a calling list file
|
||||
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||
|
||||
# Function _git_find_closest_git_dir finds the next closest .git directory
|
||||
# that is part of any directory in the path defined by _start_dir.
|
||||
# The result is returned in the parent scope variable whose name is passed
|
||||
# as variable _git_dir_var. If no .git directory can be found, the
|
||||
# function returns an empty string via _git_dir_var.
|
||||
#
|
||||
# Example: Given a path C:/bla/foo/bar and assuming C:/bla/.git exists and
|
||||
# neither foo nor bar contain a file/directory .git. This wil return
|
||||
# C:/bla/.git
|
||||
#
|
||||
function(_git_find_closest_git_dir _start_dir _git_dir_var)
|
||||
set(cur_dir "${_start_dir}")
|
||||
set(git_dir "${_start_dir}/.git")
|
||||
while(NOT EXISTS "${git_dir}")
|
||||
# .git dir not found, search parent directories
|
||||
set(git_previous_parent "${cur_dir}")
|
||||
get_filename_component(cur_dir "${cur_dir}" DIRECTORY)
|
||||
if(cur_dir STREQUAL git_previous_parent)
|
||||
# We have reached the root directory, we are not in git
|
||||
set(${_git_dir_var}
|
||||
""
|
||||
PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
set(git_dir "${cur_dir}/.git")
|
||||
endwhile()
|
||||
set(${_git_dir_var}
|
||||
"${git_dir}"
|
||||
PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(get_git_head_revision _refspecvar _hashvar)
|
||||
_git_find_closest_git_dir("${CMAKE_CURRENT_SOURCE_DIR}" GIT_DIR)
|
||||
|
||||
if("${ARGN}" STREQUAL "ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR")
|
||||
set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR TRUE)
|
||||
else()
|
||||
set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR FALSE)
|
||||
endif()
|
||||
if(NOT "${GIT_DIR}" STREQUAL "")
|
||||
file(RELATIVE_PATH _relative_to_source_dir "${CMAKE_SOURCE_DIR}"
|
||||
"${GIT_DIR}")
|
||||
if("${_relative_to_source_dir}" MATCHES "[.][.]" AND NOT ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR)
|
||||
# We've gone above the CMake root dir.
|
||||
set(GIT_DIR "")
|
||||
endif()
|
||||
endif()
|
||||
if("${GIT_DIR}" STREQUAL "")
|
||||
set(${_refspecvar}
|
||||
"GITDIR-NOTFOUND"
|
||||
PARENT_SCOPE)
|
||||
set(${_hashvar}
|
||||
"GITDIR-NOTFOUND"
|
||||
PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Check if the current source dir is a git submodule or a worktree.
|
||||
# In both cases .git is a file instead of a directory.
|
||||
#
|
||||
if(NOT IS_DIRECTORY ${GIT_DIR})
|
||||
# The following git command will return a non empty string that
|
||||
# points to the super project working tree if the current
|
||||
# source dir is inside a git submodule.
|
||||
# Otherwise the command will return an empty string.
|
||||
#
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" rev-parse
|
||||
--show-superproject-working-tree
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE out
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT "${out}" STREQUAL "")
|
||||
# If out is empty, GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a submodule
|
||||
file(READ ${GIT_DIR} submodule)
|
||||
string(REGEX REPLACE "gitdir: (.*)$" "\\1" GIT_DIR_RELATIVE
|
||||
${submodule})
|
||||
string(STRIP ${GIT_DIR_RELATIVE} GIT_DIR_RELATIVE)
|
||||
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
|
||||
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE}
|
||||
ABSOLUTE)
|
||||
set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD")
|
||||
else()
|
||||
# GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a worktree
|
||||
file(READ ${GIT_DIR} worktree_ref)
|
||||
# The .git directory contains a path to the worktree information directory
|
||||
# inside the parent git repo of the worktree.
|
||||
#
|
||||
string(REGEX REPLACE "gitdir: (.*)$" "\\1" git_worktree_dir
|
||||
${worktree_ref})
|
||||
string(STRIP ${git_worktree_dir} git_worktree_dir)
|
||||
_git_find_closest_git_dir("${git_worktree_dir}" GIT_DIR)
|
||||
set(HEAD_SOURCE_FILE "${git_worktree_dir}/HEAD")
|
||||
endif()
|
||||
else()
|
||||
set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD")
|
||||
endif()
|
||||
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
|
||||
if(NOT EXISTS "${GIT_DATA}")
|
||||
file(MAKE_DIRECTORY "${GIT_DATA}")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${HEAD_SOURCE_FILE}")
|
||||
return()
|
||||
endif()
|
||||
set(HEAD_FILE "${GIT_DATA}/HEAD")
|
||||
configure_file("${HEAD_SOURCE_FILE}" "${HEAD_FILE}" COPYONLY)
|
||||
|
||||
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
|
||||
"${GIT_DATA}/grabRef.cmake" @ONLY)
|
||||
include("${GIT_DATA}/grabRef.cmake")
|
||||
|
||||
set(${_refspecvar}
|
||||
"${HEAD_REF}"
|
||||
PARENT_SCOPE)
|
||||
set(${_hashvar}
|
||||
"${HEAD_HASH}"
|
||||
PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_describe _var)
|
||||
if(NOT GIT_FOUND)
|
||||
find_package(Git QUIET)
|
||||
endif()
|
||||
get_git_head_revision(refspec hash)
|
||||
if(NOT GIT_FOUND)
|
||||
set(${_var}
|
||||
"GIT-NOTFOUND"
|
||||
PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
if(NOT hash)
|
||||
set(${_var}
|
||||
"HEAD-HASH-NOTFOUND"
|
||||
PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# TODO sanitize
|
||||
#if((${ARGN}" MATCHES "&&") OR
|
||||
# (ARGN MATCHES "||") OR
|
||||
# (ARGN MATCHES "\\;"))
|
||||
# message("Please report the following error to the project!")
|
||||
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
|
||||
#endif()
|
||||
|
||||
#message(STATUS "Arguments to execute_process: ${ARGN}")
|
||||
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" describe --tags --always ${hash} ${ARGN}
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
RESULT_VARIABLE res
|
||||
OUTPUT_VARIABLE out
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT res EQUAL 0)
|
||||
set(out "${out}-${res}-NOTFOUND")
|
||||
endif()
|
||||
|
||||
set(${_var}
|
||||
"${out}"
|
||||
PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_describe_working_tree _var)
|
||||
if(NOT GIT_FOUND)
|
||||
find_package(Git QUIET)
|
||||
endif()
|
||||
if(NOT GIT_FOUND)
|
||||
set(${_var}
|
||||
"GIT-NOTFOUND"
|
||||
PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" describe --dirty ${ARGN}
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
RESULT_VARIABLE res
|
||||
OUTPUT_VARIABLE out
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT res EQUAL 0)
|
||||
set(out "${out}-${res}-NOTFOUND")
|
||||
endif()
|
||||
|
||||
set(${_var}
|
||||
"${out}"
|
||||
PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_get_exact_tag _var)
|
||||
git_describe(out --exact-match ${ARGN})
|
||||
set(${_var}
|
||||
"${out}"
|
||||
PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_local_changes _var)
|
||||
if(NOT GIT_FOUND)
|
||||
find_package(Git QUIET)
|
||||
endif()
|
||||
get_git_head_revision(refspec hash)
|
||||
if(NOT GIT_FOUND)
|
||||
set(${_var}
|
||||
"GIT-NOTFOUND"
|
||||
PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
if(NOT hash)
|
||||
set(${_var}
|
||||
"HEAD-HASH-NOTFOUND"
|
||||
PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD --
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
RESULT_VARIABLE res
|
||||
OUTPUT_VARIABLE out
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(res EQUAL 0)
|
||||
set(${_var}
|
||||
"CLEAN"
|
||||
PARENT_SCOPE)
|
||||
else()
|
||||
set(${_var}
|
||||
"DIRTY"
|
||||
PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
43
cmake/GetGitRevisionDescription.cmake.in
Normal file
43
cmake/GetGitRevisionDescription.cmake.in
Normal file
@ -0,0 +1,43 @@
|
||||
#
|
||||
# Internal file for GetGitRevisionDescription.cmake
|
||||
#
|
||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
#
|
||||
# Copyright 2009-2012, Iowa State University
|
||||
# Copyright 2011-2015, Contributors
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
set(HEAD_HASH)
|
||||
|
||||
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
|
||||
|
||||
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
|
||||
if(HEAD_CONTENTS MATCHES "ref")
|
||||
# named branch
|
||||
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
|
||||
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
|
||||
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
else()
|
||||
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
|
||||
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
|
||||
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
|
||||
set(HEAD_HASH "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
# detached HEAD
|
||||
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
endif()
|
||||
|
||||
if(NOT HEAD_HASH)
|
||||
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
|
||||
string(STRIP "${HEAD_HASH}" HEAD_HASH)
|
||||
endif()
|
@ -1,16 +1,5 @@
|
||||
function(post_source_hw_os_config)
|
||||
|
||||
if(LINK_LWIP)
|
||||
message(STATUS "Linking against ${LIB_LWIP_NAME} lwIP library")
|
||||
if(LIB_LWIP_NAME)
|
||||
target_link_libraries(${OBSW_NAME} PUBLIC
|
||||
${LIB_LWIP_NAME}
|
||||
)
|
||||
else()
|
||||
message(WARNING "lwIP library name not set!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LINKER_SCRIPT)
|
||||
add_link_options(
|
||||
-T${LINKER_SCRIPT}
|
||||
@ -42,6 +31,11 @@ add_compile_options(
|
||||
)
|
||||
|
||||
set(STRIPPED_OBSW_NAME ${OBSW_BIN_NAME}-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(
|
||||
TARGET ${OBSW_NAME}
|
||||
@ -51,4 +45,22 @@ add_custom_command(
|
||||
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(
|
||||
TARGET ${WATCHDOG_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_STRIP} --strip-all eive-watchdog -o ${STRIPPED_WATCHDOG_NAME}
|
||||
BYPRODUCTS ${STRIPPED_WATCHDOG_NAME}
|
||||
COMMENT "Generating stripped executable ${STRIPPED_WATCHDOG_NAME}.."
|
||||
)
|
||||
|
||||
endfunction()
|
@ -1,74 +0,0 @@
|
||||
function(pre_source_hw_os_config)
|
||||
|
||||
# FreeRTOS
|
||||
if(FSFW_OSAL MATCHES freertos)
|
||||
message(FATAL_ERROR "No FreeRTOS support implemented yet.")
|
||||
# RTEMS
|
||||
elseif(FSFW_OSAL STREQUAL rtems)
|
||||
add_definitions(-DRTEMS)
|
||||
message(FATAL_ERROR "No RTEMS support implemented yet.")
|
||||
elseif(FSFW_OSAL STREQUAL linux)
|
||||
add_definitions(-DUNIX -DLINUX)
|
||||
find_package(Threads REQUIRED)
|
||||
# Hosted
|
||||
else()
|
||||
set(BSP_PATH "bsp_hosted")
|
||||
if(WIN32)
|
||||
add_definitions(-DWIN32)
|
||||
elseif(UNIX)
|
||||
find_package(Threads REQUIRED)
|
||||
add_definitions(-DUNIX -DLINUX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Cross-compile information
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
# set(CMAKE_VERBOSE TRUE)
|
||||
|
||||
message(STATUS "Cross-compiling for ${TGT_BSP} target")
|
||||
message(STATUS "Cross-compile gcc: ${CMAKE_C_COMPILER}")
|
||||
message(STATUS "Cross-compile g++: ${CMAKE_CXX_COMPILER}")
|
||||
|
||||
if(CMAKE_VERBOSE)
|
||||
message(STATUS "Cross-compile linker: ${CMAKE_LINKER}")
|
||||
message(STATUS "Cross-compile size utility: ${CMAKE_SIZE}")
|
||||
message(STATUS "Cross-compile objcopy utility: ${CMAKE_OBJCOPY}")
|
||||
message(STATUS "Cross-compile ranlib utility: ${CMAKE_RANLIB}")
|
||||
message(STATUS "Cross-compile ar utility: ${CMAKE_AR}")
|
||||
message(STATUS "Cross-compile nm utility: ${CMAKE_NM}")
|
||||
message(STATUS "Cross-compile strip utility: ${CMAKE_STRIP}")
|
||||
message(STATUS
|
||||
"Cross-compile assembler: ${CMAKE_ASM_COMPILER} "
|
||||
"-x assembler-with-cpp"
|
||||
)
|
||||
message(STATUS "ABI flags: ${ABI_FLAGS}")
|
||||
message(STATUS "Custom linker script: ${LINKER_SCRIPT}")
|
||||
endif()
|
||||
|
||||
set_property(CACHE TGT_BSP
|
||||
PROPERTY STRINGS
|
||||
"arm/q7s" "arm/raspberrypi" "arm/egse"
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
if(TGT_BSP)
|
||||
if (TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
|
||||
set(BSP_PATH "bsp_linux_board")
|
||||
elseif(TGT_BSP MATCHES "arm/q7s")
|
||||
set(BSP_PATH "bsp_q7s")
|
||||
elseif(TGT_BSP MATCHES "arm/egse")
|
||||
set(BSP_PATH "bsp_egse")
|
||||
elseif(TGT_BSP MATCHES "arm/te0720-1cfa")
|
||||
set(BSP_PATH "bsp_te0720_1cfa")
|
||||
else()
|
||||
message(WARNING "CMake not configured for this target!")
|
||||
message(FATAL_ERROR "Target: ${TGT_BSP}!")
|
||||
endif()
|
||||
else()
|
||||
set(BSP_PATH "bsp_hosted")
|
||||
endif()
|
||||
|
||||
set(BSP_PATH ${BSP_PATH} PARENT_SCOPE)
|
||||
|
||||
endfunction()
|
@ -1,3 +1,81 @@
|
||||
function(obsw_module_config)
|
||||
endfunction()
|
||||
|
||||
function(pre_source_hw_os_config)
|
||||
|
||||
# FreeRTOS
|
||||
if(FSFW_OSAL MATCHES freertos)
|
||||
message(FATAL_ERROR "No FreeRTOS support implemented yet.")
|
||||
# RTEMS
|
||||
elseif(FSFW_OSAL STREQUAL rtems)
|
||||
add_definitions(-DRTEMS)
|
||||
message(FATAL_ERROR "No RTEMS support implemented yet.")
|
||||
elseif(FSFW_OSAL STREQUAL linux)
|
||||
add_definitions(-DUNIX -DLINUX)
|
||||
find_package(Threads REQUIRED)
|
||||
# Hosted
|
||||
else()
|
||||
set(BSP_PATH "bsp_hosted")
|
||||
if(WIN32)
|
||||
add_definitions(-DWIN32)
|
||||
elseif(UNIX)
|
||||
find_package(Threads REQUIRED)
|
||||
add_definitions(-DUNIX -DLINUX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Cross-compile information
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
# set(CMAKE_VERBOSE TRUE)
|
||||
|
||||
message(STATUS "Cross-compiling for ${TGT_BSP} target")
|
||||
message(STATUS "Cross-compile gcc: ${CMAKE_C_COMPILER}")
|
||||
message(STATUS "Cross-compile g++: ${CMAKE_CXX_COMPILER}")
|
||||
|
||||
if(CMAKE_VERBOSE)
|
||||
message(STATUS "Cross-compile linker: ${CMAKE_LINKER}")
|
||||
message(STATUS "Cross-compile size utility: ${CMAKE_SIZE}")
|
||||
message(STATUS "Cross-compile objcopy utility: ${CMAKE_OBJCOPY}")
|
||||
message(STATUS "Cross-compile ranlib utility: ${CMAKE_RANLIB}")
|
||||
message(STATUS "Cross-compile ar utility: ${CMAKE_AR}")
|
||||
message(STATUS "Cross-compile nm utility: ${CMAKE_NM}")
|
||||
message(STATUS "Cross-compile strip utility: ${CMAKE_STRIP}")
|
||||
message(STATUS
|
||||
"Cross-compile assembler: ${CMAKE_ASM_COMPILER} "
|
||||
"-x assembler-with-cpp"
|
||||
)
|
||||
message(STATUS "ABI flags: ${ABI_FLAGS}")
|
||||
message(STATUS "Custom linker script: ${LINKER_SCRIPT}")
|
||||
endif()
|
||||
|
||||
set_property(CACHE TGT_BSP
|
||||
PROPERTY STRINGS
|
||||
"arm/q7s" "arm/raspberrypi" "arm/egse"
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
if(TGT_BSP)
|
||||
if (TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
|
||||
set(BSP_PATH "bsp_linux_board")
|
||||
elseif(TGT_BSP MATCHES "arm/q7s")
|
||||
set(BSP_PATH "bsp_q7s")
|
||||
elseif(TGT_BSP MATCHES "arm/egse")
|
||||
set(BSP_PATH "bsp_egse")
|
||||
elseif(TGT_BSP MATCHES "arm/te0720-1cfa")
|
||||
set(BSP_PATH "bsp_te0720_1cfa")
|
||||
else()
|
||||
message(WARNING "CMake not configured for this target!")
|
||||
message(FATAL_ERROR "Target: ${TGT_BSP}!")
|
||||
endif()
|
||||
else()
|
||||
set(BSP_PATH "bsp_hosted")
|
||||
endif()
|
||||
|
||||
set(BSP_PATH ${BSP_PATH} PARENT_SCOPE)
|
||||
|
||||
endfunction()
|
||||
|
||||
function(pre_project_config)
|
||||
|
||||
# Basic input sanitization
|
||||
@ -11,10 +89,10 @@ endif()
|
||||
|
||||
|
||||
# Disable compiler checks for cross-compiling.
|
||||
if(FSFW_OSAL MATCHES linux AND TGT_BSP)
|
||||
if(FSFW_OSAL MATCHES linux AND TGT_BSP AND EIVE_HARDCODED_TOOLCHAIN_FILE)
|
||||
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/te0720-1cfa")
|
||||
set(CMAKE_TOOLCHAIN_FILE
|
||||
"${CMAKE_SCRIPT_PATH}/Zynq7020CrossCompileConfig.cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Zynq7020CrossCompileConfig.cmake"
|
||||
PARENT_SCOPE
|
||||
)
|
||||
elseif(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/egse")
|
||||
@ -48,13 +126,13 @@ if(FSFW_OSAL MATCHES linux AND TGT_BSP)
|
||||
endif()
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE
|
||||
"${CMAKE_SCRIPT_PATH}/RPiCrossCompileConfig.cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/RPiCrossCompileConfig.cmake"
|
||||
PARENT_SCOPE
|
||||
)
|
||||
elseif(${TGT_BSP} MATCHES "arm/beagleboneblack")
|
||||
if(LINUX_CROSS_COMPILE)
|
||||
set(CMAKE_TOOLCHAIN_FILE
|
||||
"${CMAKE_SCRIPT_PATH}/BBBCrossCompileConfig.cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/BBBCrossCompileConfig.cmake"
|
||||
PARENT_SCOPE
|
||||
)
|
||||
endif()
|
||||
|
@ -1,32 +0,0 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build_generator="make"
|
||||
os_fsfw="host"
|
||||
builddir="build-Debug-Host"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
@ -1,32 +0,0 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build_generator="make"
|
||||
os_fsfw="host"
|
||||
builddir="build-Release-Host"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "release" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
@ -1,32 +0,0 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build_generator="ninja"
|
||||
os_fsfw="host"
|
||||
builddir="build-Debug-Host"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
@ -1,32 +0,0 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build_generator="make"
|
||||
os_fsfw="linux"
|
||||
builddir="build-Debug-Host"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
@ -1,32 +0,0 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build_generator="Unix Makefiles"
|
||||
os_fsfw="linux"
|
||||
builddir="build-Release-Host"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "release" -l "${builddir}"
|
||||
# Use this if commands are added which should not be printed
|
||||
# set +x
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user