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
Implement itm tracing #145
Conversation
…public interface better structured. Also document stuff.
…ed fresh from reset it has an invalid preamble in the romtables; when @widelbouwman's swviewer is connected once it reads properly afterwards. so it seems like we forget to enable something
…ich ties off all debug components to save energy; It is questionable why this should give bogus reads of the romtables
…ng atm (enabling it misses something)
Ensure compilation.
Nice! This worked right away for me with an st-link on an stm32f4 nucleo board, although it kicked up some errors about reading the ROM tables. I don't know if there's some stm32-specific thing to do for that? These errors didn't seem to cause any actual problems.
Forwarding the SWV access through the session object seems sensible to me and the example seems to work nicely with it. I think that user-level API ( The In the ST-link implementation you first request how many bytes are available, and then try to read exactly this many bytes, erroring if you get less. That way if there's no bytes available you can immediately return an empty Vec instead of waiting for data. However at higher data rates this means an extra USB round trip for every transfer which will limit throughput. If we could allow I'm interested in adding DAPlink support. There are two ways DAPlink devices can send SWO data, either polled (host sends "send me at most N bytes of SWO data", device replies "here are M bytes of data" where 0<=M<=N) over either the HID or v2 endpoints, or if the probe supports it, the probe simply streams all SWO data to a dedicated bulk endpoint, which looks to be the same as the ST-link. There is also a command for "how much data do you have?" without transferring the data. I think this should be pretty easy to add to this design. Have you thought about how SWV might work alongside the gdb server? I think it's a similar problem to RTT in that we want two things to access the device at the same time so they might conflict, but with SWV it could be easier, since we're not touching device registers, just reading a data stream. Maybe this can be something for later though. |
Awesome! Well, I am sorry for the errors. It was just a way for me to get the log messages up in the hierarchy and isolate them because the debug & trace logs are kinda cluttered ... should have removed them, sorry.
No, I think I started naming things SWV halfways through the coding ... I am not sure what we should use best. But trace can be ambivalent.
Sound like a great idea to me!
To be honest, I am always against blocking for more sophisticated applications. It doesn't allow for cancellation or similar things. Even when you run on a separate thread. A timeout could work :)
Sounds great!
Yes, actually, I have put a lot of though into that. At the moment the Now the One thing we could do would be using an Not sure my words/thoughts make any sense ... hopefully they do ... |
Ah, I thought they meant something was not working with the STM32, I've heard there are some oddities around reading its ROM tables but I don't really know anything about it.
I'm not really sure either, there are so many options.. I guess trace could also be used for the high-speed parallel tracing one day.
Perhaps: both STlink and the cmsis-dap endpoint-based implementations could call read_bulk with a timeout of 0/nearly 0, so they will immediately return anything waiting in the probe but not otherwise block.
I will read and think about this part tomorrow! |
Ensure everything compiles correctly
Todo:
|
…ad timeout until which the function will block whereas swo_read resolves immediately
…oll of the buffer size
This commit updates the probe-side `SwoAccess` trait to add new enable and disable methods, including configuration on enable to allow specifying clock rates and mode. The higher-level methods for enabling SWV from a Session are renamed and refactored to also use the new configuration methods.
…export from mod.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we go!
Here goes nothing! |
145: README.md: add troubleshooting section r=jonas-schievink a=Lotterleben prompted by knurling-rs/probe-run#144 : add a troubleshooting section that explains what to look for on your board in order to be able to use `probe-run`. while we're at it, also adds a section about udev rules as a band-aid for probe-rs#357 . Co-authored-by: Lotte Steenbrink <lotte.steenbrink@ferrous-systems.com> Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
No description provided.