ChanServ changed the topic of #rust-embedded to: Welcome to the Rust Embedded IRC channel! Bridged to #rust-embedded:matrix.org and logged at https://libera.irclog.whitequark.org/rust-embedded, code of conduct at https://www.rust-lang.org/conduct.html
fabic_ has quit [Ping timeout: 268 seconds]
IlPalazzo-ojiisa has quit [Quit: Leaving.]
starblue has quit [Ping timeout: 255 seconds]
starblue has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
lehmrob has joined #rust-embedded
corecode has quit [*.net *.split]
corecode has joined #rust-embedded
starblue has quit [Ping timeout: 248 seconds]
starblue has joined #rust-embedded
Ekho- has joined #rust-embedded
rektide_ has joined #rust-embedded
WSalmon__ has joined #rust-embedded
a2800276 has joined #rust-embedded
IlPalazzo-ojiisa has quit [*.net *.split]
WSalmon has quit [*.net *.split]
a2800276_ has quit [*.net *.split]
Rahix has quit [*.net *.split]
rektide has quit [*.net *.split]
Lumpio- has quit [*.net *.split]
Ekho has quit [*.net *.split]
Rahix has joined #rust-embedded
fabic_ has joined #rust-embedded
Lumpio- has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
lehmrob has quit [Ping timeout: 252 seconds]
lehmrob has joined #rust-embedded
dc740 has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
dc740 has joined #rust-embedded
emerent has quit [Ping timeout: 248 seconds]
emerent has joined #rust-embedded
brazuca has joined #rust-embedded
fabic_ has quit [Ping timeout: 246 seconds]
brazuca has quit [Quit: Client closed]
Foxyloxy has joined #rust-embedded
Foxyloxy_ has quit [Ping timeout: 265 seconds]
emerent has quit [Remote host closed the connection]
emerent has joined #rust-embedded
Ekho- is now known as Ekho
brazuca has joined #rust-embedded
lehmrob has quit [Quit: Konversation terminated!]
brazuca has quit [Quit: Client closed]
IlPalazzo-ojiisa has quit [Quit: Leaving.]
IlPalazzo-ojiisa has joined #rust-embedded
re_irc has quit [Remote host closed the connection]
re_irc has joined #rust-embedded
<agg> and we're back
<re_irc> < (@stephen:crabsin.space)> Yeah that's the issue I have with freecad
<re_irc> < (@stephen:crabsin.space)> I want to do X, I find a very janky way to do it, but it's really bad
<re_irc> < (@charles:computer.surgery)> You're just expected to figure it out
<re_irc> < (@firefrommoonlight:matrix.org)> : I have a GUI dashboard for one of m yprojects where you plug it in by USB, and a PC program tells you which systems/sensors are working. QSPI flash is actually on there lol
<re_irc> < (@charles:computer.surgery)> (The answer is do everything in partdesign)
<re_irc> < (@stephen:crabsin.space)> Also when I make a change to something old I find I have to redo a ton of stuff because freecad is bad at resolving the things that happened since then (which may just be due to my janky workflow)
<re_irc> < (@charles:computer.surgery)> : Yeah this really depends on your workflow. Making stuff with only partdesign I don't have this problem _too much_
<re_irc> < (@grantm11235:matrix.org)> For simple parts, I like to use openscad
<re_irc> < (@charles:computer.surgery)> i wish i had the brainpower for cad-as-code tools
<re_irc> < (@jamesmunns:beeper.com)> I'm just waiting for 's fornjot to be a thing: https://www.fornjot.app/
<agg> SSL cert failed to autorenew.. or to tell me about it? annoying
<re_irc> < (@jamesmunns:beeper.com)> (to be clear, it IS a think, and the demos are very cool, but it is also very much a WIP, from what I've seen)
<re_irc> < (@bugadani:matrix.org)> until it is, openscad worked pretty well to me
<re_irc> < (@jamesmunns:beeper.com)> * thing,
<re_irc> < (@charles:computer.surgery)> I like how the readme says "expect to run into roadblocks pretty much immediately. If you want to actually use this, come back in a year or ten" (paraphrased)
<re_irc> < (@charles:computer.surgery)> Hope they can stick with it because it would be really awesome
<re_irc> < (@jamesmunns:beeper.com)> I have a lot of respect for people willing to start five (or ten) year fights :)
<re_irc> < (@charles:computer.surgery)> Yep
<re_irc> < (@jamesmunns:beeper.com)> all of rust embedded wasn't "a thing" five years ago.
<re_irc> < (@charles:computer.surgery)> You could like, kind of do stuff
<re_irc> < (@charles:computer.surgery)> But yeah it's really great now, the tools and software support are way way better now
<re_irc> < (@hanno:braun-odw.eu)> : Gotta wait a while longer. It's... a lot of work 😄
<re_irc> < (@jamesmunns:beeper.com)> hah, Feb 15th 2018 (two days from now!) is when Jorge invited me to join the embedded wg :D
<re_irc> < (@jamesmunns:beeper.com)> so preeeeeetty close to 5 years exactly now :D
<re_irc> < (@charles:computer.surgery)> Wow lol, nice
<re_irc> < (@jamesmunns:beeper.com)> oh j/k, feb 14th, so tomorrow is five years lol
<re_irc> < (@stephen:crabsin.space)> valentine's day embedded work (:
<re_irc> < (@jamesmunns:beeper.com)> pebble folks were doing _something_ in 2014: https://github.com/franc0is/RustyPebble
<re_irc> < (@adamgreig:matrix.org)> look at this nonsense lol https://gist.github.com/adamgreig/b47fe9159e721e368601#file-test_rust-rs
<re_irc> < (@adamgreig:matrix.org)> at least it still looks like rust
<re_irc> < (@jamesmunns:beeper.com)> yeah, it was certainly A Thing back in those days.
<re_irc> < (@adamgreig:matrix.org)> the 2013 era rust stuff with all the wild pointer types and stuff
<re_irc> < (@adamgreig:matrix.org)> somewhere i still have some 2013 rust code but i think it's on a long lost hard drive from phd days...
<re_irc> < (@jamesmunns:beeper.com)> back in the days when zinc-rs was the new hotness: https://github.com/hackndev/zinc
<re_irc> < (@adamgreig:matrix.org)> ten years ago _
<re_irc> < (@adamgreig:matrix.org)> RIP zinc
<re_irc> < (@adamgreig:matrix.org)> man, zinc was really exciting
<re_irc> < (@charles:computer.surgery)> : "just used for critical error handling" lol
<re_irc> < (@jamesmunns:beeper.com)> "back in my day, we had to walk uphills both ways to write a panic handler"
<re_irc> < (@adamgreig:matrix.org)> surprised that "loop {}" didn't get miscompiled tbh
<re_irc> < (@adamgreig:matrix.org)> probably it did and I just didn't panic...
<re_irc> < (@jamesmunns:beeper.com)> lol
<re_irc> < (@dirbaio:matrix.org)> ah, stm32, requiring cursed code generation since forever
<re_irc> < (@adamgreig:matrix.org)> zinc had a whole platform tree sort of thing going on
<re_irc> < (@jamesmunns:beeper.com)> "what the hell is this? is it a macro? where is the... (sees the .rb extension)... oh.
<re_irc> < (@jamesmunns:beeper.com)> * oh."
<re_irc> < (@bugadani:matrix.org)> : undefined behaviour is so undefined, it can result in actually something correct sometimes
<re_irc> < (@adamgreig:matrix.org)> when the planets align
<re_irc> < (@adamgreig:matrix.org)> and your stack is aligned...
<re_irc> < (@bugadani:matrix.org)> I'm having nightmares today from the word "aligned"
<re_irc> < (@jamesmunns:beeper.com)> THATS A MISCOMP
<re_irc> < (@stephen:crabsin.space)> > sees the rb extension
<re_irc> happy.jpg
<re_irc> > not ruby code
<re_irc> sad.jpg
<re_irc> < (@adamgreig:matrix.org)> anyway I'm finally at my computer for the evening so time to do something about that misaligned stack
<re_irc> < (@jamesmunns:beeper.com)> oh hey yeah your turn lol
<re_irc> < (@adamgreig:matrix.org)> how do people feel about just deleting the lr handling now vs putting the extra push in now and deleting lr later once probe-run has a chance to change something?
<re_irc> < (@adamgreig:matrix.org)> I've got some more research to do this evening but it seems like we can get a release out today
<re_irc> < (@jamesmunns:beeper.com)> weeeeeak preference to the previous plan (merge as-is, put probe-run on notice, yeet the push entirely later)
<re_irc> < (@adamgreig:matrix.org)> if it actually _broke_ probe-run i'd not consider it
<re_irc> < (@adamgreig:matrix.org)> but since it's just a warning without functional impact i'm considering it a little bit
<re_irc> < (@jamesmunns:beeper.com)> yeah, it won't _break_, just be noisy
<re_irc> < (@jamesmunns:beeper.com)> but I don't want people to revert to 0.7.2 "because the warning goes away"
<re_irc> < (@adamgreig:matrix.org)> but it's not like it's a huge impact to have an extra word on the stack until the next cmrt release either, so
<re_irc> < (@adamgreig:matrix.org)> I'm defo yanking 0.7.2 once 0.7.3 is out anyway though
<re_irc> < (@jamesmunns:beeper.com)> squeaky wheels get greased. a probe-run warning is more visible than a silent miscomp
<re_irc> < (@adamgreig:matrix.org)> are any of the knurling people here?
<re_irc> < (@adamgreig:matrix.org)> yea, I think there's a chance if we do "something now, something else later" then the problem just happens the same a month down the road
<re_irc> < (@jamesmunns:beeper.com)> jorge isn't jonas isn't and doesn't work on it now, honestly not sure if any of them are.
<re_irc> < (@jamesmunns:beeper.com)> well, is :D
<re_irc> < (@jamesmunns:beeper.com)> dunno what his involvement is with probe-run, but he sits closer to them (metaphorically)
<re_irc> < (@jamesmunns:beeper.com)> "we did our best to warn" is reasonable imo
<re_irc> < (@jamesmunns:beeper.com)> brb, gotta walk the dog
<re_irc> < (@thejpster:matrix.org)> Can you raise a ticket? Johann looks at those - he’s the Knurling maintainer.
<re_irc> < (@thejpster:matrix.org)> Also Jonas doesn’t work for us any more.
<re_irc> < (@thejpster:matrix.org)> Down to 4 Js from 5.
<re_irc> < (@adamgreig:matrix.org)> still a pretty solid number of Js!
<re_irc> < (@thejpster:matrix.org)> It’s a high ratio for sure.
<re_irc> < (@dngrs:matrix.org)> who needs six sigma when you can have six ... hmm. iota? ypsilon?
<re_irc> < (@jamesmunns:beeper.com)> : it's a shame we never overlapped, it would have been six!
<re_irc> < (@jamesmunns:beeper.com)> : you can't guarantee results, but 1mo notice is polite imo.
<re_irc> < (@jamesmunns:beeper.com)> : I'll make this ticket now. CC
<re_irc> < (@jamesmunns:beeper.com)> is the irc bridge working? the logs from today seem to be missing: https://libera.irclog.whitequark.org/rust-embedded/2023-02-13
<re_irc> < (@jamesmunns:beeper.com)> I can ping whitequark to see if it's on the logger's end, is cr1901 around to confirm?
<re_irc> < (@adamgreig:matrix.org)> no, looks like it cut out at 2218 yesterday
<re_irc> < (@jamesmunns:beeper.com)> what a day to take a nap :D
<re_irc> < (@jamesmunns:beeper.com)> hello irc! I've missed you all so much.
IlPalazzo-ojiisa has quit [Quit: Leaving.]
<re_irc> < (@jamesmunns:beeper.com)> https://github.com/knurling-rs/probe-run/issues/382
<re_irc> < (@jamesmunns:beeper.com)> hey , does "cargo-embed" do any stack unwinding?
<re_irc> < (@dirbaio:matrix.org)> no, but probe-rs-debugger does
<re_irc> < (@yatekii:matrix.org)> : nope, not yet :)
<re_irc> < (@dirbaio:matrix.org)> also "probe-rs-cli debug", has the "bt" command
<re_irc> < (@jamesmunns:beeper.com)> it might be good to test p-rs-debugger (and the "not yet" part) with https://github.com/rust-embedded/cortex-m/pull/463 to make sure things still work good
<cr1901> I can see msgs just fine
<re_irc> < (@jamesmunns:beeper.com)> cr1901 there were... a lot of messages today, did you see all those? or was it a quiet day?
<cr1901> quiet day
<re_irc> < (@adamgreig:matrix.org)> irc side was quiet from 2218 utc yesterday until i booped the bridge just now
<re_irc> < (@jamesmunns:beeper.com)> cr1901 aw man, you missed a good one (e.g. a lot of me being very bad at asm for a very long time)
<cr1901> I'm sure there will be other opportunities :)
<re_irc> < (@jamesmunns:beeper.com)> gotta write an all-asm forth one of these days
<cr1901> postcard-infomem release is delayed by "holy shit I don't feel like writing docs"
<cr1901> "My God, that's a lot of docs"
<cr1901> "What the hell was I thinking, making so much stuff user overridable to account for edge cases" amount of docs
<re_irc> < (@jamesmunns:beeper.com)> hey uh, are there any folks here who:
<re_irc> - know rust (really well)
<re_irc> - know cortex-m (really well)
<re_irc> - know asm (really well)
<re_irc> < (@jamesmunns:beeper.com)> It would be good to have an audit to catch things like this before we go 1.0, and it seems we have a lot of folks that have time, or are good at asm, but not both, and it would probably be good to have someone have a reasonable amount of time to sit down, look at things, fix any problems, and add docs/citations to make sure things like this don't happen again.
<re_irc> < (@jamesmunns:beeper.com)> I don't have like, "throw down a ton of cash" money for it (just a solo consultant here), but I also would be willing to do the legwork to try and find some other folks to help bankroll it if we find someone who can help
<re_irc> < (@jamesmunns:beeper.com)> (this is james wearing his "crazy ideas" hat, not an officially wg-approved position)
<re_irc> < (@adamgreig:matrix.org)> and then we can _never accept any more PRs to link.x or the startup code again_ lol
<re_irc> < (@adamgreig:matrix.org)> which tbh we are already converging on, given the hit rate
<re_irc> < (@jamesmunns:beeper.com)> Hey (slash Amanieu), are you around (and does the above apply to you, or do you have someone to recommend?)
<re_irc> < (@jamesmunns:beeper.com)> Anyway, if that vibes with anyone, feel free to send me a dm, or an email at: james at onevariable dot com, and I'll do my best to see if we can make it happen.
<re_irc> < (@adamgreig:matrix.org)> lol. rust is using LR as a scratch register for the number of cycles to delay in my call to cortex_m::asm::delay, and gdb and probe-run are both very confused about what frame exists at address 4_000_001
<re_irc> < (@adamgreig:matrix.org)> so much for all this unwinding business
<re_irc> < (@adamgreig:matrix.org)> (it's totally allowed to use lr for whatever in a leaf function, so...)
<re_irc> < (@jamesmunns:beeper.com)> itsfreerealestate.gif
<re_irc> < (@adamgreig:matrix.org)> maybe we're worrying too much about unwinding given this is legit lmao
<re_irc> < (@adamgreig:matrix.org)> just hopeless
<re_irc> < (@jamesmunns:beeper.com)> tbh it's nice when it works
<re_irc> < (@jamesmunns:beeper.com)> and i'm less worried about frame pointers/stack unwinding than I am about other subtle startup things :p
<re_irc> < (@adamgreig:matrix.org)> oh yea, don't worry, I was just amused at my test case suddenly failing for a completely unrelated reason
<re_irc> < (@adamgreig:matrix.org)> I suppose we could push lr to the stack before calling pre_init so that unwinding works there, but perhaps not worth changing righ tnow
<re_irc> < (@jamesmunns:beeper.com)> I _think_ stack frames are callee-pushed, so if you don't, it will look like you are still in reset. Do you mean before calling user pre-init?
<re_irc> < (@adamgreig:matrix.org)> we "bl" to pre_init
<re_irc> < (@jamesmunns:beeper.com)> like shove the function prelude before the "bl pre_init", then shove the post-lude afterwards?
<re_irc> < (@jamesmunns:beeper.com)> yeah, that updates the lr, but doesn't push the lr+fp to the stack
<re_irc> < (@jamesmunns:beeper.com)> we hard-reset the lr after pre-init
<re_irc> < (@adamgreig:matrix.org)> yea, I'm saying we could move pushing lr+fp from before-main to before-pre-init
<re_irc> < (@jamesmunns:beeper.com)> yeah, we could build the fake frame before calling pre init
<re_irc> < (@jamesmunns:beeper.com)> if you abort/panic in pre-init, everything is going to be terrible anyway lol
<re_irc> < (@jamesmunns:beeper.com)> you can't really "panic", all you can do is udf/bkpt, I guess
<re_irc> < (@jamesmunns:beeper.com)> panic implies rust, which doesn't really "exist" yet in pre_init lol
<re_irc> < (@jamesmunns:beeper.com)> ohhh we still let people write pre_init in rust tho today, don't we
<re_irc> < (@jamesmunns:beeper.com)> that's super ub lol
<re_irc> < (@dirbaio:matrix.org)> ¯\_(ツ)_/¯
<re_irc> < (@dirbaio:matrix.org)> * "¯\_(ツ)_/¯"
<re_irc> < (@adamgreig:matrix.org)> ub... "useful behaviour"?
dc740 has quit [Remote host closed the connection]
<re_irc> < (@adamgreig:matrix.org)> but anyway you can absolutely set a breakpoint inside pre_init, in asm or rust, from your debugger/IDE, and expect to stop at it and then look at a backtrace, right?
<re_irc> < (@dirbaio:matrix.org)> honestly I agree with the "it's hopeless" argument a lot 😅
<re_irc> < (@dirbaio:matrix.org)> cmrt shouldn't have to workaround bugs in unwinders
<re_irc> < (@adamgreig:matrix.org)> did you get the ".cfi_offset lr" value to do much of anything ?
<re_irc> < (@adamgreig:matrix.org)> gdb doesn't seem to care...
<re_irc> < (@dirbaio:matrix.org)> i'd remove the cfi stuff and the fake frame
<re_irc> < (@adamgreig:matrix.org)> now, or with a month grace for probe-run to do something different?
<re_irc> < (@jamesmunns:beeper.com)> : so part of why I think gdb doesn't care:
<re_irc> < (@jamesmunns:beeper.com)> we push u32::max twice
<re_irc> < (@dirbaio:matrix.org)> leaving the cfi directives might be wrong I think, if it's not a well-formed call frame
<re_irc> < (@dirbaio:matrix.org)> have you guys tested what happens with no ".cfi" and no fake frame?
<re_irc> < (@adamgreig:matrix.org)> yea
<re_irc> < (@jamesmunns:beeper.com)> which means lr 8: ignore both, gdb ends before the fake frame. lr 4: it looks at the u32::MAX "lr" we pushed. lr 0: it looks at the u32::MAX "fp" we pushed.
<re_irc> < (@adamgreig:matrix.org)> probe-run is sad, gdb doesn't care
<re_irc> < (@adamgreig:matrix.org)> gdb usually stops at the main trampoline anyway
<re_irc> < (@jamesmunns:beeper.com)> yeah, you need the "bt -past-main on" directive
<re_irc> < (@adamgreig:matrix.org)> : yea, but I'm doing like "lr 128" and it still 🤷
<re_irc> < (@dirbaio:matrix.org)> : so.. perhaps now?
<re_irc> < (@jamesmunns:beeper.com)> : I mean that only works IF there is some value on the stack, 128 bytes after the base addres
<re_irc> < (@dirbaio:matrix.org)> it's only probe-run, and it's only a scary message appended to the backtrace, the tool is still perfectly functional
<re_irc> < (@adamgreig:matrix.org)> any of the rest of the cortex-m team have opinions? , , , ?
<re_irc> < (@jamesmunns:beeper.com)> it's _probably_ zero in your runs, and gdb just says "fuck that"
<re_irc> < (@jamesmunns:beeper.com)> my vote is still "just merge dirbaios pr, maybe put sp in r7 if you are feeling kind". but also not on the c-m team :)
<re_irc> < (@dirbaio:matrix.org)> then probe-run will never get fixed, and everyone will waste 8 bytes of ram and a few bytes of flash forever :)
<re_irc> < (@jamesmunns:beeper.com)> or: people use wrong versions of c-m-rt to avoid the scary probe-run warnings.
<re_irc> < (@adamgreig:matrix.org)> how? we're yanking the bad versions
<re_irc> < (@jamesmunns:beeper.com)> : there's a lot of projects with lock files out there
<re_irc> < (@adamgreig:matrix.org)> so either they use 0.7.0 and no bug or warnings, or 0.7.3 and no bug but probe-run warnings
<re_irc> < (@adamgreig:matrix.org)> yea, but by the time they get the warning they've already upgraded?
<re_irc> < (@dirbaio:matrix.org)> the scary message is printed at the bottom of the backtrace, you still get the backtrace fine
<re_irc> < (@jamesmunns:beeper.com)> revert: get rid of scary warnings introduce by pr#123
<re_irc> < (@adamgreig:matrix.org)> fwiw even with "cfi_offset lr" set to a specific random bad value on the stack, gdb still doesn't seem to do anything different at all
<re_irc> < (@jamesmunns:beeper.com)> I don't honestly know if gdb even looks at that. but probe-run does.
<re_irc> < (@jamesmunns:beeper.com)> (i'd bet we have more probe-run users than gdb users out there)
<re_irc> < (@adamgreig:matrix.org)> ah yea, probe-run does indeed check it
<re_irc> < (@jamesmunns:beeper.com)> IF you want to change it, the warning for totally eliding that chunk isn't so bad, just a little "WARN" at the end of probe-run
<re_irc> < (@dirbaio:matrix.org)> there's still many many cases where probe-run backtrace explodes, and much more spectacularly
<re_irc> < (@jamesmunns:beeper.com)> but still, we've tested the current PR, it works, it's not perfect, but it does work
<re_irc> < (@dirbaio:matrix.org)> calls thorugh C frames, trustzone...
<re_irc> < (@jamesmunns:beeper.com)> anyway, not gunna die on this hill, and honestly I'm working entirely from facts I think I have learned correctly today
<re_irc> < (@jamesmunns:beeper.com)> i'll take ANY "stack correct" release that happens today.
<re_irc> < (@adamgreig:matrix.org)> yea, assuming I can get an r+ I intend to have one out one way or another
<re_irc> < (@dirbaio:matrix.org)> same, I don't really mind, though I lean more towards removing the fake frame entirely
<re_irc> < (@dirbaio:matrix.org)> not a c-m team member tho 🤣
<re_irc> < (@jamesmunns:beeper.com)> update https://github.com/knurling-rs/probe-run/issues/382 tho if you make a liar out of me
<re_irc> < (@adamgreig:matrix.org)> yea will do
<re_irc> < (@adamgreig:matrix.org)> (thanks for writing it up there)
<re_irc> < (@jamesmunns:beeper.com)> diff --git a/cortex-m-rt/src/lib.rs b/cortex-m-rt/src/lib.rs
<re_irc> index 70f5b19..f607e95 100644
<re_irc> +++ b/cortex-m-rt/src/lib.rs
<re_irc> --- a/cortex-m-rt/src/lib.rs
<re_irc> < (@jamesmunns:beeper.com)> this works, btw.
<re_irc> < (@jamesmunns:beeper.com)> oh that should be "frame pointer" not "lr" in the comment
<re_irc> < (@jamesmunns:beeper.com)> I didn't OBSERVE anything caring that the frame pointer in the callee-saved frame was garbo, but hell, who knows. it's supposed to be there.
<re_irc> < (@adamgreig:matrix.org)> : what was the recent force push? I can't spot any changes
<re_irc> < (@dirbaio:matrix.org)> just a rebase
<re_irc> < (@adamgreig:matrix.org)> ah thanks
<re_irc> < (@adamgreig:matrix.org)> : as in, no pushing to the stack, don't care what LR is, but just copy SP to r7?
<re_irc> < (@adamgreig:matrix.org)> I still get a WARN from probe-run in that case
<re_irc> < (@jamesmunns:beeper.com)> yeah, bl updates the lr, the callee stacks lr+r7 to make a frame pointer
<re_irc> < (@jamesmunns:beeper.com)> : yeah, but you get the whole backtrace
<re_irc> < (@jamesmunns:beeper.com)> you're gunna get a warning if you don't have a dummy frame
<re_irc> < (@jamesmunns:beeper.com)> no way to avoid the probe-run warning without a dummy frame.
<re_irc> < (@jamesmunns:beeper.com)> (that I found in my couple hours of noodling today)
<re_irc> < (@jamesmunns:beeper.com)> if we do that, you can also kill the lr init to 0xFFFFFFFF, it gets blown away by "bl" anyway
<re_irc> < (@jamesmunns:beeper.com)> (the lr gets set to the addr of the udf instruction following the bl)
<re_irc> < (@jamesmunns:beeper.com)> like, probe-run is looking SPECIFICALLY for 0xFFFF_FFFF in a stacked LR, which doesn't occur unless we stack it in the reset body. "calling" main means that main stacks the first frame, which points back to the return addr.
<re_irc> < (@jamesmunns:beeper.com)> again, this is with like... no confidence. just from what I googled this morning.
<re_irc> < (@dirbaio:matrix.org)> I really thing the bug is probe-run is "too noisy": If you land on a place with no unwind info, just stop, don't print a scary message.
<re_irc> < (@dirbaio:matrix.org)> because there's many legit reasons for that to happen
<re_irc> < (@dirbaio:matrix.org)> not just Reset
<re_irc> < (@jamesmunns:beeper.com)> (that's what I suggested in my issue. I even suggested silencing the warning ONLY if you end up "right" at the end of the stack, e.g. no "bonus data".
<re_irc> < (@jamesmunns:beeper.com)> like, if you see a full 8-byte stack frame at the top 8 bytes of the stack, hooray! you're done! success!
<re_irc> < (@dirbaio:matrix.org)> oh that's a good one :D
<re_irc> < (@dirbaio:matrix.org)> posted the alternative version of the PR https://github.com/rust-embedded/cortex-m/pull/467
<re_irc> < (@dirbaio:matrix.org)> i'm fine with whichever you guys decide to merge
<re_irc> < (@newam:matrix.org)> : I prefer this approach, but I don't care that strongly.
<re_irc> < (@jamesmunns:beeper.com)> I tested that earlier, it made probe-run puke
<re_irc> < (@jamesmunns:beeper.com)> like, big angry MISSING DEBUG INFO puke
<re_irc> < (@jamesmunns:beeper.com)> 7: main
<re_irc> (HOST) ERROR error occurred during backtrace creation: debug information for address 0x448 is missing. Likely fixes:
<re_irc> at src/bin/test_extract.rs:7:1
<re_irc> 8: Reset
<re_irc> < (@jamesmunns:beeper.com)> you JUST want to remove the cfi/cfa directives around the fake frame.
<re_irc> < (@dirbaio:matrix.org)> this is the same error as with cmrt 0.7.0 right?
<re_irc> < (@jamesmunns:beeper.com)> no, that one is going to be similar to what we get now, if my proposed diff is merged
<re_irc> < (@jamesmunns:beeper.com)> (you just get a baby "WARN: oopsie woopsie stack may be corrupted")
<re_irc> < (@jamesmunns:beeper.com)> THAT error looks like this:
<re_irc> 7: main
<re_irc> at src/bin/test_extract.rs:7:1
<re_irc> (HOST) WARN call stack was corrupted; unwinding could not be completed
<re_irc> 8: Reset
<re_irc> < (@dirbaio:matrix.org)> ah there's TWO different errors
<re_irc> < (@dirbaio:matrix.org)> ugh
<re_irc> < (@grantm11235:matrix.org)> "Stack was corrupted" sounds way scarier than "debug information is missing" imo
<re_irc> < (@dirbaio:matrix.org)> but no other r0 that linked the other day does this cfi / fake frame stuff
<re_irc> < (@dirbaio:matrix.org)> is probe-run similarly broken with all these?
<re_irc> < (@jamesmunns:beeper.com)> probably
<re_irc> < (@jamesmunns:beeper.com)> but those didn't work yesterday
<re_irc> < (@jamesmunns:beeper.com)> this did.
<re_irc> < (@jamesmunns:beeper.com)> if you don't merge 463 (the older one) as-is, PLEASE test it on real hardware.
<re_irc> < (@jamesmunns:beeper.com)> I spent a couple of hours today testing 463 on real hardware with gdb and probe-run. I'm fairly confident what it will do.
<re_irc> < (@jamesmunns:beeper.com)> (I did try 463 with and without the r7 = sp change, so just that change should be fine)
<re_irc> < (@adamgreig:matrix.org)> I summarised the debugger outputs in https://github.com/rust-embedded/cortex-m/pull/463#issuecomment-1428876508
<re_irc> < (@dirbaio:matrix.org)> imo it's fine to make probe-run explode, because this is a probe-run bug
<re_irc> < (@adamgreig:matrix.org)> I don't think there's any point putting sp into r7 in #467 is there?
<re_irc> < (@jamesmunns:beeper.com)> yes
<re_irc> < (@jamesmunns:beeper.com)> r7 is for the NEXT stack frame
<re_irc> < (@jamesmunns:beeper.com)> e.g. when "main" saves off the lr (of reset) and the sp (of reset)
<re_irc> < (@jamesmunns:beeper.com)> THAT prelude is why you set up r7
<re_irc> < (@adamgreig:matrix.org)> yea, but, so?
<re_irc> < (@jamesmunns:beeper.com)> otherwise you push junk (but again, I didn't observe anyone "caring" there was junk there)
<re_irc> < (@dirbaio:matrix.org)> is there some standard document somewhere defining how the very first stack frame should look like? like AAPCS?
<re_irc> If yes, we should do that
<re_irc> if no, we should do what all the other crt0's are doing, which is what has become the de-facto standard (which seems to be no cfi, no fake frame) _and not do workarounds to appease one particular buggy unwinder_
<re_irc> < (@jamesmunns:beeper.com)> at the exit of Reset, sp == fp
<re_irc> < (@jamesmunns:beeper.com)> (we use no stack in Reset)
<re_irc> < (@jamesmunns:beeper.com)> r7 (by convention) is used as the caller-provided fp value.
<re_irc> < (@jamesmunns:beeper.com)> also
<re_irc> < (@jamesmunns:beeper.com)> > is there some standard document somewhere defining how the very first stack frame should look like
<re_irc> yes, and nobody follows it
<re_irc> < (@dirbaio:matrix.org)> > The end of the frame record chain is indicated by the address zero in the address for the previous frame
<re_irc> < (@jamesmunns:beeper.com)> it's supposed to be zero not FFFF_FFFF
<re_irc> < (@jamesmunns:beeper.com)> yep
<re_irc> < (@dirbaio:matrix.org)> shouldn't that be "mov r7, #0" then? not "mov r7, sp"?
<re_irc> < (@jamesmunns:beeper.com)> no, the LR is supposed to be zero
<re_irc> < (@jamesmunns:beeper.com)> lemme write it out, it'll be easier.
<re_irc> < (@jamesmunns:beeper.com)> gimme a sec
Darius_ has joined #rust-embedded
<re_irc> < (@adamgreig:matrix.org)> whose convention is the r7 being used? is it in aapcs?
Darius has quit [Ping timeout: 268 seconds]
Darius_ is now known as Darius
<re_irc> < (@jamesmunns:beeper.com)> I saw a lot of docs talking about that