<re_irc>
<thebutlah> what is the difference between "probe-run" and "cargo flash"?
<re_irc>
<therealprof> thebutlah: cargo-flash only flashes the binary and doesn't deal with the system after that at all. probe-run flashes the binary and attaches to the system, watching and displaying any output coming via rtt and printing panics.
<re_irc>
<thebutlah> in that case, what is the difference between "probe-run" and "cargo embed"?
<re_irc>
<therealprof> "probe-run" is a fire and forget type of affair: flash the binary, attach to the target. "cargo embed" provides more tooling and integration with IDEs/debuggers.
<re_irc>
<therealprof> I don't use debuggers unless I can't avoid it and I don't like setup so I can't really tell you that much about "cargo embed".
GenTooMan has quit [Ping timeout: 268 seconds]
GenTooMan has joined #rust-embedded
<re_irc>
<adamgreig> "cargo embed" is used a bit differently, in that you can configure it with a "Embed.toml" or your "Cargo.toml" and it runs as a cargo subcommand (you can do "cargo embed --release --features bla" etc)
<re_irc>
<adamgreig> "probe run" is a runner you set in your .cargo/config.toml, then you use "cargo run" to execute it
<re_irc>
<adamgreig> both do RTT and defmt if you want, "cargo embed" has a slightly different user interface (more compact display, logs to a file as well as the screen, uses curses to do a scrolling interface with multiple tabs for each RTT channel)
<re_irc>
<adamgreig> probe-run is maintained by knurling, separately from the probe-rs team, so it sometimes/often has an older version of the probe-rs library, not sure if that's currently the case
<re_irc>
<adamgreig> (but both cargo-embed and probe-run use the probe-rs library to talk to debug probes and microcontrollers etc)
<re_irc>
<boondocker> The default riscv32i target should work for you. The config you’re showing enables +m and +a which would enable the multiplier and atomic extensions
<re_irc>
<laizy> boondocker: but some dependencies use atomics, if i do not enable +a, it can not compile.
<re_irc>
<boondocker> laizy: Then you’ll have to emulate them. See the trap handler emulation above
<re_irc>
<laizy> mabez: boondocker Thank you for the link! I have tried to emulate them by myself, but do not known how to implement LR/SC. I find the link code just use 1 slot to reserve address, is this implementation meet the requirements of the specification?
<re_irc>
<James Munns> We got 8 submissions for the Final Friday showcase, the first one is up, the next seven are going up at :30 past the hour for the rest of the day :)
<re_irc>
<James Munns> If anyone is now having FOMO and wants to share their project, I can add it to the queue if you get it to me (or DM the rustembedded twitter) in the next few hours :D
<re_irc>
<Mehmet Ali> Hi all, does defmt default to the terminal?
<re_irc>
<Mehmet Ali> If I omit defmt-rtt, would it work like println?
<re_irc>
<James Munns> So, defmt logs to a global source. You need to provide one. Typically, people use RTT, which uses the debugger to read from that global source and print to your desktop
<re_irc>
<James Munns> you can provide a DIFFERENT global option, but it wouldn't "fall back" to anything if you just removed defmt-rtt.
<re_irc>
<James Munns> You could use https://github.com/gauteh/defmt-serial, or https://github.com/jamesmunns/defmt-bbq/, but the output would still be in the "compressed" defmt protocol, so you'd need something to decode it. e.g. you couldn't just print it to a UART and read it directly (without piping it through a decoder program/library)
brazuca has quit [Ping timeout: 252 seconds]
<re_irc>
<Mehmet Ali> Ahh, I see.
<re_irc>
<Mehmet Ali> Thanks, Jame
<re_irc>
<Mehmet Ali> * James
<re_irc>
<Mehmet Ali> I am actually following the testing embedded apps project structure
<re_irc>
<Mehmet Ali> So, I have a cross compiled crate in the workspace which I flash
<re_irc>
<Mehmet Ali> There are also other crates that the cross compiled imports
<re_irc>
<Mehmet Ali> * depends.
<re_irc>
<Mehmet Ali> +in my workspace
<re_irc>
<Mehmet Ali> That makes those other crates testable on the dev machine.
<re_irc>
<Mehmet Ali> Like "messages" crate in that blog post.
brazuca has joined #rust-embedded
<re_irc>
<Mehmet Ali> I was wondering whether if I use defmt in those crates I can still be able to "read" the messages, say in tests.
<re_irc>
<Mehmet Ali> Or whether those packages can emit the messages when compiled within the cross compiled project
<re_irc>
<Mehmet Ali> Well, maybe this requires a feature gate.
<re_irc>
<Mehmet Ali> like log deferred and not
<re_irc>
<James Munns> Yeah, defmt (afaik) doesn't work on "desktop" targets
<re_irc>
<James Munns> I know embassy (and smoltcp) have a feature flag that switches between the "log" crate and "defmt" for off/on embedded targets
<re_irc>
<Mehmet Ali> Ah, let me check how they have implemented.
<re_irc>
<Mehmet Ali> Thanks!
<re_irc>
<James Munns> Yeah! IIRC it's a boilerplate macro that just forwards the call to the right lib. The challenge is you are limited to the formatting that works in both.
<cr1901>
>mabez: I don't think single thread helps if CAS is involved <-- I'm trying to catch up on scrollback. What's the context to this msg? I don't see anything about CAS in surrounding messages (and I thought RV used LL/SC)
<re_irc>
<mabez> cr1901: because afaik single thread only helps with load/stores, also the error posted after mentions "__atomic_fetch_add_4" implying one of the libraries used was using cas
<cr1901>
ahhh
<cr1901>
Also, TIL that singlethreaded must _not_ be set if your target has interrupts (which makes sense after reading, but I was under the impression that singlethreaded was a euphemism only for "not multicore capable")
<cr1901>
>I have no native atomic operations, but I can emulate them myself <-- yea, it annoys me that libatomic in gcc has absolutely no support for bare metal envs, so you'll get those lovely __sync_ or __atomic builtins as part of codegen and the linker will tell you to go screw yourself
<cr1901>
I didn't know there was _any_ support in Rust for them, since atomics in std have to be lock free (and libatomic is not necessarily)