cinemaSundays has quit [Quit: Connection closed for inactivity]
cinemaSundays has joined #rust-embedded
jxsl has joined #rust-embedded
<thejpster[m]>
I have a chip with atomic set/clear/xor aliases for every peripheral. Is there a way to get the register field shift and mask values from svd2rust generated code, so I can manually bash the set alias with the appropriate bitmask? It's weird to say `thing.register().read().field().bit()` but then `let p = thing.register().as_ptr(); p.add(0x3000).write(1 << 6);` I'd like to turn (register, field) into `1 << 6` somehow.
burrbull[m] has joined #rust-embedded
<burrbull[m]>
<thejpster[m]> "I have a chip with atomic set/..." <- Interesting question. You can get `.offset()` and `width()` from `FieldWriter`, but it exists only inside `write` closure. So they useless for your case.
<thejpster[m]>
I guess in an ideal world there would be a set method that gives an s proxy to a closure, and you can only access single bit sized fields. Same for clear and toggle. But I don’t know how to do it in a portable way without just forking svd2rust. But rather than do that, accessing the shift values as a const would help.
cinemaSundays has quit [Quit: Connection closed for inactivity]
<thejpster[m]>
Ah, ha ha. Same chip. Yeah.
<thejpster[m]>
I recently wrote some new stuff for it and I had to use the atomic writes to lower a &mut self down to a &self method, and in one case down to a free standing function to make it easier to call from an ISR where you don’t own the driver and I didn’t want to stick it in a mutex refcell option nightmare.
<thejpster[m]>
I’m fine with calling write_bitmask_set by hand. I just need the const bitmask.
<dirbaio[m]>
Maybe it's possible to add it via an extension trait?
<burrbull[m]>
I'm fine to add such extension. The issue that stopped #535 was that it is allowed not to all registers.
<burrbull[m]>
<thejpster[m]> "I’m fine with calling write_bitm..." <- This is much more complex as requires to generate such mask for EACH field.
<thejpster[m]>
Which you have already because the w proxy methods use it?
<thejpster[m]>
dirbaio[m]: I’ll try this.
ryan-summers[m] has quit [Quit: Idle timeout reached: 172800s]
GeorgesP[m] has quit [Quit: Idle timeout reached: 172800s]
marmrt[m] has quit [Quit: Idle timeout reached: 172800s]
corecode[m] has joined #rust-embedded
<corecode[m]>
hi
<corecode[m]>
can you suggest books/articles about hardware testing from firmware (self test), for production testing. i'm especially interested in formalisms for test procedures and test reporting
<corecode[m]>
i've done the open coded turn a LED green or red, but i think it could be done much better
<corecode[m]>
like keeping metrics during production
jannic[m] has quit [Quit: Idle timeout reached: 172800s]
<JamesMunns[m]>
ryan-summers gave a good talk at Oxidize this year about this
<ryan-summers[m]>
Yeah I have some blog posts drafted up that I need to post... Will try and get to it this week and post a link :)
<dinkelhacker>
regarding the talk: I don't get how probe.rs gets rid of the eeprom where calibration data is stored. I mean the argument is that with probe.rs I can write the settings directly to flash? Wouldn't I be able to do that with any flash programmer?
<LiamKinne[m]>
Yeah that's not specific to probe-rs, but the point is you get both a CLI and library to write the code for your production tooling in.
<dinkelhacker>
Right, but OpenOCD has that? So does trace32, and probably others aswell? I mean I get it: OpenOCD is much less convenient and trace32 is extremely expensive (and also less convenient). I'm just trying to understand how probe.rs is "fundementally different" than what is already exists.
<JamesMunns[m]>
I think the point is that the probe-rs API, including integrated comms like rtt lowers the threshold substantially. I don't think it's novel, but rather, now accessible.
<dinkelhacker>
That is also my understanding. Plus, it's much nicer to be able to write debugger scripts in rust than in some homegrown obscure scripting language.
<thejpster[m]>
Please can someone tag https://github.com/rust-embedded/riscv/ with all the recent releases. Trying to fork the linker script, but I can't find exactly which linker script is used in the last release of riscv-rt.
<thejpster[m]>
Meh, I copied it out of ~/.cargo for now.