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
starblue has quit [Ping timeout: 265 seconds]
starblue has joined #rust-embedded
crabbedhaloablut has quit [Read error: Connection reset by peer]
crabbedhaloablut has joined #rust-embedded
_whitelogger has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
hmw has quit [Quit: Bye.]
hmw has joined #rust-embedded
id_tam has joined #rust-embedded
id_tam has quit [Client Quit]
crabbedhaloablut has quit [Read error: Connection reset by peer]
crabbedhaloablut has joined #rust-embedded
<re_irc> <@korken89:matrix.org> Hey , is you wrapper of the CMSIS DSP lib working? I found it and thought I'd ask before I used it :) This one I mean: https://github.com/David-OConnor/cmsis-dsp-api
<re_irc> <@korken89:matrix.org> I found an older one (https://crates.io/crates/cmsis_dsp) but for some reason it bloats the binary with ~130kB
neon[m] has joined #rust-embedded
<re_irc> <@ragarnoy:matrix.org> Hey, any idea why I'm getting this error when compiling cortex-m
<re_irc> --> C:\Users\Ragarnoy.cargo\registry\src\index.crates.io-6f17d22bba15001f\cortex-m-0.7.7\src\register\basepri.rs:6:15
<re_irc> error[E0425]: cannot find function "__basepri_r" in module "crate::asm::inline"
<re_irc> |
<re_irc> | ^^^^^^^^^^^ not found in "crate::asm::inline"
<re_irc> error[E0425]: cannot find function "__basepri_w" in module "crate::asm::inline"
<re_irc> 6 | call_asm!(__basepri_r() -> u8)
<re_irc> --> C:\Users\Ragarnoy.cargo\registry\src\index.crates.io-6f17d22bba15001f\cortex-m-0.7.7\src\register\basepri.rs:22:19
<re_irc> |
<re_irc> 22 | call_asm!(__basepri_w(basepri: u8));
<re_irc> | ^^^^^^^^^^^ not found in "crate::asm::inline"
<re_irc> error[E0425]: cannot find function "__basepri_max" in module "crate::asm::inline"
<re_irc> --> C:\Users\Ragarnoy.cargo\registry\src\index.crates.io-6f17d22bba15001f\cortex-m-0.7.7\src\register\basepri_max.rs:19:19
<re_irc> |
<re_irc> 19 | call_asm!(__basepri_max(basepri: u8));
<re_irc> | ^^^^^^^^^^^^^ not found in "crate::asm::inline"
<re_irc> error[E0425]: cannot find function "__faultmask_r" in module "crate::asm::inline"
<re_irc> --> C:\Users\Ragarnoy.cargo\registry\src\index.crates.io-6f17d22bba15001f\cortex-m-0.7.7\src\register\faultmask.rs:29:28
<re_irc> |
<re_irc> 29 | let r: u32 = call_asm!(__faultmask_r() -> u32);
<re_irc> | ^^^^^^^^^^^^^ not found in "crate::asm::inline"
<re_irc> error: invalid register "r0": unknown register
<re_irc> --> C:\Users\Ragarnoy.cargo\registry\src\index.crates.io-6f17d22bba15001f\cortex-m-0.7.7\src..\asm\inline.rs:197:24
<re_irc> |
<re_irc> 197 | asm!("bkpt #0xab", inout("r0") nr, in("r1") arg, options(nomem, nostack, preserves_flags));
<re_irc> | ^^^^^^^^^^^^^^
<re_irc> error: invalid register "r1": unknown register
<re_irc> --> C:\Users\Ragarnoy.cargo\registry\src\index.crates.io-6f17d22bba15001f\cortex-m-0.7.7\src..\asm\inline.rs:197:40
<re_irc> |
<re_irc> 197 | asm!("bkpt #0xab", inout("r0") nr, in("r1") arg, options(nomem, nostack, preserves_flags));
<re_irc> | ^^^^^^^^^^^^
<re_irc> <@ragarnoy:matrix.org> Hey, any idea why I'm getting this error when compiling cortex-m
<re_irc> error\[E0425\]: cannot find function `__basepri_r` in module `crate::asm::inline`
<re_irc> |
<re_irc> 6 | call\_asm!(\_\_basepri\_r() -> u8)
<re_irc> | ^^^^^^^^^^^ not found in `crate::asm::inline`
<re_irc> error\[E0425\]: cannot find function `__basepri_w` in module `crate::asm::inline`
<re_irc> |
<re_irc> 22 | call\_asm!(\_\_basepri\_w(basepri: u8));
<re_irc> | ^^^^^^^^^^^ not found in `crate::asm::inline`
<re_irc> error\[E0425\]: cannot find function `__basepri_max` in module `crate::asm::inline`
<re_irc> |
<re_irc> 19 | call\_asm!(\_\_basepri\_max(basepri: u8));
<re_irc> | ^^^^^^^^^^^^^ not found in `crate::asm::inline`
<re_irc> error\[E0425\]: cannot find function `__faultmask_r` in module `crate::asm::inline`
<re_irc> |
<re_irc> 29 | let r: u32 = call\_asm!(\_\_faultmask\_r() -> u32);
<re_irc> | ^^^^^^^^^^^^^ not found in `crate::asm::inline`
<re_irc> error: invalid register `r0`: unknown register
<re_irc> |
<re_irc> 197 | asm!("bkpt #0xab", inout("r0") nr, in("r1") arg, options(nomem, nostack, preserves\_flags));
<re_irc> | ^^^^^^^^^^^^^^
<re_irc> error: invalid register `r1`: unknown register
<re_irc> |
<re_irc> 197 | asm!("bkpt #0xab", inout("r0") nr, in("r1") arg, options(nomem, nostack, preserves\_flags));
<re_irc> | ^^^^^^^^^^^^
<re_irc> <@ragarnoy:matrix.org> all i'm doing is this
<re_irc> cortex-m = { version = "0.7.6", features = ["critical-section-single-core", "inline-asm"] }
<re_irc> cortex-m-rt = "0.7"
<re_irc> <@adamgreig:matrix.org> Are you building for a cortex-m target like thumbv7m-none-eabi ?
<re_irc> <@ragarnoy:matrix.org> yep
<re_irc> runner = "probe-rs-cli run --chip STM32WLE5JCIx --chip-erase"
<re_irc> [target.'cfg(all(target_arch = "arm", target_os = "none"))']
<re_irc> <@ragarnoy:matrix.org> target = "thumbv7em-none-eabihf"
<re_irc> <@diondokter:matrix.org> Try turning off the inline asm feature
<re_irc> <@ragarnoy:matrix.org> now it fails to link with msvc
<re_irc> <@ragarnoy:matrix.org> i could show the error but it's miles long
<re_irc> <@ragarnoy:matrix.org> error: linking with "link.exe" failed: exit code: 1120
<re_irc> <@korken89:matrix.org> Hmm, does anyone know how to get the linker to throw away unused stuff when doing C FFI? I'm linking in CMSIS-DSP, but it always bloats with 130k even though I only use one thing from it.
<re_irc> <@korken89:matrix.org> I thought "lto = "fat"" would do it
<re_irc> <@korken89:matrix.org> Oh noes, it's all the FFT tables - it can't detect which size is used to it links them all
<re_irc> <@korken89:matrix.org> All 130k of tables
<re_irc> <@korken89:matrix.org> So eh, does anyone know of an acceptable FFT impl in Rust for embedded? 😅
<re_irc> <@adamgreig:matrix.org> : Just to be sure, maybe try "cargo build --target thumbv7em-none-eabihf"?
<re_irc> <@korken89:matrix.org> Looks promising: https://docs.rs/microfft/latest/microfft/index.html
<re_irc> <@adamgreig:matrix.org> : There's a few on crates.io, like microfft
<re_irc> <@adamgreig:matrix.org> Ah you beat me to it :p
<re_irc> <@korken89:matrix.org> Oh thank lord, 2k vs 130k xD
<re_irc> <@korken89:matrix.org> microfft ❤️
<re_irc> <@korken89:matrix.org> I had a small issue, as my MCU had 128k flash xD
<re_irc> <@ragarnoy:matrix.org> : same :(
<re_irc> <@adamgreig:matrix.org> Weird, the error definitely looks like it's trying to build for a different architecture, and the other error from link.exe suggests it's using the windows linker which it would do for native builds but not cross builds to arm
<re_irc> <@ragarnoy:matrix.org> on the embassy repository, or even any repository, it works, i'm just trying to create my own app for nrf52 and stm32, and i can't get the correct build architecture
<re_irc> <@ragarnoy:matrix.org> : https://github.com/Ragarnoy/lorelay this is it, if you want to take a loot
<re_irc> <@ragarnoy:matrix.org> * look
<re_irc> <@datdenkikniet:matrix.org> there's no ".cargo/config.toml" in the top-level project
<re_irc> <@datdenkikniet:matrix.org> so the target config isn't applied if you try to build from the top level directory
<re_irc> <@datdenkikniet:matrix.org> there's no ".cargo/config.toml" in the top-level directory
<re_irc> <@datdenkikniet:matrix.org> you can either copy the ".cargo/config.toml" so that there's one in the top level directory as well
<re_irc> <@datdenkikniet:matrix.org> or go into the directory of the project you're trying to build and run "cargo" there
<re_irc> <@datdenkikniet:matrix.org> You can read more about how that config file is applied here (https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure)
<re_irc> <@datdenkikniet:matrix.org> : ^^
emerent has quit [Ping timeout: 246 seconds]
emerent has joined #rust-embedded
<re_irc> <@dirbaio:matrix.org> : add "resolver = 2" to the "[workspace]"
<re_irc> <@dngrs:matrix.org> this one is always so unintuitive
<re_irc> <@firefrommoonlight:matrix.org> : It works for the subset of functionality it implements. I don't have a fix for the bloating. It also bloats compile time and tgt dir. ( I didn't notice the binary bloat, but noted)
<re_irc> <@firefrommoonlight:matrix.org> FFI is a bit of a black box for me, so I'm curious if anyone has a fix
<re_irc> <@firefrommoonlight:matrix.org> I use that wrapper regularly, but for trig fns, FIR, and IIR filters. Haven't tried FFT
<re_irc> <@firefrommoonlight:matrix.org> *It looks like I did implement FFT, but don't remember if I tested it
<re_irc> <@firefrommoonlight:matrix.org> Overall, that lib is a thin wrapper on a bindgen wrapper by Jacob Rosenthal. Its main value is cleaning up the API, eg arrays instead of pointers, and removal of some redundant parameters
<re_irc> <@firefrommoonlight:matrix.org> Unrelated - any prog on the GPS? I got it working recently
<re_irc> <@firefrommoonlight:matrix.org> (UBX m10)
<re_irc> <@firefrommoonlight:matrix.org> * Oh NVM the other one is the binary bloater. Well, this one is def a compile-time and tgt folder bloater
dreamcat4 has quit [Quit: Connection closed for inactivity]
<re_irc> <@thejpster:matrix.org> Pinging again for an REC person to review https://github.com/rust-embedded-community/embedded-sdmmc-rs/pull/80
<re_irc> <@chrysn:matrix.org> : Or set the edition to 2021, when the new resolver became default
<re_irc> <@dirbaio:matrix.org> resolver=2 is the default in edition=2021
<re_irc> <@dirbaio:matrix.org> but you can only set edition=2021 in crates
<re_irc> <@dirbaio:matrix.org> not in a workspace
<re_irc> <@dirbaio:matrix.org> workspaces still always use resolve=1, even if they contain edition=2021 crates
<re_irc> <@dirbaio:matrix.org> it sucks
<re_irc> <@dirbaio:matrix.org> they should fix it in edition=2024
<re_irc> <@dirbaio:matrix.org> workspaces still always use resolver=1, even if they contain edition=2021 crates
<re_irc> <@diondokter:matrix.org> Oh man... 2024 is only a year away
<re_irc> <@diondokter:matrix.org> Goes by fast!
IlPalazzo-ojiisa has quit [Quit: Leaving.]