starblue has quit [Ping timeout: 252 seconds]
starblue has joined #rust-embedded
cr1901 has quit [Remote host closed the connection]
cr1901 has joined #rust-embedded
cr1901 has quit [Remote host closed the connection]
cr1901 has joined #rust-embedded
cr1901 has quit [Remote host closed the connection]
cr1901 has joined #rust-embedded
cr1901_ has joined #rust-embedded
cr1901 has quit [Ping timeout: 240 seconds]
<re_irc> <@luojia65:matrix.org> I have a Rust API design question. I have a piece of code that reads memory in virtual system from hypervisor, should this pointer read code marked as #[must_use]?
<re_irc> <@grantm11235:matrix.org> I don't think that `#[must_use]` is helpful in that case
<re_irc> <@grantm11235:matrix.org> `core::ptr::read` doesnt
cr1901_ is now known as cr1901
<re_irc> <@ubik:matrix.org> What kind of mess-up can cause a HardFault?
<re_irc> <@matoushybl:matrix.org> Wrong memory.x
<re_irc> <@ubik:matrix.org> only that?
<re_irc> <@xiretza:xiretza.xyz> ubik:matrix.org: too many things to iterate, honestly
<re_irc> <@xiretza:xiretza.xyz> do you have a stack trace?
<re_irc> <@ubik:matrix.org> that's the problem
<re_irc> <@ubik:matrix.org> the debugger says it's s HardFault but there is no stack trace
<re_irc> <@xiretza:xiretza.xyz> yeah, not too surprising
<re_irc> <@xiretza:xiretza.xyz> this happens immediately on reset?
<re_irc> <@ubik:matrix.org> basically
<re_irc> <@ubik:matrix.org> the debugger stops at the entry point
<re_irc> <@xiretza:xiretza.xyz> alright, one easy thing to do is to set a breakpoint on main and check if it gets there before faulting
<re_irc> <@ubik:matrix.org> but then even doing "step" results in that
<re_irc> <@xiretza:xiretza.xyz> oh, I see
<re_irc> <@ubik:matrix.org> very weird. it happens when I enable certain DMA transfers, but it seems to already fail at the very beginning of the program
<re_irc> <@xiretza:xiretza.xyz> ah, so you have at least a working hello world?
<re_irc> <@ubik:matrix.org> sure, the program works fine otherwise. it's just when I enable certain lines that this happens
<re_irc> <@xiretza:xiretza.xyz> hm, possibly a bad interrupt handler or something?
<re_irc> <@xiretza:xiretza.xyz> although I don't think anything other than the reset handler should fire until you explicity enable it
<re_irc> <@ubik:matrix.org> yeah, masking the corresponding interrupt doesn't improve the situation
<re_irc> <@ubik:matrix.org> it's super weird
<Lumpio-> So could you get it to stop on a breakpoint at the start of main or not?
<re_irc> <@ubik:matrix.org> i believe I can:
<Lumpio-> I'm not sure how to read that color scheme - does that mean the debugger actually stopped there?
<Lumpio-> Does it crash immediately when you "step" then?
<re_irc> <@ubik:matrix.org> it still allows a few lines to go OK, but then it explodes way before anything relevant is done
<Lumpio-> Can you see the PC and stack pointer in the hardfault state (the ones stacked for the exception)