Compare commits
1600 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 31425877b4 | |||
| 09f80f63b5 | |||
| a945b3cae0 | |||
| 81b29cfda6 | |||
| a7b696884c | |||
| e98563d834 | |||
| a920f60c61 | |||
| b54641a2a1 | |||
| a2a7313016 | |||
| 6893b895e3 | |||
| 8f9d84c293 | |||
| 0c82d06ec4 | |||
| a3419412cc | |||
| cc662738f2 | |||
| b426475ca4 | |||
| 957c8f5298 | |||
| 4445ac34ca | |||
| b9535f46d9 | |||
| a232b9bf98 | |||
| 165963ed2d | |||
| 54a50beacb | |||
| c24d5c05f0 | |||
| a2e22302fb | |||
| 1a6fb52e1d | |||
| c83a177061 | |||
| 4589b3b696 | |||
| 0271b4970c | |||
| 4db35e8641 | |||
| 8315a03efc | |||
| 2cf1da5478 | |||
| e06f459333 | |||
| 535da53093 | |||
| b10486052e | |||
| bb2bd87541 | |||
| afaeca7cf7 | |||
| 86752417f2 | |||
| 243d38f832 | |||
| 79efc9de39 | |||
| 0ad13a473e | |||
| 4d13743b7f | |||
| 79aac89f36 | |||
| 6dde823d4c | |||
| 4a637e79c6 | |||
| 42247620c0 | |||
| 115d2dea88 | |||
| 47f4aebd15 | |||
| fbd9e65398 | |||
| f0270b91d9 | |||
| 08046ef621 | |||
| a9cf5f9ae9 | |||
| e088bec582 | |||
| 5a52155065 | |||
| 8b4d56cc0d | |||
| 4fdeccc3a8 | |||
| 0543f6b425 | |||
| fdf7f03242 | |||
| 9a73637b5e | |||
| 4035cb1fcb | |||
| 0d37272feb | |||
| b2ec1773e4 | |||
| 4149b08f3a | |||
| f435f7217e | |||
| ac0b2e0dce | |||
| 51bcdafe33 | |||
| c131c685a4 | |||
| 08d7b3b859 | |||
| 456dac6afd | |||
| cce0d5448d | |||
| ef4f713883 | |||
| 0f4fe7694b | |||
| 7aa900e6d5 | |||
| c1d754d8ff | |||
| 10d0bf1550 | |||
| 9dc382706a | |||
|
|
2f90c3e937 | ||
|
|
5f6a8fa37d | ||
| 2f3d60e974 | |||
| c1fb7ce0df | |||
| e919d3b7ef | |||
|
|
52bfcd7039 | ||
| 3d817363e6 | |||
| 7e36edc41c | |||
| 074e2d8517 | |||
| c1248dd4e1 | |||
| 3a03d6ca55 | |||
| f01f63d8e8 | |||
| e16f5e68d6 | |||
| 517aaf2146 | |||
| bbe1e996e6 | |||
| 6d326137fb | |||
| b40ceafbe0 | |||
| a9e106bb71 | |||
| 199acec3b5 | |||
| d0b7531e48 | |||
| b97604d7d2 | |||
| 7e230b64ea | |||
| 7e2a993211 | |||
| ab85ebf83e | |||
| b40302210f | |||
| 713bfbd7dc | |||
| 40168bcd5f | |||
| 9ce7a28cff | |||
| 9bb6c41134 | |||
| e836ed8a2d | |||
| a45f298505 | |||
| 234a6b7ac3 | |||
| 584700a2ba | |||
| a1c3b1786f | |||
| bed58a45e5 | |||
| 5b2239cee6 | |||
| b3f0d19bb9 | |||
| 00bbc86d39 | |||
| 49b3120ada | |||
| 2b33d8772c | |||
| ba2589c8d5 | |||
| f421fd4dde | |||
| 9ac5d0da67 | |||
| c5ae12e10b | |||
| 25570cc631 | |||
| baf2e5fb39 | |||
| 957b067eac | |||
| 9fe2de5244 | |||
| 177b4305bb | |||
| 67ab265645 | |||
| ea139d0657 | |||
| 8bd7d00ab1 | |||
| 417a6d8ea0 | |||
| 17fd273d10 | |||
| 772a829333 | |||
| bf1f6887be | |||
| 3c2092926e | |||
| f22644697e | |||
| 48e0718b76 | |||
| 6f54129f60 | |||
| 32f2cd60bb | |||
| 0638c87f62 | |||
| 0f80501467 | |||
| a416ca406b | |||
| aa84175382 | |||
| 737d18135f | |||
| 0da74f1bf9 | |||
| 85d8c2c471 | |||
| 4a5ea4450f | |||
| 1485b14c7d | |||
| 604d7ab228 | |||
| d1814f9a49 | |||
| c4b1703b8e | |||
| d6532f8181 | |||
| a24464f13e | |||
| e61fada99e | |||
| 333155b1a0 | |||
| 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 | |||
| d12b5958b9 | |||
| a4c5d8de45 | |||
| be2834cb1a | |||
| 07d345183e | |||
| d3403d341f | |||
| a14af7f728 | |||
| aa95aa185b | |||
| 2e93d7300a | |||
| f6f51665a2 | |||
| f08eb9b5ae | |||
| b0006c2272 | |||
| f5d88a4b6a | |||
| 23730349b0 | |||
| 500c54e430 | |||
| cf575f0d70 | |||
| 1db5d278f6 | |||
| 9fa745cfb2 | |||
| aefd8b696d | |||
|
|
0f7f17b591 | ||
| 6fdf7f704d | |||
| 17aa70f5e0 | |||
| fd9fbe4543 | |||
| 6c63356edc | |||
| 94896c9e74 | |||
| 25138d8931 | |||
| 655497934b | |||
| fd3313fc62 | |||
| a72c2f7b7d | |||
| 3e4d728b10 | |||
| 9b6f254954 | |||
|
|
42b7b4a7c4 | ||
| 435f8164a1 | |||
|
|
a807aab97e | ||
| 52885919d0 | |||
| b618302db0 | |||
| a14ca283cc | |||
| 2529ed905c | |||
| 2cd5450333 | |||
| 604870d1fe | |||
| 6e33af7a75 | |||
| e2e85c19e1 | |||
| df38903fe9 | |||
| d96ff72635 | |||
| 5e8262657f | |||
| 8a0999851f | |||
| 5e0e8232df | |||
| 456f6ad6af | |||
| 1d98582bbd | |||
| f05922e19e | |||
| d5bdc00abf | |||
| a5881a238b | |||
| d144f5bd11 | |||
| 6a875d5f0b | |||
| a9419cd328 | |||
| 90e8d7ecaf | |||
| ff5e271f88 | |||
| c83efd149e | |||
| 6ae9e539a6 | |||
| 351920aa7b | |||
| 4a6840f098 | |||
| a728a6d04b | |||
| 26ff40ae0c | |||
| 8f0d0917ab | |||
| 59d58da4f2 | |||
| cb81798c0c | |||
| 45007d726d | |||
| 5801c17509 | |||
| 796b814b49 | |||
| 0e7cd7de6f | |||
| d570b5c460 | |||
| 64b3afae22 | |||
| 5e4c3728ed | |||
| 160df15cbf | |||
| 4e3fa54ae2 | |||
| bf849b24e6 | |||
| 64dce75e09 | |||
| 66627741f9 | |||
| 68992e77dc | |||
| ca92b85864 | |||
| 8f4f271331 | |||
| 1876bbe449 | |||
| b5ce035c09 | |||
| 5c4ae861b1 | |||
| b2933f95d7 | |||
| 1a5196f9d2 | |||
| e7e810eb20 | |||
| 8f391d3a68 | |||
| 569735474a | |||
| c3aa9fb908 | |||
| 81e33348bb | |||
| a6d20de0a5 | |||
| bc47402a6d | |||
| c6e16e0866 | |||
| 042a6b2960 | |||
| 06a15ccec1 | |||
| 834e935c64 | |||
| d7e899e113 | |||
| f325d139da | |||
| 1d6ae35465 | |||
| 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 | |||
| b66c730c49 | |||
| 4447a9d4b1 | |||
| 39b9ed06c3 | |||
| 01f601e761 | |||
| 66029cb47a | |||
| 25fe13a4a4 | |||
| d6ed952fa9 | |||
| 6e25cf912f | |||
| 0c889f9492 | |||
| a9a6bbd948 | |||
|
|
a6f2227490 | ||
|
|
5db4b9cb86 | ||
|
|
27419f48e3 | ||
|
|
758c4e6f4f | ||
|
|
e2c9bece05 | ||
|
|
6d04c278c3 | ||
|
|
3fe9599c48 | ||
|
|
0d8ccd649a | ||
|
|
0f77c606e0 | ||
|
|
ad9f40d70a | ||
|
|
1dfc18ae66 | ||
|
|
7f9b2a5bd0 | ||
|
|
d4d1c8106c | ||
|
|
b41806d6c2 | ||
|
|
022ae4091d | ||
|
|
a359afb1c3 | ||
|
|
44a0d4af61 | ||
|
|
ceb7f40d35 | ||
| af57f02840 | |||
|
|
98795f9529 | ||
|
|
471a981ccf | ||
| 2410c6ccc6 | |||
| 7612564a8f | |||
| 83d90f41b0 | |||
| 243af65ca6 | |||
| 5f8ec0e089 | |||
| ac0326a944 | |||
| 9d10af35d8 | |||
| 043984172c | |||
|
|
47a3804145 | ||
| 80fe0bdce6 | |||
| 94dc4eb367 | |||
| 9351c8285b | |||
| 2f6d9ab7f1 | |||
|
|
0ff84b31ef | ||
| 4bf0521a5d | |||
| 6db4092dc8 | |||
| 15d1da8199 | |||
| f88a063d83 | |||
| 74fa98d161 | |||
| 0937697637 | |||
| 71639f21e8 | |||
| 184ce2917d | |||
| c47919bb3d | |||
| c4ea13a5f4 | |||
| 563bf0747a | |||
| c949f9f795 | |||
| 931c53f1a6 | |||
|
|
c8c2e543a1 | ||
|
|
3e3fc20fc6 | ||
|
|
4b6cf3c30a | ||
|
|
7f7a756094 | ||
|
|
59dfff9bf8 | ||
| 4ccec03e47 | |||
|
|
53a780ed0f | ||
|
|
3df7a7f896 | ||
| 1e2df7bf91 | |||
| 2fb8ca4aaa | |||
| 6e91462cba | |||
| 1cd98c5604 | |||
| c9930c6cc8 | |||
| 368b01c081 | |||
|
|
f99e96a20a | ||
| 8f63e6321e | |||
| 017eaf07f5 | |||
| 9c6f349a08 | |||
| 3e9910b1d2 | |||
| 5fb4e468ba | |||
| 22154f2851 | |||
| 4afacbe82b | |||
| 5b7dd7c432 | |||
| 14d9efce1f | |||
| e95d25db66 | |||
| c21dae1afc | |||
| 1d712854bf | |||
| 1ebd92a17e | |||
| 27f9cb7469 | |||
| c184385e12 | |||
| ce8253b940 | |||
| 1c7601aa1c | |||
| 73e3d29ed0 | |||
| bcd97076e1 | |||
|
|
78b3f28188 | ||
| 5589eb2c7b | |||
| e4d1cdafcc | |||
| c95374bfbd | |||
|
|
05b43d4d72 | ||
|
|
bbed4a3b6e | ||
| 664670573a | |||
| dfca599f6e | |||
| f37c57d0bc | |||
|
|
be45d21486 | ||
|
|
5875868f72 | ||
| 5763485688 | |||
| a18a752b8e | |||
|
|
253e2731bd | ||
|
|
33b250562b | ||
| e5a4065055 | |||
|
|
8d70560968 | ||
|
|
b8fb5c289c | ||
| acd0307591 | |||
|
|
9dc124004d | ||
| e373fe0769 | |||
| 4fef5781a8 | |||
| dabc3e1fbc | |||
| 3c1055f988 | |||
| ad30b84c83 | |||
| e23687dd66 | |||
| 1c5c15bdc7 | |||
| 03c04aa2e6 | |||
| 72acab599a | |||
| 4e3562f9fe | |||
| c212f0ad48 | |||
| 40d9829700 | |||
| b0dadf9bb7 | |||
| bbf3a4df91 | |||
| 1b2060694b | |||
| 1edfc48acf | |||
|
|
b0b2854d44 | ||
| 8bf91f2645 | |||
|
|
dc7c48d211 | ||
|
|
595b9aff6c | ||
| 38e8c4f035 | |||
| 037d68587b | |||
|
|
f8f7848200 | ||
| 08a1101000 | |||
| 197d1a4ce0 | |||
| 0063ce0ccd | |||
| 8e3f40a780 | |||
| a362e71388 | |||
| 1a0f9164ef | |||
|
|
9fc1e57943 | ||
| 79d2ae837c | |||
| f3bf1a6085 | |||
| bfb9985a46 | |||
| 6cc6870934 | |||
| 819f5f3680 | |||
| 4415cb4eda | |||
| e8ced3c4c4 | |||
|
|
fb162e3332 | ||
|
|
27063f102b | ||
|
|
d99825e20e | ||
|
|
c3115fc974 | ||
| a50be52f50 | |||
| b863dfb981 | |||
| 245e3a0ff7 | |||
| 4c7b527735 | |||
| 99fa736947 | |||
| cbb8b6e16b | |||
| 3aa641f05c | |||
| 4ca4db621a | |||
| 0587295c1b | |||
| 47beaad58c | |||
| dd37f90b47 | |||
| fec6cc3ea9 | |||
| 8c41669d1f | |||
| 3cfb58d681 | |||
| 1742371c14 | |||
| bf8a76c1f5 | |||
| 03aba8b080 | |||
| 1dcf34f3ba | |||
| 662e8cae17 | |||
| 6a59f6338c | |||
| 3f54a3a5a5 | |||
| 406f44ae26 | |||
| 85372a10c8 | |||
| 62348bb37d | |||
| d836f6ea10 | |||
| 636dbda36b | |||
| bfc8d8a7c4 | |||
| 8cf3220cd0 | |||
| f9c8b544ba | |||
| 39b4393b13 | |||
| 3dd6fcc75a | |||
| 95e694d01a | |||
| 29f0c5b8f6 | |||
| 15151e0400 | |||
| b992058e00 | |||
| 3dbf66383a | |||
| ea49e3b8cd | |||
| b2ad33a1c6 | |||
| 48f972f7a2 | |||
| b9c1523e81 | |||
| b6c34d11d2 | |||
| a73710088d | |||
| 3dad3f311b | |||
| 6b2d6609a3 | |||
| 45dff6b920 | |||
| b66b1e0fff | |||
| db1a4267bb | |||
| 7b4f45b082 | |||
| 84dead546c | |||
| 124703aa99 | |||
| d799e3768d | |||
| e2ad666d07 | |||
| 10a2973dc7 | |||
| 39c47a1abf | |||
| 6ccf16f56d | |||
| 9ab8188034 | |||
| a145a868dc | |||
| 62229cb999 | |||
| 597ab9c74c | |||
| b9139d5c40 | |||
| d262b8ab8b | |||
| e678b53452 | |||
| ba5829a070 | |||
| a2fee43c8c | |||
| 7134401570 | |||
| 21d7d5b6f9 | |||
| afb1c875da | |||
| 2ef1befb9c | |||
| a1ea5db4f0 | |||
| b5660d582e | |||
| f83153934c | |||
| b53900071c | |||
| 4e8ce4eb0a | |||
| d5c755a331 | |||
| 970b8c33e5 | |||
| 59b89b730d | |||
| debc72014a | |||
| 32def71502 | |||
| cbb8103278 | |||
| 0904cadde5 | |||
| e1e6657b48 | |||
| 909a0e1c16 | |||
| 4eb948c5ef | |||
| bb99c195e9 | |||
| ffe1fd9af4 | |||
| 926888308d | |||
| e7c0066d5d | |||
| 7f42de1c82 | |||
| 8054694763 | |||
| f419ac8fd7 | |||
| 392faa6664 | |||
| b71ea7c4c7 | |||
| a0897c3afb | |||
| fe7394bded | |||
| f39a755815 | |||
| 535a2eea84 | |||
| c4ed263e6c | |||
| e2d6202d56 | |||
| 12b0ac5847 | |||
| ad3fcbf0f3 | |||
| a74c606307 | |||
| 38e5a97015 | |||
| bc310c9dfb | |||
| 7b9023cb6f | |||
| 6c51553f71 | |||
| b6de685ea2 | |||
| f6a69e2eca | |||
| 60f9bf8fe5 | |||
| 120153e9c7 | |||
| 0595e29100 | |||
| a7c1dafce5 | |||
| 74c1bba814 | |||
| ebdd3914f4 | |||
| 90972cf2f5 | |||
| cc9a2dab50 | |||
| b44442b282 | |||
| bf10fe4cdb | |||
| 42d3ebe1b0 | |||
| bb20b470ec | |||
| 63c4095d4d | |||
| 261b4a808d | |||
| ff0da65662 | |||
| 1586c3e69a | |||
| 714167f112 | |||
| 5ce46beebf | |||
| 0f60d82c06 | |||
| e07713a6f7 | |||
| fd368343c4 | |||
| 97a0662adc | |||
| 3f7fb259c9 | |||
| 458b33e5fd | |||
| c7183b730e | |||
| 5255e7d2ed | |||
| 221d7b408a | |||
| 5873371d36 | |||
| f413ed6f7d | |||
| 05bd1cc8c6 | |||
| 2f51f58c7e | |||
| 182b90ee6d | |||
|
|
606da48861 | ||
| 0b200cd296 | |||
| 566c7913c9 | |||
| d8240881cc | |||
| e1b8debb27 | |||
| 33483b81a6 | |||
| 2a730df2a8 | |||
| 200b92bb15 | |||
| 193e2bb0f9 | |||
| 3b1f088596 | |||
| b8a4384c91 | |||
| 6faea8a33b | |||
| e0e0554fea | |||
| b8bd211d8e | |||
| c23c36535c | |||
| 54fb646ea1 | |||
| dae901a45e | |||
| 27f9c0223c | |||
| db75f6d3bf | |||
| 711732ccd6 | |||
| 20f1cb4ef9 | |||
| 6e0c708a81 | |||
| 58e4b9f347 | |||
|
|
f8942cd6c6 | ||
| 81915f1772 | |||
|
|
033bdb93ad | ||
|
|
57b815c8ee | ||
| c569900968 | |||
| 7ab26362f1 | |||
| 23e2c5ffc8 | |||
| 66ece6544e | |||
| be9242b975 | |||
| 7f71ee82ec | |||
| b98a24373e | |||
| 501b35c20c | |||
| 9e03f9babe | |||
| be122038ed | |||
| 84367f8424 | |||
| e1112f1903 | |||
| 684d9b8059 | |||
| 4a5ad4fb4d | |||
| b279434ef0 | |||
| daa3b0084a | |||
| 02d092fb23 | |||
| 8ecf7dda9e | |||
| 65961695de | |||
| 1c17aac544 | |||
| 165e6e829e | |||
| 0d1ff8585c | |||
| d4dcd8c03f | |||
| 8e8fe3d0c9 | |||
| 8c2c402821 | |||
| a2bc72a798 | |||
| 8e6d8a6fa8 | |||
| ff35986a16 | |||
| 1684c28e0f | |||
| 54640147c1 | |||
| dc4c721360 | |||
| e250ddc43e | |||
| cffafb6a6b | |||
| 042acc1a23 | |||
| ba68c80d6b | |||
| 6b88c525b2 | |||
|
|
c88ed9616d | ||
|
|
f88674ed59 | ||
|
|
dfd817d27b | ||
| af19d40444 | |||
| 77042ef297 | |||
| a3d806a923 | |||
| 30f4beb5f6 | |||
| 49e58b2365 | |||
| a5e2208e01 | |||
| 3f3bbfcde4 | |||
| 006e9e2229 | |||
| a36a6dc847 | |||
| f6e0487558 | |||
|
|
e61dfc0401 | ||
|
|
e082f3973a | ||
| da78e57dd3 | |||
| dfaaae5512 | |||
| 55618e381c | |||
| 9597e3868c | |||
| 3a6c7e3183 | |||
| 00bd6e260a | |||
| 8a0757dcef | |||
| a85aba92f9 | |||
| 486fa9cae2 | |||
| 39f4ef6ccb | |||
| cca0d5735e | |||
| fec2d718af | |||
| 07da61d8c5 | |||
| 9010f58636 | |||
| f959ffb6ee | |||
| 33ff05c558 | |||
| e01f2a8947 | |||
|
|
3593f5ab8c | ||
| 203bb8f618 | |||
| 11fb5f9e81 | |||
| 9eb990b3a2 | |||
| 2419e9fcc6 | |||
| 6955d4a3d9 | |||
| 608d45f055 | |||
| 5bf4e50849 | |||
| 3edf7572b6 | |||
| 768bb14842 | |||
| 446940f219 | |||
| e56532367f | |||
| 42da2f2153 | |||
| 0b215bf7e0 | |||
| be8734dd59 | |||
| 9f60c82725 | |||
| 20074dcbd7 | |||
| 7ae2d7117e | |||
| 69e36f4667 | |||
| 10e2600415 | |||
| a067014116 | |||
| c7c2ae0ca3 | |||
| 75563d107b | |||
| c83020d2c1 | |||
| fd85ab3122 | |||
| 2551e673d8 | |||
| 4ad3339331 | |||
|
|
b822ee77bc | ||
| 37cf7ac01b | |||
| 00eb5a2f1e | |||
| a3f63e970f | |||
| dbba10185c | |||
| fa93ca4dc0 | |||
| d5b22ca636 | |||
| 61b5836acd | |||
| f5c1263dd3 | |||
| ee53485d4e | |||
| 940115b588 | |||
| 9c625a5743 | |||
| e58c375cb9 | |||
| d27a57ab28 | |||
| bf9f40aad3 | |||
| 9387fdce1c | |||
| d54695faeb | |||
| 631a4334f9 | |||
| 398277ca08 | |||
| fcb9d401f0 | |||
| f30005cc49 | |||
| ceb8911403 | |||
| db57a52bf6 | |||
| f8c1e337af | |||
| 9245815f97 | |||
| 4da0555bfd | |||
| e1f9a4bbd9 | |||
| 6c988ecf50 | |||
| 3f35dbfad8 | |||
| b9e8346e82 | |||
| 7a97471ed9 | |||
| 5dcc6e2003 | |||
| 3f318afe2c | |||
| 9e3d7bccd9 | |||
| 66b579a63a | |||
| 495badaef6 | |||
| 9823823742 | |||
| 27ee6bfffc | |||
| d5e978adc6 | |||
| 121b4ed974 | |||
| f5c525699e | |||
| 7427d93c1d | |||
| d35ba2c894 | |||
| 63ec6d3eae | |||
| 56a57fadc8 | |||
| 0f9690f6c2 | |||
| 1b97dd4968 | |||
| 3e1cefe5a4 | |||
| 8abd6c39e7 | |||
| cad967ec56 | |||
| ee2c194aeb | |||
| 71d257fd12 | |||
| eb1b4f1b05 | |||
| 4eb5e8acba | |||
| ee45418f8c | |||
| 0964eb85ec | |||
| 03afb7ed2e | |||
| 292cf8f5e4 | |||
| aaefe9e1ca | |||
| bd0df3493f | |||
| c683097635 | |||
| 8953f6f60d | |||
| 7c1dcb5f11 | |||
| 134b0d3822 | |||
| cd2097850e | |||
| 8394f6226a | |||
| 9c7a203930 | |||
|
|
7d01aa463b | ||
|
|
b10bf2c68d | ||
| 23ba1a997d | |||
| aee3f7b075 | |||
| 4b7a4ebe3a | |||
| 68e1208b7f | |||
| f95abfe032 | |||
| 8498a84354 | |||
| b5cb09edb0 | |||
| 4fce0fd0e0 | |||
| fc3fb70025 | |||
| d9ee7e9025 | |||
| 1400945d99 | |||
| 1e3311f635 | |||
| 2bc717caa0 | |||
| a6f3b6fc83 | |||
| bbb07dd459 | |||
| 9cae806dd9 | |||
| a01ddf6a5b | |||
| 16680663fd | |||
| b6f3b838b7 | |||
| c37e7022d1 | |||
| 15bab6ae33 | |||
| 5bd613fb57 | |||
| 6a8c9e14e9 | |||
| 54e3b99708 | |||
| 52e420b0be | |||
| 6326ac71ca | |||
| 151621b49a | |||
| ec7d624cca | |||
| 029ed7de9b | |||
| ce57f0b0f7 | |||
| 64b4ab3249 | |||
| 49decb8e9a | |||
|
|
4704e6deb8 | ||
| 29efde6cbb | |||
|
|
62531a710f | ||
| 57280167a2 | |||
| bcac56a65c | |||
| 4ea8ff9876 | |||
| 090979e5a9 | |||
| 334ba6d4bf | |||
| ae4d1e6db3 | |||
| effe461380 | |||
| 25b4af1921 | |||
| c06ef5d6b5 | |||
| 3400c538b3 | |||
| 91e0e9f233 | |||
| 3387a71399 | |||
| b722b15b26 | |||
| f5879f5867 | |||
| ce41b3316c | |||
| 41b029f12b | |||
| c6c9a02f09 | |||
| 82f9d9db4b | |||
| a2ec4a4828 | |||
| 6ddd2e4759 | |||
| 208f417d17 | |||
| 666188036f | |||
| 3a6dcdc78e | |||
| 4a5b201eba | |||
| 4af119d904 | |||
| 3a6be97c26 | |||
| bc88dfd9a4 | |||
| 35322add7a | |||
| 4c60e54fe7 | |||
| 938c361097 | |||
| 1fd7ba18e9 | |||
| a38dd52d7b | |||
| 84f77642d5 | |||
| 2a4905a1f7 | |||
| 1981be6e2f | |||
| a1409fbcdf | |||
|
|
583ab285d8 | ||
|
|
88a9f8f8de | ||
| e95647c572 | |||
|
|
7adff2c9a8 | ||
| 0f42790aa1 | |||
| 66bd5f8fbf | |||
| 602a6cd86e | |||
| 201bfd1b07 | |||
| 587e9451ea | |||
|
|
685b9cd1fb | ||
|
|
e3f36ddcfb | ||
|
|
b1973f77f7 | ||
|
|
1e40013210 | ||
| f1249392cf | |||
|
|
3c17ba5cc7 | ||
|
|
c9e5fbc361 | ||
| f9721eb1ae | |||
| d9badee18f | |||
| d51e2c19f6 | |||
| 773242cc8e | |||
| ce566b0fa8 | |||
| 656eaf4dea | |||
| 513c907962 | |||
| 50cf01376f | |||
| 00f411eaca | |||
| 9313fa4639 | |||
| e59a98f11c | |||
| 00042af77c | |||
| 77f718bfce | |||
| 02a8fd124f | |||
|
|
ac49f3f72b | ||
| 4d154b7cee | |||
|
|
07e68bd05b | ||
|
|
a65072b743 | ||
|
|
3035aea885 | ||
| 20f091d54e | |||
| 60d43246d4 | |||
| 7005314d4b | |||
| 0108a913e6 | |||
| a3092e57e4 | |||
|
|
cfce44ca3a | ||
| fb6b5b9e46 | |||
| 00eeeade3f | |||
| acfd6bfd5e | |||
| 1fa0e3f9c2 | |||
| 90da51ed5a | |||
|
|
328a3b2d02 | ||
|
|
92eb403e35 | ||
| c3e20d6a11 | |||
|
|
4823496b58 | ||
| 0c086f9f15 | |||
| 632b8c7355 | |||
| 470f0c05bf | |||
| 826cb13c3e | |||
|
|
191f3c3deb | ||
|
|
21593a4696 | ||
|
|
e222be0534 | ||
|
|
83d99a6662 | ||
|
|
68d56c4cd3 | ||
|
|
27e3e446e9 | ||
|
|
3c4033f83c | ||
|
|
814f6caa43 | ||
|
|
bb8ccd2842 | ||
|
|
abeb4cdbb1 | ||
|
|
b4d1046928 | ||
|
|
19c97546b6 | ||
|
|
e67bcd4e26 | ||
| 6543264691 | |||
| c42b3f56c3 | |||
| a56b80ec55 | |||
|
|
18d018b7d7 | ||
| 6781b6debe | |||
| e1d506926f | |||
| ec01edc535 | |||
| b8011717f7 | |||
| 5aa800af6e | |||
| 4000c35299 | |||
| 39471d8261 | |||
| 2cdd192eeb | |||
| 339b8e8ecc | |||
| 9456dc1a00 | |||
| 3250a9f489 | |||
| a77d5f3669 | |||
| 9bf3e46e3c | |||
| e142408bb8 | |||
| 6440567585 | |||
| 344390da14 | |||
| f47101c388 | |||
| fea0b2bfe9 | |||
| 7d5b4325e2 | |||
| 988a5e6b31 | |||
| 0067cac94d | |||
| 89bbf98b4a | |||
| dd822f9c44 | |||
| d6e256a5d2 | |||
| 3bd5db2352 | |||
| 866450f1ae | |||
| 9d80e73925 | |||
| 0374262176 | |||
| 9cdc67ad6c | |||
| 9d5345c5de | |||
|
|
d91ceb6fa7 | ||
|
|
4edbbf223c | ||
| 4050521e5a | |||
|
|
bae1ea7c97 | ||
|
|
1651926efa | ||
|
|
c1726f897b | ||
|
|
ab4b397918 | ||
|
|
6043a827ed | ||
|
|
6be7cb4d0c | ||
| e56c538518 | |||
| 239e1f9f9f | |||
| 3bd4c57b85 | |||
| b1e716788a | |||
| 0a315f203b | |||
| 8ee3e18327 | |||
| 0b9b24ca08 | |||
| 9231f47641 | |||
| ef48c8c6ad | |||
| 3207d25bd3 | |||
| c6f7281bc4 | |||
| 521b47d9fc | |||
| 26d66d2a36 | |||
| a9c93db790 | |||
| b4505e5305 | |||
| e8cd2207cf | |||
| 5c535784e9 | |||
| bf73a2e442 | |||
| 9998b54f89 | |||
| 604424c7ed | |||
| 71ada855c7 | |||
| 49bbfb7b7d | |||
|
|
90b65d4d8a | ||
|
|
8ad2114d4b | ||
|
|
03707f2d6a | ||
|
|
102385a707 | ||
|
|
38a1b496e7 | ||
|
|
93e84fde29 | ||
| 7a57043df8 | |||
|
|
a07468f7b7 | ||
| 512d339803 | |||
|
|
a56224c339 | ||
| 34a4904738 | |||
| 745526ce8a | |||
| b1667770fe | |||
| ded92fdf7a | |||
| 7f4f241841 | |||
| b3ca5ac6f2 | |||
| c35c94f22b | |||
| c9787f8e47 | |||
| 4913ffa6d4 | |||
| 262837bf0b | |||
| 68eb7c9271 | |||
| c88371b37a | |||
| 328b9d95af | |||
| 1eb6017a9d | |||
| 79fac2adcb | |||
| f948905aa2 | |||
| 947134bfd1 | |||
| 32236f9864 | |||
| eb23dc1b0f | |||
| 5bd4f56bc6 | |||
| dc6a2ffe56 | |||
| a74ce78c6f | |||
| df3b729baa | |||
| a50f852b9d | |||
| cf92707ee3 | |||
| 77d8f2fc54 | |||
| f49e5fbd5f | |||
| 2f153fe23c | |||
| 4a20306a83 | |||
| 29b795252e | |||
| bb2f5bbb03 | |||
| bd7958f6c5 | |||
| 890d28fb7f | |||
| 0724215b6a | |||
| 3ab6494c28 | |||
| 50e17bc160 | |||
| c1e04b286e | |||
| 2fe645375c | |||
| d4bb5e3f18 | |||
| c9fe3294ac | |||
| 5cc7331e90 | |||
| 76adea6bd5 | |||
| 0ed4691113 | |||
| c32ca422fc | |||
| a85800d86c | |||
| d5a09dc280 | |||
| fab259a2b5 | |||
| 1d6f999ab6 | |||
| 77c45c0de9 | |||
| 975b3cd294 | |||
|
|
870dd717e4 | ||
| 7138d29041 | |||
| c657264832 | |||
| ce6c9d4613 | |||
| a9cd072acd | |||
|
|
643584e1c5 | ||
| 3a274e7a9b | |||
|
|
5a210e19e1 | ||
| 384122f811 | |||
| 71c5aa4df0 | |||
| 9438ba8dcc | |||
| e6d8d24cd5 | |||
| 41ad4099e3 | |||
|
|
abfc120633 | ||
| 0d03f66e9d | |||
| 2207d06058 | |||
| 969251d9fa | |||
| 37ae508af5 | |||
|
|
952dfde5b7 | ||
| 858fd07c4a | |||
| 3b9959b8b3 | |||
| 70ab486081 | |||
| 2fa8de4103 | |||
| 1aa8befe50 | |||
| 9b0906c068 | |||
| 806280ee4a | |||
| a706f6d9bd | |||
| e73dc2f191 | |||
|
|
3421c6fcbf | ||
|
|
e1ddd19e31 | ||
|
|
a9824b71b7 | ||
| c20acfc9c8 | |||
| 5634f15293 | |||
| d0807ed262 | |||
|
|
1133ea08c8 | ||
| 2323fd0506 | |||
| 9d48438fae | |||
|
|
f0bf743f88 | ||
| 64ac41d1fe | |||
| d8ec051e13 | |||
| 1f5553b571 | |||
|
|
0f0f5e2fcb | ||
| 372dca87ad | |||
| 2e0d747a0d | |||
| 7201fdf152 | |||
| 1bed87bc20 | |||
| 470e834b80 | |||
| 17615a5a2d | |||
|
|
45c7f9555d | ||
|
|
f8eebe2e7d | ||
| 1f7ff062c1 | |||
|
|
996a8a226e | ||
|
|
7fae7afdf6 | ||
|
|
b0df5b9439 | ||
|
|
305e63cf4e | ||
|
|
ee0d3bb446 | ||
|
|
f6a0fcbe0b | ||
|
|
632759bf8a | ||
| 09db06e8b2 | |||
| 24ee4cb7f5 | |||
| 7a28cba71b | |||
| 20f4baa84f | |||
|
|
7e0510115a | ||
|
|
b59abb55fe | ||
|
|
8b8a1554a5 | ||
|
|
3bbc7820c8 | ||
|
|
1aca0b4499 | ||
|
|
ac51ad7a4f | ||
|
|
29e7ac210a | ||
|
|
3833b7a875 | ||
|
|
e26ffb6afd | ||
|
|
8d160572c7 | ||
|
|
2ea75d2a05 | ||
|
|
14dec1d700 | ||
|
|
fa8cdb3241 | ||
|
|
8cddbf86d9 | ||
|
|
76f840f137 | ||
|
|
1331c9e7e9 | ||
| cdddc76a59 | |||
| 27c011413a | |||
| 940c770b44 | |||
| db82350d53 | |||
|
|
8a104c4af2 | ||
|
|
c31ae5073b | ||
|
|
72cc081098 | ||
|
|
38ad9f0da2 | ||
|
|
d12027126c | ||
| 433b218227 | |||
| 433947824a | |||
| 861d92f3c2 | |||
|
|
1b38d34951 | ||
|
|
421866b739 | ||
|
|
337a485fc1 | ||
|
|
bed70c6fb5 | ||
|
|
36d33711a7 | ||
| 636c1fdf26 | |||
|
|
e3841d180e | ||
|
|
8694a20c63 | ||
|
|
428d2562ac | ||
|
|
72c0503ac1 | ||
|
|
654e75fec8 | ||
|
|
3163995d06 | ||
|
|
2dd8fb4f45 | ||
| 79859090f8 | |||
| ffa8a37b04 | |||
| e442a8c968 | |||
|
|
2ed0bdf132 | ||
| 6346da658a | |||
|
|
4dee8658fd | ||
| 50154c944a | |||
| 1bd1e25629 | |||
| 64ab445f4e | |||
| 481756b014 | |||
| a3b6c7e8c8 | |||
| 5a0563a7e8 | |||
| 9e6ad8807a | |||
| 5ae6a61ec0 | |||
| 774ffa8359 | |||
|
|
5067519b8a | ||
|
|
58074f9bfd | ||
|
|
717f2e21a0 | ||
|
|
74f52632f6 | ||
| 9983acf98b | |||
| 1f6dbd181c | |||
| 5fadb8f86d | |||
| 985ef0f6bc | |||
|
|
86581d81c9 | ||
|
|
9c42b861f4 | ||
| af32941352 | |||
|
|
f9581f3100 | ||
|
|
1895d7c3db | ||
|
|
e64a3fb645 | ||
| 54e5fef8fd | |||
| 52d8ae5ffb | |||
| 11704ea908 | |||
|
|
99c450933e | ||
|
|
b691a1e75d | ||
|
|
58c40695ae | ||
|
|
fac6996a15 | ||
|
|
ed8399ef9a | ||
| 7cc0fc640f | |||
| 5c1c0dc515 | |||
|
|
a7ab2bb93a | ||
| a2b9484db3 | |||
| 77f6ac57e9 | |||
|
|
8c649b3e70 | ||
| d287aa80c1 | |||
| 8d284b3d2a | |||
| 667bbc918f | |||
| ac3790b659 | |||
|
|
1affc1e1d3 | ||
|
|
077913400f | ||
|
|
b84bdcc0fc | ||
|
|
5ea129d252 | ||
|
|
eb0e9c2a41 | ||
|
|
8b97528afb | ||
|
|
007126feff | ||
|
|
0b7e8fa38b | ||
| 25b53d55ce | |||
| 5b412bf072 | |||
| 0f89282dae | |||
| 14ba11738b | |||
| fa89da4438 | |||
| be75332be7 | |||
| 1886c69e0b | |||
|
|
23d9f56308 | ||
| 1be7208f47 | |||
| 395fbb7704 | |||
|
|
b4479d6a7d | ||
|
|
34897aceae | ||
|
|
542aa994b7 | ||
|
|
345ccf5392 | ||
|
|
ec7568337c | ||
|
|
c2dbebe56b | ||
|
|
cb6db97fc1 | ||
|
|
15b2f9a13e | ||
|
|
283921cba1 | ||
|
|
dc0f435dbd | ||
|
|
63965e2f68 | ||
|
|
67ac4060d7 | ||
| 4a01ff3537 | |||
| c1be4a1e83 | |||
| 9ec653075d | |||
| a2d5f872ad | |||
|
|
8891cda1d4 | ||
|
|
9e9a19ebb0 | ||
| 0f3e9de2b0 | |||
|
|
f75e7b2002 | ||
|
|
08b369f667 | ||
|
|
6f85968f3c | ||
|
|
709661ff67 | ||
| c7cd4afa01 | |||
|
|
3e2f4e7a10 | ||
|
|
9191d1ec33 | ||
|
|
556a3986c1 | ||
|
|
b71ac25a77 | ||
|
|
ca8e3f685a | ||
|
|
017e02e513 | ||
| 46dcc18ddb | |||
| 9ddea586ea | |||
| f8d5546a03 | |||
| b7cd192185 | |||
| 9f681275b4 | |||
| dac3068437 | |||
| c56fc09da7 | |||
| 0237a22ae9 | |||
| ccb3a23602 | |||
| 30cf0c7aad | |||
| dcdf0c9843 | |||
| 7c673d6e7f | |||
| 667a893d01 | |||
| 01e9ef64c9 | |||
| 5e42618dfd | |||
| 1bef032260 | |||
| 221012f790 | |||
| 8d10dcbe18 | |||
| c51d9b437e | |||
| c85a7d6b9c | |||
| 8a6b4a14bd | |||
| 2e0606ff0c | |||
| f3f96e02a2 | |||
| 7d6022ab09 | |||
| 10f2a7a7b7 | |||
| 271d133053 | |||
| 65ed862c9b | |||
| 1f981e7a60 | |||
| 823decde5c | |||
| 2b609a413d | |||
|
|
5da2a45881 | ||
|
|
c5c7a895a4 | ||
|
|
18f7d3e3c9 | ||
| bea4b7629b | |||
|
|
1463bcae52 | ||
| a2a6bf1b45 | |||
| 448ca372a9 | |||
| 350e494930 | |||
| 47733a5648 | |||
|
|
7f70673625 | ||
|
|
7ae02d43a7 | ||
| 82b72e66ee | |||
|
|
3ca18a42ad | ||
|
|
55d31d0dc2 | ||
| 0499fd03da | |||
| 8e23be665b | |||
| 825682c36d | |||
| f61d0e83f0 | |||
| e4286d18d4 | |||
| ababb5c062 | |||
| 74fa4835e2 | |||
| cf04b83cdf | |||
| c1fe5325ed | |||
| 5b6f091859 | |||
| d903df55ce | |||
| 6a00fd3099 | |||
| 4db5944514 | |||
| 699ffd75df | |||
| 14dcd9eb5f | |||
| e5d0dac65e | |||
| 8acb0c3c02 | |||
| 55a274a6e3 | |||
| 90bd6b1fc1 | |||
| 2fd4687108 | |||
| 3af5b8560d | |||
| a5f9d0c0d5 | |||
| 7fd5b6b39e | |||
| 71bf98794d | |||
| 3e5ef61d5f | |||
| 3a606fdfc4 | |||
| 04d791824d | |||
|
|
5b26564058 | ||
| 8dd58ed4fe | |||
| c0dde1a005 | |||
|
|
773627dc3d | ||
|
|
f0885fcb2e | ||
|
|
9fd4c477f0 | ||
| 0a11ca6051 | |||
| b305924e11 | |||
|
|
11537f9988 | ||
| 863295cd31 | |||
| 5348f059b0 | |||
| 0e43969b63 | |||
| ebb575d490 | |||
| b1a91da844 | |||
|
|
d6164971df | ||
| 397e1433fd | |||
|
|
0e68dbd86c | ||
| 31c84d47fe | |||
| 8fc144b595 | |||
| 8693075061 | |||
| b128455217 | |||
| 99c975d0cd | |||
| d5205b59c1 | |||
| 26fbd81d39 | |||
| 0ccf062d51 | |||
| aa71159a9a | |||
| e56a30df06 | |||
|
|
c035a26051 | ||
| 7b7bd76703 | |||
|
|
d54e2276d6 | ||
| ee878d9fe9 | |||
| 0b50d9aedf | |||
| 4131084973 | |||
| b81ff7f8f5 | |||
| 1284d10257 | |||
| af9a9b837a | |||
| 9a16544836 | |||
| dbcf4f5d69 | |||
| f9050ab185 | |||
| d6e22e7d4d | |||
| e1ae1c021a | |||
| da45326150 | |||
| 28040f85cc | |||
| 652cfa0986 | |||
| 3a76ee366d | |||
| 09c602a830 | |||
| 1d8c4be47a | |||
|
|
e2c26efe4a | ||
|
|
c4ba578285 | ||
|
|
804afa5d96 | ||
|
|
26162f8e78 | ||
|
|
38903f647b | ||
|
|
cd92f4a611 | ||
| 8f1d521007 | |||
| cf9ff87560 | |||
| cbb7fdfa99 | |||
| 487b6fd5ca | |||
|
|
ddd8ff2180 | ||
| 87d00dbcee | |||
| 5cb6ab8416 | |||
| 4b5f22f013 | |||
| 48a8a52b1c | |||
| 8dcd2f0c95 | |||
| 2cb562cdee | |||
| 00bafd98fe | |||
| 536c0cb0fe | |||
| 0f57fc33c8 | |||
| 2aa76766af | |||
| 00711c148a | |||
| d0cba24a37 | |||
| adb0147ea9 | |||
| 086d076262 | |||
| 260082c425 | |||
| ad052462c1 | |||
| b8b6cd8872 | |||
| 799e90f617 | |||
| 8afc6dea11 | |||
| 8af3a91b5a | |||
| bdd5a7dd21 | |||
| 2630d7fae7 | |||
| df5b0a19de | |||
| c7d0a9551e | |||
| 26fa568d72 | |||
| 39acc24535 | |||
| d29b86a0bd | |||
| 8e6a2a1f02 | |||
| 43fe7e0aa0 | |||
| ca79f370b0 | |||
| 10f5933c1e | |||
| 3354f2a696 | |||
| c67a7ef1d8 | |||
| 63ec5d6338 | |||
| a66a76609f | |||
| 9f389fb920 | |||
| 9dff2e1479 | |||
| 299136f1a5 | |||
| 2c65849bc6 | |||
| 0343372910 | |||
| 366c475b05 | |||
| 46e3956bca | |||
| 6409c596f7 | |||
| 5779f511cf | |||
| 63c7903f9b | |||
| 87495fd3af | |||
| 38c60f37da | |||
| baba8b5cf0 | |||
| a4cd99ec90 | |||
| e837532b22 | |||
| f7c6f16777 | |||
| 3b3b2ed8c3 | |||
| 52d0182a52 | |||
| 405b9e7074 | |||
| 24c7a4e7e3 | |||
| 30a57ad5a4 | |||
| d78c746552 | |||
| 773b745c76 | |||
| 45409fc2d6 | |||
| f97d5df75f | |||
| 49b8232f12 | |||
| ac3812f268 | |||
| ed6ee02861 | |||
| 94979e3561 | |||
| 74e4415d58 | |||
| 08bc44ce8b | |||
| aeb289b758 | |||
| 56108aed66 | |||
| 225dcf27ba | |||
| 146035de5a | |||
| cc602ddada | |||
|
|
e13db2e6b6 | ||
|
|
0f79864446 | ||
|
|
01dd2eb92e | ||
|
|
89b68940be | ||
| c8150dff17 | |||
| d8e1e4561d | |||
| c1ca43113b | |||
| 26afe1d94a | |||
| 90622eb25a | |||
| e4e765300d | |||
| 922c33df57 | |||
| 23894f9749 | |||
| 1716034926 | |||
| acc1849fbb | |||
| d1a25bfa65 | |||
| dc0c8c704c | |||
| bb58281fba | |||
| 5b9811a950 | |||
| e9849bfedd | |||
| 6ecd4ec2f3 | |||
|
|
333c46bdf8 | ||
| 23782dc2fa | |||
|
|
95b49ca49d | ||
| a45d4592c3 | |||
| 9a84abf77f | |||
| 5789e2a3b5 | |||
| 92528c7350 | |||
|
|
3acb61959a | ||
| ef75d92415 | |||
| e821a9700a | |||
| d1afdfe578 | |||
| 24ecfe84ae | |||
| 42d225bb6c | |||
| 7c828427e9 | |||
| 8ddd7b02dc | |||
| 963e40120f | |||
| faee071edc | |||
| a6777067da | |||
| c1b22af695 | |||
| 7fc3285272 | |||
| 19d4349c05 | |||
| 99a24a9a35 | |||
| 2b061a2b1c | |||
|
|
124abf0213 | ||
| 2f72b4e42a | |||
| e98b985d66 | |||
| 9efcd90cc0 | |||
| aa248b7997 | |||
| 921e82f6d1 | |||
| aa43bd7d75 | |||
|
|
be6056aadb | ||
| a298fff602 | |||
|
|
5204afca9e | ||
|
|
1722f14a60 | ||
| 3a65f1d39f | |||
| 567199f460 | |||
| cfbacd4d80 | |||
| 95c06d5a09 | |||
| dc8879b1af | |||
| 1962b30e5f | |||
| cb330bcf29 | |||
| 268cd33677 | |||
| 0ae55e0783 | |||
| be43dbd293 | |||
| 45b78a0100 | |||
| fc22f7d86f | |||
| 0622b78dde | |||
| cf355a0451 | |||
| 337aa39ecc | |||
| 24b58e50d1 | |||
| 11c2efa733 | |||
| 0efaa13a9f | |||
|
|
ae08d14626 | ||
|
|
4fdcb5d7cd | ||
|
|
12dbc5569e | ||
|
|
8f124de79c | ||
|
|
ce1124472a | ||
|
|
0580784d16 |
8
.clang-format
Normal file
8
.clang-format
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
BasedOnStyle: Google
|
||||||
|
IndentWidth: 2
|
||||||
|
---
|
||||||
|
Language: Cpp
|
||||||
|
ColumnLimit: 100
|
||||||
|
ReflowComments: true
|
||||||
|
---
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
/build*
|
/build*
|
||||||
|
/cmake-build*
|
||||||
|
|
||||||
# Eclipse
|
# Eclipse
|
||||||
.settings
|
.settings
|
||||||
@@ -8,6 +9,9 @@
|
|||||||
!misc/eclipse/**/.cproject
|
!misc/eclipse/**/.cproject
|
||||||
!misc/eclipse/**/.project
|
!misc/eclipse/**/.project
|
||||||
|
|
||||||
|
#vscode
|
||||||
|
/.vscode
|
||||||
|
|
||||||
# Python
|
# Python
|
||||||
__pycache__
|
__pycache__
|
||||||
.idea
|
.idea
|
||||||
|
|||||||
5
.gitmodules
vendored
5
.gitmodules
vendored
@@ -1,6 +1,3 @@
|
|||||||
[submodule "etl"]
|
|
||||||
path = thirdparty/etl
|
|
||||||
url = https://github.com/ETLCPP/etl.git
|
|
||||||
[submodule "arduino"]
|
[submodule "arduino"]
|
||||||
path = arduino
|
path = arduino
|
||||||
url = https://egit.irs.uni-stuttgart.de/eive/eive_arduino_interface.git
|
url = https://egit.irs.uni-stuttgart.de/eive/eive_arduino_interface.git
|
||||||
@@ -15,7 +12,7 @@
|
|||||||
url = https://github.com/rmspacefish/lwgps.git
|
url = https://github.com/rmspacefish/lwgps.git
|
||||||
[submodule "generators/fsfwgen"]
|
[submodule "generators/fsfwgen"]
|
||||||
path = generators/fsfwgen
|
path = generators/fsfwgen
|
||||||
url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw-generators.git
|
url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw-gen.git
|
||||||
[submodule "thirdparty/arcsec_star_tracker"]
|
[submodule "thirdparty/arcsec_star_tracker"]
|
||||||
path = thirdparty/arcsec_star_tracker
|
path = thirdparty/arcsec_star_tracker
|
||||||
url = https://egit.irs.uni-stuttgart.de/eive/arcsec_star_tracker.git
|
url = https://egit.irs.uni-stuttgart.de/eive/arcsec_star_tracker.git
|
||||||
|
|||||||
86
CHANGELOG.md
Normal file
86
CHANGELOG.md
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
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.0]
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- 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)
|
||||||
461
CMakeLists.txt
461
CMakeLists.txt
@@ -9,125 +9,214 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
cmake_minimum_required(VERSION 3.13)
|
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_VERBOSE TRUE)
|
||||||
|
|
||||||
set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
option(EIVE_HARDCODED_TOOLCHAIN_FILE "\
|
||||||
|
For Linux Board Target BSPs, a default toolchain file will be set. Should be set to OFF \
|
||||||
if(TGT_BSP MATCHES "arm/q7s")
|
if a different toolchain file is set externally" ON
|
||||||
option(EIVE_BUILD_WATCHDOG "Compile the OBSW watchdog insted" OFF)
|
)
|
||||||
option(BUILD_Q7S_SIMPLE_MODE OFF "Simple mode with a minimal main function")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
option(ADD_ETL_LIB "Add ETL library" ON)
|
|
||||||
option(ADD_JSON_LIB "Add JSON library" ON)
|
|
||||||
option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF)
|
|
||||||
|
|
||||||
if(NOT FSFW_OSAL)
|
if(NOT FSFW_OSAL)
|
||||||
set(FSFW_OSAL host CACHE STRING "OS for the FSFW.")
|
set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
|
if(TGT_BSP)
|
||||||
option(LINUX_CROSS_COMPILE ON)
|
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()
|
endif()
|
||||||
|
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
# Perform steps like loading toolchain files where applicable.
|
# Perform steps like loading toolchain files where applicable.
|
||||||
include(${CMAKE_SCRIPT_PATH}/PreProjectConfig.cmake)
|
include(PreProjectConfig)
|
||||||
pre_project_config()
|
pre_project_config()
|
||||||
|
|
||||||
set(PROJECT_NAME_TO_SET eive-obsw-$ENV{USERNAME})
|
|
||||||
if(EIVE_BUILD_WATCHDOG)
|
|
||||||
set(PROJECT_NAME_TO_SET eive-watchdog)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Project Name
|
# Project Name
|
||||||
project(${PROJECT_NAME_TO_SET} ASM C CXX)
|
project(eive-obsw)
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Pre-Sources preparation
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
# Specify the C++ standard
|
# Specify the C++ standard
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
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)
|
||||||
|
|
||||||
|
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 names and variables
|
||||||
set(TARGET_NAME ${CMAKE_PROJECT_NAME})
|
set(OBSW_NAME ${CMAKE_PROJECT_NAME})
|
||||||
|
set(WATCHDOG_NAME eive-watchdog)
|
||||||
|
set(SIMPLE_OBSW_NAME eive-simple)
|
||||||
|
set(UNITTEST_NAME eive-unittest)
|
||||||
set(LIB_FSFW_NAME fsfw)
|
set(LIB_FSFW_NAME fsfw)
|
||||||
set(LIB_ETL_NAME etl)
|
set(LIB_EIVE_MISSION eive-mission)
|
||||||
|
set(LIB_ETL_TARGET etl::etl)
|
||||||
set(LIB_CSP_NAME libcsp)
|
set(LIB_CSP_NAME libcsp)
|
||||||
set(LIB_LWGPS_NAME lwgps)
|
set(LIB_LWGPS_NAME lwgps)
|
||||||
set(LIB_ARCSEC wire)
|
set(LIB_ARCSEC wire)
|
||||||
set(THIRD_PARTY_FOLDER thirdparty)
|
set(THIRD_PARTY_FOLDER thirdparty)
|
||||||
set(LIB_CXX_FS -lstdc++fs)
|
set(LIB_CXX_FS -lstdc++fs)
|
||||||
|
set(LIB_CATCH2 Catch2)
|
||||||
|
set(LIB_GPS gps)
|
||||||
set(LIB_JSON_NAME nlohmann_json::nlohmann_json)
|
set(LIB_JSON_NAME nlohmann_json::nlohmann_json)
|
||||||
|
|
||||||
# Set path names
|
# Set path names
|
||||||
set(FSFW_PATH fsfw)
|
set(FSFW_PATH fsfw)
|
||||||
set(MISSION_PATH mission)
|
set(TEST_PATH test)
|
||||||
set(TEST_PATH test/testtasks)
|
set(UNITTEST_PATH unittest)
|
||||||
set(LINUX_PATH linux)
|
set(LINUX_PATH linux)
|
||||||
set(COMMON_PATH common)
|
set(COMMON_PATH common)
|
||||||
set(WATCHDOG_PATH watchdog)
|
set(WATCHDOG_PATH watchdog)
|
||||||
set(COMMON_CONFIG_PATH ${COMMON_PATH}/config)
|
set(COMMON_CONFIG_PATH ${COMMON_PATH}/config)
|
||||||
|
set(UNITTEST_CFG_PATH ${UNITTEST_PATH}/testcfg)
|
||||||
|
|
||||||
set(FSFW_HAL_LIB_PATH fsfw_hal)
|
set(LIB_EIVE_MISSION_PATH mission)
|
||||||
set(CSP_LIB_PATH ${THIRD_PARTY_FOLDER}/libcsp)
|
set(LIB_CSP_PATH ${THIRD_PARTY_FOLDER}/libcsp)
|
||||||
set(ETL_LIB_PATH ${THIRD_PARTY_FOLDER}/etl)
|
set(LIB_ETL_PATH ${THIRD_PARTY_FOLDER}/etl)
|
||||||
set(LWGPS_LIB_PATH ${THIRD_PARTY_FOLDER}/lwgps)
|
set(LIB_CATCH2_PATH ${THIRD_PARTY_FOLDER}/Catch2)
|
||||||
set(ARCSEC_LIB_PATH ${THIRD_PARTY_FOLDER}/arcsec_star_tracker)
|
set(LIB_LWGPS_PATH ${THIRD_PARTY_FOLDER}/lwgps)
|
||||||
|
set(LIB_ARCSEC_PATH ${THIRD_PARTY_FOLDER}/arcsec_star_tracker)
|
||||||
set(LIB_JSON_PATH ${THIRD_PARTY_FOLDER}/json)
|
set(LIB_JSON_PATH ${THIRD_PARTY_FOLDER}/json)
|
||||||
|
|
||||||
set(FSFW_WARNING_SHADOW_LOCAL_GCC OFF)
|
set(FSFW_WARNING_SHADOW_LOCAL_GCC OFF)
|
||||||
set(ADD_LINUX_FILES False)
|
set(EIVE_ADD_LINUX_FILES False)
|
||||||
|
|
||||||
# Analyse different OS and architecture/target options, determine BSP_PATH,
|
# Analyse different OS and architecture/target options, determine BSP_PATH,
|
||||||
# display information about compiler etc.
|
# display information about compiler etc.
|
||||||
include (${CMAKE_SCRIPT_PATH}/HardwareOsPreConfig.cmake)
|
|
||||||
pre_source_hw_os_config()
|
pre_source_hw_os_config()
|
||||||
|
|
||||||
if(TGT_BSP)
|
if(TGT_BSP)
|
||||||
|
set(LIBGPS_VERSION_MAJOR 3)
|
||||||
|
# I assume a newer version than 3.17 will be installed on other Linux board than the Q7S
|
||||||
|
set(LIBGPS_VERSION_MINOR 20)
|
||||||
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/raspberrypi"
|
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/raspberrypi"
|
||||||
OR TGT_BSP MATCHES "arm/beagleboneblack"
|
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")
|
set(FSFW_CONFIG_PATH "linux/fsfwconfig")
|
||||||
if(NOT BUILD_Q7S_SIMPLE_MODE)
|
if(NOT BUILD_Q7S_SIMPLE_MODE)
|
||||||
set(ADD_LINUX_FILES TRUE)
|
set(EIVE_ADD_LINUX_FILES TRUE)
|
||||||
set(ADD_CSP_LIB TRUE)
|
set(ADD_CSP_LIB TRUE)
|
||||||
set(FSFW_HAL_ADD_LINUX ON)
|
set(FSFW_HAL_ADD_LINUX ON)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${TGT_BSP} MATCHES "arm/raspberrypi")
|
if(TGT_BSP MATCHES "arm/raspberrypi" )
|
||||||
# Used by configure file
|
# Used by configure file
|
||||||
set(RASPBERRY_PI ON)
|
set(RASPBERRY_PI ON)
|
||||||
set(FSFW_HAL_ADD_RASPBERRY_PI ON)
|
set(FSFW_HAL_ADD_RASPBERRY_PI 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")
|
if(TGT_BSP MATCHES "arm/beagleboneblack")
|
||||||
# Used by configure file
|
# Used by configure file
|
||||||
set(BEAGLEBONEBLACK ON)
|
set(BEAGLEBONEBLACK ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${TGT_BSP} MATCHES "arm/q7s")
|
if(TGT_BSP MATCHES "arm/q7s")
|
||||||
# Used by configure file
|
# Used by configure file
|
||||||
set(XIPHOS_Q7S ON)
|
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()
|
endif()
|
||||||
else()
|
else()
|
||||||
# Required by FSFW library
|
# Required by FSFW library
|
||||||
set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
|
set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Configuration files
|
# Configuration files
|
||||||
if(NOT EIVE_BUILD_WATCHDOG)
|
configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h)
|
||||||
configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h)
|
configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h)
|
||||||
configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h)
|
configure_file(${BSP_PATH}/OBSWConfig.h.in OBSWConfig.h)
|
||||||
configure_file(${FSFW_CONFIG_PATH}/OBSWConfig.h.in OBSWConfig.h)
|
if(TGT_BSP MATCHES "arm/q7s")
|
||||||
if(${TGT_BSP} MATCHES "arm/q7s")
|
configure_file(${BSP_PATH}/boardconfig/q7sConfig.h.in q7sConfig.h)
|
||||||
configure_file(${BSP_PATH}/boardconfig/q7sConfig.h.in q7sConfig.h)
|
elseif(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/egse")
|
||||||
elseif(${TGT_BSP} MATCHES "arm/raspberrypi")
|
configure_file(${BSP_PATH}/boardconfig/rpiConfig.h.in rpiConfig.h)
|
||||||
configure_file(${BSP_PATH}/boardconfig/rpiConfig.h.in rpiConfig.h)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
configure_file(${WATCHDOG_PATH}/watchdogConf.h.in watchdogConf.h)
|
configure_file(${WATCHDOG_PATH}/watchdogConf.h.in watchdogConf.h)
|
||||||
|
|
||||||
# Set common config path for FSFW
|
# Set common config path for FSFW
|
||||||
@@ -135,136 +224,244 @@ set(FSFW_ADDITIONAL_INC_PATHS
|
|||||||
"${COMMON_PATH}/config"
|
"${COMMON_PATH}/config"
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
# Set for lwgps library
|
|
||||||
set(LWGPS_CONFIG_PATH "${COMMON_PATH}/config")
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Executable and Sources
|
# Executable and Sources
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# Add executable
|
#global compiler options need to be set before adding executables
|
||||||
add_executable(${TARGET_NAME})
|
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"
|
||||||
|
)
|
||||||
|
|
||||||
if(ADD_ETL_LIB)
|
# Removed unused sections.
|
||||||
add_subdirectory(${ETL_LIB_PATH})
|
add_link_options(
|
||||||
|
"-Wl,--gc-sections"
|
||||||
|
)
|
||||||
|
|
||||||
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
|
set(COMPILER_FLAGS "/permissive-")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ADD_JSON_LIB)
|
add_library(${LIB_EIVE_MISSION})
|
||||||
|
|
||||||
|
# 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_target_properties(${OBSW_NAME} PROPERTIES OUTPUT_NAME ${OBSW_BIN_NAME})
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(EIVE_ADD_JSON_LIB)
|
||||||
add_subdirectory(${LIB_JSON_PATH})
|
add_subdirectory(${LIB_JSON_PATH})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(EIVE_ADD_LINUX_FILES)
|
||||||
|
add_subdirectory(${LIB_ARCSEC_PATH})
|
||||||
|
add_subdirectory(${LINUX_PATH})
|
||||||
|
endif()
|
||||||
|
add_subdirectory(${BSP_PATH})
|
||||||
|
if(ADD_CSP_LIB)
|
||||||
|
add_subdirectory(${LIB_CSP_PATH})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(${COMMON_PATH})
|
||||||
|
|
||||||
|
add_subdirectory(${LIB_LWGPS_PATH})
|
||||||
|
add_subdirectory(${FSFW_PATH})
|
||||||
|
add_subdirectory(${LIB_EIVE_MISSION_PATH})
|
||||||
|
add_subdirectory(${TEST_PATH})
|
||||||
|
|
||||||
if(NOT EIVE_BUILD_WATCHDOG)
|
add_subdirectory(${UNITTEST_PATH})
|
||||||
if(ADD_LINUX_FILES)
|
|
||||||
add_subdirectory(${LINUX_PATH})
|
# This should have already been downloaded by the FSFW
|
||||||
endif()
|
# Still include it to be safe
|
||||||
add_subdirectory(${BSP_PATH})
|
find_package(etl ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET)
|
||||||
add_subdirectory(${COMMON_PATH})
|
# Not installed, so use FetchContent to download and provide etl
|
||||||
if(ADD_CSP_LIB)
|
if(NOT etl_FOUND)
|
||||||
add_subdirectory(${CSP_LIB_PATH})
|
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()
|
||||||
|
|
||||||
|
# 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()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if((NOT BUILD_Q7S_SIMPLE_MODE) AND (NOT EIVE_BUILD_WATCHDOG))
|
# The documentation for FetchContent recommends declaring all the dependencies
|
||||||
add_subdirectory(${LWGPS_LIB_PATH})
|
# before making them available. We make all declared dependency available here
|
||||||
add_subdirectory(${FSFW_PATH})
|
# after their declaration
|
||||||
add_subdirectory(${MISSION_PATH})
|
if(FSFW_FETCH_CONTENT_TARGETS)
|
||||||
add_subdirectory(${TEST_PATH})
|
FetchContent_MakeAvailable(${FSFW_FETCH_CONTENT_TARGETS})
|
||||||
add_subdirectory(${ARCSEC_LIB_PATH})
|
if(TARGET etl)
|
||||||
endif()
|
add_library(${LIB_ETL_TARGET} ALIAS etl)
|
||||||
|
endif()
|
||||||
if(EIVE_BUILD_WATCHDOG)
|
if(TARGET Catch2)
|
||||||
add_subdirectory(${WATCHDOG_PATH})
|
# 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()
|
endif()
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Post-Sources preparation
|
# Post-Sources preparation
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
set_property(CACHE FSFW_OSAL PROPERTY STRINGS host linux)
|
# Add libraries
|
||||||
|
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||||
|
${LIB_FSFW_NAME}
|
||||||
|
${LIB_LWGPS_NAME}
|
||||||
|
${LIB_OS_NAME}
|
||||||
|
)
|
||||||
|
|
||||||
if((NOT BUILD_Q7S_SIMPLE_MODE) AND (NOT EIVE_BUILD_WATCHDOG))
|
target_link_libraries(${OBSW_NAME} PRIVATE
|
||||||
# Add libraries for all sources.
|
${LIB_EIVE_MISSION}
|
||||||
target_link_libraries(${TARGET_NAME} PRIVATE
|
)
|
||||||
${LIB_FSFW_NAME}
|
|
||||||
${LIB_OS_NAME}
|
if(TGT_BSP MATCHES "arm/q7s")
|
||||||
${LIB_LWGPS_NAME}
|
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||||
|
${LIB_GPS}
|
||||||
${LIB_ARCSEC}
|
${LIB_ARCSEC}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT EIVE_BUILD_WATCHDOG)
|
target_link_libraries(${UNITTEST_NAME} PRIVATE
|
||||||
if(ADD_CSP_LIB)
|
Catch2
|
||||||
target_link_libraries(${TARGET_NAME} PRIVATE
|
${LIB_EIVE_MISSION}
|
||||||
${LIB_CSP_NAME}
|
)
|
||||||
)
|
|
||||||
endif()
|
if(TGT_BSP MATCHES "arm/egse")
|
||||||
|
target_link_libraries(${OBSW_NAME} PRIVATE
|
||||||
|
${LIB_ARCSEC}
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ADD_ETL_LIB)
|
if(ADD_CSP_LIB)
|
||||||
target_link_libraries(${TARGET_NAME} PRIVATE
|
target_link_libraries(${OBSW_NAME} PRIVATE
|
||||||
${LIB_ETL_NAME}
|
${LIB_CSP_NAME}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ADD_JSON_LIB)
|
|
||||||
target_link_libraries(${TARGET_NAME} PRIVATE
|
if(EIVE_ADD_ETL_LIB)
|
||||||
|
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}
|
${LIB_JSON_NAME}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||||
|
|
||||||
target_link_libraries(${TARGET_NAME} PRIVATE
|
|
||||||
${LIB_CXX_FS}
|
${LIB_CXX_FS}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add include paths for all sources.
|
# Add include paths for all sources.
|
||||||
target_include_directories(${TARGET_NAME} PRIVATE
|
target_include_directories(${LIB_EIVE_MISSION} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
${FSFW_CONFIG_PATH}
|
${FSFW_CONFIG_PATH}
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
${ARCSEC_LIB_PATH}
|
${LIB_ARCSEC_PATH}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/egse")
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
target_include_directories(${LIB_EIVE_MISSION} PUBLIC
|
||||||
set(WARNING_FLAGS
|
${ARCSEC_LIB_PATH}
|
||||||
-Wall
|
)
|
||||||
-Wextra
|
|
||||||
-Wimplicit-fallthrough=1
|
|
||||||
-Wno-unused-parameter
|
|
||||||
-Wno-psabi
|
|
||||||
)
|
|
||||||
|
|
||||||
# Remove unused sections.
|
|
||||||
target_compile_options(${TARGET_NAME} PRIVATE
|
|
||||||
"-ffunction-sections"
|
|
||||||
"-fdata-sections"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Removed unused sections.
|
|
||||||
target_link_options(${TARGET_NAME} PRIVATE
|
|
||||||
"-Wl,--gc-sections"
|
|
||||||
)
|
|
||||||
|
|
||||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|
||||||
set(COMPILER_FLAGS "/permissive-")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_VERBOSE)
|
if(CMAKE_VERBOSE)
|
||||||
message(STATUS "Warning flags: ${WARNING_FLAGS}")
|
message(STATUS "Warning flags: ${WARNING_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Compile options for all sources.
|
|
||||||
target_compile_options(${TARGET_NAME} PRIVATE
|
|
||||||
${WARNING_FLAGS}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(${CMAKE_CROSSCOMPILING})
|
|
||||||
include (${CMAKE_SCRIPT_PATH}/HardwareOsPostConfig.cmake)
|
if(CMAKE_CROSSCOMPILING)
|
||||||
|
include (HardwareOsPostConfig)
|
||||||
post_source_hw_os_config()
|
post_source_hw_os_config()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -285,6 +482,8 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
install(TARGETS ${OBSW_NAME} RUNTIME DESTINATION bin)
|
||||||
|
|
||||||
string(CONCAT POST_BUILD_COMMENT
|
string(CONCAT POST_BUILD_COMMENT
|
||||||
"Build directory: ${CMAKE_BINARY_DIR}\n"
|
"Build directory: ${CMAKE_BINARY_DIR}\n"
|
||||||
"Target OSAL: ${FSFW_OSAL}\n"
|
"Target OSAL: ${FSFW_OSAL}\n"
|
||||||
@@ -293,11 +492,11 @@ string(CONCAT POST_BUILD_COMMENT
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${TARGET_NAME}
|
TARGET ${OBSW_NAME}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_SIZE} ${TARGET_NAME}${FILE_SUFFIX}
|
COMMAND ${CMAKE_SIZE} ${OBSW_BIN_NAME}${FILE_SUFFIX}
|
||||||
COMMENT ${POST_BUILD_COMMENT}
|
COMMENT ${POST_BUILD_COMMENT}
|
||||||
)
|
)
|
||||||
|
|
||||||
include (${CMAKE_SCRIPT_PATH}/BuildType.cmake)
|
include (BuildType)
|
||||||
set_build_type()
|
set_build_type()
|
||||||
|
|||||||
12
Justfile
Normal file
12
Justfile
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
python_script := './cmake/scripts/cmake-build-cfg.py'
|
||||||
|
|
||||||
|
default: q7s-debug-make
|
||||||
|
|
||||||
|
q7s-debug-make:
|
||||||
|
{{python_script}} -o linux -g make -b debug -t "arm/q7s" -l build-Debug-Q7S
|
||||||
|
|
||||||
|
q7s-release-make:
|
||||||
|
{{python_script}} -o linux -g make -b release -t "arm/q7s" -l build-Release-Q7S
|
||||||
|
|
||||||
|
q7s-debug-ninja:
|
||||||
|
{{python_script}} -o linux -g ninja -b debug -t "arm/q7s" -l build-Debug-Q7S
|
||||||
202
LICENSE
Normal file
202
LICENSE
Normal file
@@ -0,0 +1,202 @@
|
|||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
13
NOTICE
Normal file
13
NOTICE
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
Copyright 2021 Institute of Space Systems (IRS), University of Stuttgart
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
419
README.md
419
README.md
@@ -11,13 +11,18 @@
|
|||||||
4. [Useful and Common Host Commands](#host-commands)
|
4. [Useful and Common Host Commands](#host-commands)
|
||||||
5. [Setting up Prerequisites](#set-up-prereq)
|
5. [Setting up Prerequisites](#set-up-prereq)
|
||||||
6. [Remote Debugging](#remote-debugging)
|
6. [Remote Debugging](#remote-debugging)
|
||||||
7. [Direct Debugging](#direct-debugging)
|
6. [Remote Reset](#remote-reset)
|
||||||
8. [Transfering Files to the Q7S](#file-transfer)
|
8. [TMTC testing](#tmtc-testing)
|
||||||
9. [Q7S OBC](#q7s)
|
9. [Direct Debugging](#direct-debugging)
|
||||||
10. [Static Code Analysis](#static-code-analysis)
|
10. [Transfering Files to the Q7S](#file-transfer)
|
||||||
11. [Eclipse](#eclipse)
|
11. [Q7S OBC](#q7s)
|
||||||
12. [Running the OBSW on a Raspberry Pi](#rpi)
|
12. [Static Code Analysis](#static-code-analysis)
|
||||||
13. [FSFW](#fsfw)
|
13. [Eclipse](#eclipse)
|
||||||
|
14. [Running the OBSW on a Raspberry Pi](#rpi)
|
||||||
|
15. [Running OBSW on EGSE](#egse)
|
||||||
|
16. [Manually preparing sysroots to compile gpsd](#gpsd)
|
||||||
|
17. [FSFW](#fsfw)
|
||||||
|
18. [Coding Style](#coding-style)
|
||||||
|
|
||||||
# <a id="general"></a> General information
|
# <a id="general"></a> General information
|
||||||
|
|
||||||
@@ -34,12 +39,14 @@ Target systems:
|
|||||||
the [Xiphos Traq Platform](https://trac2.xiphos.ca/eive-q7). Press on index to find all
|
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
|
relevant pages. The most recent datasheet can be found
|
||||||
[here](https://trac2.xiphos.ca/manual/wiki/Q7RevB/UserManual).
|
[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
|
||||||
* Linux Kernel https://github.com/XiphosSystemsCorp/linux-xlnx.git . EIVE version can be found
|
[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
|
[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).
|
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)
|
* 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
|
* Host System
|
||||||
* Generic software components which are not dependant on hardware can also
|
* 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
|
be run on a host system. All host code is contained in the `bsp_hosted` folder
|
||||||
@@ -50,7 +57,8 @@ Target systems:
|
|||||||
The steps in the primary README are related to the main OBC target Q7S.
|
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`:
|
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.
|
- 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.
|
- Windows Host: Uses the `bsp_hosted` BSP folder, the CMake MinGW Makefiles generator and MSYS2.
|
||||||
|
|
||||||
@@ -63,9 +71,9 @@ prerequisites.
|
|||||||
|
|
||||||
1. ARM cross-compiler installed, either as part of [Vivado 2018.2 installation](#vivado) or
|
1. ARM cross-compiler installed, either as part of [Vivado 2018.2 installation](#vivado) or
|
||||||
as a [separate download](#arm-toolchain)
|
as a [separate download](#arm-toolchain)
|
||||||
2. [Q7S sysroot](#q7s-sysroot) on local development machine
|
2. [Q7S sysroot](#sysroot) on local development machine
|
||||||
3. Recommended: Eclipse or [Vivado 2018.2 SDK](#vivado) for OBSW development
|
3. Recommended: Eclipse or [Vivado 2018.2 SDK](#vivado) for OBSW development
|
||||||
3. [TCF agent] running on Q7S
|
3. [TCF agent](https://wiki.eclipse.org/TCF) running on Q7S
|
||||||
|
|
||||||
## Hardware Design
|
## Hardware Design
|
||||||
|
|
||||||
@@ -91,39 +99,55 @@ When using Windows, run theses steps in MSYS2.
|
|||||||
git submodule update
|
git submodule update
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Ensure that the cross-compiler is working with `arm-linux-gnueabihf-gcc --version`.
|
3. Ensure that the cross-compiler is working with `arm-linux-gnueabihf-gcc --version` and that
|
||||||
It is recommended to set up a shell script which takes care of setting up the environment
|
the sysroot environmental variables have been set like specified in the
|
||||||
for convenience or to set up the
|
[root filesystem chapter](#sysroot).
|
||||||
[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.
|
|
||||||
|
|
||||||
4. Run the CMake configuration to create the build system in a `build-Debug-Q7S` folder.
|
4. Run the CMake configuration to create the build system in a `build-Debug-Q7S` folder.
|
||||||
Add `-G "MinGW Makefiles` in MinGW64 on Windows.
|
Add `-G "MinGW Makefiles` in MinGW64 on Windows.
|
||||||
|
|
||||||
```sh
|
```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 -DOS_FSFW=linux ..
|
cmake -DTGT_BSP="arm/q7s" -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
cmake --build . -j
|
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
|
```sh
|
||||||
cd cmake/scripts/Q7S
|
cp scripts/q7s-env.sh ..
|
||||||
./make_debug_cfg.sh
|
cp scripts/q7s-env-em.sh ..
|
||||||
cd ../../..
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This will invoke a Python script which in turn invokes CMake with the correct
|
Adapt these scripts for your needs by editing the `CROSS_COMPILE_BIN_PATH`
|
||||||
arguments to configure CMake for Q7S cross-compilation.
|
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.
|
||||||
|
|
||||||
You can build the hosted variant of the OBSW by replacing `-DOS_FSFW=linux` with
|
There are also different values for `-DTGT_BSP` to build for the Raspberry Pi
|
||||||
`-DOS_FSFW=host`. There are also different values for `-DTGT_BSP` to build for the Raspberry Pi
|
|
||||||
or the Beagle Bone Black: `arm/raspberrypi` and `arm/beagleboneblack`.
|
or the Beagle Bone Black: `arm/raspberrypi` and `arm/beagleboneblack`.
|
||||||
|
|
||||||
5. Build the software with
|
5. Build the software with
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd build-Debug-Q7S
|
cd cmake-build-debug-q7s
|
||||||
cmake --build . -j
|
cmake --build . -j
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -157,20 +181,50 @@ automatically.
|
|||||||
|
|
||||||
### Q7S OBSW
|
### Q7S OBSW
|
||||||
|
|
||||||
|
The EIVE OBSW is the default target if no target is specified.
|
||||||
|
|
||||||
|
**Debug**
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
mkdir build-Debug-Q7S && cd build-Debug-Q7S
|
mkdir cmake-build-debug-q7s && cd cmake-build-debug-q7s
|
||||||
cmake -DTGT_BSP=arm/q7s -DFSFW_OSAL=linux -DCMAKE_BUILD_TYPE=Debug ..
|
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
|
cmake --build . -j
|
||||||
```
|
```
|
||||||
|
|
||||||
### Q7S Watchdog
|
### Q7S Watchdog
|
||||||
|
|
||||||
|
The watchdog will be built along side the primary OBSW binary.
|
||||||
|
|
||||||
|
### Hosted
|
||||||
|
|
||||||
|
You can also use the FSFW OSAL `host` to build on Windows or for generic OSes.
|
||||||
|
Note: Currently this is not supported.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
mkdir build-Debug-Q7S && cd build-Debug-Q7S
|
mkdir cmake-build-debug && cd cmake-build-debug
|
||||||
cmake -DTGT_BSP=arm/q7s -DFSFW_OSAL=linux -DEIVE_BUILD_WATCHDOG=ON -DCMAKE_BUILD_TYPE=Debug ..
|
cmake -DFSFW_OSAL=host -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
cmake --build . -j
|
cmake --build . -j
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Unittests
|
||||||
|
|
||||||
|
To build the unittests, 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 cmake-build-debug && cd cmake-build-debug
|
||||||
|
cmake ..
|
||||||
|
cmake --build . --target eive-unittests -j
|
||||||
|
```
|
||||||
|
|
||||||
## Connect to EIVE flatsat
|
## Connect to EIVE flatsat
|
||||||
|
|
||||||
### DNS
|
### DNS
|
||||||
@@ -196,18 +250,19 @@ A serial console session is up permanently in a `tmux` session
|
|||||||
|
|
||||||
### Serial console
|
### 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
|
```sh
|
||||||
tmux a -t q7s-serial
|
tmux a -t q7s-fm-fpp
|
||||||
```
|
```
|
||||||
|
|
||||||
If the session does not exist, you can create it like this
|
If the session does not exist, you can create it like this
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
tmux new -s q7s-serial
|
tmux new -s q7s-fm-fpp -t /bin/bash
|
||||||
/bin/bash
|
launch-q7s-fpp
|
||||||
q7s_serial
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Other useful tmux commands:
|
Other useful tmux commands:
|
||||||
@@ -227,55 +282,50 @@ Other useful tmux commands:
|
|||||||
You can use the following command to connect to the Q7S with `ssh`:
|
You can use the following command to connect to the Q7S with `ssh`:
|
||||||
|
|
||||||
```sh
|
```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
|
## 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.
|
You can specify the `-L` option multiple times to set up all port forwarding at once.
|
||||||
Example for using the UDP communication interface:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
ssh -L 1534:192.168.133.10:1534 \
|
ssh -L 1534:192.168.155.55:1534 \
|
||||||
-L 1535:192.168.133.10:22 \
|
-L 1535:192.168.155.55:22 \
|
||||||
-L 1536:192.168.133.10:7301 \
|
-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 \
|
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.
|
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="set-up-prereq"></a> Setting up prerequisites
|
||||||
|
|
||||||
|
## <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 the the Xilinx development tools
|
## <a id="vivado"></a> Installing Vivado the the Xilinx development tools
|
||||||
|
|
||||||
It's also possible to perform debugging with a normal Eclipse installation by installing
|
It's also possible to perform debugging with a normal Eclipse installation by installing
|
||||||
@@ -314,7 +364,9 @@ twice) and generate this list manually with the following commands, according to
|
|||||||
sudo apt install libncurses5
|
sudo apt install libncurses5
|
||||||
```
|
```
|
||||||
|
|
||||||
2. ```sh
|
2. Execute the following command
|
||||||
|
|
||||||
|
```sh
|
||||||
sudo <installRoot>/Vivado/2018.2/bin/vivado -nolog -nojournal -mode batch -source
|
sudo <installRoot>/Vivado/2018.2/bin/vivado -nolog -nojournal -mode batch -source
|
||||||
<installRoot>/.xinstall/Vivado_2018.2/scripts/xlpartinfo.tcl -tclargs
|
<installRoot>/.xinstall/Vivado_2018.2/scripts/xlpartinfo.tcl -tclargs
|
||||||
<installRoot>/Vivado/2018.2/data/parts/installed_devices.txt
|
<installRoot>/Vivado/2018.2/data/parts/installed_devices.txt
|
||||||
@@ -324,23 +376,37 @@ For Linux, you can also download a more recent version of the
|
|||||||
[Linaro 8.3.0 cross-compiler](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads)
|
[Linaro 8.3.0 cross-compiler](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads)
|
||||||
from [here](https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz?revision=e09a1c45-0ed3-4a8e-b06b-db3978fd8d56&la=en&hash=93ED4444B8B3A812B893373B490B90BBB28FD2E3)
|
from [here](https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz?revision=e09a1c45-0ed3-4a8e-b06b-db3978fd8d56&la=en&hash=93ED4444B8B3A812B893373B490B90BBB28FD2E3)
|
||||||
|
|
||||||
|
### Compatibility issues with wayland on more recent Linux distributions
|
||||||
|
|
||||||
|
If Vivado crashes and you find following lines in the `hs_err_pid*` files:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
#
|
||||||
|
# An unexpected error has occurred (11)
|
||||||
|
#
|
||||||
|
Stack:
|
||||||
|
/opt/Xilinx/Vivado/2017.4/tps/lnx64/jre/lib/amd64/server/libjvm.so(+0x923da9) [0x7f666cf5eda9]
|
||||||
|
/opt/Xilinx/Vivado/2017.4/tps/lnx64/jre/lib/amd64/server/libjvm.so(JVM_handle_linux_signal+0xb6) [0x7f666cf653f6]
|
||||||
|
/opt/Xilinx/Vivado/2017.4/tps/lnx64/jre/lib/amd64/server/libjvm.so(+0x9209d3) [0x7f666cf5b9d3]
|
||||||
|
/lib/x86_64-linux-gnu/libc.so.6(+0x35fc0) [0x7f66a993efc0]
|
||||||
|
/opt/Xilinx/Vivado/2017.4/tps/lnx64/jre/lib/amd64/libawt_xawt.so(+0x42028) [0x7f664e24d028]
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
You can [solve this](https://forums.xilinx.com/t5/Design-Entry/Bug-Vivado-2017-4-crashing-on-rightclick-in-console-log/td-p/881811)
|
||||||
|
by logging in with `xorg` like specified [here](https://www.maketecheasier.com/switch-xorg-wayland-ubuntu1710/).
|
||||||
|
|
||||||
|
### Using `docnav` on more recent Linux versions
|
||||||
|
|
||||||
|
If you want to use `docnav` for navigating Xilinx documentation, it is recommended to install
|
||||||
|
it as a standalone version from [here](https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/documentation-nav.html).
|
||||||
|
This is because the `docnav` installed as part of version 2018.2 requires `libpng12`, which is not part of
|
||||||
|
more recent disitributions anymore.
|
||||||
|
|
||||||
## <a id="arm-toolchain"></a> Installing toolchain without Vivado
|
## <a id="arm-toolchain"></a> Installing toolchain without Vivado
|
||||||
|
|
||||||
You can download the toolchains for Windows and Linux
|
You can download the toolchains for Windows and Linux
|
||||||
[from the EIVE cloud](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files?dir=/EIVE_IRS/Software/tools&fileid=831898).
|
[from the EIVE cloud](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/tools).
|
||||||
|
|
||||||
If `wget` is available (e.g. MinGW64), you can use the following command to download the
|
|
||||||
toolchain for Windows
|
|
||||||
|
|
||||||
```sh
|
|
||||||
wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/rfoaistRd67yBbH/download/gcc-arm-linux-gnueabi-win.zip
|
|
||||||
```
|
|
||||||
|
|
||||||
or the following command for Linux (could be useful for CI/CD)
|
|
||||||
|
|
||||||
```sh
|
|
||||||
wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/MRaeA2XnMXpZ5Pp/download/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz
|
|
||||||
```
|
|
||||||
|
|
||||||
## Installing CMake and MSYS2 on Windows
|
## Installing CMake and MSYS2 on Windows
|
||||||
|
|
||||||
@@ -374,21 +440,18 @@ wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/MRaeA2XnMXpZ5Pp/downloa
|
|||||||
```sh
|
```sh
|
||||||
sudo apt-get install cmake
|
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
|
### Updating system root for CI
|
||||||
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:
|
|
||||||
|
|
||||||
|
If the system root is updated, it needs to be manually updated on the buggy file server.
|
||||||
|
If access on `buggy.irs.uni-stuttgart.de` is possible with `ssh` and the rootfs in the cloud
|
||||||
|
[was updated](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/rootfs&fileid=831849)
|
||||||
|
as well, you can update the rootfs like this:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd /var/www/eive/tools
|
||||||
|
wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/SyXpdBBQX32xPgE/download/cortexa9hf-neon-xiphos-linux-gnueabi.tar.gz
|
||||||
```
|
```
|
||||||
wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/agnJGYeRf6fw2ci/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.
|
|
||||||
|
|
||||||
## Setting up UNIX environment for real-time functionalities
|
## Setting up UNIX environment for real-time functionalities
|
||||||
|
|
||||||
@@ -487,10 +550,10 @@ ssh root@192.168.133.10
|
|||||||
```
|
```
|
||||||
|
|
||||||
If this has not been done yet, you can access the serial
|
If this has not been done yet, you can access the serial
|
||||||
console of the Q7S like this to set it
|
console of the Q7S like this
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
picocom -b 115200 /dev/ttyUSB0
|
picocom -b 115200 /dev/q7sSerial
|
||||||
```
|
```
|
||||||
|
|
||||||
The flatsat has the aliases and shell scripts `q7s_ssh` and `q7s_serial` for this task as well.
|
The flatsat has the aliases and shell scripts `q7s_ssh` and `q7s_serial` for this task as well.
|
||||||
@@ -527,6 +590,63 @@ alias or shell script to do this quickly.
|
|||||||
Note: When now setting up a debug session in the Xilinx SDK or Eclipse, the host must be set
|
Note: When now setting up a debug session in the Xilinx SDK or Eclipse, the host must be set
|
||||||
to localhost instead of the IP address of the Q7S.
|
to localhost instead of the IP address of the Q7S.
|
||||||
|
|
||||||
|
# <a id="remote-reset"></a> Remote Reset
|
||||||
|
1. Launch xilinx hardware server on flatsat with alias
|
||||||
|
````
|
||||||
|
launch-hwserver-xilinx
|
||||||
|
````
|
||||||
|
2. On host PC start xsc
|
||||||
|
3. In xsct console type the follwing command to connect to the hardware server (replace </flatsat-pc-ip-address/> with the IP address of the flatsat PC. Can be found out with ifconfig)
|
||||||
|
````
|
||||||
|
connect -url tcp:</flatsat-pc-ip-address/>:3121
|
||||||
|
````
|
||||||
|
4. The following command will list all available devices
|
||||||
|
````
|
||||||
|
targets
|
||||||
|
````
|
||||||
|
5. Connect to the APU of the Q7S
|
||||||
|
````
|
||||||
|
target </APU-number/>
|
||||||
|
````
|
||||||
|
6. Perform reset
|
||||||
|
````
|
||||||
|
rst
|
||||||
|
````
|
||||||
|
|
||||||
|
# <a id="tmtc-testing"></a> TMTC testing
|
||||||
|
|
||||||
|
The OBSW supports sending PUS TM packets via TCP or the PDEC IP Core which transmits the data as
|
||||||
|
CADU frames. To make the CADU frames receivabel by the
|
||||||
|
[TMTC porgram](https://egit.irs.uni-stuttgart.de/eive/eive-tmtc), a python script is running as
|
||||||
|
`systemd` service named `tmtc_bridge` on the flatsat PC which forwards TCP commands to the TCP
|
||||||
|
server of the OBC and reads CADU frames from a serial interface.
|
||||||
|
|
||||||
|
You can check whether the service is running the following command on the flatsat PC
|
||||||
|
|
||||||
|
```sh
|
||||||
|
systemctl status tmtc_bridge
|
||||||
|
```
|
||||||
|
|
||||||
|
The PUS packets transported with the CADU frames are extracted
|
||||||
|
and forwared to the TMTC program's TCP client. The code of the TMTC bridge can be found
|
||||||
|
[here](https://egit.irs.uni-stuttgart.de/eive/tmtc-bridge). To connect the TMTC program to the
|
||||||
|
TMTC-bridge a port forwarding from a host must be set up with the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ssh -L 1537:127.0.0.1:7100 eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5 -t bash
|
||||||
|
```
|
||||||
|
|
||||||
|
You can print the output of the `systemd` service with
|
||||||
|
|
||||||
|
```sh
|
||||||
|
journalctl -u tmtc_bridge
|
||||||
|
```
|
||||||
|
|
||||||
|
This can be helpful to determine whether any TCs arrive or TMs are coming back.
|
||||||
|
|
||||||
|
Note: The encoding of the TM packets and conversion of CADU frames takes some time.
|
||||||
|
Thus the replies are received with a larger delay compared to a direct TCP connection.
|
||||||
|
|
||||||
# <a id="direct-debugging"></a> Direct Debugging
|
# <a id="direct-debugging"></a> Direct Debugging
|
||||||
|
|
||||||
1. Assign static IP address to Q7S
|
1. Assign static IP address to Q7S
|
||||||
@@ -610,7 +730,10 @@ More detailed information about the used q7s commands can be found in the Q7S us
|
|||||||
|
|
||||||
# <a id="q7s"></a> Q7S OBC
|
# <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
|
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
|
of the [Q7S base repository](https://egit.irs.uni-stuttgart.de/eive/q7s-base). This might
|
||||||
@@ -712,10 +835,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
|
The watchdog and its configuration will be directly integrated into this repostory, which
|
||||||
makes adaptions easy.
|
makes adaptions easy.
|
||||||
|
|
||||||
### `tcfagent`
|
### `tcf-agent`
|
||||||
|
|
||||||
This starts the `/usr/bin/agent` program to allows remote debugging. Might not be part of
|
This starts the `/usr/bin/tcf-agent` program to allows remote debugging
|
||||||
the mission code
|
|
||||||
|
|
||||||
### `eive-early-config`
|
### `eive-early-config`
|
||||||
|
|
||||||
@@ -924,28 +1046,22 @@ Reading data from CAN:
|
|||||||
candump can0
|
candump can0
|
||||||
````
|
````
|
||||||
|
|
||||||
|
## Dump content of file in hex
|
||||||
|
````
|
||||||
|
cat file.bin | hexdump -C
|
||||||
|
````
|
||||||
|
All content will be printed with
|
||||||
|
````
|
||||||
|
cat file.bin | hexdump -v
|
||||||
|
````
|
||||||
|
To print only the first X bytes of a file
|
||||||
|
````
|
||||||
|
cat file.bin | hexdump -v -n X
|
||||||
|
````
|
||||||
|
|
||||||
## Preparation of a fresh rootfs and SD card
|
## Preparation of a fresh rootfs and SD card
|
||||||
|
|
||||||
This section summarizes important changes between a fresh rootfs and the current
|
See [q7s-package repository README](https://egit.irs.uni-stuttgart.de/eive/q7s-package)
|
||||||
EIVE implementation
|
|
||||||
|
|
||||||
### rootfs
|
|
||||||
|
|
||||||
- Mount point `/mnt/sd0` created for SD card 0. Created with `mkdir`
|
|
||||||
- Mount point `/mnt/sd1` created for SD card 1. Created with `mkdir`
|
|
||||||
- Folder `scripts` in `/home/root` folder.
|
|
||||||
- `scripts` folder currently contains a few shell helper scripts
|
|
||||||
- Folder `profile.d` in `/etc` folder which contains the `path-set.sh` script
|
|
||||||
which is sourced at software startup
|
|
||||||
- Library `libwire.so` in `/usr/lib` folder
|
|
||||||
|
|
||||||
### SD Cards
|
|
||||||
|
|
||||||
- Folder `bin` for binaries, for example the OBSW
|
|
||||||
- Folder `misc` for miscellaneous files. Contains `ls` for directory listings
|
|
||||||
- Folder `tc` for telecommands
|
|
||||||
- Folder `tm` for telemetry
|
|
||||||
- Folder `xdi` for XDI components (e.g. for firmware or device tree updates)
|
|
||||||
|
|
||||||
# <a id="static-code-analysis"></a> Running cppcheck on the Software
|
# <a id="static-code-analysis"></a> Running cppcheck on the Software
|
||||||
|
|
||||||
@@ -993,7 +1109,7 @@ The [TCF agent](https://wiki.eclipse.org/TCF) can be used to perform remote debu
|
|||||||
1. Install the TCF agent plugin in Eclipse from
|
1. Install the TCF agent plugin in Eclipse from
|
||||||
the [releases](https://www.eclipse.org/tcf/downloads.php). Go to
|
the [releases](https://www.eclipse.org/tcf/downloads.php). Go to
|
||||||
Help → Install New Software and use the download page, for
|
Help → Install New Software and use the download page, for
|
||||||
example https://download.eclipse.org/tools/tcf/releases/1.6/1.6.2/ to search for the plugin and install it.
|
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**.
|
2. 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.
|
Here, the Q7S should show up if the local port forwarding was set up as explained previously.
|
||||||
@@ -1032,6 +1148,38 @@ sudo apt-get install gpiod libgpiod-dev
|
|||||||
|
|
||||||
to install the required GPIO libraries before cloning the system root folder.
|
to install the required GPIO libraries before cloning the system root folder.
|
||||||
|
|
||||||
|
# <a id="egse"></a> Running OBSW on EGSE
|
||||||
|
The EGSE is a test system from arcsec build arround a raspberry pi 4 to test the star tracker. The IP address of the EGSE (raspberry pi) is 192.168.18.31. An ssh session can be opened with
|
||||||
|
````
|
||||||
|
ssh pi@192.168.18.31
|
||||||
|
````
|
||||||
|
Password: raspberry
|
||||||
|
|
||||||
|
To run the obsw perform the following steps:
|
||||||
|
1. Build the cmake EGSE Configuration
|
||||||
|
* the sysroots for the EGSE can be found [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/egse&fileid=1190471)
|
||||||
|
* toolchain for linux host can be downloaded from [here](https://github.com/Pro/raspi-toolchain)
|
||||||
|
* toolchain for windows host from [here](https://gnutoolchains.com/raspberry/) (the raspios-buster-armhf toolchain is the right one for the EGSE)
|
||||||
|
2. Disable the ser2net systemd service on the EGSE
|
||||||
|
````sh
|
||||||
|
$ sudo systemctl stop ser2net.service
|
||||||
|
````
|
||||||
|
3. Power on the star tracker by running
|
||||||
|
````sh
|
||||||
|
$ ~/powerctrl/enable0.sh`
|
||||||
|
````
|
||||||
|
4. Run portforwarding script for tmtc tcp connection and tcf agent on host PC
|
||||||
|
````sh
|
||||||
|
$ ./scripts/egse-port.sh
|
||||||
|
````
|
||||||
|
5. The star tracker can be powered off by running
|
||||||
|
````sh
|
||||||
|
$ ~/powerctrl/disable0.sh
|
||||||
|
````
|
||||||
|
|
||||||
|
# <a id="gpsd"></a> Manually preparing sysroots to compile gpsd
|
||||||
|
Copy all header files from [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/gpsd&fileid=1189985) to the /usr/include directory and all static libraries to /usr/lib.
|
||||||
|
|
||||||
# <a id="fsfw"></a> Flight Software Framework (FSFW)
|
# <a id="fsfw"></a> Flight Software Framework (FSFW)
|
||||||
|
|
||||||
An EIVE fork of the FSFW is submodules into this repository.
|
An EIVE fork of the FSFW is submodules into this repository.
|
||||||
@@ -1051,3 +1199,18 @@ git merge upstream/master
|
|||||||
|
|
||||||
Alternatively, changes from other upstreams (forks) and branches can be merged like that
|
Alternatively, changes from other upstreams (forks) and branches can be merged like that
|
||||||
in the same way.
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
4. On windows download the clang-formatting tools from https://llvm.org/builds/. On linux clang-format can be installed with the package manager.
|
||||||
|
5. Navigate to Preferences → C/C++ → CppStyle
|
||||||
|
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
|
||||||
|
|||||||
32
archive/gpio/GpioCookie.cpp
Normal file
32
archive/gpio/GpioCookie.cpp
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#include "GpioCookie.h"
|
||||||
|
|
||||||
|
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||||
|
|
||||||
|
GpioCookie::GpioCookie() {}
|
||||||
|
|
||||||
|
ReturnValue_t GpioCookie::addGpio(gpioId_t gpioId, GpioBase* gpioConfig) {
|
||||||
|
if (gpioConfig == nullptr) {
|
||||||
|
sif::debug << "GpioCookie::addGpio: gpioConfig is nullpointer" << std::endl;
|
||||||
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
}
|
||||||
|
auto gpioMapIter = gpioMap.find(gpioId);
|
||||||
|
if (gpioMapIter == gpioMap.end()) {
|
||||||
|
auto statusPair = gpioMap.emplace(gpioId, gpioConfig);
|
||||||
|
if (statusPair.second == false) {
|
||||||
|
#if FSFW_VERBOSE_LEVEL >= 1
|
||||||
|
sif::error << "GpioCookie::addGpio: Failed to add GPIO " << gpioId << " to GPIO map"
|
||||||
|
<< std::endl;
|
||||||
|
#endif
|
||||||
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
}
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
#if FSFW_VERBOSE_LEVEL >= 1
|
||||||
|
sif::error << "GpioCookie::addGpio: GPIO already exists in GPIO map " << std::endl;
|
||||||
|
#endif
|
||||||
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpioMap GpioCookie::getGpioMap() const { return gpioMap; }
|
||||||
|
|
||||||
|
GpioCookie::~GpioCookie() {}
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
#ifndef LINUX_GPIO_GPIOCOOKIE_H_
|
#ifndef LINUX_GPIO_GPIOCOOKIE_H_
|
||||||
#define LINUX_GPIO_GPIOCOOKIE_H_
|
#define LINUX_GPIO_GPIOCOOKIE_H_
|
||||||
|
|
||||||
#include "GpioIF.h"
|
|
||||||
#include "gpioDefinitions.h"
|
|
||||||
#include <fsfw/devicehandlers/CookieIF.h>
|
#include <fsfw/devicehandlers/CookieIF.h>
|
||||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||||
|
|
||||||
|
#include "GpioIF.h"
|
||||||
|
#include "gpioDefinitions.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Cookie for the GpioIF. Allows the GpioIF to determine which
|
* @brief Cookie for the GpioIF. Allows the GpioIF to determine which
|
||||||
* GPIOs to initialize and whether they should be configured as in- or
|
* GPIOs to initialize and whether they should be configured as in- or
|
||||||
@@ -16,24 +17,23 @@
|
|||||||
*
|
*
|
||||||
* @author J. Meier
|
* @author J. Meier
|
||||||
*/
|
*/
|
||||||
class GpioCookie: public CookieIF {
|
class GpioCookie : public CookieIF {
|
||||||
public:
|
public:
|
||||||
|
GpioCookie();
|
||||||
|
|
||||||
GpioCookie();
|
virtual ~GpioCookie();
|
||||||
|
|
||||||
virtual ~GpioCookie();
|
ReturnValue_t addGpio(gpioId_t gpioId, GpioBase* gpioConfig);
|
||||||
|
/**
|
||||||
|
* @brief Get map with registered GPIOs.
|
||||||
|
*/
|
||||||
|
GpioMap getGpioMap() const;
|
||||||
|
|
||||||
ReturnValue_t addGpio(gpioId_t gpioId, GpioBase* gpioConfig);
|
private:
|
||||||
/**
|
/**
|
||||||
* @brief Get map with registered GPIOs.
|
* Returns a copy of the internal GPIO map.
|
||||||
*/
|
*/
|
||||||
GpioMap getGpioMap() const;
|
GpioMap gpioMap;
|
||||||
|
|
||||||
private:
|
|
||||||
/**
|
|
||||||
* Returns a copy of the internal GPIO map.
|
|
||||||
*/
|
|
||||||
GpioMap gpioMap;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* LINUX_GPIO_GPIOCOOKIE_H_ */
|
#endif /* LINUX_GPIO_GPIOCOOKIE_H_ */
|
||||||
54
archive/gpio/GpioIF.h
Normal file
54
archive/gpio/GpioIF.h
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
#ifndef LINUX_GPIO_GPIOIF_H_
|
||||||
|
#define LINUX_GPIO_GPIOIF_H_
|
||||||
|
|
||||||
|
#include <fsfw/devicehandlers/CookieIF.h>
|
||||||
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||||
|
|
||||||
|
#include "gpioDefinitions.h"
|
||||||
|
|
||||||
|
class GpioCookie;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This class defines the interface for objects requiring the control
|
||||||
|
* over GPIOs.
|
||||||
|
* @author J. Meier
|
||||||
|
*/
|
||||||
|
class GpioIF : public HasReturnvaluesIF {
|
||||||
|
public:
|
||||||
|
virtual ~GpioIF(){};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called by the GPIO using object.
|
||||||
|
* @param cookie Cookie specifying informations of the GPIOs required
|
||||||
|
* by a object.
|
||||||
|
*/
|
||||||
|
virtual ReturnValue_t addGpios(GpioCookie* cookie) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief By implementing this function a child must provide the
|
||||||
|
* functionality to pull a certain GPIO to high logic level.
|
||||||
|
*
|
||||||
|
* @param gpioId A unique number which specifies the GPIO to drive.
|
||||||
|
* @return Returns RETURN_OK for success. This should never return RETURN_FAILED.
|
||||||
|
*/
|
||||||
|
virtual ReturnValue_t pullHigh(gpioId_t gpioId) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief By implementing this function a child must provide the
|
||||||
|
* functionality to pull a certain GPIO to low logic level.
|
||||||
|
*
|
||||||
|
* @param gpioId A unique number which specifies the GPIO to drive.
|
||||||
|
*/
|
||||||
|
virtual ReturnValue_t pullLow(gpioId_t gpioId) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function requires a child to implement the functionality to read the state of
|
||||||
|
* an ouput or input gpio.
|
||||||
|
*
|
||||||
|
* @param gpioId A unique number which specifies the GPIO to read.
|
||||||
|
* @param gpioState State of GPIO will be written to this pointer.
|
||||||
|
*/
|
||||||
|
virtual ReturnValue_t readGpio(gpioId_t gpioId, int* gpioState) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* LINUX_GPIO_GPIOIF_H_ */
|
||||||
295
archive/gpio/LinuxLibgpioIF.cpp
Normal file
295
archive/gpio/LinuxLibgpioIF.cpp
Normal file
@@ -0,0 +1,295 @@
|
|||||||
|
#include "LinuxLibgpioIF.h"
|
||||||
|
|
||||||
|
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||||
|
#include <gpiod.h>
|
||||||
|
#include <linux/gpio/gpioDefinitions.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
#include "GpioCookie.h"
|
||||||
|
|
||||||
|
LinuxLibgpioIF::LinuxLibgpioIF(object_id_t objectId) : SystemObject(objectId) {
|
||||||
|
struct gpiod_chip* chip = gpiod_chip_open_by_label("/amba_pl/gpio@42030000");
|
||||||
|
|
||||||
|
sif::debug << chip->name << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
LinuxLibgpioIF::~LinuxLibgpioIF() {}
|
||||||
|
|
||||||
|
ReturnValue_t LinuxLibgpioIF::addGpios(GpioCookie* gpioCookie) {
|
||||||
|
ReturnValue_t result;
|
||||||
|
if (gpioCookie == nullptr) {
|
||||||
|
sif::error << "LinuxLibgpioIF::initialize: Invalid cookie" << std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpioMap mapToAdd = gpioCookie->getGpioMap();
|
||||||
|
|
||||||
|
/* Check whether this ID already exists in the map and remove duplicates */
|
||||||
|
result = checkForConflicts(mapToAdd);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
result = configureGpios(mapToAdd);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Register new GPIOs in gpioMap */
|
||||||
|
gpioMap.insert(mapToAdd.begin(), mapToAdd.end());
|
||||||
|
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t LinuxLibgpioIF::configureGpios(GpioMap& mapToAdd) {
|
||||||
|
for (auto& gpioConfig : mapToAdd) {
|
||||||
|
switch (gpioConfig.second->gpioType) {
|
||||||
|
case (gpio::GpioTypes::NONE): {
|
||||||
|
return GPIO_INVALID_INSTANCE;
|
||||||
|
}
|
||||||
|
case (gpio::GpioTypes::GPIOD_REGULAR): {
|
||||||
|
GpiodRegular* regularGpio = dynamic_cast<GpiodRegular*>(gpioConfig.second);
|
||||||
|
if (regularGpio == nullptr) {
|
||||||
|
return GPIO_INVALID_INSTANCE;
|
||||||
|
}
|
||||||
|
configureRegularGpio(gpioConfig.first, regularGpio);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (gpio::GpioTypes::CALLBACK): {
|
||||||
|
auto gpioCallback = dynamic_cast<GpioCallback*>(gpioConfig.second);
|
||||||
|
if (gpioCallback->callback == nullptr) {
|
||||||
|
return GPIO_INVALID_INSTANCE;
|
||||||
|
}
|
||||||
|
gpioCallback->callback(gpioConfig.first, gpio::GpioOperation::WRITE,
|
||||||
|
gpioCallback->initValue, gpioCallback->callbackArgs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t LinuxLibgpioIF::configureRegularGpio(gpioId_t gpioId, GpiodRegular* regularGpio) {
|
||||||
|
std::string chipname;
|
||||||
|
unsigned int lineNum;
|
||||||
|
struct gpiod_chip* chip;
|
||||||
|
gpio::Direction direction;
|
||||||
|
std::string consumer;
|
||||||
|
struct gpiod_line* lineHandle;
|
||||||
|
int result = 0;
|
||||||
|
|
||||||
|
chipname = regularGpio->chipname;
|
||||||
|
chip = gpiod_chip_open_by_name(chipname.c_str());
|
||||||
|
if (!chip) {
|
||||||
|
sif::error << "LinuxLibgpioIF::configureGpios: Failed to open chip " << chipname
|
||||||
|
<< ". Gpio ID: " << gpioId << std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
lineNum = regularGpio->lineNum;
|
||||||
|
lineHandle = gpiod_chip_get_line(chip, lineNum);
|
||||||
|
if (!lineHandle) {
|
||||||
|
sif::error << "LinuxLibgpioIF::configureGpios: Failed to open line for GPIO with id " << gpioId
|
||||||
|
<< std::endl;
|
||||||
|
gpiod_chip_close(chip);
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
direction = regularGpio->direction;
|
||||||
|
consumer = regularGpio->consumer;
|
||||||
|
/* Configure direction and add a description to the GPIO */
|
||||||
|
switch (direction) {
|
||||||
|
case (gpio::OUT): {
|
||||||
|
result = gpiod_line_request_output(lineHandle, consumer.c_str(), regularGpio->initValue);
|
||||||
|
if (result < 0) {
|
||||||
|
sif::error << "LinuxLibgpioIF::configureGpios: Failed to request line " << lineNum
|
||||||
|
<< " from GPIO instance with ID: " << gpioId << std::endl;
|
||||||
|
gpiod_line_release(lineHandle);
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (gpio::IN): {
|
||||||
|
result = gpiod_line_request_input(lineHandle, consumer.c_str());
|
||||||
|
if (result < 0) {
|
||||||
|
sif::error << "LinuxLibgpioIF::configureGpios: Failed to request line " << lineNum
|
||||||
|
<< " from GPIO instance with ID: " << gpioId << std::endl;
|
||||||
|
gpiod_line_release(lineHandle);
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
sif::error << "LinuxLibgpioIF::configureGpios: Invalid direction specified" << std::endl;
|
||||||
|
return GPIO_INVALID_INSTANCE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Write line handle to GPIO configuration instance so it can later be used to set or
|
||||||
|
* read states of GPIOs.
|
||||||
|
*/
|
||||||
|
regularGpio->lineHandle = lineHandle;
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t LinuxLibgpioIF::pullHigh(gpioId_t gpioId) {
|
||||||
|
gpioMapIter = gpioMap.find(gpioId);
|
||||||
|
if (gpioMapIter == gpioMap.end()) {
|
||||||
|
sif::warning << "LinuxLibgpioIF::driveGpio: Unknown GPIOD ID " << gpioId << std::endl;
|
||||||
|
return UNKNOWN_GPIO_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gpioMapIter->second->gpioType == gpio::GpioTypes::GPIOD_REGULAR) {
|
||||||
|
return driveGpio(gpioId, dynamic_cast<GpiodRegular*>(gpioMapIter->second), 1);
|
||||||
|
} else {
|
||||||
|
auto gpioCallback = dynamic_cast<GpioCallback*>(gpioMapIter->second);
|
||||||
|
if (gpioCallback->callback == nullptr) {
|
||||||
|
return GPIO_INVALID_INSTANCE;
|
||||||
|
}
|
||||||
|
gpioCallback->callback(gpioMapIter->first, gpio::GpioOperation::WRITE, 1,
|
||||||
|
gpioCallback->callbackArgs);
|
||||||
|
}
|
||||||
|
return GPIO_TYPE_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t LinuxLibgpioIF::pullLow(gpioId_t gpioId) {
|
||||||
|
gpioMapIter = gpioMap.find(gpioId);
|
||||||
|
if (gpioMapIter == gpioMap.end()) {
|
||||||
|
sif::warning << "LinuxLibgpioIF::driveGpio: Unknown GPIOD ID " << gpioId << std::endl;
|
||||||
|
return UNKNOWN_GPIO_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gpioMapIter->second->gpioType == gpio::GpioTypes::GPIOD_REGULAR) {
|
||||||
|
return driveGpio(gpioId, dynamic_cast<GpiodRegular*>(gpioMapIter->second), 0);
|
||||||
|
} else {
|
||||||
|
auto gpioCallback = dynamic_cast<GpioCallback*>(gpioMapIter->second);
|
||||||
|
if (gpioCallback->callback == nullptr) {
|
||||||
|
return GPIO_INVALID_INSTANCE;
|
||||||
|
}
|
||||||
|
gpioCallback->callback(gpioMapIter->first, gpio::GpioOperation::WRITE, 0,
|
||||||
|
gpioCallback->callbackArgs);
|
||||||
|
}
|
||||||
|
return GPIO_TYPE_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t LinuxLibgpioIF::driveGpio(gpioId_t gpioId, GpiodRegular* regularGpio,
|
||||||
|
unsigned int logicLevel) {
|
||||||
|
if (regularGpio == nullptr) {
|
||||||
|
return GPIO_TYPE_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int result = gpiod_line_set_value(regularGpio->lineHandle, logicLevel);
|
||||||
|
if (result < 0) {
|
||||||
|
sif::warning << "LinuxLibgpioIF::driveGpio: Failed to pull GPIO with ID " << gpioId
|
||||||
|
<< " to logic level " << logicLevel << std::endl;
|
||||||
|
return DRIVE_GPIO_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t LinuxLibgpioIF::readGpio(gpioId_t gpioId, int* gpioState) {
|
||||||
|
gpioMapIter = gpioMap.find(gpioId);
|
||||||
|
if (gpioMapIter == gpioMap.end()) {
|
||||||
|
sif::warning << "LinuxLibgpioIF::readGpio: Unknown GPIOD ID " << gpioId << std::endl;
|
||||||
|
return UNKNOWN_GPIO_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gpioMapIter->second->gpioType == gpio::GpioTypes::GPIOD_REGULAR) {
|
||||||
|
GpiodRegular* regularGpio = dynamic_cast<GpiodRegular*>(gpioMapIter->second);
|
||||||
|
if (regularGpio == nullptr) {
|
||||||
|
return GPIO_TYPE_FAILURE;
|
||||||
|
}
|
||||||
|
*gpioState = gpiod_line_get_value(regularGpio->lineHandle);
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t LinuxLibgpioIF::checkForConflicts(GpioMap& mapToAdd) {
|
||||||
|
ReturnValue_t status = HasReturnvaluesIF::RETURN_OK;
|
||||||
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||||
|
for (auto& gpioConfig : mapToAdd) {
|
||||||
|
switch (gpioConfig.second->gpioType) {
|
||||||
|
case (gpio::GpioTypes::GPIOD_REGULAR): {
|
||||||
|
auto regularGpio = dynamic_cast<GpiodRegular*>(gpioConfig.second);
|
||||||
|
if (regularGpio == nullptr) {
|
||||||
|
return GPIO_TYPE_FAILURE;
|
||||||
|
}
|
||||||
|
/* Check for conflicts and remove duplicates if necessary */
|
||||||
|
result = checkForConflictsRegularGpio(gpioConfig.first, regularGpio, mapToAdd);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
status = result;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (gpio::GpioTypes::CALLBACK): {
|
||||||
|
auto callbackGpio = dynamic_cast<GpioCallback*>(gpioConfig.second);
|
||||||
|
if (callbackGpio == nullptr) {
|
||||||
|
return GPIO_TYPE_FAILURE;
|
||||||
|
}
|
||||||
|
/* Check for conflicts and remove duplicates if necessary */
|
||||||
|
result = checkForConflictsCallbackGpio(gpioConfig.first, callbackGpio, mapToAdd);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
status = result;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t LinuxLibgpioIF::checkForConflictsRegularGpio(gpioId_t gpioIdToCheck,
|
||||||
|
GpiodRegular* gpioToCheck,
|
||||||
|
GpioMap& mapToAdd) {
|
||||||
|
/* Cross check with private map */
|
||||||
|
gpioMapIter = gpioMap.find(gpioIdToCheck);
|
||||||
|
if (gpioMapIter != gpioMap.end()) {
|
||||||
|
if (gpioMapIter->second->gpioType != gpio::GpioTypes::GPIOD_REGULAR) {
|
||||||
|
sif::warning << "LinuxLibgpioIF::checkForConflicts: ID already exists for different "
|
||||||
|
"GPIO type"
|
||||||
|
<< gpioIdToCheck << ". Removing duplicate." << std::endl;
|
||||||
|
mapToAdd.erase(gpioIdToCheck);
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
auto ownRegularGpio = dynamic_cast<GpiodRegular*>(gpioMapIter->second);
|
||||||
|
if (ownRegularGpio == nullptr) {
|
||||||
|
return GPIO_TYPE_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Remove element from map to add because a entry for this GPIO
|
||||||
|
already exists */
|
||||||
|
sif::warning << "LinuxLibgpioIF::checkForConflictsRegularGpio: Duplicate GPIO definition"
|
||||||
|
<< " detected. Duplicate will be removed from map to add." << std::endl;
|
||||||
|
mapToAdd.erase(gpioIdToCheck);
|
||||||
|
}
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t LinuxLibgpioIF::checkForConflictsCallbackGpio(gpioId_t gpioIdToCheck,
|
||||||
|
GpioCallback* callbackGpio,
|
||||||
|
GpioMap& mapToAdd) {
|
||||||
|
/* Cross check with private map */
|
||||||
|
gpioMapIter = gpioMap.find(gpioIdToCheck);
|
||||||
|
if (gpioMapIter != gpioMap.end()) {
|
||||||
|
if (gpioMapIter->second->gpioType != gpio::GpioTypes::CALLBACK) {
|
||||||
|
sif::warning << "LinuxLibgpioIF::checkForConflicts: ID already exists for different "
|
||||||
|
"GPIO type"
|
||||||
|
<< gpioIdToCheck << ". Removing duplicate." << std::endl;
|
||||||
|
mapToAdd.erase(gpioIdToCheck);
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Remove element from map to add because a entry for this GPIO
|
||||||
|
already exists */
|
||||||
|
sif::warning << "LinuxLibgpioIF::checkForConflictsRegularGpio: Duplicate GPIO definition"
|
||||||
|
<< " detected. Duplicate will be removed from map to add." << std::endl;
|
||||||
|
mapToAdd.erase(gpioIdToCheck);
|
||||||
|
}
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
75
archive/gpio/LinuxLibgpioIF.h
Normal file
75
archive/gpio/LinuxLibgpioIF.h
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
#ifndef LINUX_GPIO_LINUXLIBGPIOIF_H_
|
||||||
|
#define LINUX_GPIO_LINUXLIBGPIOIF_H_
|
||||||
|
|
||||||
|
#include <fsfw/objectmanager/SystemObject.h>
|
||||||
|
#include <fsfwconfig/returnvalues/classIds.h>
|
||||||
|
#include <linux/gpio/GpioIF.h>
|
||||||
|
|
||||||
|
class GpioCookie;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This class implements the GpioIF for a linux based system. The
|
||||||
|
* implementation is based on the libgpiod lib which requires linux 4.8
|
||||||
|
* or higher.
|
||||||
|
* @note The Petalinux SDK from Xilinx supports libgpiod since Petalinux
|
||||||
|
* 2019.1.
|
||||||
|
*/
|
||||||
|
class LinuxLibgpioIF : public GpioIF, public SystemObject {
|
||||||
|
public:
|
||||||
|
static const uint8_t gpioRetvalId = CLASS_ID::LINUX_LIBGPIO_IF;
|
||||||
|
|
||||||
|
static constexpr ReturnValue_t UNKNOWN_GPIO_ID =
|
||||||
|
HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 1);
|
||||||
|
static constexpr ReturnValue_t DRIVE_GPIO_FAILURE =
|
||||||
|
HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 2);
|
||||||
|
static constexpr ReturnValue_t GPIO_TYPE_FAILURE =
|
||||||
|
HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 3);
|
||||||
|
static constexpr ReturnValue_t GPIO_INVALID_INSTANCE =
|
||||||
|
HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 4);
|
||||||
|
|
||||||
|
LinuxLibgpioIF(object_id_t objectId);
|
||||||
|
virtual ~LinuxLibgpioIF();
|
||||||
|
|
||||||
|
ReturnValue_t addGpios(GpioCookie* gpioCookie) override;
|
||||||
|
ReturnValue_t pullHigh(gpioId_t gpioId) override;
|
||||||
|
ReturnValue_t pullLow(gpioId_t gpioId) override;
|
||||||
|
ReturnValue_t readGpio(gpioId_t gpioId, int* gpioState) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
/* Holds the information and configuration of all used GPIOs */
|
||||||
|
GpioMap gpioMap;
|
||||||
|
GpioMapIter gpioMapIter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This functions drives line of a GPIO specified by the GPIO ID.
|
||||||
|
*
|
||||||
|
* @param gpioId The GPIO ID of the GPIO to drive.
|
||||||
|
* @param logiclevel The logic level to set. O or 1.
|
||||||
|
*/
|
||||||
|
ReturnValue_t driveGpio(gpioId_t gpioId, GpiodRegularBase& regularGpio, unsigned int logiclevel);
|
||||||
|
|
||||||
|
ReturnValue_t configureRegularGpio(gpioId_t gpioId, GpiodRegularBase& regularGpio);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function checks if GPIOs are already registered and whether
|
||||||
|
* there exists a conflict in the GPIO configuration. E.g. the
|
||||||
|
* direction.
|
||||||
|
*
|
||||||
|
* @param mapToAdd The GPIOs which shall be added to the gpioMap.
|
||||||
|
*
|
||||||
|
* @return RETURN_OK if successful, otherwise RETURN_FAILED
|
||||||
|
*/
|
||||||
|
ReturnValue_t checkForConflicts(GpioMap& mapToAdd);
|
||||||
|
|
||||||
|
ReturnValue_t checkForConflictsRegularGpio(gpioId_t gpiodId, GpiodRegular* regularGpio,
|
||||||
|
GpioMap& mapToAdd);
|
||||||
|
ReturnValue_t checkForConflictsCallbackGpio(gpioId_t gpiodId, GpioCallback* regularGpio,
|
||||||
|
GpioMap& mapToAdd);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Performs the initial configuration of all GPIOs specified in the GpioMap mapToAdd.
|
||||||
|
*/
|
||||||
|
ReturnValue_t configureGpios(GpioMap& mapToAdd);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* LINUX_GPIO_LINUXLIBGPIOIF_H_ */
|
||||||
83
archive/gpio/gpioDefinitions.h
Normal file
83
archive/gpio/gpioDefinitions.h
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
#ifndef LINUX_GPIO_GPIODEFINITIONS_H_
|
||||||
|
#define LINUX_GPIO_GPIODEFINITIONS_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
|
using gpioId_t = uint16_t;
|
||||||
|
|
||||||
|
namespace gpio {
|
||||||
|
|
||||||
|
enum class Levels : uint8_t { LOW = 0, HIGH = 1 };
|
||||||
|
|
||||||
|
enum class Direction : uint8_t { IN = 0, OUT = 1 };
|
||||||
|
|
||||||
|
enum class GpioOperation { READ, WRITE };
|
||||||
|
|
||||||
|
enum class GpioTypes { NONE, GPIOD_REGULAR, CALLBACK };
|
||||||
|
|
||||||
|
static constexpr gpioId_t NO_GPIO = -1;
|
||||||
|
} // namespace gpio
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Struct containing information about the GPIO to use. This is
|
||||||
|
* required by the libgpiod to access and drive a GPIO.
|
||||||
|
* @param chipname String of the chipname specifying the group which contains the GPIO to
|
||||||
|
* access. E.g. gpiochip0. To detect names of GPIO groups run gpiodetect on
|
||||||
|
* the linux command line.
|
||||||
|
* @param lineNum The offset of the GPIO within the GPIO group.
|
||||||
|
* @param consumer Name of the consumer. Simply a description of the GPIO configuration.
|
||||||
|
* @param direction Specifies whether the GPIO should be used as in- or output.
|
||||||
|
* @param initValue Defines the initial state of the GPIO when configured as output.
|
||||||
|
* Only required for output GPIOs.
|
||||||
|
* @param lineHandle The handle returned by gpiod_chip_get_line will be later written to this
|
||||||
|
* pointer.
|
||||||
|
*/
|
||||||
|
class GpioBase {
|
||||||
|
public:
|
||||||
|
GpioBase() = default;
|
||||||
|
|
||||||
|
GpioBase(gpio::GpioTypes gpioType, std::string consumer, gpio::Direction direction, int initValue)
|
||||||
|
: gpioType(gpioType), consumer(consumer), direction(direction), initValue(initValue) {}
|
||||||
|
|
||||||
|
virtual ~GpioBase(){};
|
||||||
|
|
||||||
|
/* Can be used to cast GpioBase to a concrete child implementation */
|
||||||
|
gpio::GpioTypes gpioType = gpio::GpioTypes::NONE;
|
||||||
|
std::string consumer;
|
||||||
|
gpio::Direction direction = gpio::Direction::IN;
|
||||||
|
int initValue = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class GpiodRegular : public GpioBase {
|
||||||
|
public:
|
||||||
|
GpiodRegular()
|
||||||
|
: GpioBase(gpio::GpioTypes::GPIOD_REGULAR, std::string(), gpio::Direction::IN, 0){};
|
||||||
|
|
||||||
|
GpiodRegular(std::string chipname_, int lineNum_, std::string consumer_,
|
||||||
|
gpio::Direction direction_, int initValue_)
|
||||||
|
: GpioBase(gpio::GpioTypes::GPIOD_REGULAR, consumer_, direction_, initValue_),
|
||||||
|
chipname(chipname_),
|
||||||
|
lineNum(lineNum_) {}
|
||||||
|
std::string chipname;
|
||||||
|
int lineNum = 0;
|
||||||
|
struct gpiod_line* lineHandle = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
class GpioCallback : public GpioBase {
|
||||||
|
public:
|
||||||
|
GpioCallback(std::string consumer, gpio::Direction direction_, int initValue_,
|
||||||
|
void (*callback)(gpioId_t gpioId, gpio::GpioOperation gpioOp, int value, void* args),
|
||||||
|
void* callbackArgs)
|
||||||
|
: GpioBase(gpio::GpioTypes::CALLBACK, consumer, direction_, initValue_),
|
||||||
|
callback(callback),
|
||||||
|
callbackArgs(callbackArgs) {}
|
||||||
|
|
||||||
|
void (*callback)(gpioId_t gpioId, gpio::GpioOperation gpioOp, int value, void* args) = nullptr;
|
||||||
|
void* callbackArgs = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
using GpioMap = std::unordered_map<gpioId_t, GpioBase*>;
|
||||||
|
using GpioMapIter = GpioMap::iterator;
|
||||||
|
|
||||||
|
#endif /* LINUX_GPIO_GPIODEFINITIONS_H_ */
|
||||||
128
archive/tmtc/CCSDSIPCoreBridge.cpp
Normal file
128
archive/tmtc/CCSDSIPCoreBridge.cpp
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
#include <fcntl.h>
|
||||||
|
#include <linux/obc/Ptme.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
|
||||||
|
CCSDSIPCoreBridge::CCSDSIPCoreBridge(object_id_t objectId, object_id_t tcDestination,
|
||||||
|
object_id_t tmStoreId, object_id_t tcStoreId,
|
||||||
|
LinuxLibgpioIF* gpioComIF, std::string uioPtme,
|
||||||
|
gpioId_t papbBusyId, gpioId_t papbEmptyId)
|
||||||
|
: TmTcBridge(objectId, tcDestination, tmStoreId, tcStoreId),
|
||||||
|
gpioComIF(gpioComIF),
|
||||||
|
uioPtme(uioPtme),
|
||||||
|
papbBusyId(papbBusyId),
|
||||||
|
papbEmptyId(papbEmptyId) {}
|
||||||
|
|
||||||
|
CCSDSIPCoreBridge::~CCSDSIPCoreBridge() {}
|
||||||
|
|
||||||
|
ReturnValue_t CCSDSIPCoreBridge::initialize() {
|
||||||
|
ReturnValue_t result = TmTcBridge::initialize();
|
||||||
|
|
||||||
|
fd = open("/dev/uio0", O_RDWR);
|
||||||
|
if (fd < 1) {
|
||||||
|
sif::debug << "CCSDSIPCoreBridge::initialize: Invalid UIO device file" << std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map uio device in virtual address space
|
||||||
|
* PROT_WRITE: Map uio device in writable only mode
|
||||||
|
*/
|
||||||
|
ptmeBaseAddress =
|
||||||
|
static_cast<uint32_t*>(mmap(NULL, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0));
|
||||||
|
|
||||||
|
if (ptmeBaseAddress == MAP_FAILED) {
|
||||||
|
sif::error << "CCSDSIPCoreBridge::initialize: Failed to map uio address" << std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t CCSDSIPCoreBridge::handleTm() {
|
||||||
|
#if OBSW_TEST_CCSDS_PTME == 1
|
||||||
|
return sendTestFrame();
|
||||||
|
#else
|
||||||
|
return TmTcBridge::handleTm();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t CCSDSIPCoreBridge::sendTm(const uint8_t* data, size_t dataLen) {
|
||||||
|
if (pollPapbBusySignal() == RETURN_OK) {
|
||||||
|
startPacketTransfer();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t idx = 0; idx < dataLen; idx++) {
|
||||||
|
if (pollPapbBusySignal() == RETURN_OK) {
|
||||||
|
*(ptmeBaseAddress + PTME_DATA_REG_OFFSET) = static_cast<uint32_t>(*(data + idx));
|
||||||
|
} else {
|
||||||
|
sif::debug << "CCSDSIPCoreBridge::sendTm: Only written " << idx - 1 << " of " << dataLen
|
||||||
|
<< " data" << std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pollPapbBusySignal() == RETURN_OK) {
|
||||||
|
endPacketTransfer();
|
||||||
|
}
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCSDSIPCoreBridge::startPacketTransfer() { *ptmeBaseAddress = PTME_CONFIG_START; }
|
||||||
|
|
||||||
|
void CCSDSIPCoreBridge::endPacketTransfer() { *ptmeBaseAddress = PTME_CONFIG_END; }
|
||||||
|
|
||||||
|
ReturnValue_t CCSDSIPCoreBridge::pollPapbBusySignal() {
|
||||||
|
int papbBusyState = 0;
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
|
||||||
|
/** Check if PAPB interface is ready to receive data */
|
||||||
|
result = gpioComIF->readGpio(papbBusyId, &papbBusyState);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
sif::debug << "CCSDSIPCoreBridge::pollPapbBusySignal: Failed to read papb busy signal"
|
||||||
|
<< std::endl;
|
||||||
|
return RETURN_FAILED;
|
||||||
|
}
|
||||||
|
if (!papbBusyState) {
|
||||||
|
sif::debug << "CCSDSIPCoreBridge::pollPapbBusySignal: PAPB busy" << std::endl;
|
||||||
|
return PAPB_BUSY;
|
||||||
|
}
|
||||||
|
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCSDSIPCoreBridge::isPtmeBufferEmpty() {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
int papbEmptyState = 1;
|
||||||
|
|
||||||
|
result = gpioComIF->readGpio(papbEmptyId, &papbEmptyState);
|
||||||
|
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
sif::debug << "CCSDSIPCoreBridge::isPtmeBufferEmpty: Failed to read papb empty signal"
|
||||||
|
<< std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (papbEmptyState == 1) {
|
||||||
|
sif::debug << "CCSDSIPCoreBridge::isPtmeBufferEmpty: Buffer is empty" << std::endl;
|
||||||
|
} else {
|
||||||
|
sif::debug << "CCSDSIPCoreBridge::isPtmeBufferEmpty: Buffer is not empty" << std::endl;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t CCSDSIPCoreBridge::sendTestFrame() {
|
||||||
|
/** Size of one complete transfer frame data field amounts to 1105 bytes */
|
||||||
|
uint8_t testPacket[1105];
|
||||||
|
|
||||||
|
/** Fill one test packet */
|
||||||
|
for (int idx = 0; idx < 1105; idx++) {
|
||||||
|
testPacket[idx] = static_cast<uint8_t>(idx & 0xFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t result = sendTm(testPacket, 1105);
|
||||||
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
129
archive/tmtc/CCSDSIPCoreBridge.h
Normal file
129
archive/tmtc/CCSDSIPCoreBridge.h
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
#ifndef MISSION_OBC_CCSDSIPCOREBRIDGE_H_
|
||||||
|
#define MISSION_OBC_CCSDSIPCOREBRIDGE_H_
|
||||||
|
|
||||||
|
#include <fsfw/tmtcservices/TmTcBridge.h>
|
||||||
|
#include <fsfw_hal/common/gpio/gpioDefinitions.h>
|
||||||
|
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
#include "OBSWConfig.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This class handles the interfacing to the telemetry (PTME) and telecommand (PDEC) IP
|
||||||
|
* cores responsible for the CCSDS encoding and decoding. The IP cores are implemented
|
||||||
|
* on the programmable logic and are accessible through the linux UIO driver.
|
||||||
|
*/
|
||||||
|
class CCSDSIPCoreBridge : public TmTcBridge {
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Constructor
|
||||||
|
*
|
||||||
|
* @param objectId
|
||||||
|
* @param tcDestination
|
||||||
|
* @param tmStoreId
|
||||||
|
* @param tcStoreId
|
||||||
|
* @param uioPtme Name of the uio device file which provides access to the PTME IP Core.
|
||||||
|
* @param papbBusyId The ID of the GPIO which is connected to the PAPBBusy_N signal of the
|
||||||
|
* PTME IP Core. A low logic level indicates the PTME is not ready to
|
||||||
|
* receive more data.
|
||||||
|
* @param papbEmptyId The ID of the GPIO which is connected to the PAPBEmpty signal of the
|
||||||
|
* PTME IP Core. The signal is high when there are no packets in the
|
||||||
|
* external buffer memory (BRAM).
|
||||||
|
*/
|
||||||
|
CCSDSIPCoreBridge(object_id_t objectId, object_id_t tcDestination, object_id_t tmStoreId,
|
||||||
|
object_id_t tcStoreId, LinuxLibgpioIF* gpioComIF, std::string uioPtme,
|
||||||
|
gpioId_t papbBusyId, gpioId_t papbEmptyId);
|
||||||
|
virtual ~CCSDSIPCoreBridge();
|
||||||
|
|
||||||
|
ReturnValue_t initialize() override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* Overwriting this function to provide the capability of testing the PTME IP Core
|
||||||
|
* implementation.
|
||||||
|
*/
|
||||||
|
virtual ReturnValue_t handleTm() override;
|
||||||
|
|
||||||
|
virtual ReturnValue_t sendTm(const uint8_t* data, size_t dataLen) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static const uint8_t INTERFACE_ID = CLASS_ID::CCSDS_IP_CORE_BRIDGE;
|
||||||
|
|
||||||
|
static const ReturnValue_t PAPB_BUSY = MAKE_RETURN_CODE(0xA0);
|
||||||
|
|
||||||
|
/** Size of mapped address space. 4k (minimal size of pl device) */
|
||||||
|
// static const int MAP_SIZE = 0xFA0;
|
||||||
|
static const int MAP_SIZE = 0x1000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration bits:
|
||||||
|
* bit[1:0]: Size of data (1,2,3 or 4 bytes). 1 Byte <=> b00
|
||||||
|
* bit[2]: Set this bit to 1 to abort a transfered packet
|
||||||
|
* bit[3]: Signals to PTME the start of a new telemetry packet
|
||||||
|
*/
|
||||||
|
static const uint32_t PTME_CONFIG_START = 0x8;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writing this word to the ptme base address signals to the PTME that a complete tm packet has
|
||||||
|
* been transferred.
|
||||||
|
*/
|
||||||
|
static const uint32_t PTME_CONFIG_END = 0x0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writing to this offset within the PTME memory space will insert data for encoding to the
|
||||||
|
* PTME IP core.
|
||||||
|
* The address offset is 0x400 (= 4 * 256)
|
||||||
|
*/
|
||||||
|
static const int PTME_DATA_REG_OFFSET = 256;
|
||||||
|
|
||||||
|
LinuxLibgpioIF* gpioComIF = nullptr;
|
||||||
|
|
||||||
|
/** The uio device file related to the PTME IP Core */
|
||||||
|
std::string uioPtme;
|
||||||
|
|
||||||
|
/** Pulled to low when PTME not ready to receive data */
|
||||||
|
gpioId_t papbBusyId = gpio::NO_GPIO;
|
||||||
|
|
||||||
|
/** High when externally buffer memory of PTME is empty */
|
||||||
|
gpioId_t papbEmptyId = gpio::NO_GPIO;
|
||||||
|
|
||||||
|
/** The file descriptor of the UIO driver */
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
uint32_t* ptmeBaseAddress = nullptr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function sends the config byte to the PTME IP Core to initiate a packet
|
||||||
|
* transfer.
|
||||||
|
*/
|
||||||
|
void startPacketTransfer();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function sends the config byte to the PTME IP Core to signal the end of a
|
||||||
|
* packet transfer.
|
||||||
|
*/
|
||||||
|
void endPacketTransfer();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function reads the papb busy signal indicating whether the PAPB interface is
|
||||||
|
* ready to receive more data or not. PAPB is ready when PAPB_Busy_N == '1'.
|
||||||
|
*
|
||||||
|
* @return RETURN_OK when ready to receive data else PAPB_BUSY.
|
||||||
|
*/
|
||||||
|
ReturnValue_t pollPapbBusySignal();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function can be used for debugging to check wheter there are packets in
|
||||||
|
* the packet buffer of the PTME or not.
|
||||||
|
*/
|
||||||
|
void isPtmeBufferEmpty();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function sends a complete telemetry transfer frame data field (1105 bytes)
|
||||||
|
* to the input of the PTME IP Core. Can be used to test the implementation.
|
||||||
|
*/
|
||||||
|
ReturnValue_t sendTestFrame();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* MISSION_OBC_CCSDSIPCOREBRIDGE_H_ */
|
||||||
27
automation/Dockerfile
Normal file
27
automation/Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
FROM ubuntu:focal
|
||||||
|
|
||||||
|
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 python3
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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"
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
FROM ubuntu:focal
|
|
||||||
|
|
||||||
RUN apt-get update
|
|
||||||
RUN apt-get --yes upgrade
|
|
||||||
RUN apt-get --yes install cmake libgpiod-dev xz-utils nano curl
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# 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 Q7S_SYSROOT="/usr/rootfs/cortexa9hf-neon-xiphos-linux-gnueabi"
|
|
||||||
ENV PATH=$PATH:"/usr/tools/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin"
|
|
||||||
54
automation/Jenkinsfile
vendored
54
automation/Jenkinsfile
vendored
@@ -1,48 +1,36 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
environment {
|
||||||
stages {
|
BUILDDIR_Q7 = 'build_q7'
|
||||||
stage('Build Container') {
|
BUILDDIR_LINUX = 'build_linux'
|
||||||
when {
|
}
|
||||||
changeset "automation/Dockerfile-q7s"
|
agent {
|
||||||
branch 'develop'
|
docker {
|
||||||
}
|
image 'eive-obsw-ci:d5'
|
||||||
steps {
|
args '--sysctl fs.mqueue.msg_max=100'
|
||||||
sh 'docker build -t eive-fsw-build-q7s:gcc8 - < automation/Dockerfile-q7s'
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
stages {
|
||||||
stage('Clean') {
|
stage('Clean') {
|
||||||
when {
|
|
||||||
anyOf {
|
|
||||||
changelog 'cleanCI'
|
|
||||||
changeset '*.cmake'
|
|
||||||
changeset 'CMakeLists.txt'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
sh 'rm -rf build-q7s-debug'
|
sh 'rm -rf $BUILDDIR_Q7'
|
||||||
|
sh 'rm -rf $BUILDDIR_LINUX'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build Q7S') {
|
stage('Build Q7S') {
|
||||||
agent {
|
|
||||||
docker {
|
|
||||||
image 'eive-fsw-build-q7s:gcc8'
|
|
||||||
reuseNode true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
dir('build-q7s-debug') {
|
dir(BUILDDIR_Q7) {
|
||||||
sh 'cmake -DTGT_BSP="arm/q7s" -DCMAKE_BUILD_TYPE=Debug -DFSFW_OSAL=linux ..'
|
sh 'cmake -DTGT_BSP="arm/q7s" -DCMAKE_BUILD_TYPE=Debug ..'
|
||||||
sh 'cmake --build . -j'
|
sh 'cmake --build . -j4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Deploy') {
|
stage('Build Host and Tests') {
|
||||||
when {
|
|
||||||
tag 'v*.*.*'
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
sh 'echo Deploying'
|
dir(BUILDDIR_LINUX) {
|
||||||
|
sh 'cmake ..'
|
||||||
|
sh 'cmake --build . -j4'
|
||||||
|
sh './eive-unittest'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
7
bsp_egse/CMakeLists.txt
Normal file
7
bsp_egse/CMakeLists.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
target_sources(${OBSW_NAME} PUBLIC
|
||||||
|
InitMission.cpp
|
||||||
|
main.cpp
|
||||||
|
ObjectFactory.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_subdirectory(boardconfig)
|
||||||
192
bsp_egse/InitMission.cpp
Normal file
192
bsp_egse/InitMission.cpp
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
#include "InitMission.h"
|
||||||
|
|
||||||
|
#include <fsfw/objectmanager/ObjectManager.h>
|
||||||
|
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||||
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||||
|
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||||
|
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||||
|
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||||
|
#include <fsfw/tasks/TaskFactory.h>
|
||||||
|
#include <mission/utility/InitMission.h>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "OBSWConfig.h"
|
||||||
|
#include "ObjectFactory.h"
|
||||||
|
#include "objects/systemObjectList.h"
|
||||||
|
#include "pollingsequence/pollingSequenceFactory.h"
|
||||||
|
|
||||||
|
ServiceInterfaceStream sif::debug("DEBUG");
|
||||||
|
ServiceInterfaceStream sif::info("INFO");
|
||||||
|
ServiceInterfaceStream sif::warning("WARNING");
|
||||||
|
ServiceInterfaceStream sif::error("ERROR");
|
||||||
|
|
||||||
|
ObjectManagerIF* objectManager = nullptr;
|
||||||
|
|
||||||
|
void initmission::initMission() {
|
||||||
|
sif::info << "Make sure the systemd service ser2net on the egse has been stopped "
|
||||||
|
<< "(alias stop-ser2net)" << std::endl;
|
||||||
|
sif::info << "Make sure the power lines of the star tracker have been enabled "
|
||||||
|
<< "(alias enable-startracker)" << std::endl;
|
||||||
|
sif::info << "Building global objects.." << std::endl;
|
||||||
|
/* Instantiate global object manager and also create all objects */
|
||||||
|
ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
|
||||||
|
sif::info << "Initializing all objects.." << std::endl;
|
||||||
|
ObjectManager::instance()->initialize();
|
||||||
|
|
||||||
|
/* This function creates and starts all tasks */
|
||||||
|
initTasks();
|
||||||
|
}
|
||||||
|
|
||||||
|
void initmission::initTasks() {
|
||||||
|
TaskFactory* factory = TaskFactory::instance();
|
||||||
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||||
|
if (factory == nullptr) {
|
||||||
|
/* Should never happen ! */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#if OBSW_PRINT_MISSED_DEADLINES == 1
|
||||||
|
void (*missedDeadlineFunc)(void) = TaskFactory::printMissedDeadline;
|
||||||
|
#else
|
||||||
|
void (*missedDeadlineFunc)(void) = nullptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* TMTC Distribution */
|
||||||
|
PeriodicTaskIF* tmtcDistributor = factory->createPeriodicTask(
|
||||||
|
"DIST", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||||
|
result = tmtcDistributor->addComponent(objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "Object add component failed" << std::endl;
|
||||||
|
}
|
||||||
|
result = tmtcDistributor->addComponent(objects::PUS_PACKET_DISTRIBUTOR);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "Object add component failed" << std::endl;
|
||||||
|
}
|
||||||
|
result = tmtcDistributor->addComponent(objects::TM_FUNNEL);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "Object add component failed" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
PeriodicTaskIF* tmtcBridgeTask = factory->createPeriodicTask(
|
||||||
|
"TMTC_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||||
|
result = tmtcBridgeTask->addComponent(objects::TMTC_BRIDGE);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "Add component TMTC Bridge failed" << std::endl;
|
||||||
|
}
|
||||||
|
PeriodicTaskIF* tmtcPollingTask = factory->createPeriodicTask(
|
||||||
|
"TMTC_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||||
|
result = tmtcPollingTask->addComponent(objects::TMTC_POLLING_TASK);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "Add component TMTC Polling failed" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* PUS Services */
|
||||||
|
std::vector<PeriodicTaskIF*> pusTasks;
|
||||||
|
createPusTasks(*factory, missedDeadlineFunc, pusTasks);
|
||||||
|
|
||||||
|
std::vector<PeriodicTaskIF*> pstTasks;
|
||||||
|
FixedTimeslotTaskIF* pst = factory->createFixedTimeslotTask(
|
||||||
|
"STAR_TRACKER_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc);
|
||||||
|
result = pst::pstUart(pst);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl;
|
||||||
|
}
|
||||||
|
pstTasks.push_back(pst);
|
||||||
|
|
||||||
|
PeriodicTaskIF* strHelperTask = factory->createPeriodicTask(
|
||||||
|
"STR_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||||
|
result = strHelperTask->addComponent(objects::STR_HELPER);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("STR_HELPER", objects::STR_HELPER);
|
||||||
|
}
|
||||||
|
pstTasks.push_back(strHelperTask);
|
||||||
|
|
||||||
|
auto taskStarter = [](std::vector<PeriodicTaskIF*>& taskVector, std::string name) {
|
||||||
|
for (const auto& task : taskVector) {
|
||||||
|
if (task != nullptr) {
|
||||||
|
task->startTask();
|
||||||
|
} else {
|
||||||
|
sif::error << "Task in vector " << name << " is invalid!" << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
sif::info << "Starting tasks.." << std::endl;
|
||||||
|
tmtcDistributor->startTask();
|
||||||
|
tmtcBridgeTask->startTask();
|
||||||
|
tmtcPollingTask->startTask();
|
||||||
|
|
||||||
|
taskStarter(pstTasks, "PST Tasks");
|
||||||
|
taskStarter(pusTasks, "PUS Tasks");
|
||||||
|
|
||||||
|
sif::info << "Tasks started.." << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void initmission::createPusTasks(TaskFactory& factory,
|
||||||
|
TaskDeadlineMissedFunction missedDeadlineFunc,
|
||||||
|
std::vector<PeriodicTaskIF*>& taskVec) {
|
||||||
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||||
|
PeriodicTaskIF* pusVerification = factory.createPeriodicTask(
|
||||||
|
"PUS_VERIF", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
||||||
|
result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "Object add component failed" << std::endl;
|
||||||
|
}
|
||||||
|
taskVec.push_back(pusVerification);
|
||||||
|
|
||||||
|
PeriodicTaskIF* pusEvents = factory.createPeriodicTask(
|
||||||
|
"PUS_EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
||||||
|
result = pusEvents->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS_EVENTS", objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||||
|
}
|
||||||
|
result = pusEvents->addComponent(objects::EVENT_MANAGER);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS_MGMT", objects::EVENT_MANAGER);
|
||||||
|
}
|
||||||
|
taskVec.push_back(pusEvents);
|
||||||
|
|
||||||
|
PeriodicTaskIF* pusHighPrio = factory.createPeriodicTask(
|
||||||
|
"PUS_HIGH_PRIO", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
||||||
|
result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||||
|
}
|
||||||
|
result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS9", objects::PUS_SERVICE_9_TIME_MGMT);
|
||||||
|
}
|
||||||
|
taskVec.push_back(pusHighPrio);
|
||||||
|
|
||||||
|
PeriodicTaskIF* pusMedPrio = factory.createPeriodicTask(
|
||||||
|
"PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
|
||||||
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||||
|
}
|
||||||
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS200", objects::PUS_SERVICE_200_MODE_MGMT);
|
||||||
|
}
|
||||||
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS20", objects::PUS_SERVICE_20_PARAMETERS);
|
||||||
|
}
|
||||||
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS3", objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||||
|
}
|
||||||
|
taskVec.push_back(pusMedPrio);
|
||||||
|
|
||||||
|
PeriodicTaskIF* pusLowPrio = factory.createPeriodicTask(
|
||||||
|
"PUS_LOW_PRIO", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.6, missedDeadlineFunc);
|
||||||
|
result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST);
|
||||||
|
}
|
||||||
|
result = pusLowPrio->addComponent(objects::INTERNAL_ERROR_REPORTER);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("INT_ERR_RPRT", objects::INTERNAL_ERROR_REPORTER);
|
||||||
|
}
|
||||||
|
taskVec.push_back(pusLowPrio);
|
||||||
|
}
|
||||||
21
bsp_egse/InitMission.h
Normal file
21
bsp_egse/InitMission.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#ifndef BSP_LINUX_INITMISSION_H_
|
||||||
|
#define BSP_LINUX_INITMISSION_H_
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "fsfw/tasks/Typedef.h"
|
||||||
|
|
||||||
|
class PeriodicTaskIF;
|
||||||
|
class TaskFactory;
|
||||||
|
|
||||||
|
namespace initmission {
|
||||||
|
void initMission();
|
||||||
|
void initTasks();
|
||||||
|
|
||||||
|
void createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc,
|
||||||
|
std::vector<PeriodicTaskIF*>& taskVec);
|
||||||
|
void createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc,
|
||||||
|
std::vector<PeriodicTaskIF*>& taskVec);
|
||||||
|
}; // namespace initmission
|
||||||
|
|
||||||
|
#endif /* BSP_LINUX_INITMISSION_H_ */
|
||||||
48
bsp_egse/ObjectFactory.cpp
Normal file
48
bsp_egse/ObjectFactory.cpp
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
#include "ObjectFactory.h"
|
||||||
|
|
||||||
|
#include <devConf.h>
|
||||||
|
#include <fsfw_hal/linux/uart/UartComIF.h>
|
||||||
|
#include <fsfw_hal/linux/uart/UartCookie.h>
|
||||||
|
|
||||||
|
#include "OBSWConfig.h"
|
||||||
|
#include "busConf.h"
|
||||||
|
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
|
||||||
|
#include "fsfw/tmtcpacket/pus/tm.h"
|
||||||
|
#include "fsfw/tmtcservices/CommandingServiceBase.h"
|
||||||
|
#include "fsfw/tmtcservices/PusServiceBase.h"
|
||||||
|
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
|
||||||
|
#include "linux/devices/startracker/StarTrackerHandler.h"
|
||||||
|
#include "mission/core/GenericFactory.h"
|
||||||
|
#include "mission/utility/TmFunnel.h"
|
||||||
|
#include "objects/systemObjectList.h"
|
||||||
|
#include "tmtc/apid.h"
|
||||||
|
#include "tmtc/pusIds.h"
|
||||||
|
|
||||||
|
void Factory::setStaticFrameworkObjectIds() {
|
||||||
|
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||||
|
PusServiceBase::packetDestination = objects::TM_FUNNEL;
|
||||||
|
|
||||||
|
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||||
|
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
||||||
|
|
||||||
|
TmFunnel::downlinkDestination = objects::TMTC_BRIDGE;
|
||||||
|
TmFunnel::storageDestination = objects::NO_OBJECT;
|
||||||
|
|
||||||
|
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
||||||
|
TmPacketBase::timeStamperId = objects::TIME_STAMPER;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObjectFactory::produce(void* args) {
|
||||||
|
Factory::setStaticFrameworkObjectIds();
|
||||||
|
ObjectFactory::produceGenericObjects();
|
||||||
|
|
||||||
|
UartCookie* starTrackerCookie =
|
||||||
|
new UartCookie(objects::STAR_TRACKER, egse::STAR_TRACKER_UART, UartModes::NON_CANONICAL,
|
||||||
|
uart::STAR_TRACKER_BAUD, startracker::MAX_FRAME_SIZE * 2 + 2);
|
||||||
|
new UartComIF(objects::UART_COM_IF);
|
||||||
|
starTrackerCookie->setNoFixedSizeReply();
|
||||||
|
StrHelper* strHelper = new StrHelper(objects::STR_HELPER);
|
||||||
|
StarTrackerHandler* starTrackerHandler = new StarTrackerHandler(
|
||||||
|
objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, strHelper);
|
||||||
|
starTrackerHandler->setStartUpImmediately();
|
||||||
|
}
|
||||||
8
bsp_egse/ObjectFactory.h
Normal file
8
bsp_egse/ObjectFactory.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef BSP_LINUX_OBJECTFACTORY_H_
|
||||||
|
#define BSP_LINUX_OBJECTFACTORY_H_
|
||||||
|
|
||||||
|
namespace ObjectFactory {
|
||||||
|
void produce(void* args);
|
||||||
|
}; // namespace ObjectFactory
|
||||||
|
|
||||||
|
#endif /* BSP_LINUX_OBJECTFACTORY_H_ */
|
||||||
7
bsp_egse/boardconfig/CMakeLists.txt
Normal file
7
bsp_egse/boardconfig/CMakeLists.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
target_sources(${OBSW_NAME} PRIVATE
|
||||||
|
print.c
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(${OBSW_NAME} PUBLIC
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
)
|
||||||
8
bsp_egse/boardconfig/busConf.h
Normal file
8
bsp_egse/boardconfig/busConf.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef BSP_EGSE_BOARDCONFIG_BUSCONF_H_
|
||||||
|
#define BSP_EGSE_BOARDCONFIG_BUSCONF_H_
|
||||||
|
|
||||||
|
namespace egse {
|
||||||
|
static constexpr char STAR_TRACKER_UART[] = "/dev/serial0";
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* BSP_EGSE_BOARDCONFIG_BUSCONF_H_ */
|
||||||
38
bsp_egse/boardconfig/etl_profile.h
Normal file
38
bsp_egse/boardconfig/etl_profile.h
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
///\file
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
The MIT License(MIT)
|
||||||
|
|
||||||
|
Embedded Template Library.
|
||||||
|
https://github.com/ETLCPP/etl
|
||||||
|
https://www.etlcpp.com
|
||||||
|
|
||||||
|
Copyright(c) 2019 jwellbelove
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files(the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions :
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
******************************************************************************/
|
||||||
|
#ifndef __ETL_PROFILE_H__
|
||||||
|
#define __ETL_PROFILE_H__
|
||||||
|
|
||||||
|
#define ETL_CHECK_PUSH_POP
|
||||||
|
|
||||||
|
#define ETL_CPP11_SUPPORTED 1
|
||||||
|
#define ETL_NO_NULLPTR_SUPPORT 0
|
||||||
|
|
||||||
|
#endif
|
||||||
15
bsp_egse/boardconfig/gcov.h
Normal file
15
bsp_egse/boardconfig/gcov.h
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#ifndef LINUX_GCOV_H_
|
||||||
|
#define LINUX_GCOV_H_
|
||||||
|
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||||
|
|
||||||
|
#ifdef GCOV
|
||||||
|
extern "C" void __gcov_flush();
|
||||||
|
#else
|
||||||
|
void __gcov_flush() {
|
||||||
|
sif::info << "GCC GCOV: Please supply GCOV=1 in Makefile if "
|
||||||
|
"coverage information is desired.\n"
|
||||||
|
<< std::flush;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* LINUX_GCOV_H_ */
|
||||||
10
bsp_egse/boardconfig/print.c
Normal file
10
bsp_egse/boardconfig/print.c
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#include <bsp_egse/boardconfig/print.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
void printChar(const char* character, bool errStream) {
|
||||||
|
if (errStream) {
|
||||||
|
putc(*character, stderr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
putc(*character, stdout);
|
||||||
|
}
|
||||||
8
bsp_egse/boardconfig/print.h
Normal file
8
bsp_egse/boardconfig/print.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef HOSTED_BOARDCONFIG_PRINT_H_
|
||||||
|
#define HOSTED_BOARDCONFIG_PRINT_H_
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
void printChar(const char* character, bool errStream);
|
||||||
|
|
||||||
|
#endif /* HOSTED_BOARDCONFIG_PRINT_H_ */
|
||||||
6
bsp_egse/boardconfig/rpiConfig.h.in
Normal file
6
bsp_egse/boardconfig/rpiConfig.h.in
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_
|
||||||
|
#define BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
#endif /* BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_ */
|
||||||
28
bsp_egse/main.cpp
Normal file
28
bsp_egse/main.cpp
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "InitMission.h"
|
||||||
|
#include "OBSWConfig.h"
|
||||||
|
#include "OBSWVersion.h"
|
||||||
|
#include "fsfw/tasks/TaskFactory.h"
|
||||||
|
#include "fsfw/version.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This is the main program entry point for the egse (raspberry pi 4)
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int main(void) {
|
||||||
|
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||||
|
std::cout << "-- Compiled for EGSE from Arcsec"
|
||||||
|
<< " --" << 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 << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||||
|
|
||||||
|
initmission::initMission();
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
|
/* Suspend main thread by sleeping it. */
|
||||||
|
TaskFactory::delayTask(5000);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
target_sources(${TARGET_NAME} PUBLIC
|
target_sources(${OBSW_NAME} PUBLIC
|
||||||
InitMission.cpp
|
InitMission.cpp
|
||||||
main.cpp
|
main.cpp
|
||||||
ObjectFactory.cpp
|
ObjectFactory.cpp
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
#include "InitMission.h"
|
#include "InitMission.h"
|
||||||
#include "ObjectFactory.h"
|
|
||||||
|
|
||||||
#include <OBSWConfig.h>
|
#include <OBSWConfig.h>
|
||||||
|
#include <fsfw/objectmanager/ObjectManager.h>
|
||||||
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||||
#include <fsfw/objectmanager/ObjectManager.h>
|
|
||||||
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||||
#include <fsfw/tasks/PeriodicTaskIF.h>
|
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||||
#include <fsfw/tasks/TaskFactory.h>
|
#include <fsfw/tasks/TaskFactory.h>
|
||||||
|
|
||||||
#include <mission/utility/InitMission.h>
|
#include <mission/utility/InitMission.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "ObjectFactory.h"
|
||||||
|
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
ServiceInterfaceStream sif::debug("DEBUG");
|
ServiceInterfaceStream sif::debug("DEBUG");
|
||||||
ServiceInterfaceStream sif::info("INFO");
|
ServiceInterfaceStream sif::info("INFO");
|
||||||
@@ -27,133 +26,132 @@ ServiceInterfaceStream sif::warning("WARNING", true);
|
|||||||
ServiceInterfaceStream sif::error("ERROR", true, false, true);
|
ServiceInterfaceStream sif::error("ERROR", true, false, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ObjectManagerIF *objectManager = nullptr;
|
ObjectManagerIF* objectManager = nullptr;
|
||||||
|
|
||||||
void initmission::initMission() {
|
void initmission::initMission() {
|
||||||
sif::info << "Building global objects.." << std::endl;
|
sif::info << "Building global objects.." << std::endl;
|
||||||
/* Instantiate global object manager and also create all objects */
|
/* Instantiate global object manager and also create all objects */
|
||||||
ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
|
ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
|
||||||
sif::info << "Initializing all objects.." << std::endl;
|
sif::info << "Initializing all objects.." << std::endl;
|
||||||
ObjectManager::instance()->initialize();
|
ObjectManager::instance()->initialize();
|
||||||
|
|
||||||
/* This function creates and starts all tasks */
|
/* This function creates and starts all tasks */
|
||||||
initTasks();
|
initTasks();
|
||||||
}
|
}
|
||||||
|
|
||||||
void initmission::initTasks() {
|
void initmission::initTasks() {
|
||||||
TaskFactory* factory = TaskFactory::instance();
|
TaskFactory* factory = TaskFactory::instance();
|
||||||
if(factory == nullptr) {
|
if (factory == nullptr) {
|
||||||
/* Should never happen ! */
|
/* Should never happen ! */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if OBSW_PRINT_MISSED_DEADLINES == 1
|
#if OBSW_PRINT_MISSED_DEADLINES == 1
|
||||||
void (*missedDeadlineFunc) (void) = TaskFactory::printMissedDeadline;
|
void (*missedDeadlineFunc)(void) = TaskFactory::printMissedDeadline;
|
||||||
#else
|
#else
|
||||||
void (*missedDeadlineFunc) (void) = nullptr;
|
void (*missedDeadlineFunc)(void) = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* TMTC Distribution */
|
/* TMTC Distribution */
|
||||||
PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask(
|
PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask(
|
||||||
"DIST", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
"DIST", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||||
ReturnValue_t result = tmTcDistributor->addComponent(
|
ReturnValue_t result = tmTcDistributor->addComponent(objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||||
objects::CCSDS_PACKET_DISTRIBUTOR);
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK){
|
sif::error << "Object add component failed" << std::endl;
|
||||||
sif::error << "Object add component failed" << std::endl;
|
}
|
||||||
}
|
result = tmTcDistributor->addComponent(objects::PUS_PACKET_DISTRIBUTOR);
|
||||||
result = tmTcDistributor->addComponent(objects::PUS_PACKET_DISTRIBUTOR);
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK){
|
sif::error << "Object add component failed" << std::endl;
|
||||||
sif::error << "Object add component failed" << std::endl;
|
}
|
||||||
}
|
result = tmTcDistributor->addComponent(objects::TM_FUNNEL);
|
||||||
result = tmTcDistributor->addComponent(objects::TM_FUNNEL);
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
sif::error << "Object add component failed" << std::endl;
|
||||||
sif::error << "Object add component failed" << std::endl;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* UDP bridge */
|
/* UDP bridge */
|
||||||
PeriodicTaskIF* tmtcBridgeTask = factory->createPeriodicTask(
|
PeriodicTaskIF* tmtcBridgeTask = factory->createPeriodicTask(
|
||||||
"TMTC_UNIX_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
"TMTC_UNIX_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||||
result = tmtcBridgeTask->addComponent(objects::TMTC_BRIDGE);
|
result = tmtcBridgeTask->addComponent(objects::TMTC_BRIDGE);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::error << "Add component UDP Unix Bridge failed" << std::endl;
|
sif::error << "Add component UDP Unix Bridge failed" << std::endl;
|
||||||
}
|
}
|
||||||
PeriodicTaskIF* tmtcPollingTask = factory->createPeriodicTask(
|
PeriodicTaskIF* tmtcPollingTask = factory->createPeriodicTask(
|
||||||
"UDP_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
"UDP_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||||
result = tmtcPollingTask->addComponent(objects::TMTC_POLLING_TASK);
|
result = tmtcPollingTask->addComponent(objects::TMTC_POLLING_TASK);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::error << "Add component UDP Polling failed" << std::endl;
|
sif::error << "Add component UDP Polling failed" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PUS Services */
|
/* PUS Services */
|
||||||
PeriodicTaskIF* pusVerification = factory->createPeriodicTask(
|
PeriodicTaskIF* pusVerification = factory->createPeriodicTask(
|
||||||
"PUS_VERIF", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
"PUS_VERIF", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
||||||
result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
|
result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK){
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::error << "Object add component failed" << std::endl;
|
sif::error << "Object add component failed" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
PeriodicTaskIF* pusEvents = factory->createPeriodicTask(
|
PeriodicTaskIF* pusEvents = factory->createPeriodicTask(
|
||||||
"PUS_EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
"PUS_EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
||||||
result = pusVerification->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
|
result = pusVerification->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK){
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("PUS5", objects::PUS_SERVICE_5_EVENT_REPORTING);
|
initmission::printAddObjectError("PUS5", objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
PeriodicTaskIF* pusHighPrio = factory->createPeriodicTask(
|
PeriodicTaskIF* pusHighPrio = factory->createPeriodicTask(
|
||||||
"PUS_HIGH_PRIO", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
"PUS_HIGH_PRIO", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
||||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("PUS2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
initmission::printAddObjectError("PUS2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||||
}
|
}
|
||||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
|
result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("PUS9", objects::PUS_SERVICE_9_TIME_MGMT);
|
initmission::printAddObjectError("PUS9", objects::PUS_SERVICE_9_TIME_MGMT);
|
||||||
}
|
}
|
||||||
|
|
||||||
PeriodicTaskIF* pusMedPrio = factory->createPeriodicTask(
|
PeriodicTaskIF* pusMedPrio = factory->createPeriodicTask(
|
||||||
"PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
|
"PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
|
||||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("PUS8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
initmission::printAddObjectError("PUS8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||||
}
|
}
|
||||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("PUS200", objects::PUS_SERVICE_200_MODE_MGMT);
|
initmission::printAddObjectError("PUS200", objects::PUS_SERVICE_200_MODE_MGMT);
|
||||||
}
|
}
|
||||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("PUS20", objects::PUS_SERVICE_20_PARAMETERS);
|
initmission::printAddObjectError("PUS20", objects::PUS_SERVICE_20_PARAMETERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
PeriodicTaskIF* pusLowPrio = factory->createPeriodicTask(
|
PeriodicTaskIF* pusLowPrio = factory->createPeriodicTask(
|
||||||
"PUS_LOW_PRIO", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.6, missedDeadlineFunc);
|
"PUS_LOW_PRIO", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.6, missedDeadlineFunc);
|
||||||
result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
|
result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST);
|
initmission::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
PeriodicTaskIF* testTask = factory->createPeriodicTask(
|
PeriodicTaskIF* testTask = factory->createPeriodicTask(
|
||||||
"TEST_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
"TEST_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||||
#if OBSW_ADD_TEST_CODE == 1
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
result = testTask->addComponent(objects::TEST_TASK);
|
result = testTask->addComponent(objects::TEST_TASK);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK);
|
initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK);
|
||||||
}
|
}
|
||||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||||
|
|
||||||
sif::info << "Starting tasks.." << std::endl;
|
sif::info << "Starting tasks.." << std::endl;
|
||||||
tmTcDistributor->startTask();
|
tmTcDistributor->startTask();
|
||||||
tmtcBridgeTask->startTask();
|
tmtcBridgeTask->startTask();
|
||||||
tmtcPollingTask->startTask();
|
tmtcPollingTask->startTask();
|
||||||
|
|
||||||
pusVerification->startTask();
|
pusVerification->startTask();
|
||||||
pusEvents->startTask();
|
pusEvents->startTask();
|
||||||
pusHighPrio->startTask();
|
pusHighPrio->startTask();
|
||||||
pusMedPrio->startTask();
|
pusMedPrio->startTask();
|
||||||
pusLowPrio->startTask();
|
pusLowPrio->startTask();
|
||||||
|
|
||||||
#if OBSW_ADD_TEST_CODE == 1
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
testTask->startTask();
|
testTask->startTask();
|
||||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||||
|
|
||||||
sif::info << "Tasks started.." << std::endl;
|
sif::info << "Tasks started.." << std::endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,6 @@
|
|||||||
namespace initmission {
|
namespace initmission {
|
||||||
void initMission();
|
void initMission();
|
||||||
void initTasks();
|
void initTasks();
|
||||||
};
|
}; // namespace initmission
|
||||||
|
|
||||||
#endif /* BSP_LINUX_INITMISSION_H_ */
|
#endif /* BSP_LINUX_INITMISSION_H_ */
|
||||||
|
|||||||
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_ */
|
||||||
@@ -1,14 +1,15 @@
|
|||||||
#include "ObjectFactory.h"
|
#include "ObjectFactory.h"
|
||||||
#include "OBSWConfig.h"
|
|
||||||
|
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||||
|
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||||
|
#include <mission/core/GenericFactory.h>
|
||||||
|
#include <mission/utility/TmFunnel.h>
|
||||||
#include <objects/systemObjectList.h>
|
#include <objects/systemObjectList.h>
|
||||||
#include <tmtc/apid.h>
|
#include <tmtc/apid.h>
|
||||||
#include <tmtc/pusIds.h>
|
#include <tmtc/pusIds.h>
|
||||||
|
|
||||||
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
#include "OBSWConfig.h"
|
||||||
#include <fsfw/tmtcservices/PusServiceBase.h>
|
#include "fsfw_tests/integration/task/TestTask.h"
|
||||||
|
|
||||||
#include <mission/core/GenericFactory.h>
|
|
||||||
#include <mission/utility/TmFunnel.h>
|
|
||||||
|
|
||||||
#if OBSW_USE_TMTC_TCP_BRIDGE == 0
|
#if OBSW_USE_TMTC_TCP_BRIDGE == 0
|
||||||
#include "fsfw/osal/common/UdpTcPollingTask.h"
|
#include "fsfw/osal/common/UdpTcPollingTask.h"
|
||||||
@@ -20,42 +21,28 @@
|
|||||||
|
|
||||||
#include <fsfw/tmtcpacket/pus/tm.h>
|
#include <fsfw/tmtcpacket/pus/tm.h>
|
||||||
|
|
||||||
|
|
||||||
#if OBSW_ADD_TEST_CODE == 1
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
#include <test/testtasks/TestTask.h>
|
#include <test/testtasks/TestTask.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void Factory::setStaticFrameworkObjectIds(){
|
void Factory::setStaticFrameworkObjectIds() {
|
||||||
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||||
PusServiceBase::packetDestination = objects::TM_FUNNEL;
|
PusServiceBase::packetDestination = objects::TM_FUNNEL;
|
||||||
|
|
||||||
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||||
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
||||||
|
|
||||||
TmFunnel::downlinkDestination = objects::TMTC_BRIDGE;
|
TmFunnel::downlinkDestination = objects::TMTC_BRIDGE;
|
||||||
// No storage object for now.
|
// No storage object for now.
|
||||||
TmFunnel::storageDestination = objects::NO_OBJECT;
|
TmFunnel::storageDestination = objects::NO_OBJECT;
|
||||||
|
|
||||||
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
||||||
TmPacketBase::timeStamperId = objects::TIME_STAMPER;
|
TmPacketBase::timeStamperId = objects::TIME_STAMPER;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::produce(void* args){
|
void ObjectFactory::produce(void* args) {
|
||||||
Factory::setStaticFrameworkObjectIds();
|
Factory::setStaticFrameworkObjectIds();
|
||||||
ObjectFactory::produceGenericObjects();
|
ObjectFactory::produceGenericObjects();
|
||||||
|
|
||||||
#if OBSW_USE_TMTC_TCP_BRIDGE == 0
|
|
||||||
sif::info << "Setting up UDP TMTC bridge with listener port " <<
|
|
||||||
UdpTmTcBridge::DEFAULT_SERVER_PORT << std::endl;
|
|
||||||
new UdpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR);
|
|
||||||
new UdpTcPollingTask(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE);
|
|
||||||
#else
|
|
||||||
sif::info << "Setting up TCP TMTC bridge with listener port " <<
|
|
||||||
TcpTmTcServer::DEFAULT_SERVER_PORT << std::endl;
|
|
||||||
new TcpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR);
|
|
||||||
new TcpTmTcServer(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
new TestTask(objects::TEST_TASK);
|
|
||||||
|
|
||||||
|
new TestTask(objects::TEST_TASK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#ifndef BSP_LINUX_OBJECTFACTORY_H_
|
#ifndef BSP_LINUX_OBJECTFACTORY_H_
|
||||||
#define BSP_LINUX_OBJECTFACTORY_H_
|
#define BSP_LINUX_OBJECTFACTORY_H_
|
||||||
|
|
||||||
|
|
||||||
namespace ObjectFactory {
|
namespace ObjectFactory {
|
||||||
void setStatics();
|
void setStatics();
|
||||||
void produce(void* args);
|
void produce(void* args);
|
||||||
};
|
}; // namespace ObjectFactory
|
||||||
|
|
||||||
#endif /* BSP_LINUX_OBJECTFACTORY_H_ */
|
#endif /* BSP_LINUX_OBJECTFACTORY_H_ */
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
target_sources(${TARGET_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE
|
||||||
print.c
|
print.c
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(${TARGET_NAME} PUBLIC
|
target_include_directories(${OBSW_NAME} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#define ETL_CHECK_PUSH_POP
|
#define ETL_CHECK_PUSH_POP
|
||||||
|
|
||||||
#define ETL_CPP11_SUPPORTED 1
|
#define ETL_CPP11_SUPPORTED 1
|
||||||
#define ETL_NO_NULLPTR_SUPPORT 0
|
#define ETL_NO_NULLPTR_SUPPORT 0
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,8 +6,9 @@
|
|||||||
extern "C" void __gcov_flush();
|
extern "C" void __gcov_flush();
|
||||||
#else
|
#else
|
||||||
void __gcov_flush() {
|
void __gcov_flush() {
|
||||||
sif::info << "GCC GCOV: Please supply GCOV=1 in Makefile if "
|
sif::info << "GCC GCOV: Please supply GCOV=1 in Makefile if "
|
||||||
"coverage information is desired.\n" << std::flush;
|
"coverage information is desired.\n"
|
||||||
|
<< std::flush;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -3,13 +3,9 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
void printChar(const char* character, bool errStream) {
|
void printChar(const char* character, bool errStream) {
|
||||||
if(errStream) {
|
if (errStream) {
|
||||||
putc(*character, stderr);
|
putc(*character, stderr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
putc(*character, stdout);
|
putc(*character, stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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,376 +1,351 @@
|
|||||||
#include "ArduinoComIF.h"
|
#include "ArduinoComIF.h"
|
||||||
#include "ArduinoCookie.h"
|
|
||||||
|
|
||||||
#include <fsfw/globalfunctions/DleEncoder.h>
|
|
||||||
#include <fsfw/globalfunctions/CRC.h>
|
#include <fsfw/globalfunctions/CRC.h>
|
||||||
|
#include <fsfw/globalfunctions/DleEncoder.h>
|
||||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||||
|
|
||||||
|
#include "ArduinoCookie.h"
|
||||||
|
|
||||||
// This only works on Linux
|
// This only works on Linux
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
#include <termios.h>
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#elif WIN32
|
#elif WIN32
|
||||||
#include <windows.h>
|
|
||||||
#include <strsafe.h>
|
#include <strsafe.h>
|
||||||
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
ArduinoComIF::ArduinoComIF(object_id_t setObjectId, bool promptComIF,
|
ArduinoComIF::ArduinoComIF(object_id_t setObjectId, bool promptComIF, const char *serialDevice)
|
||||||
const char *serialDevice):
|
: rxBuffer(MAX_PACKET_SIZE * MAX_NUMBER_OF_SPI_DEVICES * 10, true), SystemObject(setObjectId) {
|
||||||
rxBuffer(MAX_PACKET_SIZE * MAX_NUMBER_OF_SPI_DEVICES*10, true),
|
|
||||||
SystemObject(setObjectId) {
|
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
initialized = false;
|
initialized = false;
|
||||||
serialPort = ::open("/dev/ttyUSB0", O_RDWR);
|
serialPort = ::open("/dev/ttyUSB0", O_RDWR);
|
||||||
|
|
||||||
if (serialPort < 0) {
|
if (serialPort < 0) {
|
||||||
//configuration error
|
// configuration error
|
||||||
printf("Error %i from open: %s\n", errno, strerror(errno));
|
printf("Error %i from open: %s\n", errno, strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct termios tty;
|
struct termios tty;
|
||||||
memset(&tty, 0, sizeof tty);
|
memset(&tty, 0, sizeof tty);
|
||||||
|
|
||||||
// Read in existing settings, and handle any error
|
// Read in existing settings, and handle any error
|
||||||
if (tcgetattr(serialPort, &tty) != 0) {
|
if (tcgetattr(serialPort, &tty) != 0) {
|
||||||
printf("Error %i from tcgetattr: %s\n", errno, strerror(errno));
|
printf("Error %i from tcgetattr: %s\n", errno, strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tty.c_cflag &= ~PARENB; // Clear parity bit, disabling parity
|
tty.c_cflag &= ~PARENB; // Clear parity bit, disabling parity
|
||||||
tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication
|
tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication
|
||||||
tty.c_cflag |= CS8; // 8 bits per byte
|
tty.c_cflag |= CS8; // 8 bits per byte
|
||||||
tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control
|
tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control
|
||||||
tty.c_lflag &= ~ICANON; //Disable Canonical Mode
|
tty.c_lflag &= ~ICANON; // Disable Canonical Mode
|
||||||
tty.c_oflag &= ~OPOST; // Prevent special interpretation of output bytes (e.g. newline chars)
|
tty.c_oflag &= ~OPOST; // Prevent special interpretation of output bytes (e.g. newline chars)
|
||||||
tty.c_oflag &= ~ONLCR; // Prevent conversion of newline to carriage return/line feed
|
tty.c_oflag &= ~ONLCR; // Prevent conversion of newline to carriage return/line feed
|
||||||
tty.c_cc[VTIME] = 0; // Non Blocking
|
tty.c_cc[VTIME] = 0; // Non Blocking
|
||||||
tty.c_cc[VMIN] = 0;
|
tty.c_cc[VMIN] = 0;
|
||||||
|
|
||||||
cfsetispeed(&tty, B9600); //Baudrate
|
cfsetispeed(&tty, B9600); // Baudrate
|
||||||
|
|
||||||
if (tcsetattr(serialPort, TCSANOW, &tty) != 0) {
|
if (tcsetattr(serialPort, TCSANOW, &tty) != 0) {
|
||||||
//printf("Error %i from tcsetattr: %s\n", errno, strerror(errno));
|
// printf("Error %i from tcsetattr: %s\n", errno, strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
#elif WIN32
|
#elif WIN32
|
||||||
DCB serialParams = { 0 };
|
DCB serialParams = {0};
|
||||||
|
|
||||||
// we need to ask the COM port from the user.
|
// we need to ask the COM port from the user.
|
||||||
if(promptComIF) {
|
if (promptComIF) {
|
||||||
sif::info << "Please enter the COM port (c to cancel): " << std::flush;
|
sif::info << "Please enter the COM port (c to cancel): " << std::flush;
|
||||||
std::string comPort;
|
std::string comPort;
|
||||||
while(hCom == INVALID_HANDLE_VALUE) {
|
while (hCom == INVALID_HANDLE_VALUE) {
|
||||||
|
std::getline(std::cin, comPort);
|
||||||
|
if (comPort[0] == 'c') {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
const TCHAR *pcCommPort = comPort.c_str();
|
||||||
|
hCom = CreateFileA(pcCommPort, // port name
|
||||||
|
GENERIC_READ | GENERIC_WRITE, // Read/Write
|
||||||
|
0, // No Sharing
|
||||||
|
NULL, // No Security
|
||||||
|
OPEN_EXISTING, // Open existing port only
|
||||||
|
0, // Non Overlapped I/O
|
||||||
|
NULL); // Null for Comm Devices
|
||||||
|
|
||||||
std::getline(std::cin, comPort);
|
if (hCom == INVALID_HANDLE_VALUE) {
|
||||||
if(comPort[0] == 'c') {
|
if (GetLastError() == 2) {
|
||||||
break;
|
sif::error << "COM Port does not found!" << std::endl;
|
||||||
}
|
} else {
|
||||||
const TCHAR *pcCommPort = comPort.c_str();
|
TCHAR err[128];
|
||||||
hCom = CreateFileA(pcCommPort, //port name
|
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
|
||||||
GENERIC_READ | GENERIC_WRITE, //Read/Write
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), err, sizeof(err), NULL);
|
||||||
0, // No Sharing
|
// Handle the error.
|
||||||
NULL, // No Security
|
sif::info << "CreateFileA Error code: " << GetLastError() << std::endl;
|
||||||
OPEN_EXISTING,// Open existing port only
|
sif::error << err << std::flush;
|
||||||
0, // Non Overlapped I/O
|
}
|
||||||
NULL); // Null for Comm Devices
|
sif::info << "Please enter a valid COM port: " << std::flush;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (hCom == INVALID_HANDLE_VALUE)
|
serialParams.DCBlength = sizeof(serialParams);
|
||||||
{
|
if (baudRate == 9600) {
|
||||||
if(GetLastError() == 2) {
|
serialParams.BaudRate = CBR_9600;
|
||||||
sif::error << "COM Port does not found!" << std::endl;
|
}
|
||||||
}
|
if (baudRate == 115200) {
|
||||||
else {
|
serialParams.BaudRate = CBR_115200;
|
||||||
TCHAR err[128];
|
} else {
|
||||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL,
|
serialParams.BaudRate = baudRate;
|
||||||
GetLastError(),
|
}
|
||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
|
||||||
err, sizeof(err), NULL);
|
|
||||||
// Handle the error.
|
|
||||||
sif::info << "CreateFileA Error code: " << GetLastError()
|
|
||||||
<< std::endl;
|
|
||||||
sif::error << err << std::flush;
|
|
||||||
}
|
|
||||||
sif::info << "Please enter a valid COM port: " << std::flush;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
serialParams.ByteSize = 8;
|
||||||
|
serialParams.Parity = NOPARITY;
|
||||||
|
serialParams.StopBits = ONESTOPBIT;
|
||||||
|
SetCommState(hCom, &serialParams);
|
||||||
|
|
||||||
|
COMMTIMEOUTS timeout = {0};
|
||||||
serialParams.DCBlength = sizeof(serialParams);
|
// This will set the read operation to be blocking until data is received
|
||||||
if(baudRate == 9600) {
|
// and then read continuously until there is a gap of one millisecond.
|
||||||
serialParams.BaudRate = CBR_9600;
|
timeout.ReadIntervalTimeout = 1;
|
||||||
}
|
timeout.ReadTotalTimeoutConstant = 0;
|
||||||
if(baudRate == 115200) {
|
timeout.ReadTotalTimeoutMultiplier = 0;
|
||||||
serialParams.BaudRate = CBR_115200;
|
timeout.WriteTotalTimeoutConstant = 0;
|
||||||
}
|
timeout.WriteTotalTimeoutMultiplier = 0;
|
||||||
else {
|
SetCommTimeouts(hCom, &timeout);
|
||||||
serialParams.BaudRate = baudRate;
|
// Serial port should now be read for operations.
|
||||||
}
|
|
||||||
|
|
||||||
serialParams.ByteSize = 8;
|
|
||||||
serialParams.Parity = NOPARITY;
|
|
||||||
serialParams.StopBits = ONESTOPBIT;
|
|
||||||
SetCommState(hCom, &serialParams);
|
|
||||||
|
|
||||||
COMMTIMEOUTS timeout = { 0 };
|
|
||||||
// This will set the read operation to be blocking until data is received
|
|
||||||
// and then read continuously until there is a gap of one millisecond.
|
|
||||||
timeout.ReadIntervalTimeout = 1;
|
|
||||||
timeout.ReadTotalTimeoutConstant = 0;
|
|
||||||
timeout.ReadTotalTimeoutMultiplier = 0;
|
|
||||||
timeout.WriteTotalTimeoutConstant = 0;
|
|
||||||
timeout.WriteTotalTimeoutMultiplier = 0;
|
|
||||||
SetCommTimeouts(hCom, &timeout);
|
|
||||||
// Serial port should now be read for operations.
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ArduinoComIF::~ArduinoComIF() {
|
ArduinoComIF::~ArduinoComIF() {
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
::close(serialPort);
|
::close(serialPort);
|
||||||
#elif WIN32
|
#elif WIN32
|
||||||
CloseHandle(hCom);
|
CloseHandle(hCom);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
ReturnValue_t ArduinoComIF::initializeInterface(CookieIF * cookie) {
|
ReturnValue_t ArduinoComIF::initializeInterface(CookieIF *cookie) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t ArduinoComIF::sendMessage(CookieIF *cookie, const uint8_t *data,
|
ReturnValue_t ArduinoComIF::sendMessage(CookieIF *cookie, const uint8_t *data, size_t len) {
|
||||||
size_t len) {
|
ArduinoCookie *arduinoCookie = dynamic_cast<ArduinoCookie *>(cookie);
|
||||||
ArduinoCookie *arduinoCookie = dynamic_cast<ArduinoCookie*>(cookie);
|
if (arduinoCookie == nullptr) {
|
||||||
if (arduinoCookie == nullptr) {
|
return INVALID_COOKIE_TYPE;
|
||||||
return INVALID_COOKIE_TYPE;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return sendMessage(arduinoCookie->command, arduinoCookie->address, data,
|
return sendMessage(arduinoCookie->command, arduinoCookie->address, data, len);
|
||||||
len);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t ArduinoComIF::getSendSuccess(CookieIF *cookie) {
|
ReturnValue_t ArduinoComIF::getSendSuccess(CookieIF *cookie) { return RETURN_OK; }
|
||||||
return RETURN_OK;
|
|
||||||
|
ReturnValue_t ArduinoComIF::requestReceiveMessage(CookieIF *cookie, size_t requestLen) {
|
||||||
|
return RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t ArduinoComIF::requestReceiveMessage(CookieIF *cookie,
|
ReturnValue_t ArduinoComIF::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, size_t *size) {
|
||||||
size_t requestLen) {
|
handleSerialPortRx();
|
||||||
return RETURN_OK;
|
|
||||||
|
ArduinoCookie *arduinoCookie = dynamic_cast<ArduinoCookie *>(cookie);
|
||||||
|
if (arduinoCookie == nullptr) {
|
||||||
|
return INVALID_COOKIE_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
*buffer = arduinoCookie->replyBuffer.data();
|
||||||
|
*size = arduinoCookie->receivedDataLen;
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t ArduinoComIF::readReceivedMessage(CookieIF *cookie,
|
ReturnValue_t ArduinoComIF::sendMessage(uint8_t command, uint8_t address, const uint8_t *data,
|
||||||
uint8_t **buffer, size_t *size) {
|
size_t dataLen) {
|
||||||
|
if (dataLen > UINT16_MAX) {
|
||||||
|
return TOO_MUCH_DATA;
|
||||||
|
}
|
||||||
|
|
||||||
handleSerialPortRx();
|
// being conservative here
|
||||||
|
uint8_t sendBuffer[(dataLen + 6) * 2 + 2];
|
||||||
|
|
||||||
ArduinoCookie *arduinoCookie = dynamic_cast<ArduinoCookie*>(cookie);
|
sendBuffer[0] = DleEncoder::STX_CHAR;
|
||||||
if (arduinoCookie == nullptr) {
|
|
||||||
return INVALID_COOKIE_TYPE;
|
|
||||||
}
|
|
||||||
|
|
||||||
*buffer = arduinoCookie->replyBuffer.data();
|
uint8_t *currentPosition = sendBuffer + 1;
|
||||||
*size = arduinoCookie->receivedDataLen;
|
size_t remainingLen = sizeof(sendBuffer) - 1;
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
size_t encodedLen = 0;
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t ArduinoComIF::sendMessage(uint8_t command,
|
ReturnValue_t result =
|
||||||
uint8_t address, const uint8_t *data, size_t dataLen) {
|
DleEncoder::encode(&command, 1, currentPosition, remainingLen, &encodedLen, false);
|
||||||
if (dataLen > UINT16_MAX) {
|
if (result != RETURN_OK) {
|
||||||
return TOO_MUCH_DATA;
|
return result;
|
||||||
}
|
}
|
||||||
|
currentPosition += encodedLen;
|
||||||
|
remainingLen -= encodedLen; // DleEncoder will never return encodedLen > remainingLen
|
||||||
|
|
||||||
//being conservative here
|
result = DleEncoder::encode(&address, 1, currentPosition, remainingLen, &encodedLen, false);
|
||||||
uint8_t sendBuffer[(dataLen + 6) * 2 + 2];
|
if (result != RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
currentPosition += encodedLen;
|
||||||
|
remainingLen -= encodedLen; // DleEncoder will never return encodedLen > remainingLen
|
||||||
|
|
||||||
sendBuffer[0] = DleEncoder::STX_CHAR;
|
uint8_t temporaryBuffer[2];
|
||||||
|
|
||||||
uint8_t *currentPosition = sendBuffer + 1;
|
// note to Lukas: yes we _could_ use Serialize here, but for 16 bit it is a bit too much...
|
||||||
size_t remainingLen = sizeof(sendBuffer) - 1;
|
temporaryBuffer[0] = dataLen >> 8; // we checked dataLen above
|
||||||
size_t encodedLen = 0;
|
temporaryBuffer[1] = dataLen;
|
||||||
|
|
||||||
ReturnValue_t result = DleEncoder::encode(&command, 1, currentPosition,
|
result =
|
||||||
remainingLen, &encodedLen, false);
|
DleEncoder::encode(temporaryBuffer, 2, currentPosition, remainingLen, &encodedLen, false);
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
currentPosition += encodedLen;
|
currentPosition += encodedLen;
|
||||||
remainingLen -= encodedLen; //DleEncoder will never return encodedLen > remainingLen
|
remainingLen -= encodedLen; // DleEncoder will never return encodedLen > remainingLen
|
||||||
|
|
||||||
result = DleEncoder::encode(&address, 1, currentPosition, remainingLen,
|
// encoding the actual data
|
||||||
&encodedLen, false);
|
result = DleEncoder::encode(data, dataLen, currentPosition, remainingLen, &encodedLen, false);
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
currentPosition += encodedLen;
|
currentPosition += encodedLen;
|
||||||
remainingLen -= encodedLen; //DleEncoder will never return encodedLen > remainingLen
|
remainingLen -= encodedLen; // DleEncoder will never return encodedLen > remainingLen
|
||||||
|
|
||||||
uint8_t temporaryBuffer[2];
|
uint16_t crc = CRC::crc16ccitt(&command, 1);
|
||||||
|
crc = CRC::crc16ccitt(&address, 1, crc);
|
||||||
|
// fortunately the length is still there
|
||||||
|
crc = CRC::crc16ccitt(temporaryBuffer, 2, crc);
|
||||||
|
crc = CRC::crc16ccitt(data, dataLen, crc);
|
||||||
|
|
||||||
//note to Lukas: yes we _could_ use Serialize here, but for 16 bit it is a bit too much...
|
temporaryBuffer[0] = crc >> 8;
|
||||||
temporaryBuffer[0] = dataLen >> 8; //we checked dataLen above
|
temporaryBuffer[1] = crc;
|
||||||
temporaryBuffer[1] = dataLen;
|
|
||||||
|
|
||||||
result = DleEncoder::encode(temporaryBuffer, 2, currentPosition,
|
result =
|
||||||
remainingLen, &encodedLen, false);
|
DleEncoder::encode(temporaryBuffer, 2, currentPosition, remainingLen, &encodedLen, false);
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
currentPosition += encodedLen;
|
currentPosition += encodedLen;
|
||||||
remainingLen -= encodedLen; //DleEncoder will never return encodedLen > remainingLen
|
remainingLen -= encodedLen; // DleEncoder will never return encodedLen > remainingLen
|
||||||
|
|
||||||
//encoding the actual data
|
if (remainingLen > 0) {
|
||||||
result = DleEncoder::encode(data, dataLen, currentPosition, remainingLen,
|
*currentPosition = DleEncoder::ETX_CHAR;
|
||||||
&encodedLen, false);
|
}
|
||||||
if (result != RETURN_OK) {
|
remainingLen -= 1;
|
||||||
return result;
|
|
||||||
}
|
|
||||||
currentPosition += encodedLen;
|
|
||||||
remainingLen -= encodedLen; //DleEncoder will never return encodedLen > remainingLen
|
|
||||||
|
|
||||||
uint16_t crc = CRC::crc16ccitt(&command, 1);
|
encodedLen = sizeof(sendBuffer) - remainingLen;
|
||||||
crc = CRC::crc16ccitt(&address, 1, crc);
|
|
||||||
//fortunately the length is still there
|
|
||||||
crc = CRC::crc16ccitt(temporaryBuffer, 2, crc);
|
|
||||||
crc = CRC::crc16ccitt(data, dataLen, crc);
|
|
||||||
|
|
||||||
temporaryBuffer[0] = crc >> 8;
|
|
||||||
temporaryBuffer[1] = crc;
|
|
||||||
|
|
||||||
result = DleEncoder::encode(temporaryBuffer, 2, currentPosition,
|
|
||||||
remainingLen, &encodedLen, false);
|
|
||||||
if (result != RETURN_OK) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
currentPosition += encodedLen;
|
|
||||||
remainingLen -= encodedLen; //DleEncoder will never return encodedLen > remainingLen
|
|
||||||
|
|
||||||
if (remainingLen > 0) {
|
|
||||||
*currentPosition = DleEncoder::ETX_CHAR;
|
|
||||||
}
|
|
||||||
remainingLen -= 1;
|
|
||||||
|
|
||||||
encodedLen = sizeof(sendBuffer) - remainingLen;
|
|
||||||
|
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
ssize_t writtenlen = ::write(serialPort, sendBuffer, encodedLen);
|
ssize_t writtenlen = ::write(serialPort, sendBuffer, encodedLen);
|
||||||
if (writtenlen < 0) {
|
if (writtenlen < 0) {
|
||||||
//we could try to find out what happened...
|
// we could try to find out what happened...
|
||||||
return RETURN_FAILED;
|
return RETURN_FAILED;
|
||||||
}
|
}
|
||||||
if (writtenlen != encodedLen) {
|
if (writtenlen != encodedLen) {
|
||||||
//the OS failed us, we do not try to block until everything is written, as
|
// the OS failed us, we do not try to block until everything is written, as
|
||||||
//we can not block the whole system here
|
// we can not block the whole system here
|
||||||
return RETURN_FAILED;
|
return RETURN_FAILED;
|
||||||
}
|
}
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
#elif WIN32
|
#elif WIN32
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArduinoComIF::handleSerialPortRx() {
|
void ArduinoComIF::handleSerialPortRx() {
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
uint32_t availableSpace = rxBuffer.availableWriteSpace();
|
uint32_t availableSpace = rxBuffer.availableWriteSpace();
|
||||||
|
|
||||||
uint8_t dataFromSerial[availableSpace];
|
uint8_t dataFromSerial[availableSpace];
|
||||||
|
|
||||||
ssize_t bytesRead = read(serialPort, dataFromSerial,
|
ssize_t bytesRead = read(serialPort, dataFromSerial, sizeof(dataFromSerial));
|
||||||
sizeof(dataFromSerial));
|
|
||||||
|
|
||||||
if (bytesRead < 0) {
|
if (bytesRead < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rxBuffer.writeData(dataFromSerial, bytesRead);
|
rxBuffer.writeData(dataFromSerial, bytesRead);
|
||||||
|
|
||||||
uint8_t dataReceivedSoFar[rxBuffer.getMaxSize()];
|
uint8_t dataReceivedSoFar[rxBuffer.getMaxSize()];
|
||||||
|
|
||||||
uint32_t dataLenReceivedSoFar = 0;
|
uint32_t dataLenReceivedSoFar = 0;
|
||||||
|
|
||||||
rxBuffer.readData(dataReceivedSoFar, sizeof(dataReceivedSoFar), true,
|
rxBuffer.readData(dataReceivedSoFar, sizeof(dataReceivedSoFar), true, &dataLenReceivedSoFar);
|
||||||
&dataLenReceivedSoFar);
|
|
||||||
|
|
||||||
//look for STX
|
// look for STX
|
||||||
size_t firstSTXinRawData = 0;
|
size_t firstSTXinRawData = 0;
|
||||||
while ((firstSTXinRawData < dataLenReceivedSoFar)
|
while ((firstSTXinRawData < dataLenReceivedSoFar) &&
|
||||||
&& (dataReceivedSoFar[firstSTXinRawData] != DleEncoder::STX_CHAR)) {
|
(dataReceivedSoFar[firstSTXinRawData] != DleEncoder::STX_CHAR)) {
|
||||||
firstSTXinRawData++;
|
firstSTXinRawData++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dataReceivedSoFar[firstSTXinRawData] != DleEncoder::STX_CHAR) {
|
if (dataReceivedSoFar[firstSTXinRawData] != DleEncoder::STX_CHAR) {
|
||||||
//there is no STX in our data, throw it away...
|
// there is no STX in our data, throw it away...
|
||||||
rxBuffer.deleteData(dataLenReceivedSoFar);
|
rxBuffer.deleteData(dataLenReceivedSoFar);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t packet[MAX_PACKET_SIZE];
|
uint8_t packet[MAX_PACKET_SIZE];
|
||||||
size_t packetLen = 0;
|
size_t packetLen = 0;
|
||||||
|
|
||||||
size_t readSize = 0;
|
size_t readSize = 0;
|
||||||
|
|
||||||
ReturnValue_t result = DleEncoder::decode(
|
ReturnValue_t result = DleEncoder::decode(dataReceivedSoFar + firstSTXinRawData,
|
||||||
dataReceivedSoFar + firstSTXinRawData,
|
dataLenReceivedSoFar - firstSTXinRawData, &readSize,
|
||||||
dataLenReceivedSoFar - firstSTXinRawData, &readSize, packet,
|
packet, sizeof(packet), &packetLen);
|
||||||
sizeof(packet), &packetLen);
|
|
||||||
|
|
||||||
size_t toDelete = firstSTXinRawData;
|
size_t toDelete = firstSTXinRawData;
|
||||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
handlePacket(packet, packetLen);
|
handlePacket(packet, packetLen);
|
||||||
|
|
||||||
// after handling the packet, we can delete it from the raw stream,
|
// after handling the packet, we can delete it from the raw stream,
|
||||||
// it has been copied to packet
|
// it has been copied to packet
|
||||||
toDelete += readSize;
|
toDelete += readSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
//remove Data which was processed
|
// remove Data which was processed
|
||||||
rxBuffer.deleteData(toDelete);
|
rxBuffer.deleteData(toDelete);
|
||||||
#elif WIN32
|
#elif WIN32
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArduinoComIF::setBaudrate(uint32_t baudRate) {
|
void ArduinoComIF::setBaudrate(uint32_t baudRate) { this->baudRate = baudRate; }
|
||||||
this->baudRate = baudRate;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ArduinoComIF::handlePacket(uint8_t *packet, size_t packetLen) {
|
void ArduinoComIF::handlePacket(uint8_t *packet, size_t packetLen) {
|
||||||
uint16_t crc = CRC::crc16ccitt(packet, packetLen);
|
uint16_t crc = CRC::crc16ccitt(packet, packetLen);
|
||||||
if (crc != 0) {
|
if (crc != 0) {
|
||||||
//CRC error
|
// CRC error
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t command = packet[0];
|
uint8_t command = packet[0];
|
||||||
uint8_t address = packet[1];
|
uint8_t address = packet[1];
|
||||||
|
|
||||||
uint16_t size = (packet[2] << 8) + packet[3];
|
uint16_t size = (packet[2] << 8) + packet[3];
|
||||||
|
|
||||||
if (size != packetLen - 6) {
|
if (size != packetLen - 6) {
|
||||||
//Invalid Length
|
// Invalid Length
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case ArduinoCookie::SPI: {
|
case ArduinoCookie::SPI: {
|
||||||
//ArduinoCookie **itsComplicated;
|
// ArduinoCookie **itsComplicated;
|
||||||
auto findIter = spiMap.find(address);
|
auto findIter = spiMap.find(address);
|
||||||
if (findIter == spiMap.end()) {
|
if (findIter == spiMap.end()) {
|
||||||
//we do no know this address
|
// we do no know this address
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ArduinoCookie& cookie = findIter->second;
|
ArduinoCookie &cookie = findIter->second;
|
||||||
if (packetLen > cookie.maxReplySize + 6) {
|
if (packetLen > cookie.maxReplySize + 6) {
|
||||||
packetLen = cookie.maxReplySize + 6;
|
packetLen = cookie.maxReplySize + 6;
|
||||||
}
|
}
|
||||||
std::memcpy(cookie.replyBuffer.data(), packet + 4, packetLen - 6);
|
std::memcpy(cookie.replyBuffer.data(), packet + 4, packetLen - 6);
|
||||||
cookie.receivedDataLen = packetLen - 6;
|
cookie.receivedDataLen = packetLen - 6;
|
||||||
}
|
} break;
|
||||||
break;
|
default:
|
||||||
default:
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
#include <fsfw/container/FixedMap.h>
|
#include <fsfw/container/FixedMap.h>
|
||||||
#include <fsfw/container/SimpleRingBuffer.h>
|
#include <fsfw/container/SimpleRingBuffer.h>
|
||||||
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
|
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
|
||||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
|
||||||
#include <fsfw/objectmanager/SystemObject.h>
|
#include <fsfw/objectmanager/SystemObject.h>
|
||||||
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <map>
|
#include <map>
|
||||||
@@ -14,56 +14,53 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Forward declaration, so users don't peek
|
// Forward declaration, so users don't peek
|
||||||
class ArduinoCookie;
|
class ArduinoCookie;
|
||||||
|
|
||||||
class ArduinoComIF: public SystemObject,
|
class ArduinoComIF : public SystemObject, public DeviceCommunicationIF {
|
||||||
public DeviceCommunicationIF {
|
public:
|
||||||
public:
|
static const uint8_t MAX_NUMBER_OF_SPI_DEVICES = 8;
|
||||||
static const uint8_t MAX_NUMBER_OF_SPI_DEVICES = 8;
|
static const uint8_t MAX_PACKET_SIZE = 64;
|
||||||
static const uint8_t MAX_PACKET_SIZE = 64;
|
|
||||||
|
|
||||||
static const uint8_t COMMAND_INVALID = -1;
|
static const uint8_t COMMAND_INVALID = -1;
|
||||||
static const uint8_t COMMAND_SPI = 1;
|
static const uint8_t COMMAND_SPI = 1;
|
||||||
|
|
||||||
ArduinoComIF(object_id_t setObjectId, bool promptComIF = false,
|
ArduinoComIF(object_id_t setObjectId, bool promptComIF = false,
|
||||||
const char *serialDevice = nullptr);
|
const char *serialDevice = nullptr);
|
||||||
void setBaudrate(uint32_t baudRate);
|
void setBaudrate(uint32_t baudRate);
|
||||||
|
|
||||||
virtual ~ArduinoComIF();
|
virtual ~ArduinoComIF();
|
||||||
|
|
||||||
/** DeviceCommunicationIF overrides */
|
/** DeviceCommunicationIF overrides */
|
||||||
virtual ReturnValue_t initializeInterface(CookieIF * cookie) override;
|
virtual ReturnValue_t initializeInterface(CookieIF *cookie) override;
|
||||||
virtual ReturnValue_t sendMessage(CookieIF *cookie,
|
virtual ReturnValue_t sendMessage(CookieIF *cookie, const uint8_t *sendData,
|
||||||
const uint8_t * sendData, size_t sendLen) override;
|
size_t sendLen) override;
|
||||||
virtual ReturnValue_t getSendSuccess(CookieIF *cookie) override;
|
virtual ReturnValue_t getSendSuccess(CookieIF *cookie) override;
|
||||||
virtual ReturnValue_t requestReceiveMessage(CookieIF *cookie,
|
virtual ReturnValue_t requestReceiveMessage(CookieIF *cookie, size_t requestLen) override;
|
||||||
size_t requestLen) override;
|
virtual ReturnValue_t readReceivedMessage(CookieIF *cookie, uint8_t **buffer,
|
||||||
virtual ReturnValue_t readReceivedMessage(CookieIF *cookie,
|
size_t *size) override;
|
||||||
uint8_t **buffer, size_t *size) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
#elif WIN32
|
#elif WIN32
|
||||||
HANDLE hCom = INVALID_HANDLE_VALUE;
|
HANDLE hCom = INVALID_HANDLE_VALUE;
|
||||||
#endif
|
#endif
|
||||||
// remembering if the initialization in the ctor worked
|
// remembering if the initialization in the ctor worked
|
||||||
// if not, all calls are disabled
|
// if not, all calls are disabled
|
||||||
bool initialized = false;
|
bool initialized = false;
|
||||||
int serialPort = 0;
|
int serialPort = 0;
|
||||||
// Default baud rate is 9600 for now.
|
// Default baud rate is 9600 for now.
|
||||||
uint32_t baudRate = 9600;
|
uint32_t baudRate = 9600;
|
||||||
|
|
||||||
//used to know where to put the data if a reply is received
|
// used to know where to put the data if a reply is received
|
||||||
std::map<uint8_t, ArduinoCookie> spiMap;
|
std::map<uint8_t, ArduinoCookie> spiMap;
|
||||||
|
|
||||||
SimpleRingBuffer rxBuffer;
|
SimpleRingBuffer rxBuffer;
|
||||||
|
|
||||||
ReturnValue_t sendMessage(uint8_t command, uint8_t address,
|
ReturnValue_t sendMessage(uint8_t command, uint8_t address, const uint8_t *data, size_t dataLen);
|
||||||
const uint8_t *data, size_t dataLen);
|
void handleSerialPortRx();
|
||||||
void handleSerialPortRx();
|
|
||||||
|
|
||||||
void handlePacket(uint8_t *packet, size_t packetLen);
|
void handlePacket(uint8_t *packet, size_t packetLen);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MISSION_ARDUINOCOMMINTERFACE_H_ */
|
#endif /* MISSION_ARDUINOCOMMINTERFACE_H_ */
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#include <bsp_hosted/comIF/ArduinoCookie.h>
|
#include <bsp_hosted/comIF/ArduinoCookie.h>
|
||||||
|
|
||||||
ArduinoCookie::ArduinoCookie(Protocol_t protocol, uint8_t address,
|
ArduinoCookie::ArduinoCookie(Protocol_t protocol, uint8_t address, const size_t maxReplySize)
|
||||||
const size_t maxReplySize) :
|
: protocol(protocol),
|
||||||
protocol(protocol), command(protocol), address(address),
|
command(protocol),
|
||||||
maxReplySize(maxReplySize), replyBuffer(maxReplySize) {
|
address(address),
|
||||||
}
|
maxReplySize(maxReplySize),
|
||||||
|
replyBuffer(maxReplySize) {}
|
||||||
|
|||||||
@@ -2,26 +2,21 @@
|
|||||||
#define MISSION_ARDUINO_ARDUINOCOOKIE_H_
|
#define MISSION_ARDUINO_ARDUINOCOOKIE_H_
|
||||||
|
|
||||||
#include <fsfw/devicehandlers/CookieIF.h>
|
#include <fsfw/devicehandlers/CookieIF.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class ArduinoCookie: public CookieIF {
|
class ArduinoCookie : public CookieIF {
|
||||||
public:
|
public:
|
||||||
enum Protocol_t: uint8_t {
|
enum Protocol_t : uint8_t { INVALID, SPI, I2C };
|
||||||
INVALID,
|
|
||||||
SPI,
|
|
||||||
I2C
|
|
||||||
};
|
|
||||||
|
|
||||||
ArduinoCookie(Protocol_t protocol, uint8_t address,
|
ArduinoCookie(Protocol_t protocol, uint8_t address, const size_t maxReplySize);
|
||||||
const size_t maxReplySize);
|
|
||||||
|
|
||||||
Protocol_t protocol;
|
|
||||||
uint8_t command;
|
|
||||||
uint8_t address;
|
|
||||||
std::vector<uint8_t> replyBuffer;
|
|
||||||
size_t receivedDataLen = 0;
|
|
||||||
size_t maxReplySize;
|
|
||||||
|
|
||||||
|
Protocol_t protocol;
|
||||||
|
uint8_t command;
|
||||||
|
uint8_t address;
|
||||||
|
std::vector<uint8_t> replyBuffer;
|
||||||
|
size_t receivedDataLen = 0;
|
||||||
|
size_t maxReplySize;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MISSION_ARDUINO_ARDUINOCOOKIE_H_ */
|
#endif /* MISSION_ARDUINO_ARDUINOCOOKIE_H_ */
|
||||||
|
|||||||
@@ -1,21 +1,27 @@
|
|||||||
target_sources(${TARGET_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE
|
||||||
ipc/MissionMessageTypes.cpp
|
ipc/MissionMessageTypes.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(${TARGET_NAME} PUBLIC
|
target_include_directories(${OBSW_NAME} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
# If a special translation file for object IDs exists, compile it.
|
# If a special translation file for object IDs exists, compile it.
|
||||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
||||||
target_sources(${TARGET_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE
|
||||||
|
objects/translateObjects.cpp
|
||||||
|
)
|
||||||
|
target_sources(${UNITTEST_NAME} PRIVATE
|
||||||
objects/translateObjects.cpp
|
objects/translateObjects.cpp
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# If a special translation file for events exists, compile it.
|
# If a special translation file for events exists, compile it.
|
||||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
||||||
target_sources(${TARGET_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE
|
||||||
|
events/translateEvents.cpp
|
||||||
|
)
|
||||||
|
target_sources(${UNITTEST_NAME} PRIVATE
|
||||||
events/translateEvents.cpp
|
events/translateEvents.cpp
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -8,11 +8,25 @@
|
|||||||
|
|
||||||
#include "commonConfig.h"
|
#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
|
/* These defines should be disabled for mission code but are useful for
|
||||||
debugging. */
|
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
|
||||||
|
#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_SYRLINKS_SIMULATED 0
|
||||||
|
|
||||||
|
#define OBSW_INITIALIZE_SWITCHES 0
|
||||||
|
|
||||||
|
#define OBSW_TCP_SERVER_WIRETAPPING 0
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
#ifndef FSFWCONFIG_DEVICES_GPIOIDS_H_
|
|
||||||
#define FSFWCONFIG_DEVICES_GPIOIDS_H_
|
|
||||||
|
|
||||||
#include <linux/gpio/GpioIF.h>
|
|
||||||
|
|
||||||
namespace gpioIds {
|
|
||||||
enum gpioId_t {
|
|
||||||
HEATER_0,
|
|
||||||
HEATER_1,
|
|
||||||
HEATER_2,
|
|
||||||
HEATER_3,
|
|
||||||
HEATER_4,
|
|
||||||
HEATER_5,
|
|
||||||
HEATER_6,
|
|
||||||
HEATER_7,
|
|
||||||
DEPLSA1,
|
|
||||||
DEPLSA2,
|
|
||||||
|
|
||||||
MGM_0_LIS3_CS,
|
|
||||||
MGM_1_RM3100_CS,
|
|
||||||
GYRO_0_ADIS_CS,
|
|
||||||
GYRO_1_L3G_CS,
|
|
||||||
GYRO_2_L3G_CS,
|
|
||||||
MGM_2_LIS3_CS,
|
|
||||||
MGM_3_RM3100_CS,
|
|
||||||
|
|
||||||
TEST_ID_0,
|
|
||||||
TEST_ID_1,
|
|
||||||
|
|
||||||
RTD_IC3,
|
|
||||||
RTD_IC4,
|
|
||||||
RTD_IC5,
|
|
||||||
RTD_IC6,
|
|
||||||
RTD_IC7,
|
|
||||||
RTD_IC8,
|
|
||||||
RTD_IC9,
|
|
||||||
RTD_IC10,
|
|
||||||
RTD_IC11,
|
|
||||||
RTD_IC12,
|
|
||||||
RTD_IC13,
|
|
||||||
RTD_IC14,
|
|
||||||
RTD_IC15,
|
|
||||||
RTD_IC16,
|
|
||||||
RTD_IC17,
|
|
||||||
RTD_IC18,
|
|
||||||
|
|
||||||
SPI_MUX_BIT_1,
|
|
||||||
SPI_MUX_BIT_2,
|
|
||||||
SPI_MUX_BIT_3,
|
|
||||||
SPI_MUX_BIT_4,
|
|
||||||
SPI_MUX_BIT_5,
|
|
||||||
SPI_MUX_BIT_6
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* FSFWCONFIG_DEVICES_GPIOIDS_H_ */
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
#ifndef FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_
|
|
||||||
#define FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_
|
|
||||||
|
|
||||||
#include <OBSWConfig.h>
|
|
||||||
|
|
||||||
namespace pcduSwitches {
|
|
||||||
/* Switches are uint8_t datatype and go from 0 to 255 */
|
|
||||||
enum switcherList {
|
|
||||||
Q7S,
|
|
||||||
PAYLOAD_PCDU_CH1,
|
|
||||||
RW,
|
|
||||||
TCS_BOARD_8V_HEATER_IN,
|
|
||||||
SUS_REDUNDANT,
|
|
||||||
DEPLOYMENT_MECHANISM,
|
|
||||||
PAYLOAD_PCDU_CH6,
|
|
||||||
ACS_BOARD_SIDE_B,
|
|
||||||
PAYLOAD_CAMERA,
|
|
||||||
TCS_BOARD_3V3,
|
|
||||||
SYRLINKS,
|
|
||||||
STAR_TRACKER,
|
|
||||||
MGT,
|
|
||||||
SUS_NOMINAL,
|
|
||||||
SOLAR_CELL_EXP,
|
|
||||||
PLOC,
|
|
||||||
ACS_BORAD_SIDE_A,
|
|
||||||
NUMBER_OF_SWITCHES
|
|
||||||
};
|
|
||||||
|
|
||||||
static const uint8_t ON = 1;
|
|
||||||
static const uint8_t OFF = 0;
|
|
||||||
|
|
||||||
/* Output states after reboot of the PDUs */
|
|
||||||
static const uint8_t INIT_STATE_Q7S = ON;
|
|
||||||
static const uint8_t INIT_STATE_PAYLOAD_PCDU_CH1 = OFF;
|
|
||||||
static const uint8_t INIT_STATE_RW = OFF;
|
|
||||||
#if BOARD_TE0720 == 1
|
|
||||||
/* Because the TE0720 is not connected to the PCDU, this switch is always on */
|
|
||||||
static const uint8_t INIT_STATE_TCS_BOARD_8V_HEATER_IN = ON;
|
|
||||||
#else
|
|
||||||
static const uint8_t INIT_STATE_TCS_BOARD_8V_HEATER_IN = OFF;
|
|
||||||
#endif
|
|
||||||
static const uint8_t INIT_STATE_SUS_REDUNDANT = OFF;
|
|
||||||
static const uint8_t INIT_STATE_DEPLOYMENT_MECHANISM = OFF;
|
|
||||||
static const uint8_t INIT_STATE_PAYLOAD_PCDU_CH6 = OFF;
|
|
||||||
static const uint8_t INIT_STATE_ACS_BOARD_SIDE_B = OFF;
|
|
||||||
static const uint8_t INIT_STATE_PAYLOAD_CAMERA = OFF;
|
|
||||||
static const uint8_t INIT_STATE_TCS_BOARD_3V3 = OFF;
|
|
||||||
static const uint8_t INIT_STATE_SYRLINKS = OFF;
|
|
||||||
static const uint8_t INIT_STATE_STAR_TRACKER = OFF;
|
|
||||||
static const uint8_t INIT_STATE_MGT = OFF;
|
|
||||||
static const uint8_t INIT_STATE_SUS_NOMINAL = OFF;
|
|
||||||
static const uint8_t INIT_STATE_SOLAR_CELL_EXP = OFF;
|
|
||||||
static const uint8_t INIT_STATE_PLOC = OFF;
|
|
||||||
static const uint8_t INIT_STATE_ACS_BOARD_SIDE_A = OFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_ */
|
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
#define CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_
|
#define CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_
|
||||||
|
|
||||||
#include <common/config/commonSubsystemIds.h>
|
#include <common/config/commonSubsystemIds.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -9,9 +10,7 @@
|
|||||||
* Numbers 0-80 are reserved for FSFW Subsystem IDs (framework/events/)
|
* Numbers 0-80 are reserved for FSFW Subsystem IDs (framework/events/)
|
||||||
*/
|
*/
|
||||||
namespace SUBSYSTEM_ID {
|
namespace SUBSYSTEM_ID {
|
||||||
enum: uint8_t {
|
enum : uint8_t { SUBSYSTEM_ID_START = COMMON_SUBSYSTEM_ID_END };
|
||||||
SUBSYSTEM_ID_START = COMMON_SUBSYSTEM_ID_END
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ */
|
#endif /* CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ */
|
||||||
|
|||||||
@@ -89,176 +89,176 @@ const char *ACK_FAILURE_STRING = "ACK_FAILURE";
|
|||||||
const char *EXE_FAILURE_STRING = "EXE_FAILURE";
|
const char *EXE_FAILURE_STRING = "EXE_FAILURE";
|
||||||
const char *CRC_FAILURE_EVENT_STRING = "CRC_FAILURE_EVENT";
|
const char *CRC_FAILURE_EVENT_STRING = "CRC_FAILURE_EVENT";
|
||||||
|
|
||||||
const char * translateEvents(Event event) {
|
const char *translateEvents(Event event) {
|
||||||
switch( (event & 0xffff) ) {
|
switch ((event & 0xffff)) {
|
||||||
case(2200):
|
case (2200):
|
||||||
return STORE_SEND_WRITE_FAILED_STRING;
|
return STORE_SEND_WRITE_FAILED_STRING;
|
||||||
case(2201):
|
case (2201):
|
||||||
return STORE_WRITE_FAILED_STRING;
|
return STORE_WRITE_FAILED_STRING;
|
||||||
case(2202):
|
case (2202):
|
||||||
return STORE_SEND_READ_FAILED_STRING;
|
return STORE_SEND_READ_FAILED_STRING;
|
||||||
case(2203):
|
case (2203):
|
||||||
return STORE_READ_FAILED_STRING;
|
return STORE_READ_FAILED_STRING;
|
||||||
case(2204):
|
case (2204):
|
||||||
return UNEXPECTED_MSG_STRING;
|
return UNEXPECTED_MSG_STRING;
|
||||||
case(2205):
|
case (2205):
|
||||||
return STORING_FAILED_STRING;
|
return STORING_FAILED_STRING;
|
||||||
case(2206):
|
case (2206):
|
||||||
return TM_DUMP_FAILED_STRING;
|
return TM_DUMP_FAILED_STRING;
|
||||||
case(2207):
|
case (2207):
|
||||||
return STORE_INIT_FAILED_STRING;
|
return STORE_INIT_FAILED_STRING;
|
||||||
case(2208):
|
case (2208):
|
||||||
return STORE_INIT_EMPTY_STRING;
|
return STORE_INIT_EMPTY_STRING;
|
||||||
case(2209):
|
case (2209):
|
||||||
return STORE_CONTENT_CORRUPTED_STRING;
|
return STORE_CONTENT_CORRUPTED_STRING;
|
||||||
case(2210):
|
case (2210):
|
||||||
return STORE_INITIALIZE_STRING;
|
return STORE_INITIALIZE_STRING;
|
||||||
case(2211):
|
case (2211):
|
||||||
return INIT_DONE_STRING;
|
return INIT_DONE_STRING;
|
||||||
case(2212):
|
case (2212):
|
||||||
return DUMP_FINISHED_STRING;
|
return DUMP_FINISHED_STRING;
|
||||||
case(2213):
|
case (2213):
|
||||||
return DELETION_FINISHED_STRING;
|
return DELETION_FINISHED_STRING;
|
||||||
case(2214):
|
case (2214):
|
||||||
return DELETION_FAILED_STRING;
|
return DELETION_FAILED_STRING;
|
||||||
case(2215):
|
case (2215):
|
||||||
return AUTO_CATALOGS_SENDING_FAILED_STRING;
|
return AUTO_CATALOGS_SENDING_FAILED_STRING;
|
||||||
case(2600):
|
case (2600):
|
||||||
return GET_DATA_FAILED_STRING;
|
return GET_DATA_FAILED_STRING;
|
||||||
case(2601):
|
case (2601):
|
||||||
return STORE_DATA_FAILED_STRING;
|
return STORE_DATA_FAILED_STRING;
|
||||||
case(2800):
|
case (2800):
|
||||||
return DEVICE_BUILDING_COMMAND_FAILED_STRING;
|
return DEVICE_BUILDING_COMMAND_FAILED_STRING;
|
||||||
case(2801):
|
case (2801):
|
||||||
return DEVICE_SENDING_COMMAND_FAILED_STRING;
|
return DEVICE_SENDING_COMMAND_FAILED_STRING;
|
||||||
case(2802):
|
case (2802):
|
||||||
return DEVICE_REQUESTING_REPLY_FAILED_STRING;
|
return DEVICE_REQUESTING_REPLY_FAILED_STRING;
|
||||||
case(2803):
|
case (2803):
|
||||||
return DEVICE_READING_REPLY_FAILED_STRING;
|
return DEVICE_READING_REPLY_FAILED_STRING;
|
||||||
case(2804):
|
case (2804):
|
||||||
return DEVICE_INTERPRETING_REPLY_FAILED_STRING;
|
return DEVICE_INTERPRETING_REPLY_FAILED_STRING;
|
||||||
case(2805):
|
case (2805):
|
||||||
return DEVICE_MISSED_REPLY_STRING;
|
return DEVICE_MISSED_REPLY_STRING;
|
||||||
case(2806):
|
case (2806):
|
||||||
return DEVICE_UNKNOWN_REPLY_STRING;
|
return DEVICE_UNKNOWN_REPLY_STRING;
|
||||||
case(2807):
|
case (2807):
|
||||||
return DEVICE_UNREQUESTED_REPLY_STRING;
|
return DEVICE_UNREQUESTED_REPLY_STRING;
|
||||||
case(2808):
|
case (2808):
|
||||||
return INVALID_DEVICE_COMMAND_STRING;
|
return INVALID_DEVICE_COMMAND_STRING;
|
||||||
case(2809):
|
case (2809):
|
||||||
return MONITORING_LIMIT_EXCEEDED_STRING;
|
return MONITORING_LIMIT_EXCEEDED_STRING;
|
||||||
case(2810):
|
case (2810):
|
||||||
return MONITORING_AMBIGUOUS_STRING;
|
return MONITORING_AMBIGUOUS_STRING;
|
||||||
case(4201):
|
case (4201):
|
||||||
return FUSE_CURRENT_HIGH_STRING;
|
return FUSE_CURRENT_HIGH_STRING;
|
||||||
case(4202):
|
case (4202):
|
||||||
return FUSE_WENT_OFF_STRING;
|
return FUSE_WENT_OFF_STRING;
|
||||||
case(4204):
|
case (4204):
|
||||||
return POWER_ABOVE_HIGH_LIMIT_STRING;
|
return POWER_ABOVE_HIGH_LIMIT_STRING;
|
||||||
case(4205):
|
case (4205):
|
||||||
return POWER_BELOW_LOW_LIMIT_STRING;
|
return POWER_BELOW_LOW_LIMIT_STRING;
|
||||||
case(4300):
|
case (4300):
|
||||||
return SWITCH_WENT_OFF_STRING;
|
return SWITCH_WENT_OFF_STRING;
|
||||||
case(5000):
|
case (5000):
|
||||||
return HEATER_ON_STRING;
|
return HEATER_ON_STRING;
|
||||||
case(5001):
|
case (5001):
|
||||||
return HEATER_OFF_STRING;
|
return HEATER_OFF_STRING;
|
||||||
case(5002):
|
case (5002):
|
||||||
return HEATER_TIMEOUT_STRING;
|
return HEATER_TIMEOUT_STRING;
|
||||||
case(5003):
|
case (5003):
|
||||||
return HEATER_STAYED_ON_STRING;
|
return HEATER_STAYED_ON_STRING;
|
||||||
case(5004):
|
case (5004):
|
||||||
return HEATER_STAYED_OFF_STRING;
|
return HEATER_STAYED_OFF_STRING;
|
||||||
case(5200):
|
case (5200):
|
||||||
return TEMP_SENSOR_HIGH_STRING;
|
return TEMP_SENSOR_HIGH_STRING;
|
||||||
case(5201):
|
case (5201):
|
||||||
return TEMP_SENSOR_LOW_STRING;
|
return TEMP_SENSOR_LOW_STRING;
|
||||||
case(5202):
|
case (5202):
|
||||||
return TEMP_SENSOR_GRADIENT_STRING;
|
return TEMP_SENSOR_GRADIENT_STRING;
|
||||||
case(5901):
|
case (5901):
|
||||||
return COMPONENT_TEMP_LOW_STRING;
|
return COMPONENT_TEMP_LOW_STRING;
|
||||||
case(5902):
|
case (5902):
|
||||||
return COMPONENT_TEMP_HIGH_STRING;
|
return COMPONENT_TEMP_HIGH_STRING;
|
||||||
case(5903):
|
case (5903):
|
||||||
return COMPONENT_TEMP_OOL_LOW_STRING;
|
return COMPONENT_TEMP_OOL_LOW_STRING;
|
||||||
case(5904):
|
case (5904):
|
||||||
return COMPONENT_TEMP_OOL_HIGH_STRING;
|
return COMPONENT_TEMP_OOL_HIGH_STRING;
|
||||||
case(5905):
|
case (5905):
|
||||||
return TEMP_NOT_IN_OP_RANGE_STRING;
|
return TEMP_NOT_IN_OP_RANGE_STRING;
|
||||||
case(7101):
|
case (7101):
|
||||||
return FDIR_CHANGED_STATE_STRING;
|
return FDIR_CHANGED_STATE_STRING;
|
||||||
case(7102):
|
case (7102):
|
||||||
return FDIR_STARTS_RECOVERY_STRING;
|
return FDIR_STARTS_RECOVERY_STRING;
|
||||||
case(7103):
|
case (7103):
|
||||||
return FDIR_TURNS_OFF_DEVICE_STRING;
|
return FDIR_TURNS_OFF_DEVICE_STRING;
|
||||||
case(7201):
|
case (7201):
|
||||||
return MONITOR_CHANGED_STATE_STRING;
|
return MONITOR_CHANGED_STATE_STRING;
|
||||||
case(7202):
|
case (7202):
|
||||||
return VALUE_BELOW_LOW_LIMIT_STRING;
|
return VALUE_BELOW_LOW_LIMIT_STRING;
|
||||||
case(7203):
|
case (7203):
|
||||||
return VALUE_ABOVE_HIGH_LIMIT_STRING;
|
return VALUE_ABOVE_HIGH_LIMIT_STRING;
|
||||||
case(7204):
|
case (7204):
|
||||||
return VALUE_OUT_OF_RANGE_STRING;
|
return VALUE_OUT_OF_RANGE_STRING;
|
||||||
case(7301):
|
case (7301):
|
||||||
return SWITCHING_TM_FAILED_STRING;
|
return SWITCHING_TM_FAILED_STRING;
|
||||||
case(7400):
|
case (7400):
|
||||||
return CHANGING_MODE_STRING;
|
return CHANGING_MODE_STRING;
|
||||||
case(7401):
|
case (7401):
|
||||||
return MODE_INFO_STRING;
|
return MODE_INFO_STRING;
|
||||||
case(7402):
|
case (7402):
|
||||||
return FALLBACK_FAILED_STRING;
|
return FALLBACK_FAILED_STRING;
|
||||||
case(7403):
|
case (7403):
|
||||||
return MODE_TRANSITION_FAILED_STRING;
|
return MODE_TRANSITION_FAILED_STRING;
|
||||||
case(7404):
|
case (7404):
|
||||||
return CANT_KEEP_MODE_STRING;
|
return CANT_KEEP_MODE_STRING;
|
||||||
case(7405):
|
case (7405):
|
||||||
return OBJECT_IN_INVALID_MODE_STRING;
|
return OBJECT_IN_INVALID_MODE_STRING;
|
||||||
case(7406):
|
case (7406):
|
||||||
return FORCING_MODE_STRING;
|
return FORCING_MODE_STRING;
|
||||||
case(7407):
|
case (7407):
|
||||||
return MODE_CMD_REJECTED_STRING;
|
return MODE_CMD_REJECTED_STRING;
|
||||||
case(7506):
|
case (7506):
|
||||||
return HEALTH_INFO_STRING;
|
return HEALTH_INFO_STRING;
|
||||||
case(7507):
|
case (7507):
|
||||||
return CHILD_CHANGED_HEALTH_STRING;
|
return CHILD_CHANGED_HEALTH_STRING;
|
||||||
case(7508):
|
case (7508):
|
||||||
return CHILD_PROBLEMS_STRING;
|
return CHILD_PROBLEMS_STRING;
|
||||||
case(7509):
|
case (7509):
|
||||||
return OVERWRITING_HEALTH_STRING;
|
return OVERWRITING_HEALTH_STRING;
|
||||||
case(7510):
|
case (7510):
|
||||||
return TRYING_RECOVERY_STRING;
|
return TRYING_RECOVERY_STRING;
|
||||||
case(7511):
|
case (7511):
|
||||||
return RECOVERY_STEP_STRING;
|
return RECOVERY_STEP_STRING;
|
||||||
case(7512):
|
case (7512):
|
||||||
return RECOVERY_DONE_STRING;
|
return RECOVERY_DONE_STRING;
|
||||||
case(7900):
|
case (7900):
|
||||||
return RF_AVAILABLE_STRING;
|
return RF_AVAILABLE_STRING;
|
||||||
case(7901):
|
case (7901):
|
||||||
return RF_LOST_STRING;
|
return RF_LOST_STRING;
|
||||||
case(7902):
|
case (7902):
|
||||||
return BIT_LOCK_STRING;
|
return BIT_LOCK_STRING;
|
||||||
case(7903):
|
case (7903):
|
||||||
return BIT_LOCK_LOST_STRING;
|
return BIT_LOCK_LOST_STRING;
|
||||||
case(7905):
|
case (7905):
|
||||||
return FRAME_PROCESSING_FAILED_STRING;
|
return FRAME_PROCESSING_FAILED_STRING;
|
||||||
case(8900):
|
case (8900):
|
||||||
return CLOCK_SET_STRING;
|
return CLOCK_SET_STRING;
|
||||||
case(8901):
|
case (8901):
|
||||||
return CLOCK_SET_FAILURE_STRING;
|
return CLOCK_SET_FAILURE_STRING;
|
||||||
case(9700):
|
case (9700):
|
||||||
return TEST_STRING;
|
return TEST_STRING;
|
||||||
case(10600):
|
case (10600):
|
||||||
return CHANGE_OF_SETUP_PARAMETER_STRING;
|
return CHANGE_OF_SETUP_PARAMETER_STRING;
|
||||||
case(11101):
|
case (11101):
|
||||||
return MEMORY_READ_RPT_CRC_FAILURE_STRING;
|
return MEMORY_READ_RPT_CRC_FAILURE_STRING;
|
||||||
case(11102):
|
case (11102):
|
||||||
return ACK_FAILURE_STRING;
|
return ACK_FAILURE_STRING;
|
||||||
case(11103):
|
case (11103):
|
||||||
return EXE_FAILURE_STRING;
|
return EXE_FAILURE_STRING;
|
||||||
case(11104):
|
case (11104):
|
||||||
return CRC_FAILURE_EVENT_STRING;
|
return CRC_FAILURE_EVENT_STRING;
|
||||||
default:
|
default:
|
||||||
return "UNKNOWN_EVENT";
|
return "UNKNOWN_EVENT";
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
|
|
||||||
#include <fsfw/events/Event.h>
|
#include <fsfw/events/Event.h>
|
||||||
|
|
||||||
const char * translateEvents(Event event);
|
const char* translateEvents(Event event);
|
||||||
|
|
||||||
#endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */
|
#endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
CXXSRC += $(wildcard $(CURRENTPATH)/cdatapool/*.cpp)
|
|
||||||
CXXSRC += $(wildcard $(CURRENTPATH)/ipc/*.cpp)
|
|
||||||
CXXSRC += $(wildcard $(CURRENTPATH)/objects/*.cpp)
|
|
||||||
CXXSRC += $(wildcard $(CURRENTPATH)/pollingsequence/*.cpp)
|
|
||||||
CXXSRC += $(wildcard $(CURRENTPATH)/events/*.cpp)
|
|
||||||
|
|
||||||
INCLUDES += $(CURRENTPATH)
|
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
#include "MissionMessageTypes.h"
|
#include "MissionMessageTypes.h"
|
||||||
|
|
||||||
#include <fsfw/ipc/CommandMessage.h>
|
#include <fsfw/ipc/CommandMessage.h>
|
||||||
|
|
||||||
void messagetypes::clearMissionMessage(CommandMessage* message) {
|
void messagetypes::clearMissionMessage(CommandMessage* message) {
|
||||||
switch(message->getMessageType()) {
|
switch (message->getMessageType()) {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ class CommandMessage;
|
|||||||
*/
|
*/
|
||||||
namespace messagetypes {
|
namespace messagetypes {
|
||||||
enum MESSAGE_TYPE {
|
enum MESSAGE_TYPE {
|
||||||
MISSION_MESSAGE_TYPE_START = FW_MESSAGES_COUNT,
|
MISSION_MESSAGE_TYPE_START = FW_MESSAGES_COUNT,
|
||||||
};
|
};
|
||||||
|
|
||||||
void clearMissionMessage(CommandMessage* message);
|
void clearMissionMessage(CommandMessage* message);
|
||||||
}
|
} // namespace messagetypes
|
||||||
|
|
||||||
#endif /* CONFIG_IPC_MISSIONMESSAGETYPES_H_ */
|
#endif /* CONFIG_IPC_MISSIONMESSAGETYPES_H_ */
|
||||||
|
|||||||
@@ -1,31 +1,32 @@
|
|||||||
#ifndef HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_
|
#ifndef HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_
|
||||||
#define HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_
|
#define HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
#include <commonObjects.h>
|
#include <commonObjects.h>
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
// The objects will be instantiated in the ID order
|
// The objects will be instantiated in the ID order
|
||||||
namespace objects {
|
namespace objects {
|
||||||
enum sourceObjects: uint32_t {
|
enum sourceObjects : uint32_t {
|
||||||
|
|
||||||
PUS_SERVICE_3 = 0x51000300,
|
PUS_SERVICE_3 = 0x51000300,
|
||||||
PUS_SERVICE_5 = 0x51000400,
|
PUS_SERVICE_5 = 0x51000400,
|
||||||
PUS_SERVICE_6 = 0x51000500,
|
PUS_SERVICE_6 = 0x51000500,
|
||||||
PUS_SERVICE_8 = 0x51000800,
|
PUS_SERVICE_8 = 0x51000800,
|
||||||
PUS_SERVICE_23 = 0x51002300,
|
PUS_SERVICE_23 = 0x51002300,
|
||||||
PUS_SERVICE_201 = 0x51020100,
|
PUS_SERVICE_201 = 0x51020100,
|
||||||
|
|
||||||
TM_FUNNEL = 0x52000002,
|
TM_FUNNEL = 0x52000002,
|
||||||
|
|
||||||
/* Test Task */
|
/* Test Task */
|
||||||
|
|
||||||
TEST_TASK = 0x42694269,
|
TEST_TASK = 0x42694269,
|
||||||
DUMMY_INTERFACE = 0xCAFECAFE,
|
DUMMY_INTERFACE = 0xCAFECAFE,
|
||||||
DUMMY_HANDLER = 0x4400AFFE,
|
DUMMY_HANDLER = 0x4400AFFE,
|
||||||
|
|
||||||
/* 0x49 ('I') for Communication Interfaces **/
|
/* 0x49 ('I') for Communication Interfaces **/
|
||||||
ARDUINO_COM_IF = 0x49000001
|
ARDUINO_COM_IF = 0x49000001
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* BSP_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ */
|
#endif /* BSP_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ */
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/**
|
/**
|
||||||
* @brief Auto-generated object translation file.
|
* @brief Auto-generated object translation file.
|
||||||
* @details
|
* @details
|
||||||
* Contains 31 translations.
|
* Contains 31 translations.
|
||||||
@@ -38,72 +38,72 @@ const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END";
|
|||||||
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
||||||
const char *NO_OBJECT_STRING = "NO_OBJECT";
|
const char *NO_OBJECT_STRING = "NO_OBJECT";
|
||||||
|
|
||||||
const char* translateObject(object_id_t object) {
|
const char *translateObject(object_id_t object) {
|
||||||
switch( (object & 0xFFFFFFFF) ) {
|
switch ((object & 0xFFFFFFFF)) {
|
||||||
case 0x42694269:
|
case 0x42694269:
|
||||||
return TEST_TASK_STRING;
|
return TEST_TASK_STRING;
|
||||||
case 0x4400AFFE:
|
case 0x4400AFFE:
|
||||||
return DUMMY_HANDLER_STRING;
|
return DUMMY_HANDLER_STRING;
|
||||||
case 0x49000001:
|
case 0x49000001:
|
||||||
return ARDUINO_COM_IF_STRING;
|
return ARDUINO_COM_IF_STRING;
|
||||||
case 0x51000300:
|
case 0x51000300:
|
||||||
return PUS_SERVICE_3_STRING;
|
return PUS_SERVICE_3_STRING;
|
||||||
case 0x51000400:
|
case 0x51000400:
|
||||||
return PUS_SERVICE_5_STRING;
|
return PUS_SERVICE_5_STRING;
|
||||||
case 0x51000500:
|
case 0x51000500:
|
||||||
return PUS_SERVICE_6_STRING;
|
return PUS_SERVICE_6_STRING;
|
||||||
case 0x51000800:
|
case 0x51000800:
|
||||||
return PUS_SERVICE_8_STRING;
|
return PUS_SERVICE_8_STRING;
|
||||||
case 0x51002300:
|
case 0x51002300:
|
||||||
return PUS_SERVICE_23_STRING;
|
return PUS_SERVICE_23_STRING;
|
||||||
case 0x51020100:
|
case 0x51020100:
|
||||||
return PUS_SERVICE_201_STRING;
|
return PUS_SERVICE_201_STRING;
|
||||||
case 0x52000002:
|
case 0x52000002:
|
||||||
return TM_FUNNEL_STRING;
|
return TM_FUNNEL_STRING;
|
||||||
case 0x53000000:
|
case 0x53000000:
|
||||||
return FSFW_OBJECTS_START_STRING;
|
return FSFW_OBJECTS_START_STRING;
|
||||||
case 0x53000001:
|
case 0x53000001:
|
||||||
return PUS_SERVICE_1_VERIFICATION_STRING;
|
return PUS_SERVICE_1_VERIFICATION_STRING;
|
||||||
case 0x53000002:
|
case 0x53000002:
|
||||||
return PUS_SERVICE_2_DEVICE_ACCESS_STRING;
|
return PUS_SERVICE_2_DEVICE_ACCESS_STRING;
|
||||||
case 0x53000003:
|
case 0x53000003:
|
||||||
return PUS_SERVICE_3_HOUSEKEEPING_STRING;
|
return PUS_SERVICE_3_HOUSEKEEPING_STRING;
|
||||||
case 0x53000005:
|
case 0x53000005:
|
||||||
return PUS_SERVICE_5_EVENT_REPORTING_STRING;
|
return PUS_SERVICE_5_EVENT_REPORTING_STRING;
|
||||||
case 0x53000008:
|
case 0x53000008:
|
||||||
return PUS_SERVICE_8_FUNCTION_MGMT_STRING;
|
return PUS_SERVICE_8_FUNCTION_MGMT_STRING;
|
||||||
case 0x53000009:
|
case 0x53000009:
|
||||||
return PUS_SERVICE_9_TIME_MGMT_STRING;
|
return PUS_SERVICE_9_TIME_MGMT_STRING;
|
||||||
case 0x53000017:
|
case 0x53000017:
|
||||||
return PUS_SERVICE_17_TEST_STRING;
|
return PUS_SERVICE_17_TEST_STRING;
|
||||||
case 0x53000020:
|
case 0x53000020:
|
||||||
return PUS_SERVICE_20_PARAMETERS_STRING;
|
return PUS_SERVICE_20_PARAMETERS_STRING;
|
||||||
case 0x53000200:
|
case 0x53000200:
|
||||||
return PUS_SERVICE_200_MODE_MGMT_STRING;
|
return PUS_SERVICE_200_MODE_MGMT_STRING;
|
||||||
case 0x53010000:
|
case 0x53010000:
|
||||||
return HEALTH_TABLE_STRING;
|
return HEALTH_TABLE_STRING;
|
||||||
case 0x53010100:
|
case 0x53010100:
|
||||||
return MODE_STORE_STRING;
|
return MODE_STORE_STRING;
|
||||||
case 0x53030000:
|
case 0x53030000:
|
||||||
return EVENT_MANAGER_STRING;
|
return EVENT_MANAGER_STRING;
|
||||||
case 0x53040000:
|
case 0x53040000:
|
||||||
return INTERNAL_ERROR_REPORTER_STRING;
|
return INTERNAL_ERROR_REPORTER_STRING;
|
||||||
case 0x534f0100:
|
case 0x534f0100:
|
||||||
return TC_STORE_STRING;
|
return TC_STORE_STRING;
|
||||||
case 0x534f0200:
|
case 0x534f0200:
|
||||||
return TM_STORE_STRING;
|
return TM_STORE_STRING;
|
||||||
case 0x534f0300:
|
case 0x534f0300:
|
||||||
return IPC_STORE_STRING;
|
return IPC_STORE_STRING;
|
||||||
case 0x53500010:
|
case 0x53500010:
|
||||||
return TIME_STAMPER_STRING;
|
return TIME_STAMPER_STRING;
|
||||||
case 0x53ffffff:
|
case 0x53ffffff:
|
||||||
return FSFW_OBJECTS_END_STRING;
|
return FSFW_OBJECTS_END_STRING;
|
||||||
case 0xCAFECAFE:
|
case 0xCAFECAFE:
|
||||||
return DUMMY_INTERFACE_STRING;
|
return DUMMY_INTERFACE_STRING;
|
||||||
case 0xFFFFFFFF:
|
case 0xFFFFFFFF:
|
||||||
return NO_OBJECT_STRING;
|
return NO_OBJECT_STRING;
|
||||||
default:
|
default:
|
||||||
return "UNKNOWN_OBJECT";
|
return "UNKNOWN_OBJECT";
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
#ifndef CONFIG_RETURNVALUES_CLASSIDS_H_
|
#ifndef CONFIG_RETURNVALUES_CLASSIDS_H_
|
||||||
#define CONFIG_RETURNVALUES_CLASSIDS_H_
|
#define CONFIG_RETURNVALUES_CLASSIDS_H_
|
||||||
|
|
||||||
#include "commonClassIds.h"
|
|
||||||
#include <fsfw/returnvalues/FwClassIds.h>
|
#include <fsfw/returnvalues/FwClassIds.h>
|
||||||
|
|
||||||
|
#include "commonClassIds.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Source IDs starts at 73 for now
|
* Source IDs starts at 73 for now
|
||||||
* Framework IDs for ReturnValues run from 0 to 56
|
* Framework IDs for ReturnValues run from 0 to 56
|
||||||
@@ -11,9 +12,8 @@
|
|||||||
*/
|
*/
|
||||||
namespace CLASS_ID {
|
namespace CLASS_ID {
|
||||||
enum {
|
enum {
|
||||||
CLASS_ID_START = COMMON_CLASS_ID_END,
|
CLASS_ID_START = COMMON_CLASS_ID_END,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* CONFIG_RETURNVALUES_CLASSIDS_H_ */
|
#endif /* CONFIG_RETURNVALUES_CLASSIDS_H_ */
|
||||||
|
|||||||
@@ -12,8 +12,7 @@
|
|||||||
* APID is a 11 bit number
|
* APID is a 11 bit number
|
||||||
*/
|
*/
|
||||||
namespace apid {
|
namespace apid {
|
||||||
static const uint16_t EIVE_OBSW = 0x65;
|
static const uint16_t EIVE_OBSW = 0x65;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* FSFWCONFIG_TMTC_APID_H_ */
|
#endif /* FSFWCONFIG_TMTC_APID_H_ */
|
||||||
|
|||||||
@@ -2,21 +2,21 @@
|
|||||||
#define CONFIG_TMTC_PUSIDS_HPP_
|
#define CONFIG_TMTC_PUSIDS_HPP_
|
||||||
|
|
||||||
namespace pus {
|
namespace pus {
|
||||||
enum Ids{
|
enum Ids {
|
||||||
PUS_SERVICE_1 = 1,
|
PUS_SERVICE_1 = 1,
|
||||||
PUS_SERVICE_2 = 2,
|
PUS_SERVICE_2 = 2,
|
||||||
PUS_SERVICE_3 = 3,
|
PUS_SERVICE_3 = 3,
|
||||||
PUS_SERVICE_3_PSB = 3,
|
PUS_SERVICE_3_PSB = 3,
|
||||||
PUS_SERVICE_5 = 5,
|
PUS_SERVICE_5 = 5,
|
||||||
PUS_SERVICE_6 = 6,
|
PUS_SERVICE_6 = 6,
|
||||||
PUS_SERVICE_8 = 8,
|
PUS_SERVICE_8 = 8,
|
||||||
PUS_SERVICE_9 = 9,
|
PUS_SERVICE_9 = 9,
|
||||||
PUS_SERVICE_17 = 17,
|
PUS_SERVICE_17 = 17,
|
||||||
PUS_SERVICE_19 = 19,
|
PUS_SERVICE_19 = 19,
|
||||||
PUS_SERVICE_20 = 20,
|
PUS_SERVICE_20 = 20,
|
||||||
PUS_SERVICE_23 = 23,
|
PUS_SERVICE_23 = 23,
|
||||||
PUS_SERVICE_200 = 200,
|
PUS_SERVICE_200 = 200,
|
||||||
PUS_SERVICE_201 = 201,
|
PUS_SERVICE_201 = 201,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#include "InitMission.h"
|
#include <iostream>
|
||||||
#include "OBSWVersion.h"
|
|
||||||
|
|
||||||
|
#include "InitMission.h"
|
||||||
|
#include "commonConfig.h"
|
||||||
#include "fsfw/FSFWVersion.h"
|
#include "fsfw/FSFWVersion.h"
|
||||||
#include "fsfw/tasks/TaskFactory.h"
|
#include "fsfw/tasks/TaskFactory.h"
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
static const char* COMPILE_PRINTOUT = "Windows";
|
static const char* COMPILE_PRINTOUT = "Windows";
|
||||||
#elif LINUX
|
#elif LINUX
|
||||||
@@ -17,21 +16,18 @@ static const char* COMPILE_PRINTOUT = "unknown OS";
|
|||||||
* Linux and Windows.
|
* Linux and Windows.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int main(void)
|
int main(void) {
|
||||||
{
|
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
std::cout << "-- Compiled for " << COMPILE_PRINTOUT << " --" << std::endl;
|
||||||
std::cout << "-- Compiled for " << COMPILE_PRINTOUT << " --" << std::endl;
|
std::cout << "-- OBSW "
|
||||||
std::cout << "-- OBSW " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION <<
|
<< "v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --"
|
||||||
"." << SW_REVISION << ", FSFW v" << FSFW_VERSION << "." << FSFW_SUBVERSION << "." <<
|
<< std::endl;
|
||||||
FSFW_REVISION << "--" << std::endl;
|
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
|
||||||
|
|
||||||
initmission::initMission();
|
initmission::initMission();
|
||||||
|
|
||||||
for(;;) {
|
for (;;) {
|
||||||
// suspend main thread by sleeping it.
|
// suspend main thread by sleeping it.
|
||||||
TaskFactory::delayTask(5000);
|
TaskFactory::delayTask(5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
target_sources(${TARGET_NAME} PUBLIC
|
target_sources(${OBSW_NAME} PUBLIC
|
||||||
InitMission.cpp
|
InitMission.cpp
|
||||||
main.cpp
|
main.cpp
|
||||||
|
gpioInit.cpp
|
||||||
ObjectFactory.cpp
|
ObjectFactory.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,192 +1,245 @@
|
|||||||
#include "InitMission.h"
|
#include "InitMission.h"
|
||||||
#include "ObjectFactory.h"
|
|
||||||
|
|
||||||
#include "objects/systemObjectList.h"
|
#include <fsfw/objectmanager/ObjectManager.h>
|
||||||
#include "OBSWConfig.h"
|
|
||||||
#include "pollingsequence/pollingSequenceFactory.h"
|
|
||||||
|
|
||||||
#include <mission/utility/InitMission.h>
|
|
||||||
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||||
#include <fsfw/objectmanager/ObjectManager.h>
|
|
||||||
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||||
#include <fsfw/tasks/PeriodicTaskIF.h>
|
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||||
#include <fsfw/tasks/TaskFactory.h>
|
#include <fsfw/tasks/TaskFactory.h>
|
||||||
|
#include <mission/utility/InitMission.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "OBSWConfig.h"
|
||||||
|
#include "ObjectFactory.h"
|
||||||
|
#include "objects/systemObjectList.h"
|
||||||
|
#include "pollingsequence/pollingSequenceFactory.h"
|
||||||
|
|
||||||
ServiceInterfaceStream sif::debug("DEBUG");
|
ServiceInterfaceStream sif::debug("DEBUG");
|
||||||
ServiceInterfaceStream sif::info("INFO");
|
ServiceInterfaceStream sif::info("INFO");
|
||||||
ServiceInterfaceStream sif::warning("WARNING");
|
ServiceInterfaceStream sif::warning("WARNING");
|
||||||
ServiceInterfaceStream sif::error("ERROR");
|
ServiceInterfaceStream sif::error("ERROR");
|
||||||
|
|
||||||
ObjectManagerIF *objectManager = nullptr;
|
ObjectManagerIF* objectManager = nullptr;
|
||||||
|
|
||||||
void initmission::initMission() {
|
void initmission::initMission() {
|
||||||
sif::info << "Building global objects.." << std::endl;
|
sif::info << "Building global objects.." << std::endl;
|
||||||
/* Instantiate global object manager and also create all objects */
|
/* Instantiate global object manager and also create all objects */
|
||||||
ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
|
ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
|
||||||
sif::info << "Initializing all objects.." << std::endl;
|
sif::info << "Initializing all objects.." << std::endl;
|
||||||
ObjectManager::instance()->initialize();
|
ObjectManager::instance()->initialize();
|
||||||
|
|
||||||
/* This function creates and starts all tasks */
|
/* This function creates and starts all tasks */
|
||||||
initTasks();
|
initTasks();
|
||||||
}
|
}
|
||||||
|
|
||||||
void initmission::initTasks() {
|
void initmission::initTasks() {
|
||||||
TaskFactory* factory = TaskFactory::instance();
|
TaskFactory* factory = TaskFactory::instance();
|
||||||
if(factory == nullptr) {
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||||
/* Should never happen ! */
|
if (factory == nullptr) {
|
||||||
return;
|
/* Should never happen ! */
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
#if OBSW_PRINT_MISSED_DEADLINES == 1
|
#if OBSW_PRINT_MISSED_DEADLINES == 1
|
||||||
void (*missedDeadlineFunc) (void) = TaskFactory::printMissedDeadline;
|
void (*missedDeadlineFunc)(void) = TaskFactory::printMissedDeadline;
|
||||||
#else
|
#else
|
||||||
void (*missedDeadlineFunc) (void) = nullptr;
|
void (*missedDeadlineFunc)(void) = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* TMTC Distribution */
|
/* TMTC Distribution */
|
||||||
PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask(
|
PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask(
|
||||||
"DIST", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
"DIST", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||||
ReturnValue_t result = tmTcDistributor->addComponent(
|
result = tmTcDistributor->addComponent(objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||||
objects::CCSDS_PACKET_DISTRIBUTOR);
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK){
|
sif::error << "Object add component failed" << std::endl;
|
||||||
sif::error << "Object add component failed" << std::endl;
|
}
|
||||||
}
|
result = tmTcDistributor->addComponent(objects::PUS_PACKET_DISTRIBUTOR);
|
||||||
result = tmTcDistributor->addComponent(objects::PUS_PACKET_DISTRIBUTOR);
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK){
|
sif::error << "Object add component failed" << std::endl;
|
||||||
sif::error << "Object add component failed" << std::endl;
|
}
|
||||||
}
|
result = tmTcDistributor->addComponent(objects::TM_FUNNEL);
|
||||||
result = tmTcDistributor->addComponent(objects::TM_FUNNEL);
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
sif::error << "Object add component failed" << std::endl;
|
||||||
sif::error << "Object add component failed" << std::endl;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* UDP bridge */
|
/* UDP bridge */
|
||||||
PeriodicTaskIF* udpBridgeTask = factory->createPeriodicTask(
|
PeriodicTaskIF* tmtcBridgeTask = factory->createPeriodicTask(
|
||||||
"UDP_UNIX_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
"TMTC_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||||
result = udpBridgeTask->addComponent(objects::TMTC_BRIDGE);
|
result = tmtcBridgeTask->addComponent(objects::TMTC_BRIDGE);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::error << "Add component UDP Unix Bridge failed" << std::endl;
|
sif::error << "Add component TMTC Bridge failed" << std::endl;
|
||||||
}
|
}
|
||||||
PeriodicTaskIF* udpPollingTask = factory->createPeriodicTask(
|
PeriodicTaskIF* tmtcPollingTask = factory->createPeriodicTask(
|
||||||
"UDP_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
"TMTC_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||||
result = udpPollingTask->addComponent(objects::TMTC_POLLING_TASK);
|
result = tmtcPollingTask->addComponent(objects::TMTC_POLLING_TASK);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::error << "Add component UDP Polling failed" << std::endl;
|
sif::error << "Add component TMTC Polling failed" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PUS Services */
|
/* PUS Services */
|
||||||
PeriodicTaskIF* pusVerification = factory->createPeriodicTask(
|
std::vector<PeriodicTaskIF*> pusTasks;
|
||||||
"PUS_VERIF", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
createPusTasks(*factory, missedDeadlineFunc, pusTasks);
|
||||||
result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
|
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK){
|
|
||||||
sif::error << "Object add component failed" << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
PeriodicTaskIF* pusEvents = factory->createPeriodicTask(
|
std::vector<PeriodicTaskIF*> pstTasks;
|
||||||
"PUS_EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
createPstTasks(*factory, missedDeadlineFunc, pstTasks);
|
||||||
result = pusVerification->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK){
|
std::vector<PeriodicTaskIF*> testTasks;
|
||||||
initmission::printAddObjectError("PUS5", objects::PUS_SERVICE_5_EVENT_REPORTING);
|
createTestTasks(*factory, missedDeadlineFunc, pstTasks);
|
||||||
}
|
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||||
|
|
||||||
PeriodicTaskIF* pusHighPrio = factory->createPeriodicTask(
|
auto taskStarter = [](std::vector<PeriodicTaskIF*>& taskVector, std::string name) {
|
||||||
"PUS_HIGH_PRIO", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
for (const auto& task : taskVector) {
|
||||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
if (task != nullptr) {
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
task->startTask();
|
||||||
initmission::printAddObjectError("PUS2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
} else {
|
||||||
}
|
sif::error << "Task in vector " << name << " is invalid!" << std::endl;
|
||||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
|
}
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
initmission::printAddObjectError("PUS9", objects::PUS_SERVICE_9_TIME_MGMT);
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
PeriodicTaskIF* pusMedPrio = factory->createPeriodicTask(
|
sif::info << "Starting tasks.." << std::endl;
|
||||||
"PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
|
tmTcDistributor->startTask();
|
||||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
tmtcBridgeTask->startTask();
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
tmtcPollingTask->startTask();
|
||||||
initmission::printAddObjectError("PUS8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
|
||||||
}
|
|
||||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
initmission::printAddObjectError("PUS200", objects::PUS_SERVICE_200_MODE_MGMT);
|
|
||||||
}
|
|
||||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
initmission::printAddObjectError("PUS20", objects::PUS_SERVICE_20_PARAMETERS);
|
|
||||||
}
|
|
||||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
|
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
initmission::printAddObjectError("PUS3", objects::PUS_SERVICE_3_HOUSEKEEPING);
|
|
||||||
}
|
|
||||||
|
|
||||||
PeriodicTaskIF* pusLowPrio = factory->createPeriodicTask(
|
taskStarter(pusTasks, "PUS Tasks");
|
||||||
"PUS_LOW_PRIO", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.6, missedDeadlineFunc);
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
|
taskStarter(testTasks, "Test Tasks");
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||||
initmission::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST);
|
taskStarter(pstTasks, "PST Tasks");
|
||||||
}
|
|
||||||
result = pusLowPrio->addComponent(objects::INTERNAL_ERROR_REPORTER);
|
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
initmission::printAddObjectError("INT_ERR_RPRT",
|
|
||||||
objects::INTERNAL_ERROR_REPORTER);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if OBSW_ADD_TEST_PST == 1
|
#if OBSW_ADD_TEST_PST == 1
|
||||||
FixedTimeslotTaskIF* pstTestTask = factory->createFixedTimeslotTask("ACS_PST", 50,
|
if (startTestPst) {
|
||||||
PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 2.0, missedDeadlineFunc);
|
pstTestTask->startTask();
|
||||||
result = pst::pstTest(pstTestTask);
|
}
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
sif::warning << "initmission::initTasks: ACS PST initialization failed!" << std::endl;
|
|
||||||
}
|
|
||||||
#endif /* RPI_TEST_ACS_BOARD == 1 */
|
#endif /* RPI_TEST_ACS_BOARD == 1 */
|
||||||
|
sif::info << "Tasks started.." << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
PeriodicTaskIF* testTask = factory->createPeriodicTask(
|
void initmission::createPusTasks(TaskFactory& factory,
|
||||||
"TEST_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
TaskDeadlineMissedFunction missedDeadlineFunc,
|
||||||
#if OBSW_ADD_TEST_CODE == 1
|
std::vector<PeriodicTaskIF*>& taskVec) {
|
||||||
result = testTask->addComponent(objects::TEST_TASK);
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
PeriodicTaskIF* pusVerification = factory.createPeriodicTask(
|
||||||
initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK);
|
"PUS_VERIF", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
||||||
}
|
result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
|
||||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
#if RPI_ADD_SPI_TEST == 1
|
sif::error << "Object add component failed" << std::endl;
|
||||||
result = testTask->addComponent(objects::SPI_TEST);
|
}
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
taskVec.push_back(pusVerification);
|
||||||
initmission::printAddObjectError("SPI_TEST", objects::SPI_TEST);
|
|
||||||
}
|
PeriodicTaskIF* pusEvents = factory.createPeriodicTask(
|
||||||
|
"PUS_EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
||||||
|
result = pusEvents->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS_EVENTS", objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||||
|
}
|
||||||
|
result = pusEvents->addComponent(objects::EVENT_MANAGER);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS_MGMT", objects::EVENT_MANAGER);
|
||||||
|
}
|
||||||
|
taskVec.push_back(pusEvents);
|
||||||
|
|
||||||
|
PeriodicTaskIF* pusHighPrio = factory.createPeriodicTask(
|
||||||
|
"PUS_HIGH_PRIO", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
||||||
|
result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||||
|
}
|
||||||
|
result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS9", objects::PUS_SERVICE_9_TIME_MGMT);
|
||||||
|
}
|
||||||
|
taskVec.push_back(pusHighPrio);
|
||||||
|
|
||||||
|
PeriodicTaskIF* pusMedPrio = factory.createPeriodicTask(
|
||||||
|
"PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
|
||||||
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||||
|
}
|
||||||
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS200", objects::PUS_SERVICE_200_MODE_MGMT);
|
||||||
|
}
|
||||||
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS20", objects::PUS_SERVICE_20_PARAMETERS);
|
||||||
|
}
|
||||||
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS3", objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||||
|
}
|
||||||
|
taskVec.push_back(pusMedPrio);
|
||||||
|
|
||||||
|
PeriodicTaskIF* pusLowPrio = factory.createPeriodicTask(
|
||||||
|
"PUS_LOW_PRIO", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.6, missedDeadlineFunc);
|
||||||
|
result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST);
|
||||||
|
}
|
||||||
|
result = pusLowPrio->addComponent(objects::INTERNAL_ERROR_REPORTER);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("INT_ERR_RPRT", objects::INTERNAL_ERROR_REPORTER);
|
||||||
|
}
|
||||||
|
taskVec.push_back(pusLowPrio);
|
||||||
|
}
|
||||||
|
|
||||||
|
void initmission::createPstTasks(TaskFactory& factory,
|
||||||
|
TaskDeadlineMissedFunction missedDeadlineFunc,
|
||||||
|
std::vector<PeriodicTaskIF*>& taskVec) {
|
||||||
|
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, 1.0, missedDeadlineFunc);
|
||||||
|
result = pst::pstSpi(spiPst);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl;
|
||||||
|
}
|
||||||
|
taskVec.push_back(spiPst);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void initmission::createTestTasks(TaskFactory& factory,
|
||||||
|
TaskDeadlineMissedFunction missedDeadlineFunc,
|
||||||
|
std::vector<PeriodicTaskIF*>& taskVec) {
|
||||||
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||||
|
PeriodicTaskIF* testTask = factory.createPeriodicTask(
|
||||||
|
"TEST_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||||
|
result = testTask->addComponent(objects::TEST_TASK);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK);
|
||||||
|
}
|
||||||
|
#if OBSW_ADD_SPI_TEST_CODE == 1
|
||||||
|
result = testTask->addComponent(objects::SPI_TEST);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
initmission::printAddObjectError("SPI_TEST", objects::SPI_TEST);
|
||||||
|
}
|
||||||
#endif /* RPI_ADD_SPI_TEST == 1 */
|
#endif /* RPI_ADD_SPI_TEST == 1 */
|
||||||
#if RPI_ADD_GPIO_TEST == 1
|
#if RPI_ADD_GPIO_TEST == 1
|
||||||
result = testTask->addComponent(objects::LIBGPIOD_TEST);
|
result = testTask->addComponent(objects::LIBGPIOD_TEST);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("GPIOD_TEST", objects::LIBGPIOD_TEST);
|
initmission::printAddObjectError("GPIOD_TEST", objects::LIBGPIOD_TEST);
|
||||||
}
|
}
|
||||||
#endif /* RPI_ADD_GPIO_TEST == 1 */
|
#endif /* RPI_ADD_GPIO_TEST == 1 */
|
||||||
#if RPI_ADD_UART_TEST == 1
|
#if OBSW_ADD_UART_TEST_CODE == 1
|
||||||
result = testTask->addComponent(objects::UART_TEST);
|
result = testTask->addComponent(objects::UART_TEST);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
initmission::printAddObjectError("UART_TEST", objects::UART_TEST);
|
initmission::printAddObjectError("UART_TEST", objects::UART_TEST);
|
||||||
}
|
}
|
||||||
#endif /* RPI_ADD_GPIO_TEST == 1 */
|
#endif /* RPI_ADD_GPIO_TEST == 1 */
|
||||||
|
taskVec.push_back(testTask);
|
||||||
|
|
||||||
sif::info << "Starting tasks.." << std::endl;
|
bool startTestPst = true;
|
||||||
tmTcDistributor->startTask();
|
static_cast<void>(startTestPst);
|
||||||
udpBridgeTask->startTask();
|
|
||||||
udpPollingTask->startTask();
|
|
||||||
|
|
||||||
pusVerification->startTask();
|
|
||||||
pusEvents->startTask();
|
|
||||||
pusHighPrio->startTask();
|
|
||||||
pusMedPrio->startTask();
|
|
||||||
pusLowPrio->startTask();
|
|
||||||
|
|
||||||
#if OBSW_ADD_TEST_CODE == 1
|
|
||||||
testTask->startTask();
|
|
||||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
|
||||||
|
|
||||||
#if OBSW_ADD_TEST_PST == 1
|
#if OBSW_ADD_TEST_PST == 1
|
||||||
pstTestTask->startTask();
|
FixedTimeslotTaskIF* pstTestTask = factory->createFixedTimeslotTask(
|
||||||
|
"TEST_PST", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 2.0, missedDeadlineFunc);
|
||||||
|
result = pst::pstTest(pstTestTask);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::info << "initmission::initTasks: ACS PST empty or invalid" << std::endl;
|
||||||
|
startTestPst = false;
|
||||||
|
}
|
||||||
#endif /* RPI_TEST_ACS_BOARD == 1 */
|
#endif /* RPI_TEST_ACS_BOARD == 1 */
|
||||||
sif::info << "Tasks started.." << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,23 @@
|
|||||||
#ifndef BSP_LINUX_INITMISSION_H_
|
#ifndef BSP_LINUX_INITMISSION_H_
|
||||||
#define BSP_LINUX_INITMISSION_H_
|
#define BSP_LINUX_INITMISSION_H_
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "fsfw/tasks/Typedef.h"
|
||||||
|
|
||||||
|
class PeriodicTaskIF;
|
||||||
|
class TaskFactory;
|
||||||
|
|
||||||
namespace initmission {
|
namespace initmission {
|
||||||
void initMission();
|
void initMission();
|
||||||
void initTasks();
|
void initTasks();
|
||||||
};
|
|
||||||
|
void createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc,
|
||||||
|
std::vector<PeriodicTaskIF*>& taskVec);
|
||||||
|
void createTestTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc,
|
||||||
|
std::vector<PeriodicTaskIF*>& taskVec);
|
||||||
|
void createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc,
|
||||||
|
std::vector<PeriodicTaskIF*>& taskVec);
|
||||||
|
}; // namespace initmission
|
||||||
|
|
||||||
#endif /* BSP_LINUX_INITMISSION_H_ */
|
#endif /* BSP_LINUX_INITMISSION_H_ */
|
||||||
|
|||||||
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_ */
|
||||||
@@ -1,165 +1,245 @@
|
|||||||
#include <fsfw_hal/linux/uart/UartComIF.h>
|
|
||||||
#include <fsfw_hal/linux/uart/UartCookie.h>
|
|
||||||
#include <mission/devices/GPSHyperionHandler.h>
|
|
||||||
#include "ObjectFactory.h"
|
#include "ObjectFactory.h"
|
||||||
|
|
||||||
#include "objects/systemObjectList.h"
|
#include "OBSWConfig.h"
|
||||||
|
#include "devConf.h"
|
||||||
#include "devices/addresses.h"
|
#include "devices/addresses.h"
|
||||||
#include "devices/gpioIds.h"
|
#include "devices/gpioIds.h"
|
||||||
#include "OBSWConfig.h"
|
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
|
||||||
#include "tmtc/apid.h"
|
#include "fsfw/power/DummyPowerSwitcher.h"
|
||||||
#include "tmtc/pusIds.h"
|
#include "fsfw/tasks/TaskFactory.h"
|
||||||
#include "spiConf.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/LibgpiodTest.h"
|
||||||
#include "linux/boardtest/SpiTestClass.h"
|
#include "linux/boardtest/SpiTestClass.h"
|
||||||
#include "linux/boardtest/UartTestClass.h"
|
#include "linux/boardtest/UartTestClass.h"
|
||||||
|
|
||||||
#include "mission/core/GenericFactory.h"
|
#include "mission/core/GenericFactory.h"
|
||||||
|
#include "mission/devices/GPSHyperionHandler.h"
|
||||||
|
#include "mission/devices/GyroADIS1650XHandler.h"
|
||||||
#include "mission/utility/TmFunnel.h"
|
#include "mission/utility/TmFunnel.h"
|
||||||
#include "mission/devices/MGMHandlerLIS3MDL.h"
|
#include "objects/systemObjectList.h"
|
||||||
#include "mission/devices/MGMHandlerRM3100.h"
|
#include "tmtc/apid.h"
|
||||||
#include "mission/devices/GyroADIS16507Handler.h"
|
#include "tmtc/pusIds.h"
|
||||||
|
|
||||||
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
|
|
||||||
#include "fsfw/tmtcservices/CommandingServiceBase.h"
|
|
||||||
#include "fsfw/tmtcservices/PusServiceBase.h"
|
|
||||||
#include "fsfw/tmtcpacket/pus/tm.h"
|
|
||||||
#include "fsfw/tasks/TaskFactory.h"
|
|
||||||
|
|
||||||
/* UDP server includes */
|
/* UDP server includes */
|
||||||
#include "fsfw/osal/common/UdpTmTcBridge.h"
|
#if OBSW_USE_TMTC_TCP_BRIDGE == 1
|
||||||
|
#include <fsfw/src/fsfw/osal/common/TcpTmTcBridge.h>
|
||||||
|
#include <fsfw/src/fsfw/osal/common/TcpTmTcServer.h>
|
||||||
|
#else
|
||||||
#include "fsfw/osal/common/UdpTcPollingTask.h"
|
#include "fsfw/osal/common/UdpTcPollingTask.h"
|
||||||
|
#include "fsfw/osal/common/UdpTmTcBridge.h"
|
||||||
#include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h"
|
|
||||||
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
|
|
||||||
#include "fsfw_hal/linux/rpi/GpioRPi.h"
|
|
||||||
#include "fsfw_hal/common/gpio/GpioCookie.h"
|
|
||||||
#include "fsfw_hal/linux/spi/SpiCookie.h"
|
|
||||||
#include "fsfw_hal/linux/spi/SpiComIF.h"
|
|
||||||
|
|
||||||
void Factory::setStaticFrameworkObjectIds() {
|
|
||||||
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
|
||||||
PusServiceBase::packetDestination = objects::TM_FUNNEL;
|
|
||||||
|
|
||||||
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
|
||||||
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
|
||||||
|
|
||||||
TmFunnel::downlinkDestination = objects::TMTC_BRIDGE;
|
|
||||||
// No storage object for now.
|
|
||||||
TmFunnel::storageDestination = objects::NO_OBJECT;
|
|
||||||
|
|
||||||
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
|
||||||
TmPacketBase::timeStamperId = objects::TIME_STAMPER;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ObjectFactory::produce(void* args){
|
|
||||||
Factory::setStaticFrameworkObjectIds();
|
|
||||||
ObjectFactory::produceGenericObjects();
|
|
||||||
|
|
||||||
new UdpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR);
|
|
||||||
new UdpTcPollingTask(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE);
|
|
||||||
|
|
||||||
GpioIF* gpioIF = new LinuxLibgpioIF(objects::GPIO_IF);
|
|
||||||
GpioCookie* gpioCookie = nullptr;
|
|
||||||
static_cast<void>(gpioCookie);
|
|
||||||
#if RPI_ADD_SPI_TEST == 1
|
|
||||||
new SpiTestClass(objects::SPI_TEST, gpioIF);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if RPI_ADD_UART_TEST == 1
|
#include <fsfw_hal/linux/uart/UartComIF.h>
|
||||||
new UartTestClass(objects::UART_TEST);
|
#include <fsfw_hal/linux/uart/UartCookie.h>
|
||||||
|
|
||||||
|
#include "fsfw_hal/common/gpio/GpioCookie.h"
|
||||||
|
#include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h"
|
||||||
|
#include "fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h"
|
||||||
|
#include "fsfw_hal/devicehandlers/MgmRM3100Handler.h"
|
||||||
|
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
|
||||||
|
#include "fsfw_hal/linux/rpi/GpioRPi.h"
|
||||||
|
#include "fsfw_hal/linux/spi/SpiComIF.h"
|
||||||
|
#include "fsfw_hal/linux/spi/SpiCookie.h"
|
||||||
|
|
||||||
|
void Factory::setStaticFrameworkObjectIds() {
|
||||||
|
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||||
|
PusServiceBase::packetDestination = objects::TM_FUNNEL;
|
||||||
|
|
||||||
|
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||||
|
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
||||||
|
|
||||||
|
TmFunnel::downlinkDestination = objects::TMTC_BRIDGE;
|
||||||
|
// No storage object for now.
|
||||||
|
TmFunnel::storageDestination = objects::NO_OBJECT;
|
||||||
|
|
||||||
|
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
||||||
|
TmPacketBase::timeStamperId = objects::TIME_STAMPER;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObjectFactory::produce(void* args) {
|
||||||
|
Factory::setStaticFrameworkObjectIds();
|
||||||
|
ObjectFactory::produceGenericObjects();
|
||||||
|
|
||||||
|
GpioIF* gpioIF = new LinuxLibgpioIF(objects::GPIO_IF);
|
||||||
|
GpioCookie* gpioCookie = nullptr;
|
||||||
|
static_cast<void>(gpioCookie);
|
||||||
|
|
||||||
|
SpiComIF* spiComIF = new SpiComIF(objects::SPI_COM_IF, gpioIF);
|
||||||
|
static_cast<void>(spiComIF);
|
||||||
|
auto pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0);
|
||||||
|
static_cast<void>(pwrSwitcher);
|
||||||
|
|
||||||
|
#if OBSW_ADD_ACS_BOARD == 1 && defined(RASPBERRY_PI)
|
||||||
|
createRpiAcsBoard(gpioIF, spiDev);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if OBSW_ADD_SUN_SENSORS == 1 || defined(OBSW_ADD_RTD_DEVICES)
|
||||||
|
#ifdef RASPBERRY_PI
|
||||||
|
rpi::gpio::initSpiCsDecoder(gpioIF);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if OBSW_ADD_SUN_SENSORS == 1
|
||||||
|
createSunSensorComponents(gpioIF, spiComIF, pwrSwitcher, spi::DEV);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if OBSW_ADD_RTD_DEVICES == 1
|
||||||
|
createRtdComponents(spi::DEV, gpioIF, pwrSwitcher);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#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, 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 OBSW_TEST_ACS == 1
|
||||||
|
mgmLis3Handler->setToGoToNormalMode(true);
|
||||||
|
#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 OBSW_TEST_ACS == 1
|
||||||
|
mgmRm3100Handler->setToGoToNormalMode(true);
|
||||||
|
#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 OBSW_TEST_ACS == 1
|
||||||
|
mgmLis3Handler->setToGoToNormalMode(true);
|
||||||
|
#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 OBSW_TEST_ACS == 1
|
||||||
|
mgmRm3100Handler->setToGoToNormalMode(true);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
spiCookie =
|
||||||
|
new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev,
|
||||||
|
ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||||
|
auto adisHandler = new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF,
|
||||||
|
spiCookie, ADIS1650X::Type::ADIS16505);
|
||||||
|
adisHandler->setStartUpImmediately();
|
||||||
|
spiCookie =
|
||||||
|
new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
|
||||||
|
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||||
|
auto gyroL3gHandler =
|
||||||
|
new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_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, spiDev,
|
||||||
|
ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
||||||
|
adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_COM_IF,
|
||||||
|
spiCookie, ADIS1650X::Type::ADIS16505);
|
||||||
|
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 OBSW_TEST_ACS == 1
|
||||||
|
gyroL3gHandler->setToGoToNormalMode(true);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObjectFactory::createTestTasks() {
|
||||||
|
new TestTask(objects::TEST_TASK);
|
||||||
|
|
||||||
|
#if OBSW_ADD_SPI_TEST_CODE == 1
|
||||||
|
new SpiTestClass(objects::SPI_TEST, gpioIF);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if OBSW_ADD_UART_TEST_CODE == 1
|
||||||
|
new UartTestClass(objects::UART_TEST);
|
||||||
#else
|
#else
|
||||||
new UartComIF(objects::UART_COM_IF);
|
new UartComIF(objects::UART_COM_IF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if RPI_LOOPBACK_TEST_GPIO == 1
|
#if RPI_LOOPBACK_TEST_GPIO == 1
|
||||||
GpioCookie* gpioCookieLoopback = new GpioCookie();
|
GpioCookie* gpioCookieLoopback = new GpioCookie();
|
||||||
/* Loopback pins. Adapt according to setup */
|
/* Loopback pins. Adapt according to setup */
|
||||||
gpioId_t gpioIdSender = gpioIds::TEST_ID_0;
|
gpioId_t gpioIdSender = gpioIds::TEST_ID_0;
|
||||||
int bcmPinSender = 26;
|
int bcmPinSender = 26;
|
||||||
gpioId_t gpioIdReader = gpioIds::TEST_ID_1;
|
gpioId_t gpioIdReader = gpioIds::TEST_ID_1;
|
||||||
int bcmPinReader = 16;
|
int bcmPinReader = 16;
|
||||||
gpio::createRpiGpioConfig(gpioCookieLoopback, gpioIdSender, bcmPinSender, "GPIO_LB_SENDER",
|
gpio::createRpiGpioConfig(gpioCookieLoopback, gpioIdSender, bcmPinSender, "GPIO_LB_SENDER",
|
||||||
gpio::Direction::OUT, 0);
|
gpio::Direction::OUT, 0);
|
||||||
gpio::createRpiGpioConfig(gpioCookieLoopback, gpioIdReader, bcmPinReader, "GPIO_LB_READER",
|
gpio::createRpiGpioConfig(gpioCookieLoopback, gpioIdReader, bcmPinReader, "GPIO_LB_READER",
|
||||||
gpio::Direction::IN, 0);
|
gpio::Direction::IN, 0);
|
||||||
new LibgpiodTest(objects::LIBGPIOD_TEST, objects::GPIO_IF, gpioCookieLoopback);
|
new LibgpiodTest(objects::LIBGPIOD_TEST, objects::GPIO_IF, gpioCookieLoopback);
|
||||||
#endif /* RPI_LOOPBACK_TEST_GPIO == 1 */
|
#endif /* RPI_LOOPBACK_TEST_GPIO == 1 */
|
||||||
|
|
||||||
new SpiComIF(objects::SPI_COM_IF, gpioIF);
|
|
||||||
|
|
||||||
std::string spiDev;
|
|
||||||
SpiCookie* spiCookie = nullptr;
|
|
||||||
static_cast<void>(spiCookie);
|
|
||||||
|
|
||||||
#if RPI_TEST_ACS_BOARD == 1
|
|
||||||
if(gpioCookie == nullptr) {
|
|
||||||
gpioCookie = new GpioCookie();
|
|
||||||
}
|
|
||||||
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_L3G_CS, gpio::GYRO_2_BCM_PIN,
|
|
||||||
"GYRO_2_L3G", gpio::Direction::OUT, 1);
|
|
||||||
gpioIF->addGpios(gpioCookie);
|
|
||||||
|
|
||||||
spiDev = "/dev/spidev0.0";
|
|
||||||
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 MGMHandlerLIS3MDL(objects::MGM_0_LIS3_HANDLER,
|
|
||||||
objects::SPI_COM_IF, spiCookie);
|
|
||||||
mgmLis3Handler->setStartUpImmediately();
|
|
||||||
|
|
||||||
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 MGMHandlerRM3100(objects::MGM_1_RM3100_HANDLER,
|
|
||||||
objects::SPI_COM_IF, spiCookie);
|
|
||||||
mgmRm3100Handler->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);
|
|
||||||
gyroL3gHandler->setStartUpImmediately();
|
|
||||||
|
|
||||||
#endif /* RPI_TEST_ACS_BOARD == 1 */
|
|
||||||
|
|
||||||
#if RPI_TEST_ADIS16507 == 1
|
#if RPI_TEST_ADIS16507 == 1
|
||||||
if(gpioCookie == nullptr) {
|
if (gpioCookie == nullptr) {
|
||||||
gpioCookie = new GpioCookie();
|
gpioCookie = new GpioCookie();
|
||||||
}
|
}
|
||||||
gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_0_ADIS_CS, gpio::GYRO_0_BCM_PIN,
|
gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_0_ADIS_CS, gpio::GYRO_0_BCM_PIN,
|
||||||
"GYRO_0_ADIS", gpio::Direction::OUT, 1);
|
"GYRO_0_ADIS", gpio::Direction::OUT, 1);
|
||||||
gpioIF->addGpios(gpioCookie);
|
gpioIF->addGpios(gpioCookie);
|
||||||
|
|
||||||
spiDev = "/dev/spidev0.0";
|
spiDev = "/dev/spidev0.1";
|
||||||
spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev,
|
spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev,
|
||||||
ADIS16507::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE, spi::DEFAULT_ADIS16507_SPEED,
|
ADIS16507::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE,
|
||||||
nullptr, nullptr);
|
spi::DEFAULT_ADIS16507_SPEED, nullptr, nullptr);
|
||||||
auto adisGyroHandler = new GyroADIS16507Handler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF, spiCookie);
|
auto adisGyroHandler =
|
||||||
adisGyroHandler->setStartUpImmediately();
|
new GyroADIS16507Handler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF, spiCookie);
|
||||||
|
adisGyroHandler->setStartUpImmediately();
|
||||||
#endif /* RPI_TEST_ADIS16507 == 1 */
|
#endif /* RPI_TEST_ADIS16507 == 1 */
|
||||||
|
|
||||||
#if RPI_TEST_GPS_HANDLER == 1
|
#if RPI_TEST_GPS_HANDLER == 1
|
||||||
UartCookie* uartCookie = new UartCookie(objects::GPS0_HANDLER, "/dev/serial0",
|
UartCookie* uartCookie =
|
||||||
UartModes::CANONICAL, 9600, 1024);
|
new UartCookie(objects::GPS0_HANDLER, "/dev/serial0", UartModes::CANONICAL, 9600, 1024);
|
||||||
uartCookie->setToFlushInput(true);
|
uartCookie->setToFlushInput(true);
|
||||||
uartCookie->setReadCycles(6);
|
uartCookie->setReadCycles(6);
|
||||||
GPSHyperionHandler* gpsHandler = new GPSHyperionHandler(objects::GPS0_HANDLER,
|
GPSHyperionHandler* gpsHandler =
|
||||||
objects::UART_COM_IF, uartCookie);
|
new GPSHyperionHandler(objects::GPS0_HANDLER, objects::UART_COM_IF, uartCookie, false);
|
||||||
gpsHandler->setStartUpImmediately();
|
gpsHandler->setStartUpImmediately();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
#ifndef BSP_LINUX_OBJECTFACTORY_H_
|
#ifndef BSP_LINUX_OBJECTFACTORY_H_
|
||||||
#define BSP_LINUX_OBJECTFACTORY_H_
|
#define BSP_LINUX_OBJECTFACTORY_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
class GpioIF;
|
||||||
|
|
||||||
namespace ObjectFactory {
|
namespace ObjectFactory {
|
||||||
void setStatics();
|
void setStatics();
|
||||||
void produce(void* args);
|
void produce(void* args);
|
||||||
};
|
|
||||||
|
void createRpiAcsBoard(GpioIF* gpioIF, std::string spiDev);
|
||||||
|
void createTestTasks();
|
||||||
|
}; // namespace ObjectFactory
|
||||||
|
|
||||||
#endif /* BSP_LINUX_OBJECTFACTORY_H_ */
|
#endif /* BSP_LINUX_OBJECTFACTORY_H_ */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
target_sources(${TARGET_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE
|
||||||
print.c
|
print.c
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(${TARGET_NAME} PUBLIC
|
target_include_directories(${OBSW_NAME} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#define ETL_CHECK_PUSH_POP
|
#define ETL_CHECK_PUSH_POP
|
||||||
|
|
||||||
#define ETL_CPP11_SUPPORTED 1
|
#define ETL_CPP11_SUPPORTED 1
|
||||||
#define ETL_NO_NULLPTR_SUPPORT 0
|
#define ETL_NO_NULLPTR_SUPPORT 0
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,8 +6,9 @@
|
|||||||
extern "C" void __gcov_flush();
|
extern "C" void __gcov_flush();
|
||||||
#else
|
#else
|
||||||
void __gcov_flush() {
|
void __gcov_flush() {
|
||||||
sif::info << "GCC GCOV: Please supply GCOV=1 in Makefile if "
|
sif::info << "GCC GCOV: Please supply GCOV=1 in Makefile if "
|
||||||
"coverage information is desired.\n" << std::flush;
|
"coverage information is desired.\n"
|
||||||
|
<< std::flush;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
#include <bsp_q7s/boardconfig/print.h>
|
#include <bsp_linux_board/boardconfig/print.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
void printChar(const char* character, bool errStream) {
|
void printChar(const char* character, bool errStream) {
|
||||||
if(errStream) {
|
if (errStream) {
|
||||||
putc(*character, stderr);
|
putc(*character, stderr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
putc(*character, stdout);
|
putc(*character, stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,20 +15,6 @@
|
|||||||
#define RPI_TEST_ACS_BOARD 0
|
#define RPI_TEST_ACS_BOARD 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define RPI_ADD_UART_TEST 1
|
#define RPI_ADD_UART_TEST 0
|
||||||
#if RPI_ADD_UART_TEST == 1
|
|
||||||
#define RPI_TEST_GPS_DEVICE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Adapt these values accordingly */
|
|
||||||
namespace gpio {
|
|
||||||
static constexpr uint8_t MGM_0_BCM_PIN = 0;
|
|
||||||
static constexpr uint8_t MGM_1_BCM_PIN = 1;
|
|
||||||
static constexpr uint8_t MGM_2_BCM_PIN = 17;
|
|
||||||
static constexpr uint8_t MGM_3_BCM_PIN = 27;
|
|
||||||
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 = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_ */
|
#endif /* BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_ */
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
target_sources(${TARGET_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
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
#include "InitMission.h"
|
|
||||||
#include "OBSWVersion.h"
|
|
||||||
|
|
||||||
#include "fsfw/FSFWVersion.h"
|
|
||||||
#include "fsfw/tasks/TaskFactory.h"
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "InitMission.h"
|
||||||
|
#include "OBSWConfig.h"
|
||||||
|
#include "OBSWVersion.h"
|
||||||
|
#include "fsfw/tasks/TaskFactory.h"
|
||||||
|
#include "fsfw/version.h"
|
||||||
|
|
||||||
#ifdef RASPBERRY_PI
|
#ifdef RASPBERRY_PI
|
||||||
static const char* const BOARD_NAME = "Raspberry Pi";
|
static const char* const BOARD_NAME = "Raspberry Pi";
|
||||||
#elif defined(BEAGLEBONEBLACK)
|
#elif defined(BEAGLEBONEBLACK)
|
||||||
@@ -18,21 +18,17 @@ static const char* const BOARD_NAME = "Unknown Board";
|
|||||||
* @brief This is the main program and entry point for the Raspberry Pi.
|
* @brief This is the main program and entry point for the Raspberry Pi.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int main(void)
|
int main(void) {
|
||||||
{
|
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
std::cout << "-- Compiled for Linux board " << BOARD_NAME << " --" << std::endl;
|
||||||
std::cout << "-- Compiled for Linux board " << BOARD_NAME << " --" << std::endl;
|
std::cout << "-- OBSW " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "."
|
||||||
std::cout << "-- OBSW " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION <<
|
<< SW_REVISION << ", FSFW v" << fsfw::FSFW_VERSION << " --" << std::endl;
|
||||||
"." << SW_REVISION << ", FSFW v" << FSFW_VERSION << "." << FSFW_SUBVERSION <<
|
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||||
FSFW_REVISION << "--" << std::endl;
|
|
||||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
|
||||||
|
|
||||||
initmission::initMission();
|
initmission::initMission();
|
||||||
|
|
||||||
for(;;) {
|
for (;;) {
|
||||||
/* Suspend main thread by sleeping it. */
|
/* Suspend main thread by sleeping it. */
|
||||||
TaskFactory::delayTask(5000);
|
TaskFactory::delayTask(5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,33 @@
|
|||||||
target_sources(${TARGET_NAME} PUBLIC
|
#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
|
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
|
||||||
|
obsw.cpp
|
||||||
|
)
|
||||||
|
|
||||||
add_subdirectory(boardtest)
|
add_subdirectory(boardtest)
|
||||||
|
|
||||||
if(Q7S_SIMPLE_MODE)
|
add_subdirectory(boardconfig)
|
||||||
add_subdirectory(simple)
|
add_subdirectory(comIF)
|
||||||
|
add_subdirectory(core)
|
||||||
|
|
||||||
|
if(EIVE_Q7S_EM)
|
||||||
|
add_subdirectory(em)
|
||||||
else()
|
else()
|
||||||
add_subdirectory(boardconfig)
|
add_subdirectory(fm)
|
||||||
add_subdirectory(comIF)
|
|
||||||
add_subdirectory(gpio)
|
|
||||||
add_subdirectory(core)
|
|
||||||
add_subdirectory(memory)
|
|
||||||
add_subdirectory(spiCallbacks)
|
|
||||||
add_subdirectory(devices)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(memory)
|
||||||
|
add_subdirectory(callbacks)
|
||||||
|
add_subdirectory(xadc)
|
||||||
|
|||||||
126
bsp_q7s/OBSWConfig.h.in
Normal file
126
bsp_q7s/OBSWConfig.h.in
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
/**
|
||||||
|
* @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 0
|
||||||
|
#define OBSW_ADD_PLOC_MPSOC 0
|
||||||
|
#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
|
||||||
|
|
||||||
|
// 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,7 +1,12 @@
|
|||||||
target_sources(${TARGET_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE
|
||||||
print.c
|
print.c
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(${TARGET_NAME} PUBLIC
|
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
|
||||||
|
print.c
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
target_include_directories(${OBSW_NAME} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
|||||||
104
bsp_q7s/boardconfig/busConf.h
Normal file
104
bsp_q7s/boardconfig/busConf.h
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
#ifndef BSP_Q7S_BOARDCONFIG_BUSCONF_H_
|
||||||
|
#define BSP_Q7S_BOARDCONFIG_BUSCONF_H_
|
||||||
|
|
||||||
|
namespace q7s {
|
||||||
|
|
||||||
|
static constexpr char SPI_DEFAULT_DEV[] = "/dev/spi-main";
|
||||||
|
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/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_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 {
|
||||||
|
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 GYRO_0_ADIS_CS[] = "gyro_0_adis_chip_select";
|
||||||
|
static constexpr char GYRO_1_L3G_CS[] = "gyro_1_l3g_chip_select";
|
||||||
|
static constexpr char GYRO_2_ADIS_CS[] = "gyro_2_adis_chip_select";
|
||||||
|
static constexpr char GYRO_3_L3G_CS[] = "gyro_3_l3g_chip_select";
|
||||||
|
static constexpr char MGM_0_CS[] = "mgm_0_lis3_chip_select";
|
||||||
|
static constexpr char MGM_1_CS[] = "mgm_1_rm3100_chip_select";
|
||||||
|
static constexpr char MGM_2_CS[] = "mgm_2_lis3_chip_select";
|
||||||
|
static constexpr char MGM_3_CS[] = "mgm_3_rm3100_chip_select";
|
||||||
|
static constexpr char RESET_GNSS_0[] = "reset_gnss_0";
|
||||||
|
static constexpr char RESET_GNSS_1[] = "reset_gnss_1";
|
||||||
|
static constexpr char GNSS_0_ENABLE[] = "enable_gnss_0";
|
||||||
|
static constexpr char GNSS_1_ENABLE[] = "enable_gnss_1";
|
||||||
|
static constexpr char GYRO_0_ENABLE[] = "enable_gyro_0";
|
||||||
|
static constexpr char GYRO_2_ENABLE[] = "enable_gyro_2";
|
||||||
|
static constexpr char GNSS_SELECT[] = "gnss_mux_select";
|
||||||
|
static constexpr char GNSS_MUX_SELECT[] = "gnss_mux_select";
|
||||||
|
|
||||||
|
static constexpr char HEATER_0[] = "heater0";
|
||||||
|
static constexpr char HEATER_1[] = "heater1";
|
||||||
|
static constexpr char HEATER_2[] = "heater2";
|
||||||
|
static constexpr char HEATER_3[] = "heater3";
|
||||||
|
static constexpr char HEATER_4[] = "heater4";
|
||||||
|
static constexpr char HEATER_5[] = "heater5";
|
||||||
|
static constexpr char HEATER_6[] = "heater6";
|
||||||
|
static constexpr char HEATER_7[] = "heater7";
|
||||||
|
static constexpr char SA_DPL_PIN_0[] = "sa_dpl_0";
|
||||||
|
static constexpr char SA_DPL_PIN_1[] = "sa_dpl_1";
|
||||||
|
static constexpr char SPI_MUX_BIT_0_PIN[] = "spi_mux_bit_0";
|
||||||
|
static constexpr char SPI_MUX_BIT_1_PIN[] = "spi_mux_bit_1";
|
||||||
|
static constexpr char SPI_MUX_BIT_2_PIN[] = "spi_mux_bit_2";
|
||||||
|
static constexpr char SPI_MUX_BIT_3_PIN[] = "spi_mux_bit_3";
|
||||||
|
static constexpr char SPI_MUX_BIT_4_PIN[] = "spi_mux_bit_4";
|
||||||
|
static constexpr char SPI_MUX_BIT_5_PIN[] = "spi_mux_bit_5";
|
||||||
|
static constexpr char EN_RW_CS[] = "en_rw_cs";
|
||||||
|
static constexpr char EN_RW_1[] = "enable_rw_1";
|
||||||
|
static constexpr char EN_RW_2[] = "enable_rw_2";
|
||||||
|
static constexpr char EN_RW_3[] = "enable_rw_3";
|
||||||
|
static constexpr char EN_RW_4[] = "enable_rw_4";
|
||||||
|
|
||||||
|
static constexpr char RAD_SENSOR_CHIP_SELECT[] = "rad_sensor_chip_select";
|
||||||
|
static constexpr char ENABLE_RADFET[] = "enable_radfet";
|
||||||
|
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";
|
||||||
|
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";
|
||||||
|
static constexpr char PL_PCDU_ENABLE_DRO[] = "enable_plpcdu_dro";
|
||||||
|
static constexpr char PL_PCDU_ENABLE_X8[] = "enable_plpcdu_x8";
|
||||||
|
static constexpr char PL_PCDU_ENABLE_TX[] = "enable_plpcdu_tx";
|
||||||
|
static constexpr char PL_PCDU_ENABLE_HPA[] = "enable_plpcdu_hpa";
|
||||||
|
static constexpr char PL_PCDU_ENABLE_MPA[] = "enable_plpcdu_mpa";
|
||||||
|
static constexpr char PL_PCDU_ADC_CS[] = "plpcdu_adc_chip_select";
|
||||||
|
|
||||||
|
static constexpr char ENABLE_SUPV_UART[] = "enable_supv_uart";
|
||||||
|
static constexpr char ENABLE_MPSOC_UART[] = "enable_mpsoc_uart";
|
||||||
|
|
||||||
|
} // namespace gpioNames
|
||||||
|
} // namespace q7s
|
||||||
|
|
||||||
|
#endif /* BSP_Q7S_BOARDCONFIG_BUSCONF_H_ */
|
||||||
@@ -32,7 +32,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#define ETL_CHECK_PUSH_POP
|
#define ETL_CHECK_PUSH_POP
|
||||||
|
|
||||||
#define ETL_CPP11_SUPPORTED 1
|
#define ETL_CPP11_SUPPORTED 1
|
||||||
#define ETL_NO_NULLPTR_SUPPORT 0
|
#define ETL_NO_NULLPTR_SUPPORT 0
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,8 +6,9 @@
|
|||||||
extern "C" void __gcov_flush();
|
extern "C" void __gcov_flush();
|
||||||
#else
|
#else
|
||||||
void __gcov_flush() {
|
void __gcov_flush() {
|
||||||
sif::info << "GCC GCOV: Please supply GCOV=1 in Makefile if "
|
sif::info << "GCC GCOV: Please supply GCOV=1 in Makefile if "
|
||||||
"coverage information is desired.\n" << std::flush;
|
"coverage information is desired.\n"
|
||||||
|
<< std::flush;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,9 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
void printChar(const char* character, bool errStream) {
|
void printChar(const char* character, bool errStream) {
|
||||||
if(errStream) {
|
if (errStream) {
|
||||||
putc(*character, stderr);
|
putc(*character, stderr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
putc(*character, stdout);
|
putc(*character, stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,33 +3,38 @@
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#cmakedefine01 Q7S_SIMPLE_MODE
|
#define OBSW_Q7S_EM @OBSW_Q7S_EM@
|
||||||
|
|
||||||
#define Q7S_SD_NONE 0
|
/*******************************************************************/
|
||||||
#define Q7S_SD_COLD_REDUNDANT 1
|
/** All of the following flags should be enabled for mission code */
|
||||||
#define Q7S_SD_HOT_REDUNDANT 2
|
/*******************************************************************/
|
||||||
|
|
||||||
|
//! Timers can mess up the code when debugging
|
||||||
|
//! All of this should be enabled for mission code!
|
||||||
|
|
||||||
|
/*******************************************************************/
|
||||||
|
/** Other flags */
|
||||||
|
/*******************************************************************/
|
||||||
|
|
||||||
|
#define Q7S_SD_NONE 0
|
||||||
|
#define Q7S_SD_COLD_REDUNDANT 1
|
||||||
|
#define Q7S_SD_HOT_REDUNDANT 2
|
||||||
// The OBSW will perform different actions to set up the SD cards depending on the flag set here
|
// The OBSW will perform different actions to set up the SD cards depending on the flag set here
|
||||||
// Set to Q7S_SD_NONE: Don't do anything
|
// Set to Q7S_SD_NONE: Don't do anything
|
||||||
// Set to Q7S_COLD_REDUNDANT: On startup, get the prefered SD card, turn it on and mount it, and
|
// Set to Q7S_COLD_REDUNDANT: On startup, get the prefered SD card, turn it on and mount it, and
|
||||||
// turn off the second SD card if it is on
|
// turn off the second SD card if it is on
|
||||||
// Set to Q7S_HOT_REDUNDANT: On startup, turn on both SD cards and mount them
|
// Set to Q7S_HOT_REDUNDANT: On startup, turn on both SD cards and mount them
|
||||||
#define Q7S_SD_CARD_CONFIG Q7S_SD_COLD_REDUNDANT
|
#define Q7S_SD_CARD_CONFIG Q7S_SD_COLD_REDUNDANT
|
||||||
|
|
||||||
// Probably better if this is disabled for mission code. Convenient for development
|
// Probably better if this is disabled for mission code. Convenient for development
|
||||||
#define Q7S_CHECK_FOR_ALREADY_RUNNING_IMG 1
|
#define Q7S_CHECK_FOR_ALREADY_RUNNING_IMG 1
|
||||||
#define Q7S_ADD_RTD_DEVICES 0
|
|
||||||
|
|
||||||
/* Only one of those 2 should be enabled! */
|
#define Q7S_SIMPLE_ADD_FILE_SYSTEM_TEST 0
|
||||||
/* Add code for ACS board */
|
|
||||||
#define OBSW_ADD_ACS_BOARD 0
|
#ifndef Q7S_SIMPLE_MODE
|
||||||
#if OBSW_ADD_ACS_BOARD == 0
|
#define Q7S_SIMPLE_MODE 0
|
||||||
#define Q7S_ADD_SPI_TEST 0
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define Q7S_ADD_SYRLINKS_HANDLER 1
|
|
||||||
|
|
||||||
#define Q7S_SIMPLE_ADD_FILE_SYSTEM_TEST 0
|
|
||||||
|
|
||||||
namespace config {
|
namespace config {
|
||||||
|
|
||||||
static const uint32_t SD_CARD_ACCESS_MUTEX_TIMEOUT = 50;
|
static const uint32_t SD_CARD_ACCESS_MUTEX_TIMEOUT = 50;
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
target_sources(${TARGET_NAME} PRIVATE
|
target_sources(${OBSW_NAME} PRIVATE
|
||||||
FileSystemTest.cpp
|
FileSystemTest.cpp
|
||||||
Q7STestTask.cpp
|
Q7STestTask.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(EIVE_BUILD_Q7S_SIMPLE_MODE)
|
||||||
|
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
|
||||||
|
FileSystemTest.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
@@ -1,26 +1,23 @@
|
|||||||
#include "FileSystemTest.h"
|
#include "FileSystemTest.h"
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "fsfw/timemanager/Stopwatch.h"
|
#include "fsfw/timemanager/Stopwatch.h"
|
||||||
|
|
||||||
#include <iostream>
|
enum SdCard { SDC0, SDC1 };
|
||||||
#include <cstdlib>
|
|
||||||
|
|
||||||
enum SdCard {
|
|
||||||
SDC0,
|
|
||||||
SDC1
|
|
||||||
};
|
|
||||||
|
|
||||||
FileSystemTest::FileSystemTest() {
|
FileSystemTest::FileSystemTest() {
|
||||||
using namespace std;
|
using namespace std;
|
||||||
SdCard sdCard = SdCard::SDC0;
|
SdCard sdCard = SdCard::SDC0;
|
||||||
cout << "SD Card Test for SD card " << static_cast<int>(sdCard) << std::endl;
|
cout << "SD Card Test for SD card " << static_cast<int>(sdCard) << std::endl;
|
||||||
//Stopwatch stopwatch;
|
// Stopwatch stopwatch;
|
||||||
std::system("q7hw sd info all > /tmp/sd_status.txt");
|
std::system("q7hw sd info all > /tmp/sd_status.txt");
|
||||||
//stopwatch.stop(true);
|
// stopwatch.stop(true);
|
||||||
std::system("q7hw sd set 0 on > /tmp/sd_set.txt");
|
std::system("q7hw sd set 0 on > /tmp/sd_set.txt");
|
||||||
//stopwatch.stop(true);
|
// stopwatch.stop(true);
|
||||||
std::system("q7hw sd set 0 off > /tmp/sd_set.txt");
|
std::system("q7hw sd set 0 off > /tmp/sd_set.txt");
|
||||||
//stopwatch.stop(true);
|
// stopwatch.stop(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSystemTest::~FileSystemTest() {
|
FileSystemTest::~FileSystemTest() {}
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,12 +2,11 @@
|
|||||||
#define BSP_Q7S_BOARDTEST_FILESYSTEMTEST_H_
|
#define BSP_Q7S_BOARDTEST_FILESYSTEMTEST_H_
|
||||||
|
|
||||||
class FileSystemTest {
|
class FileSystemTest {
|
||||||
public:
|
public:
|
||||||
FileSystemTest();
|
FileSystemTest();
|
||||||
virtual~ FileSystemTest();
|
virtual ~FileSystemTest();
|
||||||
private:
|
|
||||||
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* BSP_Q7S_BOARDTEST_FILESYSTEMTEST_H_ */
|
#endif /* BSP_Q7S_BOARDTEST_FILESYSTEMTEST_H_ */
|
||||||
|
|||||||
@@ -1,254 +1,528 @@
|
|||||||
#include <bsp_q7s/memory/FileSystemHandler.h>
|
|
||||||
#include <fsfw/objectmanager/ObjectManager.h>
|
|
||||||
#include "Q7STestTask.h"
|
#include "Q7STestTask.h"
|
||||||
|
|
||||||
|
#include <bsp_q7s/core/CoreController.h>
|
||||||
|
#include <bsp_q7s/memory/FileSystemHandler.h>
|
||||||
|
#include <bsp_q7s/xadc/Xadc.h>
|
||||||
|
#include <fsfw/objectmanager/ObjectManager.h>
|
||||||
|
#include <gps.h>
|
||||||
|
#include <libgpsmm.h>
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
#include <ctime>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <iostream>
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
#include "bsp_q7s/memory/SdCardManager.h"
|
#include "bsp_q7s/memory/SdCardManager.h"
|
||||||
#include "bsp_q7s/memory/scratchApi.h"
|
#include "bsp_q7s/memory/scratchApi.h"
|
||||||
|
|
||||||
#include "fsfw/timemanager/Stopwatch.h"
|
|
||||||
#include "fsfw/tasks/TaskFactory.h"
|
#include "fsfw/tasks/TaskFactory.h"
|
||||||
|
#include "fsfw/timemanager/Stopwatch.h"
|
||||||
#include "test/DummyParameter.h"
|
#include "test/DummyParameter.h"
|
||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
Q7STestTask::Q7STestTask(object_id_t objectId) : TestTask(objectId) {
|
||||||
|
doTestSdCard = false;
|
||||||
#include <iostream>
|
doTestScratchApi = false;
|
||||||
#include <fstream>
|
doTestGpsShm = false;
|
||||||
#include <cstdio>
|
doTestGpsSocket = false;
|
||||||
|
doTestXadc = false;
|
||||||
Q7STestTask::Q7STestTask(object_id_t objectId): TestTask(objectId) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t Q7STestTask::performOneShotAction() {
|
ReturnValue_t Q7STestTask::performOneShotAction() {
|
||||||
//testSdCard();
|
if (doTestSdCard) {
|
||||||
//testScratchApi();
|
testSdCard();
|
||||||
//testJsonLibDirect();
|
}
|
||||||
//testDummyParams();
|
if (doTestScratchApi) {
|
||||||
//FsOpCodes opCode = FsOpCodes::ATTEMPT_DIR_REMOVAL_NON_EMPTY;
|
testScratchApi();
|
||||||
//testFileSystemHandlerDirect(opCode);
|
}
|
||||||
return TestTask::performOneShotAction();
|
// testJsonLibDirect();
|
||||||
|
// testDummyParams();
|
||||||
|
if (doTestProtHandler) {
|
||||||
|
testProtHandler();
|
||||||
|
}
|
||||||
|
FsOpCodes opCode = FsOpCodes::APPEND_TO_FILE;
|
||||||
|
testFileSystemHandlerDirect(opCode);
|
||||||
|
return TestTask::performOneShotAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Q7STestTask::performPeriodicAction() {
|
||||||
|
if (doTestGpsShm) {
|
||||||
|
testGpsDaemonShm();
|
||||||
|
}
|
||||||
|
if (doTestGpsSocket) {
|
||||||
|
testGpsDaemonSocket();
|
||||||
|
}
|
||||||
|
if (doTestXadc) {
|
||||||
|
xadcTest();
|
||||||
|
}
|
||||||
|
return TestTask::performPeriodicAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Q7STestTask::testSdCard() {
|
void Q7STestTask::testSdCard() {
|
||||||
using namespace std;
|
using namespace std;
|
||||||
Stopwatch stopwatch;
|
Stopwatch stopwatch;
|
||||||
int result = std::system("q7hw sd info all > /tmp/sd_status.txt");
|
int result = std::system("q7hw sd info all > /tmp/sd_status.txt");
|
||||||
if(result != 0) {
|
if (result != 0) {
|
||||||
sif::debug << "system call failed with " << result << endl;
|
sif::debug << "system call failed with " << result << endl;
|
||||||
|
}
|
||||||
|
ifstream sdStatus("/tmp/sd_status.txt");
|
||||||
|
string line;
|
||||||
|
uint8_t idx = 0;
|
||||||
|
while (std::getline(sdStatus, line)) {
|
||||||
|
std::istringstream iss(line);
|
||||||
|
string word;
|
||||||
|
while (iss >> word) {
|
||||||
|
if (word == "on") {
|
||||||
|
sif::info << "SD card " << static_cast<int>(idx) << " is on" << endl;
|
||||||
|
} else if (word == "off") {
|
||||||
|
sif::info << "SD card " << static_cast<int>(idx) << " is off" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ifstream sdStatus("/tmp/sd_status.txt");
|
idx++;
|
||||||
string line;
|
}
|
||||||
uint8_t idx = 0;
|
std::remove("/tmp/sd_status.txt");
|
||||||
while (std::getline(sdStatus, line)) {
|
|
||||||
std::istringstream iss(line);
|
|
||||||
string word;
|
|
||||||
while(iss >> word) {
|
|
||||||
if(word == "on") {
|
|
||||||
sif::info << "SD card " << static_cast<int>(idx) << " is on" << endl;
|
|
||||||
}
|
|
||||||
else if(word == "off") {
|
|
||||||
sif::info << "SD card " << static_cast<int>(idx) << " is off" << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
idx++;
|
|
||||||
}
|
|
||||||
std::remove("/tmp/sd_status.txt");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Q7STestTask::fileTests() {
|
void Q7STestTask::fileTests() {
|
||||||
using namespace std;
|
using namespace std;
|
||||||
ofstream testFile("/tmp/test.txt");
|
ofstream testFile("/tmp/test.txt");
|
||||||
testFile << "Hallo Welt" << endl;
|
testFile << "Hallo Welt" << endl;
|
||||||
testFile.close();
|
testFile.close();
|
||||||
|
|
||||||
system("echo \"Hallo Welt\" > /tmp/test2.txt");
|
system("echo \"Hallo Welt\" > /tmp/test2.txt");
|
||||||
system("echo \"Hallo Welt\"");
|
system("echo \"Hallo Welt\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Q7STestTask::testScratchApi() {
|
void Q7STestTask::testScratchApi() {
|
||||||
ReturnValue_t result = scratch::writeNumber("TEST", 1);
|
ReturnValue_t result = scratch::writeNumber("TEST", 1);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::debug << "Q7STestTask::scratchApiTest: Writing number failed" << std::endl;
|
sif::debug << "Q7STestTask::scratchApiTest: Writing number failed" << std::endl;
|
||||||
}
|
}
|
||||||
int number = 0;
|
int number = 0;
|
||||||
result = scratch::readNumber("TEST", number);
|
result = scratch::readNumber("TEST", number);
|
||||||
sif::info << "Q7STestTask::testScratchApi: Value for key \"TEST\": " << number << std::endl;
|
sif::info << "Q7STestTask::testScratchApi: Value for key \"TEST\": " << number << std::endl;
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::debug << "Q7STestTask::scratchApiTest: Reading number failed" << std::endl;
|
sif::debug << "Q7STestTask::scratchApiTest: Reading number failed" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = scratch::writeString("TEST2", "halloWelt");
|
result = scratch::writeString("TEST2", "halloWelt");
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::debug << "Q7STestTask::scratchApiTest: Writing string failed" << std::endl;
|
sif::debug << "Q7STestTask::scratchApiTest: Writing string failed" << std::endl;
|
||||||
}
|
}
|
||||||
std::string string;
|
std::string string;
|
||||||
result = scratch::readString("TEST2", string);
|
result = scratch::readString("TEST2", string);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::debug << "Q7STestTask::scratchApiTest: Reading number failed" << std::endl;
|
sif::debug << "Q7STestTask::scratchApiTest: Reading number failed" << std::endl;
|
||||||
}
|
}
|
||||||
sif::info << "Q7STestTask::testScratchApi: Value for key \"TEST2\": " << string << std::endl;
|
sif::info << "Q7STestTask::testScratchApi: Value for key \"TEST2\": " << string << std::endl;
|
||||||
|
|
||||||
result = scratch::clearValue("TEST");
|
result = scratch::clearValue("TEST");
|
||||||
result = scratch::clearValue("TEST2");
|
result = scratch::clearValue("TEST2");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Q7STestTask::testJsonLibDirect() {
|
void Q7STestTask::testJsonLibDirect() {
|
||||||
Stopwatch stopwatch;
|
Stopwatch stopwatch;
|
||||||
// for convenience
|
// for convenience
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
json helloTest;
|
json helloTest;
|
||||||
// add a number that is stored as double (note the implicit conversion of j to an object)
|
// add a number that is stored as double (note the implicit conversion of j to an object)
|
||||||
helloTest["pi"] = 3.141;
|
helloTest["pi"] = 3.141;
|
||||||
std::string mntPrefix = SdCardManager::instance()->getCurrentMountPrefix();
|
std::string mntPrefix = SdCardManager::instance()->getCurrentMountPrefix();
|
||||||
std::string fileName = mntPrefix + "/pretty.json";
|
std::string fileName = mntPrefix + "/pretty.json";
|
||||||
std::ofstream o(fileName);
|
std::ofstream o(fileName);
|
||||||
o << std::setw(4) << helloTest << std::endl;
|
o << std::setw(4) << helloTest << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Q7STestTask::testDummyParams() {
|
void Q7STestTask::testDummyParams() {
|
||||||
std::string mntPrefix = SdCardManager::instance()->getCurrentMountPrefix();
|
std::string mntPrefix = SdCardManager::instance()->getCurrentMountPrefix();
|
||||||
DummyParameter param(mntPrefix, "dummy_json.txt");
|
DummyParameter param(mntPrefix, "dummy_json.txt");
|
||||||
param.printKeys();
|
param.printKeys();
|
||||||
param.print();
|
param.print();
|
||||||
if(not param.getJsonFileExists()) {
|
if (not param.getJsonFileExists()) {
|
||||||
param.writeJsonFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t result = param.readJsonFile();
|
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
param.setValue(DummyParameter::DUMMY_KEY_PARAM_1, 3);
|
|
||||||
param.setValue(DummyParameter::DUMMY_KEY_PARAM_2, "blirb");
|
|
||||||
|
|
||||||
param.writeJsonFile();
|
param.writeJsonFile();
|
||||||
param.print();
|
}
|
||||||
|
|
||||||
int test = param.getValue<int>(DummyParameter::DUMMY_KEY_PARAM_1);
|
ReturnValue_t result = param.readJsonFile();
|
||||||
std::string test2 = param.getValue<std::string>(DummyParameter::DUMMY_KEY_PARAM_2);
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::info << "Test value (3 expected): " << test << std::endl;
|
}
|
||||||
sif::info << "Test value 2 (\"blirb\" expected): " << test2 << std::endl;
|
|
||||||
|
param.setValue(DummyParameter::DUMMY_KEY_PARAM_1, 3);
|
||||||
|
param.setValue(DummyParameter::DUMMY_KEY_PARAM_2, "blirb");
|
||||||
|
|
||||||
|
param.writeJsonFile();
|
||||||
|
param.print();
|
||||||
|
|
||||||
|
int test = 0;
|
||||||
|
result = param.getValue<int>(DummyParameter::DUMMY_KEY_PARAM_1, test);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::warning << "Q7STestTask::testDummyParams: Key " << DummyParameter::DUMMY_KEY_PARAM_1
|
||||||
|
<< " does not exist" << std::endl;
|
||||||
|
}
|
||||||
|
std::string test2;
|
||||||
|
result = param.getValue<std::string>(DummyParameter::DUMMY_KEY_PARAM_2, test2);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::warning << "Q7STestTask::testDummyParams: Key " << DummyParameter::DUMMY_KEY_PARAM_1
|
||||||
|
<< " does not exist" << std::endl;
|
||||||
|
}
|
||||||
|
sif::info << "Test value (3 expected): " << test << std::endl;
|
||||||
|
sif::info << "Test value 2 (\"blirb\" expected): " << test2 << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t Q7STestTask::initialize() {
|
||||||
|
coreController = ObjectManager::instance()->get<CoreController>(objects::CORE_CONTROLLER);
|
||||||
|
if (coreController == nullptr) {
|
||||||
|
sif::warning << "Q7STestTask::initialize: Could not retrieve CORE_CONTROLLER object"
|
||||||
|
<< std::endl;
|
||||||
|
}
|
||||||
|
return TestTask::initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Q7STestTask::testProtHandler() {
|
||||||
|
bool opPerformed = false;
|
||||||
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||||
|
// If any chips are unlocked, lock them here
|
||||||
|
result = coreController->setBootCopyProtection(xsc::Chip::ALL_CHIP, xsc::Copy::ALL_COPY, true,
|
||||||
|
opPerformed, true);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// unlock own copy
|
||||||
|
result = coreController->setBootCopyProtection(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, false,
|
||||||
|
opPerformed, true);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl;
|
||||||
|
}
|
||||||
|
if (not opPerformed) {
|
||||||
|
sif::warning << "Q7STestTask::testProtHandler: No op performed" << std::endl;
|
||||||
|
}
|
||||||
|
int retval = std::system("print-chip-prot-status.sh");
|
||||||
|
if (retval != 0) {
|
||||||
|
utility::handleSystemError(retval, "Q7STestTask::testProtHandler");
|
||||||
|
}
|
||||||
|
|
||||||
|
// lock own copy
|
||||||
|
result = coreController->setBootCopyProtection(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, true,
|
||||||
|
opPerformed, true);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl;
|
||||||
|
}
|
||||||
|
if (not opPerformed) {
|
||||||
|
sif::warning << "Q7STestTask::testProtHandler: No op performed" << std::endl;
|
||||||
|
}
|
||||||
|
retval = std::system("print-chip-prot-status.sh");
|
||||||
|
if (retval != 0) {
|
||||||
|
utility::handleSystemError(retval, "Q7STestTask::testProtHandler");
|
||||||
|
}
|
||||||
|
|
||||||
|
// unlock specific copy
|
||||||
|
result = coreController->setBootCopyProtection(xsc::Chip::CHIP_1, xsc::Copy::COPY_1, false,
|
||||||
|
opPerformed, true);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl;
|
||||||
|
}
|
||||||
|
if (not opPerformed) {
|
||||||
|
sif::warning << "Q7STestTask::testProtHandler: No op performed" << std::endl;
|
||||||
|
}
|
||||||
|
retval = std::system("print-chip-prot-status.sh");
|
||||||
|
if (retval != 0) {
|
||||||
|
utility::handleSystemError(retval, "Q7STestTask::testProtHandler");
|
||||||
|
}
|
||||||
|
|
||||||
|
// lock specific copy
|
||||||
|
result = coreController->setBootCopyProtection(xsc::Chip::CHIP_1, xsc::Copy::COPY_1, true,
|
||||||
|
opPerformed, true);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl;
|
||||||
|
}
|
||||||
|
if (not opPerformed) {
|
||||||
|
sif::warning << "Q7STestTask::testProtHandler: No op performed" << std::endl;
|
||||||
|
}
|
||||||
|
retval = std::system("print-chip-prot-status.sh");
|
||||||
|
if (retval != 0) {
|
||||||
|
utility::handleSystemError(retval, "Q7STestTask::testProtHandler");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
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;
|
||||||
|
#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) {
|
void Q7STestTask::testFileSystemHandlerDirect(FsOpCodes opCode) {
|
||||||
auto fsHandler = ObjectManager::instance()->
|
auto fsHandler = ObjectManager::instance()->get<FileSystemHandler>(objects::FILE_SYSTEM_HANDLER);
|
||||||
get<FileSystemHandler>(objects::FILE_SYSTEM_HANDLER);
|
if (fsHandler == nullptr) {
|
||||||
if(fsHandler == nullptr) {
|
sif::warning << "Q7STestTask::testFileSystemHandlerDirect: No FS handler running.."
|
||||||
sif::warning << "Q7STestTask::testFileSystemHandlerDirect: No FS handler running.."
|
<< std::endl;
|
||||||
<< std::endl;
|
}
|
||||||
}
|
FileSystemHandler::FsCommandCfg cfg = {};
|
||||||
FileSystemHandler::FsCommandCfg cfg = {};
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
|
||||||
|
|
||||||
// Lambda for common code
|
// Lambda for common code
|
||||||
auto createNonEmptyTmpDir = [&]() {
|
auto createNonEmptyTmpDir = [&]() {
|
||||||
if(not std::filesystem::exists("/tmp/test")) {
|
if (not std::filesystem::exists("/tmp/test")) {
|
||||||
result = fsHandler->createDirectory("/tmp/test", &cfg);
|
result = fsHandler->createDirectory("/tmp", "test", false, &cfg);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Creating sample files
|
|
||||||
sif::info << "Creating sample files in directory" << std::endl;
|
|
||||||
result = fsHandler->createFile("/tmp/test", "test1.txt", nullptr, 0, &cfg);
|
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
result = fsHandler->createFile("/tmp/test", "test2.txt", nullptr, 0, &cfg);
|
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
};
|
}
|
||||||
|
}
|
||||||
|
// Creating sample files
|
||||||
|
sif::info << "Creating sample files in directory" << std::endl;
|
||||||
|
result = fsHandler->createFile("/tmp/test", "test1.txt", nullptr, 0, &cfg);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = fsHandler->createFile("/tmp/test", "test2.txt", nullptr, 0, &cfg);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (opCode) {
|
||||||
switch(opCode) {
|
case (FsOpCodes::CREATE_EMPTY_FILE_IN_TMP): {
|
||||||
case(FsOpCodes::CREATE_EMPTY_FILE_IN_TMP): {
|
// No mount prefix, cause file is created in tmp
|
||||||
// No mount prefix, cause file is created in tmp
|
cfg.useMountPrefix = false;
|
||||||
cfg.useMountPrefix = false;
|
sif::info << "Creating empty file in /tmp folder" << std::endl;
|
||||||
sif::info << "Creating empty file in /tmp folder" << std::endl;
|
// Do not delete file, user can check existence in shell
|
||||||
// Do not delete file, user can check existence in shell
|
fsHandler->createFile("/tmp/", "test.txt", nullptr, 0, &cfg);
|
||||||
fsHandler->createFile("/tmp", "test.txt", nullptr, 0, &cfg);
|
break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case(FsOpCodes::REMOVE_TMP_FILE): {
|
case (FsOpCodes::REMOVE_TMP_FILE): {
|
||||||
sif::info << "Deleting /tmp/test.txt sample file" << std::endl;
|
sif::info << "Deleting /tmp/test.txt sample file" << std::endl;
|
||||||
// No mount prefix, cause file is created in tmp
|
// No mount prefix, cause file is created in tmp
|
||||||
cfg.useMountPrefix = false;
|
cfg.useMountPrefix = false;
|
||||||
if(not std::filesystem::exists("/tmp/test.txt")) {
|
if (not std::filesystem::exists("/tmp/test.txt")) {
|
||||||
// Creating sample file
|
// Creating sample file
|
||||||
sif::info << "Creating sample file /tmp/test.txt to delete" << std::endl;
|
sif::info << "Creating sample file /tmp/test.txt to delete" << std::endl;
|
||||||
fsHandler->createFile("/tmp", "test.txt", nullptr, 0, &cfg);
|
fsHandler->createFile("/tmp/", "test.txt", nullptr, 0, &cfg);
|
||||||
}
|
}
|
||||||
result = fsHandler->removeFile("/tmp", "test.txt", &cfg);
|
result = fsHandler->removeFile("/tmp", "test.txt", &cfg);
|
||||||
if(result == HasReturnvaluesIF::RETURN_OK) {
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::info << "File removed successfully" << std::endl;
|
sif::info << "File removed successfully" << std::endl;
|
||||||
}
|
} else {
|
||||||
else {
|
sif::warning << "File removal failed!" << std::endl;
|
||||||
sif::warning << "File removal failed!" << std::endl;
|
}
|
||||||
}
|
break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case(FsOpCodes::CREATE_DIR_IN_TMP): {
|
case (FsOpCodes::CREATE_DIR_IN_TMP): {
|
||||||
// No mount prefix, cause file is created in tmp
|
// No mount prefix, cause file is created in tmp
|
||||||
cfg.useMountPrefix = false;
|
cfg.useMountPrefix = false;
|
||||||
sif::info << "Creating empty file in /tmp folder" << std::endl;
|
sif::info << "Creating empty file in /tmp folder" << std::endl;
|
||||||
// Do not delete file, user can check existence in shell
|
// Do not delete file, user can check existence in shell
|
||||||
ReturnValue_t result = fsHandler->createDirectory("/tmp/test", &cfg);
|
ReturnValue_t result = fsHandler->createDirectory("/tmp/", "test", false, &cfg);
|
||||||
if(result == HasReturnvaluesIF::RETURN_OK) {
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::info << "Directory created successfully" << std::endl;
|
sif::info << "Directory created successfully" << std::endl;
|
||||||
}
|
} else {
|
||||||
else {
|
sif::warning << "Directory creation failed!" << std::endl;
|
||||||
sif::warning << "Directory creation failed!" << std::endl;
|
}
|
||||||
}
|
break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case(FsOpCodes::REMOVE_EMPTY_DIR_IN_TMP): {
|
case (FsOpCodes::REMOVE_EMPTY_DIR_IN_TMP): {
|
||||||
// No mount prefix, cause file is created in tmp
|
// No mount prefix, cause file is created in tmp
|
||||||
cfg.useMountPrefix = false;
|
cfg.useMountPrefix = false;
|
||||||
if(not std::filesystem::exists("/tmp/test")) {
|
if (not std::filesystem::exists("/tmp/test")) {
|
||||||
result = fsHandler->createDirectory("/tmp/test", &cfg);
|
result = fsHandler->createDirectory("/tmp", "test", false, &cfg);
|
||||||
}
|
} else {
|
||||||
else {
|
// Delete any leftover files to regular dir removal works
|
||||||
// Delete any leftover files to regular dir removal works
|
std::remove("/tmp/test/*");
|
||||||
std::remove("/tmp/test/*");
|
}
|
||||||
}
|
result = fsHandler->removeDirectory("/tmp/", "test", false, &cfg);
|
||||||
result = fsHandler->removeDirectory("/tmp/test", false, &cfg);
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
if(result == HasReturnvaluesIF::RETURN_OK) {
|
sif::info << "Directory removed successfully" << std::endl;
|
||||||
sif::info << "Directory removed successfully" << std::endl;
|
} else {
|
||||||
}
|
sif::warning << "Directory removal failed!" << std::endl;
|
||||||
else {
|
}
|
||||||
sif::warning << "Directory removal failed!" << std::endl;
|
break;
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case(FsOpCodes::REMOVE_FILLED_DIR_IN_TMP): {
|
case (FsOpCodes::REMOVE_FILLED_DIR_IN_TMP): {
|
||||||
result = createNonEmptyTmpDir();
|
result = createNonEmptyTmpDir();
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result = fsHandler->removeDirectory("/tmp/test", true, &cfg);
|
result = fsHandler->removeDirectory("/tmp/", "test", true, &cfg);
|
||||||
if(result == HasReturnvaluesIF::RETURN_OK) {
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::info << "Directory removed recursively successfully" << std::endl;
|
sif::info << "Directory removed recursively successfully" << std::endl;
|
||||||
}
|
} else {
|
||||||
else {
|
sif::warning << "Recursive directory removal failed!" << std::endl;
|
||||||
sif::warning << "Recursive directory removal failed!" << std::endl;
|
}
|
||||||
}
|
break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case(FsOpCodes::ATTEMPT_DIR_REMOVAL_NON_EMPTY): {
|
case (FsOpCodes::ATTEMPT_DIR_REMOVAL_NON_EMPTY): {
|
||||||
result = createNonEmptyTmpDir();
|
result = createNonEmptyTmpDir();
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result = fsHandler->removeDirectory("/tmp/test", false, &cfg);
|
result = fsHandler->removeDirectory("/tmp/", "test", false, &cfg);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::info << "Directory removal attempt failed as expected" << std::endl;
|
sif::info << "Directory removal attempt failed as expected" << std::endl;
|
||||||
}
|
} else {
|
||||||
else {
|
sif::warning << "Directory removal worked when it should not have!" << std::endl;
|
||||||
sif::warning << "Directory removal worked when it should not have!" << std::endl;
|
}
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
|
case (FsOpCodes::RENAME_FILE): {
|
||||||
|
// No mount prefix, cause file is created in tmp
|
||||||
|
cfg.useMountPrefix = false;
|
||||||
|
if (std::filesystem::exists("/tmp/test.txt")) {
|
||||||
|
fsHandler->removeDirectory("/tmp/", "test", false, &cfg);
|
||||||
|
}
|
||||||
|
sif::info << "Creating empty file /tmp/test.txt and rename to /tmp/test2.txt" << std::endl;
|
||||||
|
// Do not delete file, user can check existence in shell
|
||||||
|
fsHandler->createFile("/tmp/", "test.txt", nullptr, 0, &cfg);
|
||||||
|
fsHandler->renameFile("/tmp/", "test.txt", "test2.txt", &cfg);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
case (FsOpCodes::APPEND_TO_FILE): {
|
||||||
|
// No mount prefix, cause file is created in tmp
|
||||||
|
cfg.useMountPrefix = false;
|
||||||
|
if (std::filesystem::exists("/tmp/test.txt")) {
|
||||||
|
fsHandler->removeDirectory("/tmp/", "test", false, &cfg);
|
||||||
|
}
|
||||||
|
if (std::filesystem::exists("/tmp/test.txt")) {
|
||||||
|
fsHandler->removeDirectory("/tmp/", "test", false, &cfg);
|
||||||
|
}
|
||||||
|
sif::info << "Creating empty file /tmp/test.txt and adding content" << std::endl;
|
||||||
|
std::string content = "Hello World\n";
|
||||||
|
// Do not delete file, user can check existence in shell
|
||||||
|
fsHandler->createFile("/tmp/", "test.txt", nullptr, 0, &cfg);
|
||||||
|
fsHandler->appendToFile("/tmp/", "test.txt", reinterpret_cast<const uint8_t*>(content.data()),
|
||||||
|
content.size(), 0, &cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Q7STestTask::xadcTest() {
|
||||||
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
float temperature = 0;
|
||||||
|
float vccPint = 0;
|
||||||
|
float vccPaux = 0;
|
||||||
|
float vccInt = 0;
|
||||||
|
float vccAux = 0;
|
||||||
|
float vccBram = 0;
|
||||||
|
float vccOddr = 0;
|
||||||
|
float vrefp = 0;
|
||||||
|
float vrefn = 0;
|
||||||
|
Xadc xadc;
|
||||||
|
result = xadc.getTemperature(temperature);
|
||||||
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::info << "Q7STestTask::xadcTest: Chip Temperature: " << temperature << " °C" << std::endl;
|
||||||
|
}
|
||||||
|
result = xadc.getVccPint(vccPint);
|
||||||
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::info << "Q7STestTask::xadcTest: VCC PS internal: " << vccPint << " mV" << std::endl;
|
||||||
|
}
|
||||||
|
result = xadc.getVccPaux(vccPaux);
|
||||||
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::info << "Q7STestTask::xadcTest: VCC PS auxilliary: " << vccPaux << " mV" << std::endl;
|
||||||
|
}
|
||||||
|
result = xadc.getVccInt(vccInt);
|
||||||
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::info << "Q7STestTask::xadcTest: VCC PL internal: " << vccInt << " mV" << std::endl;
|
||||||
|
}
|
||||||
|
result = xadc.getVccAux(vccAux);
|
||||||
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::info << "Q7STestTask::xadcTest: VCC PL auxilliary: " << vccAux << " mV" << std::endl;
|
||||||
|
}
|
||||||
|
result = xadc.getVccBram(vccBram);
|
||||||
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::info << "Q7STestTask::xadcTest: VCC BRAM: " << vccBram << " mV" << std::endl;
|
||||||
|
}
|
||||||
|
result = xadc.getVccOddr(vccOddr);
|
||||||
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::info << "Q7STestTask::xadcTest: VCC PS I/O DDR : " << vccOddr << " mV" << std::endl;
|
||||||
|
}
|
||||||
|
result = xadc.getVrefp(vrefp);
|
||||||
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::info << "Q7STestTask::xadcTest: Vrefp : " << vrefp << " mV" << std::endl;
|
||||||
|
}
|
||||||
|
result = xadc.getVrefn(vrefn);
|
||||||
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::info << "Q7STestTask::xadcTest: Vrefn : " << vrefn << " mV" << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,58 @@
|
|||||||
#ifndef BSP_Q7S_BOARDTEST_Q7STESTTASK_H_
|
#ifndef BSP_Q7S_BOARDTEST_Q7STESTTASK_H_
|
||||||
#define BSP_Q7S_BOARDTEST_Q7STESTTASK_H_
|
#define BSP_Q7S_BOARDTEST_Q7STESTTASK_H_
|
||||||
|
|
||||||
|
#include <libgpsmm.h>
|
||||||
|
|
||||||
#include "test/testtasks/TestTask.h"
|
#include "test/testtasks/TestTask.h"
|
||||||
|
|
||||||
class Q7STestTask: public TestTask {
|
class CoreController;
|
||||||
public:
|
|
||||||
Q7STestTask(object_id_t objectId);
|
|
||||||
private:
|
|
||||||
ReturnValue_t performOneShotAction() override;
|
|
||||||
|
|
||||||
void testSdCard();
|
class Q7STestTask : public TestTask {
|
||||||
void fileTests();
|
public:
|
||||||
|
Q7STestTask(object_id_t objectId);
|
||||||
|
|
||||||
void testScratchApi();
|
ReturnValue_t initialize() override;
|
||||||
void testJsonLibDirect();
|
|
||||||
void testDummyParams();
|
|
||||||
|
|
||||||
enum FsOpCodes {
|
private:
|
||||||
CREATE_EMPTY_FILE_IN_TMP,
|
bool doTestSdCard = false;
|
||||||
REMOVE_TMP_FILE,
|
bool doTestScratchApi = false;
|
||||||
CREATE_DIR_IN_TMP,
|
bool doTestGpsShm = false;
|
||||||
REMOVE_EMPTY_DIR_IN_TMP,
|
bool doTestGpsSocket = false;
|
||||||
ATTEMPT_DIR_REMOVAL_NON_EMPTY,
|
bool doTestProtHandler = false;
|
||||||
REMOVE_FILLED_DIR_IN_TMP,
|
bool doTestXadc = false;
|
||||||
};
|
|
||||||
void testFileSystemHandlerDirect(FsOpCodes opCode);
|
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 testGpsDaemonShm();
|
||||||
|
void testGpsDaemonSocket();
|
||||||
|
|
||||||
|
void testSdCard();
|
||||||
|
void fileTests();
|
||||||
|
void xadcTest();
|
||||||
|
|
||||||
|
void testScratchApi();
|
||||||
|
void testJsonLibDirect();
|
||||||
|
void testDummyParams();
|
||||||
|
void testProtHandler();
|
||||||
|
|
||||||
|
enum FsOpCodes {
|
||||||
|
CREATE_EMPTY_FILE_IN_TMP,
|
||||||
|
REMOVE_TMP_FILE,
|
||||||
|
CREATE_DIR_IN_TMP,
|
||||||
|
REMOVE_EMPTY_DIR_IN_TMP,
|
||||||
|
ATTEMPT_DIR_REMOVAL_NON_EMPTY,
|
||||||
|
REMOVE_FILLED_DIR_IN_TMP,
|
||||||
|
RENAME_FILE,
|
||||||
|
APPEND_TO_FILE,
|
||||||
|
};
|
||||||
|
void testFileSystemHandlerDirect(FsOpCodes opCode);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* BSP_Q7S_BOARDTEST_Q7STESTTASK_H_ */
|
#endif /* BSP_Q7S_BOARDTEST_Q7STESTTASK_H_ */
|
||||||
|
|||||||
6
bsp_q7s/callbacks/CMakeLists.txt
Normal file
6
bsp_q7s/callbacks/CMakeLists.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
target_sources(${OBSW_NAME} PRIVATE
|
||||||
|
rwSpiCallback.cpp
|
||||||
|
gnssCallback.cpp
|
||||||
|
pcduSwitchCb.cpp
|
||||||
|
q7sGpioCallbacks.cpp
|
||||||
|
)
|
||||||
25
bsp_q7s/callbacks/gnssCallback.cpp
Normal file
25
bsp_q7s/callbacks/gnssCallback.cpp
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#include "gnssCallback.h"
|
||||||
|
|
||||||
|
#include "devices/gpioIds.h"
|
||||||
|
#include "fsfw/tasks/TaskFactory.h"
|
||||||
|
|
||||||
|
ReturnValue_t gps::triggerGpioResetPin(void* args) {
|
||||||
|
ResetArgs* resetArgs = reinterpret_cast<ResetArgs*>(args);
|
||||||
|
if (args == nullptr) {
|
||||||
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
}
|
||||||
|
if (resetArgs->gpioComIF == nullptr) {
|
||||||
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
}
|
||||||
|
gpioId_t gpioId;
|
||||||
|
if (resetArgs->gnss1) {
|
||||||
|
gpioId = gpioIds::GNSS_1_NRESET;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
gpioId = gpioIds::GNSS_0_NRESET;
|
||||||
|
}
|
||||||
|
resetArgs->gpioComIF->pullLow(gpioId);
|
||||||
|
TaskFactory::delayTask(resetArgs->waitPeriodMs);
|
||||||
|
resetArgs->gpioComIF->pullHigh(gpioId);
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
19
bsp_q7s/callbacks/gnssCallback.h
Normal file
19
bsp_q7s/callbacks/gnssCallback.h
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#ifndef BSP_Q7S_CALLBACKS_GNSSCALLBACK_H_
|
||||||
|
#define BSP_Q7S_CALLBACKS_GNSSCALLBACK_H_
|
||||||
|
|
||||||
|
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||||
|
#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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* BSP_Q7S_CALLBACKS_GNSSCALLBACK_H_ */
|
||||||
32
bsp_q7s/callbacks/pcduSwitchCb.cpp
Normal file
32
bsp_q7s/callbacks/pcduSwitchCb.cpp
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#include "pcduSwitchCb.h"
|
||||||
|
|
||||||
|
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
|
||||||
|
|
||||||
|
#include "devices/gpioIds.h"
|
||||||
|
|
||||||
|
void pcdu::switchCallback(GOMSPACE::Pdu pdu, uint8_t channel, bool state, void* args) {
|
||||||
|
LinuxLibgpioIF* gpioComIF = reinterpret_cast<LinuxLibgpioIF*>(args);
|
||||||
|
if (gpioComIF == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pdu == GOMSPACE::Pdu::PDU1) {
|
||||||
|
PDU1::Channels typedChannel = static_cast<PDU1::Channels>(channel);
|
||||||
|
if (typedChannel == PDU1::Channels::ACS_A_SIDE) {
|
||||||
|
if (state) {
|
||||||
|
gpioComIF->pullHigh(gpioIds::GNSS_0_NRESET);
|
||||||
|
} else {
|
||||||
|
gpioComIF->pullLow(gpioIds::GNSS_0_NRESET);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (pdu == GOMSPACE::Pdu::PDU2) {
|
||||||
|
PDU2::Channels typedChannel = static_cast<PDU2::Channels>(channel);
|
||||||
|
if (typedChannel == PDU2::Channels::ACS_B_SIDE) {
|
||||||
|
if (state) {
|
||||||
|
gpioComIF->pullHigh(gpioIds::GNSS_1_NRESET);
|
||||||
|
} else {
|
||||||
|
gpioComIF->pullLow(gpioIds::GNSS_1_NRESET);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
14
bsp_q7s/callbacks/pcduSwitchCb.h
Normal file
14
bsp_q7s/callbacks/pcduSwitchCb.h
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#ifndef BSP_Q7S_CALLBACKS_PCDUSWITCHCB_H_
|
||||||
|
#define BSP_Q7S_CALLBACKS_PCDUSWITCHCB_H_
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
#include "mission/devices/devicedefinitions/GomspaceDefinitions.h"
|
||||||
|
|
||||||
|
namespace pcdu {
|
||||||
|
|
||||||
|
void switchCallback(GOMSPACE::Pdu pdu, uint8_t channel, bool state, void* args);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* BSP_Q7S_CALLBACKS_PCDUSWITCHCB_H_ */
|
||||||
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 mux bit gpios to gpioComIF" << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user