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
Shell has quit [*.net *.split]
jasperw has quit [*.net *.split]
Shell has joined #rust-embedded
jasperw has joined #rust-embedded
bjc` has quit [Ping timeout: 252 seconds]
<re_irc> <thebox> Does Rust need libc/libm present when using no-std?
<re_irc> < (@jamesmunns:beeper.com)> If you do certain floating point operations, you'll need "libm", or a "diet" alternative like micromath (https://docs.rs/micromath/latest/micromath/)
<re_irc> < (@jamesmunns:beeper.com)> you don't generally need a "libc", unless you are linking C code that expects it
<re_irc> <thebox> Such as trig functions?
<re_irc> < (@jamesmunns:beeper.com)> yeah, if you get a linker error for one of those, you probably need libm
<re_irc> < (@jamesmunns:beeper.com)> link to the libm crate (https://github.com/rust-lang/libm)
<re_irc> <thebox> Off hand, do you know if FreeRTOS through the freertos-rust would?
<re_irc> < (@jamesmunns:beeper.com)> Not familiar with freertos-rust, unfortunately.
<re_irc> <thebox> Ok, thank you very much.
<re_irc> < (@jamesmunns:beeper.com)> "fixing" the error should be as easy as adding the "libm" crate as a dependency to your cargo project, and adding "use libm as _;" in your project to ensure it gets linked in.
faern has quit [Ping timeout: 260 seconds]
bjc has joined #rust-embedded
bjc has quit [Read error: Connection reset by peer]
genpaku has quit [Remote host closed the connection]
genpaku has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
bjc has joined #rust-embedded
radens has quit [Quit: Connection closed for inactivity]
IlPalazzo-ojiisa has joined #rust-embedded
IlPalazzo-ojiisa has quit [Quit: Leaving.]
IlPalazzo-ojiisa has joined #rust-embedded
<re_irc> <the tab openoor (spookyvision@{github,cohost})> thebox: I'm using cordic (https://docs.rs/cordic/latest/cordic/) for trig, might help
<re_irc> micromath also has some trig
<re_irc> <the tab openoor (spookyvision@{github,cohost})> cordic is mostly useful when no fpu
<re_irc> <the tab openoor (spookyvision@{github,cohost})> but yeah when using FreeRTOS probably better to just link libm
<re_irc> < (@ryan-summers:matrix.org)> FYI, https://github.com/quartiq/idsp can be used for some trig functions in a faster manner than hardware cordic with some small tradeoffs :)
<re_irc> < (@adamgreig:matrix.org)> Hi all, just a quick note that neither I nor therealprof are able to run a meeting this week so we'll postpone to next week, and then probably the usual 2 week break after that one
<re_irc> < (@adamgreig:matrix.org)> Hope you all have a lovely evening!
<re_irc> < (@adamgreig:matrix.org)> Feel free to chat about embedded rust without me though :p
<re_irc> < (@dirbaio:matrix.org)> guess critical-section will stay unyanked until 2023 then :D
<re_irc> <the tab openoor (spookyvision@{github,cohost})> : ooh nice one
<re_irc> < (@ryan-summers:matrix.org)> You can get about ~40 cycle sin/cos with it. We use it in some high-throughput DSP routines. There's a slight tradeoff in quanitization/precision I believe, but the error is exceptionally small
<re_irc> <the tab openoor (spookyvision@{github,cohost})> always gotta shove the error _somewhere_ eh
WSalmon__ has joined #rust-embedded
seds_ has joined #rust-embedded
nohit_ has joined #rust-embedded
WSalmon has quit [Ping timeout: 252 seconds]
nohit has quit [Ping timeout: 252 seconds]
seds has quit [Ping timeout: 252 seconds]
seds_ is now known as seds
nohit_ is now known as nohit
dc740 has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
dc740 has joined #rust-embedded
<re_irc> < (@jamesmunns:beeper.com)> If you want something that is not at all generalizable, I got it down to 22 cycles per sin: https://jamesmunns.com/blog/fixed-point-math/
<re_irc> :D
<re_irc> < (@sourcebox:matrix.org)> : I did something similar for tan() some time ago. Initially, I thought, a const fn could be used for the LUT, but that does not work for f32s. So I ended up using a Python script to generate the table. There's surely a better approach to this.
<re_irc> < (@jamesmunns:beeper.com)> Yeah, I used a little snippet of Rust code to generate the data. You could (today) use a build rs script to generate the data, but honestly I've just copy and pasted the code depending on the tweaks I've needed.
IlPalazzo-ojiisa has quit [Quit: Leaving.]
dc740 has quit [Remote host closed the connection]
<re_irc> <Stephen D> the tab openoor (spookyvision@{github,cohost}): Lol thanks, that's my cat