6424 Commits
Author SHA1 Message Date
tbaumgartlandTobias Baumgartl 03d3b6cd68 fix: do not mix an epoch offset into the FreeRTOS monotonic clock (#74)
`Clock::getClockMonotonic` on FreeRTOS returned an epoch offset added on top of the uptime:

```cpp
*time = Timekeeper::instance()->getMonotonicClockOffset() + getUptime();
```

`monotonicClockOffset` is a `timeval` member with no initializer, and `Timekeeper`'s constructor
only initialises `offset`. The singleton is heap allocated, so the member holds indeterminate
bytes until `Timekeeper::setOffset` latches it, which happens on the first `Clock::setClock`.

Until that point `getClockMonotonic` returns garbage plus uptime, and at the latch it jumps by
whatever the difference happens to be. Any `Countdown` or `Stopwatch` armed before the latch
expires wrongly, in both directions:

- forward jump: `getCurrentTime() - startTime >= timeout`
- backward jump: the `getCurrentTime() < startTime` guard in `Countdown::hasTimedOut`

On our OBC this is not a race but the normal case. The CoreController sets the clock from its
own task, so everything constructed during object creation and early boot is on the wrong side
of the latch.

## Why the offset can go

The monotonicity came from the uptime alone. The offset only made the value look epoch based,
and nothing depends on that:

- `Countdown` uses `getCurrentTime() - startTime`
- `Stopwatch` uses `endTime - startTime`
- `PeriodicHelper::performPeriodicHkGeneration` uses `now - setSpec.lastGenerated`

Those are the only three callers in the framework. All take differences.

The Linux and host implementations already return `CLOCK_MONOTONIC_RAW` with no offset, so
FreeRTOS was the only OSAL where `getClockMonotonic` meant something different. The interface
doc in `Clock.h` also already describes the intended contract: "less suited when the absolute
time is required", with `CLOCK_MONOTONIC_RAW` named as the reference implementation.

## Changes

- `osal/freertos/Clock.cpp`: `getClockMonotonic` returns `getUptime()`
- `osal/freertos/Timekeeper.{h,cpp}`: drop `monotonicClockOffset`, `monotonicClockInitialized`,
  `getMonotonicClockOffset` and the never defined `setMonotonicClockOffset`. `setOffset` is now
  a one liner
- `timemanager/Clock.h`: drop the `monotonicClockInitialized` and `monotonicClockOffset` statics,
  which were declared but never defined or used

`Clock::getClock` is unchanged and still returns offset plus uptime, so the wall clock is
unaffected.

## Compatibility

`getClockMonotonic` on FreeRTOS now counts from scheduler start instead of the epoch. Code that
compares a monotonic timestamp against a wall clock value would break, but that would already be
broken on Linux, and no such code exists.

---------

Co-authored-by: Tobias Baumgartl <tobias.baumgartl@ksat-stuttgart.de>
Reviewed-on: #74
2026-09-25 14:24:14 +02:00
tbaumgartl 42ecc7caf1 Merge pull request 'fix MessageQueueBase ignore fault' (#72) from baumgartl/fix-mqb-ignore-fault into main
Reviewed-on: #72
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2026-09-06 17:53:14 +02:00
muellerr 17926777a1 Merge pull request 'fix: ensure proper mutex unlocking in destructor to prevent system halts' (#71) from baumgartl/fix-mutexguard into main
Reviewed-on: #71
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2026-09-05 10:33:50 +02:00
Tobias Baumgartl 5761c1e187 fix: allow configurable fault handling in sendMessage function 2026-09-05 07:22:32 +02:00
Tobias Baumgartl 427f5a99b9 fix: ensure proper mutex unlocking in destructor to prevent system halts 2026-09-05 06:49:20 +02:00
tbaumgartl b1d2a4726f Merge pull request 'Add COBS encoding support (encoding and decoding)' (#70) from blochm/fsfw:bloch/cobs into main
Reviewed-on: #70
2026-08-27 07:24:55 +02:00
tbaumgartl 4a47eced59 Merge pull request 'Exclude host sources from non-host targets' (#69) from blochm/fsfw:bloch/smol-fix into main
Reviewed-on: #69
2026-08-27 07:18:55 +02:00
blochm b123b3f260 feat: cobs 2026-08-15 12:02:57 +02:00
blochm 428ff3f373 fix: kick out host stuff from device build 2026-08-15 10:11:34 +02:00
muellerr 9890a2c52e Merge pull request 'Better printer task & Bug fix' (#68) from blochm/fsfw:bloch/improve-printout into main
Reviewed-on: #68
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2026-08-06 10:40:08 +02:00
blochm b65854eaa0 fix(DeviceHandlerBase): SerialBufferAdapter was missing <uint32_t>
Previously it simply defaulted to size_t because of the length parameter
type. This is bad, since network serialization is then platform
dependant
2026-07-14 19:20:14 +02:00
blochm 23500c8364 feat(ServiceInterfacePrinter): ringbuffer printer
Previously the printer used a 2d array mechanism to queue up messages,
by selecting a free slot with help of a etl::bitset for tracking. A
message is then sent to the callback what slot is filled up and the
callback then drains the entire queue and prints out the messages.

This was prone to deadline issues, since the entire queue was always
flushed and often I noticed a deadline missed messages when developing
other stuff. Also memory is inefficiently used with the 2d array.

This new version fixes the above using a ring buffer datastructure. We
use a flat array and 2 integer pointers for storing and tracking the
bytes to print. So now there isn't any wasted space between messages.
Also with the design of the ring buffer messages can be written in and
read out at the same time, so we have minimal mutex use (just for
updating the integer pointers). To address the deadline issue, the
callback also only prints out a limited number of bytes per cycle.

(Also the printer code in general has been optimized a bit, since it was
quite needlessly big)
2026-07-14 19:20:14 +02:00
muellerr 91c5b05723 Merge pull request 'add keep alive PDU serializer' (#67) from add-keep-alive-pdu-serializer into main
Reviewed-on: #67
2026-04-14 10:10:45 +02:00
Robin Mueller a8bcb9c8cd add keep alive PDU serializer 2026-04-14 10:09:16 +02:00
muellerr 1d278d6f5c Merge pull request 'Fix stray import' (#66) from ritzmannc/fsfw:ritzmann/fix-stray-import into main
Reviewed-on: #66
2026-03-04 10:10:27 +01:00
ritzmannc b1bc699009 Fix stray import 2026-03-03 20:31:55 +01:00
muellerr 3668e61d5c Merge pull request 'Asynchronous ServiceInterfacePrinter' (#65) from ritzmannc/fsfw:ritzmann/sif-async-print into main
Reviewed-on: #65
2026-03-03 19:28:49 +01:00
ritzmannc 45150c8ce3 Fix of by one errors and set the position after the last char to a null byte. 2026-02-19 00:34:34 +01:00
ritzmannc 7692e598d6 Add FSFW_PRINT_BUFFER_AMOUNT to FSFW template config 2026-02-17 16:40:24 +01:00
ritzmannc 52129e0c84 Remove legacy code 2026-02-13 16:35:11 +01:00
ritzmannc acf60e55e8 Fix Host TaskFactory::printMissedDeadline warning 2026-01-23 12:49:10 +01:00
ritzmannc a625a06b7d Add async printing functionality 2026-01-23 12:48:09 +01:00
muellerr c0a665ffe6 Merge pull request 'PUS: Implement serialization for TC[8, 128] (Direct Command)' (#62) from bertschs/fsfw:bertsch/packet-apis into main
Reviewed-on: #62
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2026-01-12 09:40:12 +01:00
muellerr cceef62cb6 Merge pull request 'Expose health table mutex publically' (#64) from baumgartl/expose-healthtable-mutex into main
Reviewed-on: #64
2026-01-09 13:34:09 +01:00
Tobias Baumgartl 4c3c93c106 Expose health table mutex publically 2026-01-08 19:42:53 +01:00
tbaumgartl d28e2b5f07 Merge pull request 'Increasing the maximum number of allowed mode tables for subsystems' (#63) from spahr/maxNumberOfModeTables into main
Reviewed-on: #63
2026-01-04 20:28:20 +01:00
spahr@ksat-stuttgart.de 6ebe3123ff Increasing the maximum number of allowed mode tables
changelog
2026-01-04 20:27:11 +01:00
bertschs 70b9ba68bf PUS: Implement serialization for TC[8, 128] (Direct Command)
This allows creating and serializing direct
command PUS packets. This functionality is needed
in SOURCE, where OBC prepares TC[8, 128] packets
for Payload Computer (PLOC).

Additionally, expose some setters and
datastructures to facilitate this use case.
2025-11-26 22:13:02 +01:00
muellerr 59706365f6 Merge pull request 'typo' (#59) from mdemke/typo-fix into main
Reviewed-on: #59
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2025-11-06 16:25:07 +01:00
muellerr 0c70ff1822 Merge branch 'main' into mdemke/typo-fix 2025-11-06 16:24:52 +01:00
muellerr 76dd1d1562 Merge pull request 'PUS Routing Configuration' (#60) from meier/pus-routing into main
Reviewed-on: #60
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2025-11-06 16:24:32 +01:00
muellerr f2b72db481 Merge branch 'main' into meier/pus-routing 2025-11-06 16:24:25 +01:00
muellerr fa4af546fa Merge pull request 'Changing the function definition to a virtual function to allow overrides for some custom applications' (#61) from spahr/costumCommandTableExecution into main
Reviewed-on: #61
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2025-11-06 16:24:13 +01:00
spahr@ksat-stuttgart.de 5745d7f01c Changing the function definition to a virtual to allow overrides for custom applications 2025-10-22 23:23:26 +02:00
Jakob Meier d7c1d05599 changelog update 2025-08-03 16:36:19 +02:00
Jakob Meier 86b83810c3 run auto formatter 2025-08-03 16:29:53 +02:00
Jakob Meier d0904fdaa2 added function to set verification reporter of CommandingServiceBase 2025-08-01 08:57:08 +02:00
Jakob Meier f824c066d1 PusServiceBase public functions to change the verifcation reporter and the pus distributor 2025-07-31 16:41:14 +02:00
Jakob Meier d000365b99 PusDistributor public function to change the verifcation reporter 2025-07-31 16:40:34 +02:00
Michael Demke d99f6fd356 typo 2025-06-25 15:22:18 +02:00
muellerr 49eaeae42b Merge pull request 'Adaptions to make shared power lines possible' (#57) from spahr/shared into main
Reviewed-on: #57
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2025-04-28 13:50:31 +02:00
muellerr 7bfc536cf6 Merge branch 'main' into spahr/shared 2025-04-28 13:50:23 +02:00
phoffmann 1da7f7f122 Merge pull request 'Added STOP_DOWNLINK_STORE_CONTENT for Service [15,17]' (#58) from hoffmann/TmStoreMessage into main
Reviewed-on: #58
2025-04-21 19:21:40 +02:00
Philipp Hoffmann aa443e6aa6 Added STOP_DOWNLINK_STORE_CONTENT for Service [15,17] 2025-04-21 17:05:58 +02:00
spahr@ksat-stuttgart.de b13b5b456d Give AssemblyBase more functionality: Support one-by-one commanding for childrend instead of sending all mode messages on one shot 2025-04-14 00:06:34 +02:00
spahr@ksat-stuttgart.de 297ec261ce make the recovery timeout accessable to the user 2025-04-04 10:11:11 +02:00
spahr@ksat-stuttgart.de 95520d7d0c Check if objectId exists in childrednmap first; this will prevent a hardfault 2025-04-02 22:18:31 +02:00
spahr@ksat-stuttgart.de b665b2effe add an adaption point which a user can use to convert a objectId of a shared power switch into a objectId of a device handler 2025-04-02 22:13:50 +02:00
muellerr 7ae58f8125 Merge pull request 'Send HK One Parameter Report back to Sender' (#56) from meier/hk-report-reply-queue into main
Reviewed-on: #56
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2025-04-02 14:04:46 +02:00
muellerr 7784a26a10 Merge branch 'main' into meier/hk-report-reply-queue 2025-04-02 14:04:37 +02:00