Skip to content

S08.03 slice 8: meta SD wiring + FreeRtosSysUpTime adapter for FreeRTOS example #310

Description

@DavidCozens

Parent epic: #268

Scope

Wire the meta SD-ELEMENT (sequenceId + sysUpTime + language) into Example/FreeRtos/SingleTask/main.c and untag structured_data.feature from the FreeRTOS BDD sweep.

Slice 7 (#308) wired the first SD-ELEMENT — Origin — landing 4 of 5 origin scenarios. Slice 8 adds the meta SD's three callbacks; slice 9 will follow with the timeQuality SD which untags time_quality.feature and the remaining origin.feature::All standard structured data present scenario.

Deliverables

  • New Platform/FreeRtos/Interface/SolidSyslogFreeRtosSysUpTime.h + Platform/FreeRtos/Source/SolidSyslogFreeRtosSysUpTime.c mirroring the Posix/Windows shape: SolidSyslogFreeRtosSysUpTime_Get returns uint32_t hundredths-since-boot, wraps per RFC 3418 TimeTicks. Backed by xTaskGetTickCount() × 100 / configTICK_RATE_HZ.
  • Switch Example/FreeRtos/SingleTask/FreeRTOSConfig.h to configTICK_TYPE_WIDTH_IN_BITS = TICK_TYPE_WIDTH_64_BITS so the multiplication cannot intermediate-overflow at any sane tick rate. (Existing tick consumers in main.c already cast to uint32_t explicitly — transparent.)
  • Host-TDD: new Tests/Platform/FreeRtos/SolidSyslogFreeRtosSysUpTimeTest.cpp against a stubbable xTaskGetTickCount seam, mirroring the slice-4 datagram test layout.
  • Wire SolidSyslogStdAtomicOps_CreateSolidSyslogAtomicCounter_CreateSolidSyslogMetaSd_Create into InteractiveTask alongside the slice-7 originSd. Reuse Example/Common/ExampleLanguage.c (ExampleLanguage_Get callback emitting en-GB, matching the Linux/Windows examples).
  • Add Example/Common/ExampleLanguage.c to the FreeRTOS source list (one CMakeLists line).
  • Update CLAUDE.md "Public header audiences" with a new row for SolidSyslogFreeRtosSysUpTime.h.

Atomic ops choice — StdAtomicOps

The cross toolchain already compiles SolidSyslogStdAtomicOps.c for Cortex-M3 (build/freertos-cross/.../SolidSyslogStdAtomicOps.c.obj). On Cortex-M3 + Thumb-2, _Atomic uint32_t lowers to inline LDREX/STREX with no libatomic runtime needed, and the SolidSyslog counter is incremented only inside SolidSyslog_Log — task context only on this single-task example, never from an ISR. The ARM exclusive monitor is sufficient. No new platform adapter needed; if linkage fails (unlikely) we fall back to a SolidSyslogFreeRtosAtomicOps wrapping taskENTER_CRITICAL / taskEXIT_CRITICAL.

Acceptance — BDD untag scope

  • structured_data.feature — untag at feature level. All 3 scenarios (sequenceId 1, sequential sequenceId, sysUpTime + language) pass.

time_quality.feature stays tagged: both scenarios assert tzKnown (timeQuality SD — slice 9). origin.feature::All standard structured data present stays tagged: needs sequenceId + tzKnown together.

Expected after slice 8: FreeRTOS BDD sweep at 6 features / 17 scenarios (slice-7 baseline 5 / 14).

Local pre-PR

  • cmake --build --preset freertos-cross --target SolidSyslogFreeRtosSingleTask clean
  • behave --tags='not @wip and not @freertoswip and @udp' Bdd/features/structured_data.feature Bdd/features/origin.feature Bdd/features/time_quality.feature
  • Linux unit tests including the new SolidSyslogFreeRtosSysUpTimeTest
  • clang-format --dry-run --Werror on touched C files
  • cppcheck / tidy / iwyu / sanitize / coverage: CI's responsibility per established precedent

Out of scope

  • timeQuality SD (separate slice).
  • The udp_mtu.feature::Oversize scenario — UDP path-MTU EMSGSIZE on FreeRTOS-Plus-TCP, its own slice.
  • CMake-driven memory scaling for the interactive-task stack (already deferred).
  • Real-IP enumeration via FreeRTOS_GetEndPoints (deferred to S08.03 close — see DEVLOG slice 7).

Metadata

Metadata

Assignees

No one assigned

    Labels

    storyStory issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions