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
<kpcyrd[m]> ah, apparently I can just use critical_section::Mutex::get_mut without needing to activate the critical section myself
<thejpster[m]> to answer my own question, _stext is a PROVIDE(...) so you can over-ride it. Which is exactly what I need to do.
<thejpster[m]> No idea why __stext is also defined. It seems to be unused.
<thejpster[m]> A little bit of "INSERT AFTER .vector_table" and we're all good.
<adamgreig[m]> thejpster: it was added in https://github.com/rust-embedded/cortex-m/commit/bf99836c09e6e5cab058fed4ffe38b9c3f8282b0 with "This commit also adds and exposes a few more stable address start/end symbols (__[se]uninit, __stext, __srodata) that are usefull for debugging and hooking into."
Guest7282 has left #rust-embedded [Error from remote client]
starblue has quit [Ping timeout: 256 seconds]
starblue has joined #rust-embedded
Guest7282 has joined #rust-embedded
Guest7282 has left #rust-embedded [Error from remote client]
emerent has quit [Ping timeout: 256 seconds]
emerent has joined #rust-embedded
<danielb[m]> <M9names[m]> "my guess was 50% too high. guess..." <- technically "500 at least" isn't **wrong**
SergioGasquez[m] has quit [Quit: Idle timeout reached: 172800s]
WikeChao[m] has quit [Quit: Idle timeout reached: 172800s]
Ralph[m] has joined #rust-embedded
<Ralph[m]> is this a good approach for updating to the latest RC? i thought i'd give it a try, but i'm a bit unsure about whether this is really idiomatic rust?
<Lumpio-> I wonder what a practical use case for "ToggleableOutputPin" is
<JamesMunns[m]> bitbanged 1wire or i2c?
<JamesMunns[m]> oh no, that's not like an InputOutputPin
<JamesMunns[m]> it's just stateful?
<JamesMunns[m]> Yeah then I dunno why ToggleableOutputPin and StatefulOutputPin aren't the same :p
<JamesMunns[m]> I guess most OutputPins will just impl all three traits
<Lumpio-> I don't see why fn toggle() is not just a method on StatefulOutputPin, could even have a default impl
<M9names[m]> i guess it's theoretically possible to have an output pin that you can't read the current state of, but you can set a toggle flag in hardware
<Lumpio-> Very theoretically.
<Lumpio-> I would like to have a word with whoever designed that hardware
<vollbrecht[m]> the only think logical for me here would be, if some hardware has a direct toggle hardware pin capability's. In other words one don't need to read the state of the register one just can toggle. Not every set of hardware can do that. But i suspect that is lost anyway in the abstraction and people just implement the functionality in software
<Lumpio-> idk just struck me as a weird thing to have in a general HAL for the one bizarre chip out there where you can toggle but not read the state of the pin
<Lumpio-> I'd just have put it as a method with a default impl on StatefulOutputPin
<vollbrecht[m]> Lumpio-: i mean it in a way that you can have that in one instruction, obviously there should be no hardware where you cant read the state - or its really niche :D
<vollbrecht[m]> but yeah from a hal perspective its wired
<M9names[m]> would a default impl interfere with a chip where you can toggle the pin without reading the current state?
<Lumpio-> No, because a default impl can be overridden to use the "more efficient" method if the hardware supports it
<Lumpio-> Same answer for vollbrecht[m]
<Lumpio-> I guess I'll open an issue to see if smarter people can come up with an explanation for having it
Guest7282 has joined #rust-embedded
xnor has quit [Ping timeout: 252 seconds]
xnor has joined #rust-embedded
johannes[m] has joined #rust-embedded
<johannes[m]> Hi, I'd like to use [`lora-phy`](https://github.com/lora-rs/lora-rs/tree/main/lora-phy) with `RTIC` but `lora-phy` seems to require an async HAL. Are there any async HALs for the `stm32wl55` or will I have to implement the required `embedded_hal_async` traits myself?
IlPalazzo-ojiisa has joined #rust-embedded
explodingwaffle1 has joined #rust-embedded
<explodingwaffle1> <johannes[m]> "Hi, I'd like to use [`lora-phy`]..." <- you can use the embassy-stm32 HAL with rtic
mabez[m] has quit [Quit: Idle timeout reached: 172800s]
eyduhshethey[m] has quit [Quit: Idle timeout reached: 172800s]
<johannes[m]> Ah, I was not aware of that. I'll try that, thanks.
<firefrommoonligh> FYSA, I am un-asyncing lora-phy
<firefrommoonligh> But it doesn't work yet... or more likely I forgot to wire something up on the test board.
<johannes[m]> <firefrommoonligh> "FYSA, I am un-asyncing lora-phy" <- Is that published anywhere?
<firefrommoonligh> No. I'll publish it if it works or if I can make it generic
<firefrommoonligh> I can send you the codes if you'd like, but I think not worth it until I get it working
<firefrommoonligh> RN i can't even do a successful register read...
<firefrommoonligh> Mode 0, 10Mhz SPI clock... hmm
<johannes[m]> hmm I will try getting the embassy HAL to work with RTIC and if that does not work I'll just use stm32wlxx-hal to replicate the lora-phy functionality
diondokter[m] has quit [Quit: Idle timeout reached: 172800s]
xiretza[cis] has quit [Quit: Idle timeout reached: 172800s]
jessebraham[m] has quit [Quit: Idle timeout reached: 172800s]
lulf[m] has quit [Quit: Idle timeout reached: 172800s]
newam[m] has quit [Quit: Idle timeout reached: 172800s]
spinfast[m] has joined #rust-embedded
<spinfast[m]> <firefrommoonligh> "FYSA, I am un-asyncing lora-phy" <- What inspired that?
<dirbaio[m]> <spinfast[m]> "What inspired that?" <- he doesn't like async
<spinfast[m]> hah, well I haven't tried debugging any async rust code in embedded yet, but I imagine that not being very pleasant
<spinfast[m]> then again having the async stuff generate state machines for running things semi-concurrently seems appealing
<spinfast[m]> its not like rtos scheduled threads is free of this problem either... but the debuggers can be made aware of thread stacks and such, can gdb be made aware of async tasks like that in some manner?
<spinfast[m]> like could you step through an async task as if it were a thread in gdb? that would make the debugging aspect maybe less annoying perhaps
<JamesMunns[m]> It's possible, with tooling: https://cliffle.com/blog/lildb/
<spinfast[m]> thats neat
<dirbaio[m]> async single-stepping mostly works with probe-rs
<JamesMunns[m]> There are also options like defmt and tracing (the unreleased v0.2 branch does not require an allocator), as well that are not gdb based
<dirbaio[m]> it breaks down if the binary is build with optimizations, but so does non-async single-stepping
<JamesMunns[m]> fwiw: I've found LTO breaks GDB a lot more than regular optimizations do
<JamesMunns[m]> GDB works pretty well with no lto and opt z/3 in my experience
<dirbaio[m]> async singlestepping doesn't work with gdb, but that's more like gdb's fault rather than async's
<dirbaio[m]> * doesn't work well with gdb,
<JamesMunns[m]> I suspect LLVM lto just does a bad job preserving debug transformations, error guess/opinion tho
<dirbaio[m]> I haven't found debugging to be an issue with async, no
<JamesMunns[m]> s/error/wild/
<dirbaio[m]> I use print-based debugging most of the time though:D
<dirbaio[m]> * time though :D
<dirbaio[m]> * so I haven't
<dngrsspookyvisio> can you do tracing spans with defmt? that could be useful for untangling async logs
<JamesMunns[m]> Not out of the box. You could probably fork tracing to used defmts interning machinery instead tho
<JamesMunns[m]> s/used/use/
<dngrsspookyvisio> I'll just throw this on the big pile of "projects I'll surely get to someday"
Guest7282 has left #rust-embedded [Error from remote client]
crabbedhaloablut has quit []
rmsyn[m] has joined #rust-embedded
<rmsyn[m]> I'm working on a bare-metal example program on a risc-v board, and having big trouble getting even the most basic program to actually run. I've hooked up a debugger, and the program appears to get stuck in `_start` and `_abs_start` without ever entering `main`. I'm using `riscv-rt` for startup code
<rmsyn[m]> here is a link to the example program: <https://github.com/rmsyn/jh71xx-hal-examples/blob/main/src/blinky.rs>
<rmsyn[m]> it's just meant to blink an LED off and on
<rmsyn[m]> am I doing anything obviously wrong here?
<rmsyn[m]> have tried enabling/disabling GPIO interrupts (the line with `ioirq` setting), but the program doesn't even appear to enter `main`
<rmsyn[m]> for more context, I'm running this program on the board via u-boot `go` in `s-mode`
<Darius> if it is stuck in start then I woudl check the linker file is correct
<rmsyn[m]> alright, this is the linker script: <https://github.com/rmsyn/jh71xx-hal-examples/blob/main/memory.x>
<rmsyn[m]> the `RAM` `ORIGIN` address is the `loadaddr` address in u-boot
<rmsyn[m]> does that sound correct?
<Darius> do you hve any working code to start frm?
<rmsyn[m]> u-boot and opensbi, nothing in rust
<rmsyn[m]> this `blinky` program is meant to be the most bare bones thing to get visible output that code is running on the board
<rmsyn[m]> `oreboot` has support for the board I'm working on, but I have yet to get it to run properly
<Darius> might be worth digging into why
<Darius> I would alos check to make sure the resulting file has sensible value for where things are located
<rmsyn[m]> couldn't get the `oreboot` build to go correctly because it relies on private/local clones of public repos to build u-boot style headers
<rmsyn[m]> even swapping out those tools with equivalents / reverting to the public versions, couldn't get the binary to boot
<rmsyn[m]> might be worth further debugging, but it's a more complex program
<rmsyn[m]> trying to get a minimum bare-metal program to run on the board
<rmsyn[m]> here is a disassembly of the resulting binary with debug symbols: <https://github.com/rmsyn/jh71xx-hal-examples/blob/main/disasm.S>
<rmsyn[m]> *partial disassembly