cortex-debug icon indicating copy to clipboard operation
cortex-debug copied to clipboard

Allow printing defmt output to the RTT console

Open xoviat opened this issue 2 years ago • 12 comments

defmt is widely used as a logger in the rust embedded ecosystem. This allows seamlessly debugging a rust program while printing defmt output at the same time.

xoviat avatar May 17 '23 02:05 xoviat

Oh, and defmt-print must be installed for this to work. Maybe add a tooltip for that?

xoviat avatar May 17 '23 02:05 xoviat

@haneefdm Do you have questions about this?

xoviat avatar May 25 '23 01:05 xoviat

Thank you for the PR and I agree it will be very useful for Rust developers Before I look at it, I have a request. I need an example project available on github for me to begin looking at it.

It will be my test case as well. Your github example project should be ready to run with minimal effort on my part (preferably on a Mac). I cannot accept what I cannot test. I am not Rust-educated either.

I you can also update the source code to add a reference to the example github then that would be nice.

Sorry, it took me a long time to get to it. Personal health reasons.

haneefdm avatar Sep 01 '23 20:09 haneefdm

I lied. I did a cursory review. I don't know what is going on with the executable in the RTTConfigureEvent.

And, then in the constructor of the DefmtSocketRTTSource, you are trying to re-resolve the executable. How can we be assured that the debugger and the RTT decoder is looking at the same executable? Do you need help from the debugger?

Also, I think that the executable property in launch.json is optional if you have the symbolFiles property.

haneefdm avatar Sep 01 '23 21:09 haneefdm

I'll get back to this in a few days. I need to refresh my memory after taking care of some other stuff.

xoviat avatar Sep 03 '23 03:09 xoviat

Any updates? I got the same problem, cortex-debug cannot print defmt's RTT log

HaoboGu avatar Jan 23 '24 12:01 HaoboGu

Installed extension from this PR, everything works perfectly, except vscode does not hint to set defmt as type option in rttConfig.decoders. @Marus Any chance to see this changes in master? 💌

hazer-hazer avatar Mar 05 '24 13:03 hazer-hazer

@xoviat I am still waiting for the PRs original author.

haneefdm avatar Jul 06 '24 00:07 haneefdm