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
loki_val has quit [Quit: No Ping reply in 180 seconds.]
crabbedhaloablut has joined #rust-embedded
<re_irc> <pgibson> Is there a preferred way to access a "[u32; 12]" bytewise, eg for i2c transmission? I'm currently allocating a "[0u8; 12*4]" and then copying to/from it using to/from_be_bytes which works but feels clumsy. I've seen "std::mem::transmute" which I expect is unavailable in no_std, and I'm currently looking at "unsafe {data.align_to::<u8>()}" and how to swap endianness
<re_irc> <pgibson> Some of the structures are probably much larger than u32; 12 really
causal has joined #rust-embedded
<re_irc> < (@9names:matrix.org)> transmute is also in core::mem
<re_irc> < (@9names:matrix.org)> so you can still use that with no_std
<re_irc> <pgibson> Is there any advantage to transmute vs align_to?
<re_irc> < (@9names:matrix.org)> I'm not familiar with align_to
<re_irc> < (@9names:matrix.org)> Depending on how much you're doing this you might want something like the bytemuck crate
<re_irc> <pgibson> Yeah that does look interesting thanks
<re_irc> < (@grantm11235:matrix.org)> Fun fact: "RangeInclusive" is 50% larger than "Range"
<re_irc> < (@grantm11235:matrix.org)> Due to and extra bool plus alignment padding https://doc.rust-lang.org/src/core/ops/range.rs.html#341-357
<re_irc> < (@grantm11235:matrix.org)> * an
starblue has quit [Ping timeout: 268 seconds]
starblue has joined #rust-embedded
<re_irc> < (@Ericson2314:matrix.org)> anyone have any idea with thumb1 how to load a 32-bit immediate that is a (defined elsewhere) symbol?
<re_irc> < (@Ericson2314:matrix.org)> I see newer arm has ":lower16:"
<re_irc> < (@Ericson2314:matrix.org)> but I don't see anything for each 8 bytes
<re_irc> < (@Ericson2314:matrix.org)> I guess ldr is the move
<re_irc> < (@Ericson2314:matrix.org)> or defining symbols in linker script but that sucks
<re_irc> < (@Ericson2314:matrix.org)> (1 for each 8 bits)
dc740 has quit [Remote host closed the connection]
IlPalazzo-ojiisa has joined #rust-embedded
starblue has quit [Ping timeout: 260 seconds]
starblue has joined #rust-embedded
IlPalazzo-ojiisa has quit [Ping timeout: 256 seconds]
IlPalazzo-ojiisa has joined #rust-embedded
IlPalazzo-ojiisa has quit [Ping timeout: 248 seconds]
IlPalazzo-ojiisa has joined #rust-embedded
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
dc740 has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
dc740 has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
crabbedhaloablut has quit [Quit: No Ping reply in 180 seconds.]
crabbedhaloablut has joined #rust-embedded
IlPalazzo-ojiisa has quit [Ping timeout: 260 seconds]
crabbedhaloablut has quit [Ping timeout: 255 seconds]
crabbedhaloablut has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
causal has quit [Quit: WeeChat 3.7.1]
dc740 has joined #rust-embedded
emerent has quit [Ping timeout: 252 seconds]
emerent has joined #rust-embedded
<re_irc> < (@dirbaio:matrix.org)> with vscode+rust-analyzer, "format on save" has recently stopped working for files not in the main crate
<re_irc> < (@dirbaio:matrix.org)> has anyone else seen this? any fixes?
IlPalazzo-ojiisa has quit [Quit: Leaving.]
<re_irc> < (@jessebraham:matrix.org)> I _may_ have seen that happen yesterday, but I'm not entirely sure. I chalked it up to the usual RA weirdness though.
<re_irc> < (@jessebraham:matrix.org)> Not working today but I can try to check it out later
<re_irc> < (@jessebraham:matrix.org)> * I'm not
<re_irc> < (@dirbaio:matrix.org)> lol it fails to format as soon as the file contains one "async fn"
<re_irc> < (@9names:matrix.org)> i would simply not write one async fn 🤪
Shell has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
Shell has joined #rust-embedded
<re_irc> < (@robgal519:matrix.org)> Hi I have issue with defmt-rtt, I just wanted to have some println! statement in my sample (stm32f103), but I keep getting linker errors:
<re_irc> rust-lld: error: undefined symbol: _critical_section_1_0_acquire
<re_irc> error: section .defmt.{"package":"blinky","tag":"defmt_println","data":"main","disambiguator":"8589678049887836088"} virtual address range overlaps with .text
<re_irc> my dependencies in Cargo.toml:
<re_irc> < (@robgal519:matrix.org)> what am I missing ?
<re_irc> < (@dirbaio:matrix.org)> enable Cargo feature "critical-section-single-core" in "cortex-m"
<re_irc> < (@robgal519:matrix.org)> Hi I have issue with defmt-rtt, I just wanted to have some println! statement in my sample (stm32f103), but I keep getting linker errors:
<re_irc> rust-lld: error: undefined symbol: \_critical\_section\_1\_0\_acquire
<re_irc> error: section .defmt.{"package":"blinky","tag":"defmt\_println","data":"main","disambiguator":"8589678049887836088"} virtual address range overlaps with .text
<re_irc> my dependencies in Cargo.toml:
<re_irc> cortex-m = {version = "0.7.6", features = ["critical-section-single-core"] }
<re_irc> < (@robgal519:matrix.org)> I edited Cargo.toml:
<re_irc> now I only have one linker undefined symbol:
<re_irc> I removed target directory and hit cargo build.
<re_irc> < (@robgal519:matrix.org)> I was able to use rtt_target, and got some output on RTT, but it is not defmt, that I wanted :( ( I want a printf and logging done by defmt, and in case of rtt_target all strings are embedded in the binary)
<re_irc> < (@dirbaio:matrix.org)> make sure you have "-Tdefmt.x" in your linker options (usually in ".cargo/config.toml")
<re_irc> < (@robgal519:matrix.org)> my config:
<re_irc> target = "thumbv7m-none-eabi"
<re_irc> [build]
<re_irc> # Always compile for the instruction set of the STM32F1
<re_irc> < (@robgal519:matrix.org)> : you are great ! It works perfectly now !
Rahix has quit [Quit: ZNC - https://znc.in]
Rahix has joined #rust-embedded