<re_irc>
<@jacobrosenthal:matrix.org> Also some guy asked me to give him that crate name and wouldn't pr me. So he published this https://crates.io/crates/cmsis_dsp
<re_irc>
<@jacobrosenthal:matrix.org> Translate sounds really interesting with the work adamgreig ? I think? Was doing cleaning up last intrinsics + new asm nightly
<re_irc>
<@firefrommoonlight:matrix.org> This looks great! Diving into both examples
<re_irc>
<@firefrommoonlight:matrix.org> (Importing the C lib through FFI seems like the best approach if there are no caveats; I mentioned translate in the case of needing only a few functions from it, and the C compiling sounding intimidating)
<re_irc>
<@firefrommoonlight:matrix.org> *it sounds like you've already solved the C compiling/FFI piece
<re_irc>
<@jacobrosenthal:matrix.org> I'm just bindgen the headers and linking the .a file if I recall
<re_irc>
<@firefrommoonlight:matrix.org> NVM; you're readme is pretty clear about compiling/FFI not being simple :(
<re_irc>
<@jacobrosenthal:matrix.org> It might be easier now. Haven't looked at it a while
<re_irc>
<@firefrommoonlight:matrix.org> And if let's say, it turns it into a big binary the compiler can't split up if I only need a few fns etc?
<re_irc>
<@jacobrosenthal:matrix.org> It just comes with usually
<re_irc>
<@firefrommoonlight:matrix.org> Ideally, you'd have a small Rust lib with some glue code that lets you just call any CMSIS function. The aips are generally array or float based (or integer based), so the API could map 1:1 with C
<re_irc>
<@firefrommoonlight:matrix.org> Oh!
<re_irc>
<@jacobrosenthal:matrix.org> They bundle one for each cortex
<re_irc>
<@firefrommoonlight:matrix.org> Oh nice!
<re_irc>
<@jacobrosenthal:matrix.org> For better or worse I download for you under the hood if I recall
<re_irc>
<@jacobrosenthal:matrix.org> So occasionally you have 10 of them taking up gigs but that's a common cargo prob anyway :shrug:
<re_irc>
<@firefrommoonlight:matrix.org> Oh nice!
<re_irc>
<@firefrommoonlight:matrix.org> Yea - I just assume coding with Rust needs ampl HD space, or frequent deletions of target. Hopefully they fix that eventually
<re_irc>
<@firefrommoonlight:matrix.org> I think I'm going to just use your lib
<re_irc>
<@firefrommoonlight:matrix.org> Looks full up
<re_irc>
<@firefrommoonlight:matrix.org> Is there a way to make your lib work on nostd?
<re_irc>
<@firefrommoonlight:matrix.org> Currently getting `can't find crate for std` if I import it
<re_irc>
<@firefrommoonlight:matrix.org> Under the `compiling base64` step
<re_irc>
<@jacobrosenthal:matrix.org> I had a project with it no std unless something rotted
<re_irc>
<@firefrommoonlight:matrix.org> thread 'main' panicked at 'Unable to find libclang: "couldn't find any valid shared libraries matching: ['clang.dll', 'libclang.dll'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"
<re_irc>
<@firefrommoonlight:matrix.org> ```rust
<re_irc>
<@firefrommoonlight:matrix.org> It appears this is the sort of thing I was worried about; getting flashbacks about installing Linux programs
<re_irc>
<@jacobrosenthal:matrix.org> looks like something from bindgen maybe they have something? https://crates.io/crates/bindgen
<re_irc>
<@firefrommoonlight:matrix.org> Thanks. I'll check that out
<re_irc>
<@firefrommoonlight:matrix.org> I think it would be worth putting that link, or the instructions in it, on your Readme
<re_irc>
<@firefrommoonlight:matrix.org> Dude. It works. The sin hello world works after those 2 changes (Resolution 2, and installing LLVM / setting up the LIBCLANG PATH (sp?) env var
<re_irc>
<@firefrommoonlight:matrix.org> Thank you
<re_irc>
<@firefrommoonlight:matrix.org> I can't believe I was considering a rust translation
<re_irc>
<@firefrommoonlight:matrix.org> I'll tackle your LIBM note later if/when it comes up
GenTooMan has quit [Ping timeout: 260 seconds]
GenTooMan has joined #rust-embedded
DepthDeluxe has quit [Ping timeout: 252 seconds]
fabic has joined #rust-embedded
dcz has joined #rust-embedded
dcz_ has joined #rust-embedded
dcz has quit [Ping timeout: 260 seconds]
emerent has quit [Ping timeout: 252 seconds]
emerent_ has joined #rust-embedded
emerent_ is now known as emerent
fabic has quit [Ping timeout: 260 seconds]
<re_irc>
<@korken89:matrix.org> Does anyone know of a crate that works (is as easy as) `python-can` for PC side applications using CAN?
<re_irc>
<@korken89:matrix.org> https://crates.io/crates/socketcan seems to be about the same, but has a "being rewritten" warning in the readme
<re_irc>
<@therealprof:matrix.org> jacobrosenthal:matrix.org: If we just had a a crate supporting Q types and arithmetic we could pretty easily RIIR and even let LLVM do some of the heavy lifting of using DSP instructions rather than doing it manually in assembly.
fabic has joined #rust-embedded
PyroPeter has joined #rust-embedded
fabic_ has joined #rust-embedded
fabic has quit [Ping timeout: 265 seconds]
<re_irc>
<@braincode:matrix.org> korken89:matrix.org: Despite the warnings, it worked well for me so far, what’s your use case?
GenTooMan has quit [Ping timeout: 260 seconds]
<re_irc>
<@braincode:matrix.org> I used socketcan-isotp recently and found a few reliability issues with Cantact Pro from Eric Evenchick: https://github.com/linklayer/cantact/issues/19, but ymmv with other CAN dongles, which one are you using?
<re_irc>
<@therealprof:matrix.org> jacobrosenthal:matrix.org: Sweet. Indeed `FixedI32<U32>` seems to be the same a `Q31` and FixedI16<U16>` the same as Q15. Not sure how good the internal implementation is in terms of generating ideal code for those special cases. Also I find the description a bit iffy since the formulas don't mention the sign bit.
starblue has quit [Ping timeout: 265 seconds]
fabic_ has quit [Ping timeout: 252 seconds]
starblue has joined #rust-embedded
DepthDeluxe has quit [Ping timeout: 245 seconds]
fabic_ has joined #rust-embedded
<re_irc>
<@firefrommoonlight:matrix.org> I'm hoping to use just the f32 variants for now, but it would certainly be nice to have support for fixed too, to support the full CMSIS API
<re_irc>
<@oddstr13:matrix.org> I can't quite figure out what I'm supposed to replace the Vec! and BTreeMap stuff with.
<re_irc>
<@oddstr13:matrix.org> It looks like the ManagedSlice wants something like `let mut rxps: [u8; 64];` UdpSocketBuffer::new(&mut rxps);`, but that doesn't do the trick https://crates.io/crates/managed#usage
<re_irc>
<@jamesmunns:matrix.org> Today I am excited because my RS-485 hardware works :D
<re_irc>
<@jamesmunns:matrix.org> I haven't gotten it plugged into my network stack yet, but it can receive bytes, and that means the physical layer works as expected!
GenTooMan has joined #rust-embedded
GenTooMan has quit [Ping timeout: 260 seconds]
<re_irc>
<@oddstr13:matrix.org> the method `finalize` exists for struct `InterfaceBuilder<'_, IEEE802154Socket<'_>>`, but its trait bounds were not satisfied
<re_irc>
<@oddstr13:matrix.org> How do I go about actually debugging this error in any meaningful way?
<re_irc>
<@oddstr13:matrix.org> the error is due to me not implementing `smoltcp::phy::Device` properly, but how do I tell what I did wrong?
<re_irc>
<@dirbaio:matrix.org> doesn't it have more info on *which* trait bound is not satisfied?
<re_irc>
<@oddstr13:matrix.org> right, so, uh, static clocks?
<re_irc>
<@dirbaio:matrix.org> you're already making the clocks static
<re_irc>
<@dirbaio:matrix.org> you need a `&*` in here
<re_irc>
<@dirbaio:matrix.org> ` let clocks = &*unsafe { CLOCKS.get_or_insert(_clocks) };`
<re_irc>
<@dirbaio:matrix.org> to convert from `&mut` to `&`
<re_irc>
<@oddstr13:matrix.org> That did the trick, but what exactly did that do?
<re_irc>
<@dirbaio:matrix.org> uh
<re_irc>
<@dirbaio:matrix.org> if you have a `&'static mut Foo` and you pass it to a function that requires `&Foo`
<re_irc>
<@dirbaio:matrix.org> rust will borrow first, breaking the `'static`, and *after* it will convert `&mut` to `&`
<re_irc>
<@dirbaio:matrix.org> if you convert to `&'static Foo` manually first, then you can borrow two `&'static Foo` from that no problem, because `&` can be copied all youw ant
<re_irc>
<@dirbaio:matrix.org> it's a bit weird :S
<re_irc>
<@oddstr13:matrix.org> in C, * would be get value at address, and & would be get address of value iirc, so &* would do pretty much nothing
<re_irc>
<@dirbaio:matrix.org> here it converts from `&mut` to `&`
<re_irc>
<@oddstr13:matrix.org> this feels like a hack to get rust to behave 😆
<re_irc>
<@dirbaio:matrix.org> `&mut *` would indeed do nothing