<re_irc>
<boondocker> is there a "critical_section" implementation for RISC-V?
<re_irc>
<boondocker> Getting the "undefined symbol: _critical_section_1_0_acquire" errors using "riscv" and "critical_section" crates
cr1901_ has joined #rust-embedded
msh has joined #rust-embedded
cr1901 has quit [Ping timeout: 244 seconds]
<re_irc>
<jannic> There is one within critical_section 0.2.x, but 1.0.0 removed the implementations. They should be provided by arch specific create now. That may not be available yet.
<re_irc>
But it should be easy to take the implementation from 0.2.x and use it so you can provide the implementation for 1.0.0 yourself. As long as you are on single core.
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
starblue has quit [Ping timeout: 252 seconds]
starblue 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
<re_irc>
<dirbaio> adamgreig: Yeah, I thought about it too
<re_irc>
<dirbaio> didn't think it was worth removing it, having it doesn't hurt much (unlike the "interrupt::free" multicore unsoundness)
<re_irc>
<adamgreig> yea, it's not a problem as such, but it's now not at all cortex-m specific and could be used by anyone using critical-section, I guess
<re_irc>
<adamgreig> but on the other hand it really doesn't need to live in the critical-section crate
<re_irc>
<dirbaio> thing is i've never been a fan of the syntax though
<re_irc>
<dirbaio> so having it in c-s (which is "1.0 forever, never break it again") scares me
<re_irc>
<adamgreig> yea, it feels a little bit janky
<re_irc>
<adamgreig> it could be its own crate i guess.... not super enthused about the effort to benefit ratio there though
<re_irc>
<dirbaio> in embassy we've been using a thing called "Forever" which does exactly the same without macros
<re_irc>
<dirbaio> not the macro though, TAIT is still not quite there. For example it ICEs if you do "let (a, b) = forever!((1, 2));" :D
<re_irc>
<adamgreig> hah, nice
<re_irc>
<adamgreig> a tricky case alright
<re_irc>
<adamgreig> my fav compiler bug from very simple input's still when compiling "loop { continue; }" caused rustc to infinite loop
<re_irc>
<dirbaio> lol
crabbedhaloablut has quit [Remote host closed the connection]
<re_irc>
<dirbaio> so dunno, IMO the macro should go on another crate, not c-s itself yeah
crabbedhaloablut has joined #rust-embedded
<re_irc>
<explodingwaffle101> dirbaio: i'm not fully awake yet- what's the diff between this and once_cell?
<re_irc>
<dirbaio> static_cell gives "&'static mut" once
<re_irc>
once_cell gives "&'static" many times
<re_irc>
<explodingwaffle101> oooooh ok right
<re_irc>
<adamgreig> makes perfect sense 🤣
<re_irc>
<dirbaio> should name mine "really_only_once_cell" :P
<re_irc>
<adamgreig> and give the "static_cell" name to "once_cell" :P
<re_irc>
<dirbaio> 🤷😂
<re_irc>
<James Munns> yomo
<re_irc>
<James Munns> you only mut once
<re_irc>
<jack-n> I am looking for some guidance on which repo would be the most appropriate to log it on. On Arm, if I include a core::arch::asm!("bkpt"); in my code, it halts the processor and raises a breakpoint exception, so the debugger knows what to do with it. On RISC-V (ESP32C3), if I include a core::arch::asm!("ebreak");, it sends the processor into riscv-rt's "pub fn DefaultExceptionHandler(trap_frame: &TrapFrame)". Any...
<re_irc>
<James Munns> Might not be _totally_ correct, but you probably have the best chance of the right people seeing it :D
<re_irc>
<James Munns> jack-n: ^
causal has quit [Quit: WeeChat 3.6]
<re_irc>
<tiwalun> jack-n: On RISCV, you can configure the behaviour of the _ebreak_ instruction, using the _dcsr_ register. It's described in the debug spec. Maybe you have to change a setting there.
<re_irc>
<mabez> tiwalun: Ah yes, that'll be it. 4.5.1 of the debug spec (0.13) probe-rs will need to set the ebreak bits for the respective modes
<re_irc>
<mabez> Default at reset _doesn't_ put the chip in debug mode
<re_irc>
<mabez> Probably because GCC (maybe LLVM) use ebreaks as "unreachable" markers in codegen
<re_irc>
<ryan-summers> Anyone know what "heapless" doesn't have an unsorted linked list implementation? I want to have an ordered sequence of (large) objects that doesn't incur a ton of copying between push/pop operations
<re_irc>
<ryan-summers> And/or am I missing a datastructure that does this?
<re_irc>
<ryan-summers> A vec of heapless::pool::Box's does this, but I'm using this in a lib and don't know if my users can always satisfy the CAS-portability constraints of heapless::pool
<re_irc>
<dirbaio> you want to insert/remove from the middle?
<re_irc>
<ryan-summers> No, just at the ends
<re_irc>
<ryan-summers> But need read/write throughout
<re_irc>
<dirbaio> then Deque should work
<re_irc>
<ryan-summers> Can you index the Deque?
<re_irc>
<dirbaio> hmm, no, but there's "iter" and "as_slices"
<re_irc>
<dirbaio> but indexing shouldn't be hard to add
<re_irc>
<ryan-summers> That's somewhat gross :D
<re_irc>
<ryan-summers> But yeah, Deque + adding index support might be the thing I want
<re_irc>
<dirbaio> with a linked list indexing would be actually O(n), while deque can do it in O(1)
<re_irc>
<almindor> Linked lists are rarely the thing people need.
<re_irc>
<ryan-summers> Agreed. That's why I like the deque approach. Basically turns Deque into a ring-buffer
<re_irc>
<ryan-summers> Actually, Deque's iteration methods look fine for my purposes. No modification necessary
<re_irc>
<ryan-summers> Ugh. Deque does not work because there may be a need to reorder the list (e.g. pop in the middle). I forgot about that
<re_irc>
<dirbaio> 😅
<re_irc>
<ryan-summers> The MQTT spec is a beauty. The client has to maintain order, but the server (high powered PC) is free to do what it wants ;)
<re_irc>
<dirbaio> There were some discussions about adding "load_store_only::AtomicXX" variants to "atomic-polyfill"
<re_irc>
<dirbaio> which would still lower to native load/store, on targets with native load/store but no CAS
<re_irc>
<dirbaio> 🤔
<re_irc>
<chrysn (@chrysn:matrix.org)> dirbaio, I'm just giving the nrf-softdevice a test run. I'm guessing at a few steps in the middle (not having used probe-run before). Is there any kind of intro text / article that is more detailed than the nrf-softdevice README?
<re_irc>
<chrysn (@chrysn:matrix.org)> No problem if there isn't any, but I'd prefer not to learn things the hard(er) way and later see that it was all in the intro.
crabbedhaloablut has quit [Write error: Connection reset by peer]
crabbedhaloablut has joined #rust-embedded
dc740 has joined #rust-embedded
<bjc>
has anyone here managed to get usb working on a gd32vf103c-start board? i've been tearing my hair out for weeks and am about to give up
<bjc>
at this point i assume i have to set some jumpers somehow, but there doesn't even appear to be documentation in chinese for them
<bjc>
i'm currently trying with the synopsys-usb-otg crate, but i've alse tried about every enumeration of doing it by hand that i can think of. i can get as far as getting the reset interrupt, but nothing past that; like the host doesn't even see it. maybe there's a gpio pull up i have to configure like on the gd32f303 series?
dc740 has quit [Ping timeout: 256 seconds]
rardiol has quit [Ping timeout: 248 seconds]
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
rardiol has joined #rust-embedded
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
<agg>
bjc: sorry, the matrix->irc bridge is currently acting up and your messages don't seem to have made it through to matrix
<bjc>
thanks for letting me know. i'll try again later
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
bjc has left #rust-embedded [ERC 5.4 (IRC client for GNU Emacs 28.1)]
causal has joined #rust-embedded
dc740 has joined #rust-embedded
crabbedhaloablut has quit [Read error: Connection reset by peer]