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
zxrom has quit [Read error: Connection reset by peer]
zxrom has joined #rust-embedded
radens has quit [Quit: Connection closed for inactivity]
inara` has quit [Write error: Connection reset by peer]
inara has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
dne has quit [Remote host closed the connection]
dne has joined #rust-embedded
<re_irc> <@thejpster:matrix.org> I didn’t spot the !Static. Damn.
emerent has quit [Ping timeout: 256 seconds]
emerent has joined #rust-embedded
<re_irc> <@thejpster:matrix.org> * !Sync.
dc740 has joined #rust-embedded
<re_irc> <@ixlun:matrix.org> Has anyone ever seen the error "Error: [stm32f7x.cpu] Cortex-M PARTNO 0x0 is unrecognized" when connecting openocd to a stm32f7 board?
dc740 has quit [Remote host closed the connection]
<re_irc> <@walstib-alex:matrix.org> Not really, what debugger and what host software are you using?
dc740 has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
<re_irc> <@d3zd3z:matrix.org> "embedded-storage"'s types, such as "ReadStorage", have an associated type "Error" that has no constraints. I'm trying to figure out the best way to use this in generic code that accepts any kind of "ReadStorage". Right now, I'm doing things like "flash.read(offset).map_err(|_| MyError::StorageError)". Any ideas how I could better capture that error, without making my whole error type depend on the particular Storage device...
<re_irc> ... in question?
<re_irc> <@d3zd3z:matrix.org> For some amusement: https://chat.openai.com/share/e5c5c40d-6c37-4ebe-b602-8c370b6e7a46, which is kind of the things I was thinking of. I guess the real question, should I be pushing to have the associated types in "embedded-storage" implement "std::error::Error", which would make this easier?
<re_irc> <@d3zd3z:matrix.org> Well, except that there isn't a "core::error::Error", so this can't be used in a "nostd" crate.
<re_irc> <@dirbaio:matrix.org> : it has no bounds at all, so you can't do anything with it indeed.
<re_irc> <@dirbaio:matrix.org> The ideal solution would be to add an "ErrorKind" to "embedded-storage", similar to what "embedded-hal" does
<re_irc> <@dirbaio:matrix.org> but without that
<re_irc> <@dirbaio:matrix.org> the only thing you can do is return it up
<re_irc> <@d3zd3z:matrix.org> Or just collapse it entirely, as I've done, into something indicating just a storage error.
<re_irc> <@dirbaio:matrix.org> yeah, either ignore it
<re_irc> <@dirbaio:matrix.org> or return it up
<re_irc> if you want to return that error or your own errors, the standard way is to do "enum Error<E>{ Storage(E), OtherError1, OtherError2 }" and return "Result<..., Error<S::Error>>"
<re_irc> <@dirbaio:matrix.org> otherwise you could add your own bounds. like "where S: Storage, S::Error: Debug". That allows you to do ".unwrap()" for example.
<re_irc> <@dirbaio:matrix.org> it's very likely that all errors implement Debug, so I don't think that'd cause incompatibilities in practice
<re_irc> <@dirbaio:matrix.org> or
<re_irc> <@dirbaio:matrix.org> send a PR to embedded-storage adding ErrorKind :) :) :)
<re_irc> <@grantm11235:matrix.org> : It exists, but it is unstable https://doc.rust-lang.org/core/error/index.html
<re_irc> <@dirbaio:matrix.org> even if it was stable, it's not ideal for embedded because it uses dyn liberally, which has bigger code size vs a plain old enum