Skip to content

Implement logging to LFS #2076

Open
MaxineMuster wants to merge 12 commits intoopenshwprojects:mainfrom
MaxineMuster:log2lfs
Open

Implement logging to LFS #2076
MaxineMuster wants to merge 12 commits intoopenshwprojects:mainfrom
MaxineMuster:log2lfs

Conversation

@MaxineMuster
Copy link
Copy Markdown
Contributor

Implement logging to LFS feature with two commands:

logStartup2lfs [seconds- default 10]   Enable writing startup log to lfs for this number of seconds - on every start(!).
       Disable with logStartup2lfs 0
log2lfs [seconds - default 10]      write messages to LFS for this number of seconds.
       Might be stopped before by calling log2lfs 0

For now only tested on W800 and Linux simulator

Enabled for testing on all platform using LFS

logStartup2lfs [seconds- default 10]    Enable writing startup log to lfs for this number of seconds - on every start(!). Disable with "logStartup2lfs 0"
log2lfs [seconds - default 10]		write messages to LFS for this number of seconds. Might be stopped before by calling "log2lfs 0"

For now only tested on W800 and Linux simulator
@MaxineMuster
Copy link
Copy Markdown
Contributor Author

MaxineMuster commented Apr 5, 2026

Bildschirmfoto Bildschirmfoto

MaxineMuster and others added 11 commits April 13, 2026 07:13
Building for simulator showed some strange errors - seems CFG is not equal on all platforms.
Added some comments to point this out

Added repeat counter for log2lfs - default is logging only once

Completed testing for config in win_main
Added same test for other platforms (if enabled) - needs several ifs for the diferent platforms
…tches)

Force 20 second logging on Simulator

small improvements (no need for log2lfs_end if only startup loggin is used
Try removing local change to new_common.[ch] - conflicting types for strcasestr
Don't use log2lfs in simulator testing - SIM_ClearOBK will remove lfs
@NonPIayerCharacter
Copy link
Copy Markdown
Contributor

Must Linux be 32-bit? We just got rid of apt-get's from workflows.

@MaxineMuster
Copy link
Copy Markdown
Contributor Author

It's definitely not a "must".

I mistakenly assumed my change had caused the error messages about "incorrect offsets" in mainConfig_t, but later learned, the issue was not my change but present for some time and resulting from the 64-bit compiler, which uses larger types, more bytes and larger alignment/padding.

You can work around this by using fixed 4‑byte types (which would require several #if/#else branches), or (my approach) by building as 32‑bit, which requires additional libraries.

For the GitHub build it doesn't matter at all — the config for test ruuns is always "empty" at startup and filled with defaults — you could simply omit the tests to avoid the "confusion".

For a locally compiled simulator it also doesn't really matter — I still haven't succeeded in making a "restart", so the config can never actually be used there either.

I'll split this off — just log2lfs in this PR, with no changes to the Linux simulator.

this "issue" can be discussed maybe in another PR.

Side note — it might be more sensible to revise the "mainConfig_t" structure to make offsets consistent, e.g. by standardizing padding after the pin fields (which vary by MCU) or using a uniform "maximum" pins structure. I tried to add comments showing the actual situation with "shifted" offsets and a general possibility to run the test also on other platforms, not only Linux/Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants