Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nonblocking rtt #792

Open
usbalbin opened this issue Nov 1, 2023 · 3 comments
Open

Nonblocking rtt #792

usbalbin opened this issue Nov 1, 2023 · 3 comments

Comments

@usbalbin
Copy link

usbalbin commented Nov 1, 2023

Hi :)

I am using defmt_rtt to log data in a rtic realtime application where there are quite tight timing requirements. The code runs on an stm32g474. I have noticed that sometimes the entire program is frozen for several milliseconds when having the logging active, the problem goes away when disabling the logging. I have tried doing the defmt-stuff (defmt::info!, defmt::error! etc) in the idle task using channels to send the data from the high prio interrupt, but that still locks up everything including the high prio interrupts. Same thing here when disabling logging, everything works fine.

I read in the doc that defmt_rtt will be run in blocking mode. Is there any way to avoid that? I am fine with losing data(I am using it to plot graphs, losing some data points is ok) however it can not under any circumstance lock up the high prio interrupts more than a few µs or chances are the magic smoke will be released (or watchdog timeout).

@usbalbin
Copy link
Author

usbalbin commented Jan 25, 2024

I am happy to give implementing this a go if you think this would be a useful feature and anyone could give some sort of pointers as how/where this should be done.

Sorry if sounding grumpy, I am really happy with defmt in my more normal projects :), but I am having a hard time seeing how to solve my niche use case here. Would some nb::Error::WouldBlock type of API be possible?

And/or having the option of not using defmt in the log-like global way but instead passing around some sort of handle. However I understand if this would not be possible/compatible with how things work today. But then I am not supposed to make a 3rd party crates depending on the defmt for compressing the data either so I can not do that either, right?

@usbalbin
Copy link
Author

I suppose this is also/could be related to #718

@usbalbin
Copy link
Author

usbalbin commented Feb 15, 2024

Related/duplicate of #133?

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

No branches or pull requests

1 participant