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
<re_irc> <chrysn (@chrysn:matrix.org)> Is there, when building a static library with no_std, any difference between panic=abort and the default panic=unwind?
<re_irc> <chrysn (@chrysn:matrix.org)> I found none when building for typical embedded targets, but some difference when building for i686-unknown-linux-gnu (but maybe it's just ordering of text sections)
<re_irc> <chrysn (@chrysn:matrix.org)> A relatively annoying difference is that I have to set an "eh_personality" -- even though it's not used; is this really necessary?
explore has quit [Quit: Connection closed for inactivity]
starblue has quit [Ping timeout: 256 seconds]
starblue has joined #rust-embedded
<re_irc> <justacec> I have been trying to figure out how to use DMA with a UART inside the stm32wlxx_hal. Specifically, I am unclear how to set the memory address. I see there are some traits defined as DmaOps, but not sure how to access them. Does anybody here have any experience with this?
<re_irc> <justacec> Maybe has some sort of example I can look through to better understand
emerent has quit [Ping timeout: 240 seconds]
emerent has joined #rust-embedded
eigenform has quit [Remote host closed the connection]
eigenform has joined #rust-embedded
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
IsaacClayton[m] has joined #rust-embedded
cr1901 has quit [Read error: Connection reset by peer]
cr1901 has joined #rust-embedded
<re_irc> <therealprof> thejpster: Nope, but thanks for the pointer. I'm fully immersed in neovim, it's brilliant but it takes a long time to figure out all the configuration required to get all the bells and whistles.
<re_irc> <ryan-summers> Have you ever figured out how to get rust-analyzer to do derive macro expansion in neovim? I got the analyzer running, but can't figure out the commands to do macro expansion...
crabbedhaloablut has quit [Remote host closed the connection]
<re_irc> <therealprof> I haven't tried. Let me see.
crabbedhaloablut has joined #rust-embedded
<re_irc> <therealprof> "RustExpandMacro" from https://github.com/simrat39/rust-tools.nvim seems to work for me.
<re_irc> <ryan-summers> Hmm, that looks quite interesting. I've been wanting to do expansion on some proc-macros and all the people working in VSCode have been bragging about the macro expansions there
<re_irc> <ryan-summers> Ooh that works like a charm. Thanks for the hint
Guest2 has joined #rust-embedded
Guest2 has quit [Quit: Client closed]
<re_irc> <wilsk> 👋 I've got a USB HID device thats working on an STM32F103 (blue pill) and a custom STM32F042 board. Its kind of like a custom mini macro keyboard using usbd-hid. I've noticed that as soon as I enable another timer (for instance TIM2 on the STM32F103) following any of the timer examples, the USB device is no longer recognised.
<re_irc> <wilsk> 👋 I've got a USB HID device thats working on an STM32F103 (blue pill) and a custom STM32F042 board. Its kind of like a custom mini macro keyboard using usbd-hid. I've noticed that as soon as I enable another timer (for instance TIM2 on the STM32F103) following any of the timer examples, the USB device is no longer recognised. Any hints on what I'm doing wrong here? I can't find any examples of both USB and a timer to...
<re_irc> ... follow.
<re_irc> <wilsk> The timer is set up like this
<re_irc> let mut timer = dp.TIM2.counter_hz(&clocks);
<re_irc> timer.start(Hertz::Hz(5)).ok();
<re_irc> timer.listen(Event::Update);
explore has joined #rust-embedded
<re_irc> <ryan-summers> Are you clearing the interrupt flag in your handler? You might be sitting in the ISR handler re-entering and not servicing the USB interface
<re_irc> <wilsk> I suspected something like that but the only time I'm touching interrupts in this case is the "NVIC::unmask()" call on line 5 above. Should I explicitly unmask the USB interrupts as well?
<re_irc> <ryan-summers> No, I mean when an interrupt occurs, there's a flag that occurs in the timer registers that has to be cleared
<re_irc> <ryan-summers> The UIF bit of the TIM SR register has to be cleared
<re_irc> <wilsk> ah ok, sorry this is my first STM32 project :) Thanks - I'll look into that
<re_irc> <wilsk> Success!! That worked thanks ryan-summers. Would I usually find this kind of thing documented in the application notes? The STM32 datasheets are quite light on
<re_irc> <ryan-summers> This is more a "many years of working on embedded projects" kind of thing
<re_irc> <ryan-summers> Generally, never assume IFG flags are auto-cleared unless docs tell you they are explicitly
<re_irc> <wilsk> Interestingly the stm32f0xx-hal crate doesn't have the "clear_interrupt" option but at least I know what to look for now! Thanks!
<re_irc> <adamgreig> wilsk: have you got the "reference manual" open, as well as the datasheet? that's where this stuff is documented
<re_irc> <adamgreig> (though still not very explicitly - there's no little callout saying "be sure to clear uif" or anything...)
<re_irc> <wilsk> thanks, will get that one open as well 👍️
<re_irc> <wilsk> +Edit: ahhhh 2200 pages of manuals, thats more like it 😆
starblue has quit [Ping timeout: 256 seconds]
starblue has joined #rust-embedded
Guest2 has joined #rust-embedded
Guest2 has quit [Client Quit]
Guest2 has joined #rust-embedded
ymwm__ has joined #rust-embedded
ymwm__ has quit [Max SendQ exceeded]
ymwm__ has joined #rust-embedded
ymwm_ has quit [Ping timeout: 256 seconds]
ymwm__ has quit [Ping timeout: 260 seconds]
explore has quit [Quit: Connection closed for inactivity]
<re_irc> extern "C" {
<re_irc> <diondokter> Does anybody know what's going wrong here?
<re_irc> static mut __ebss: u32;
<re_irc> static mut __sbss: u32;
<re_irc> let start = &__sbss as *const u32 as u32;
<re_irc> <diondokter> Ah, found it! It has to be
<re_irc> There's an extra "&" in there
<re_irc> <xiretza> right, those linker symbols are really only useful for their addresses, not their values
<re_irc> <diondokter> Yep
<re_irc> <diondokter> It's not the value you need, but the address of the variable itself.
<re_irc> So, take a reference to it, cast that to a pointer and cast that to an integer to 'get the value'
Guest2 has quit [Quit: Client closed]
Guest2 has joined #rust-embedded
Guest2 has quit [Quit: Client closed]
Guest2 has joined #rust-embedded
jr-oss_ has joined #rust-embedded
Guest2 has quit [Client Quit]
<re_irc> <chrysn (@chrysn:matrix.org)> Rust currently has a stabilization streak for things I've been using in embedded projects -- with 1.59 it's asm (allowing the bulk of examples), with 1.60 it'll be cfg(panic) (easing stable builds of examples that share code with native) and with 1.61 const_fn_trait_bound and const_fn_fn_ptr_basics (allowing things in flash that would otherwise have needed lazy initializers so ugly I rather went for...
<re_irc> ... nightly)
<re_irc> <chrysn (@chrysn:matrix.org)> Keep it going! :-)
explore has joined #rust-embedded
<re_irc> <corecode> korken89: i'm trying to prototype a state machine library, more closely oriented to UML, would be good to get your input, but I'm still stuck at the early stages
<re_irc> <firefrommoonlight> diondokter: These pointer operations feel like magical incantations you memorize
<re_irc> <firefrommoonlight> See also: various combinations of "Arc", "Rc", "RefCell", "Mutex"
<re_irc> <firefrommoonlight> These pointer operations feel like occult incantations you memorize
explore has quit [Quit: Connection closed for inactivity]