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
Socke has quit [Ping timeout: 256 seconds]
Socke has joined #rust-embedded
BrassPin88 has quit [Ping timeout: 250 seconds]
AtleoS has quit [Ping timeout: 264 seconds]
AtleoS has joined #rust-embedded
Maebli[m] has quit [Quit: Idle timeout reached: 172800s]
sneakernet[m] has joined #rust-embedded
<sneakernet[m]> my work needs fat32 sdmmc support, what's the status of https://github.com/embassy-rs/embedded-sdmmc-rs.git - I'm happy to contribute (as I want larger sector sizes)
barafael[m] has joined #rust-embedded
<barafael[m]> The HALs used to have more type state in them iirc. Did anybody write about what that was like, the problems it caused, and how it is now?
Socke has quit [Ping timeout: 252 seconds]
AtleoS has quit [Ping timeout: 264 seconds]
BrassPin88 has joined #rust-embedded
henrik_alser[m] has quit [Quit: Idle timeout reached: 172800s]
M9names[m] has quit [Quit: Idle timeout reached: 172800s]
Maebli[m] has joined #rust-embedded
<Maebli[m]> i'm trying to run my crate https://github.com/maebli/m-bus-parser inside of https://github.com/rust-embedded/cortex-m-quickstart but it doesn't finish execution (no panic), any ideas? it just stalls
<JamesMunns[m]> Maebli[m]: Are you using a specific chip, or HAL for running it? Or how are you trying to run your crate?
<JamesMunns[m]> JamesMunns[m]: Or: can you share your code as a github project? That way we can see all the files in one place (instead of trying to copy and paste here)
<JamesMunns[m]> and does it print anything? if you add a `hprintln!("Hello!")` to the top, do you see THAT output, just to rule out the setup of your code?
<Maebli[m]> actually that code works
<Maebli[m]> but i just pushed again, and now, in the same file (if you refresh) you will see my none function code
<Maebli[m]> it contains more parsing,
<Maebli[m]> i tried to debug, but debugging wasnt working
<Maebli[m]> i get
<Maebli[m]> JamesMunns[m]: yeah that works
<JamesMunns[m]> you have a lot of panics in your `try_from` code - I'm not sure why you aren't getting your panic message, but it's probably panicking and crashing.
<Maebli[m]> That was the first assumption yes, but there is a panic handler that doesn't get called
<JamesMunns[m]> Also, anywhere you do input[10] can crash, btw. For example, you index up to 13 or so bytes, but your example input only has like 10 bytes
<Maebli[m]> * get called. And I'm using a payload that works on the host
<Maebli[m]> yes its clear, there are some potential panics, but it should not panic, as it does not panic on my host
<Maebli[m]> and the panic handler does not get called
<JamesMunns[m]> Maybe see if using the panic-semihosting crate works? I'm not very familiar with how semihosting works, its panic handler is a little different to yours: https://github.com/rust-embedded/cortex-m/blob/master/panic-semihosting/src/lib.rs
<Maebli[m]> if I add " panic!("This is a panic!");" in main.rs and run the panic handler works and emits "Oh noes, panic PanicInfo { message: This is a panic!, location: Location { file: "src/main.rs", line: 29, col: 5 }, can_unwind: true, force_no_backtrace: false } :("
<JamesMunns[m]> Also your DataRecords type can hold 117 instances of DataRecord, which seems to not be very tiny, is it possible you are causing a stack overflow by creating a very huge item on the stack?
<Maebli[m]> yes this is possible
<Maebli[m]> how can I check this
<JamesMunns[m]> what happens if you do this:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/bmOIcKhGxyOXIHJYzRpQTCco>)
<JamesMunns[m]> (just do that in main and exit)
<Maebli[m]> size: 31832
<JamesMunns[m]> yeah, you have a total memory of 64K, are you running in debug mode?
<JamesMunns[m]> so, it's almost certainly overflowing your stack, if you are using debug mode
<Maebli[m]> no im not running in debug
<Maebli[m]> can i just increase memory in memory.x
<JamesMunns[m]> because when Rust "returns by value", you create one "slot" in the return position, and one "slot" in the called function
<JamesMunns[m]> Maebli[m]: idk how the qemu target works
<Maebli[m]> ok sure
<JamesMunns[m]> maybe test by shrinking that 117 number to like... 32?
<JamesMunns[m]> In general though, having that large of an object on the stack is not generally a good idea.
<Maebli[m]> ok
Foxyloxy_ has joined #rust-embedded
<Maebli[m]> ok any tipps debugging this?
<JamesMunns[m]> you can try using flip-link, which might cause a louder fault if it's indeed a stack overflow
<JamesMunns[m]> or like I said, try just turning the size down as a test, like to 32 items, to see if you get a real panic message and not just a corrupted stack.
<JamesMunns[m]> flip link: https://github.com/knurling-rs/flip-link - I'm not sure if/how it works with QEMU
Socke has joined #rust-embedded
pronvis has joined #rust-embedded
AdamHorden has quit [Ping timeout: 252 seconds]
AdamHorden has joined #rust-embedded
bpye has quit [Quit: Ping timeout (120 seconds)]
bpye has joined #rust-embedded
AlexandrosLiarok has quit [Quit: Idle timeout reached: 172800s]
Foxyloxy_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Maebli[m]> with  cargo run --release it works
<Maebli[m]> in this my DataRecords are "only" :size: 5448"
Foxyloxy_ has joined #rust-embedded
<Maebli[m]> but hmm, maybe general question, would you recommend using the heap instead?
Foxyloxy_ has quit [Client Quit]
<Maebli[m]> * :size: 5448" *edit: when changing the entries down to 20 that was.. haha
<pronvis> @JamesMunns thanks for your advice about using PAC operations directly. I did that and it works fine: https://github.com/pronvis/drawer-robot/blob/four_tmc2209_steppers_configuration/crates/robot-core/src/my_tmc2209/communicator.rs#L168 But one more question here: Do I need a critical session when working with one particular pin only, and I know that this is the only one place where I change it registers?
<JamesMunns[m]> To be fully correct: yes.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/bQhSmjpkJQhsAbspQqRUdIZS>)
<JamesMunns[m]> If you don't make the changes in interrupts, eh, its probably fine, but definitely not safe, and you open yourself to something that works today, for you, but could break later, for someone else, if they use it differently.
<pronvis> actually that codes executes in TIM2 interrupt with the highest priprity
<pronvis> so, looks like in that particular case I can avoid using critical session, but in the same time be careful with changing this task priority
<pronvis> btw, how "costly" is using critical session?
<JamesMunns[m]> pronvis: Generally the CS itself is not, it's like <10 cycles total.
<JamesMunns[m]> If you do "long" things INSIDE a CS, it can introduce things like interrupt delay/jitter. But one RMW is still gonna be like 10-15 cycles even with a CS
<pronvis> ok, thanks, will wrap it into CS
<JamesMunns[m]> pronvis: In that case, you should make your function unsafe, to note that there's a chance for corruption if people aren't "careful" how they use it.
spinfast[m] has quit [Quit: Idle timeout reached: 172800s]
phycrax[m] has joined #rust-embedded
<phycrax[m]> I'm new to matrix and it's a bit unrelated but I want to ask what android client do you guys use? I kinda have some problems like I can't see the reply messages from James Munns sometimes
<phycrax[m]> Like this
<JamesMunns[m]> I use `beeper` on a different homeserver, I think beeper and matrix sometimes don't agree on how threads/replies work. You're not the only one.
<JamesMunns[m]> For some people, it shows up correctly later
tamme[m] has quit [Quit: Idle timeout reached: 172800s]
<JamesMunns[m]> Reported it to Beeper, thanks for the screenshot!
<phycrax[m]> <JamesMunns[m]> "I use `beeper` on a different..." <- > <@jamesmunns:beeper.com> I use `beeper` on a different homeserver, I think beeper and matrix sometimes don't agree on how threads/replies work. You're not the only one.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/jHmyDpLmAYELEMbMNshinKFP>)
<JamesMunns[m]> phycrax I just got this response from Beeper:
<JamesMunns[m]> > Hey, James - Talked with the Team about this. Turns out that the users that are seeing this behavior is due to legacy Element on Android not supporting replies correctly. Their recommendation is to switch to some other matrix client like SchildiChat, which is the closest to legacy element android since it's a fork, Element X or SchildiChat Next. - Beeper Support
therealprof[m] has quit [Quit: Idle timeout reached: 172800s]
adamhott[m] has quit [Quit: Idle timeout reached: 172800s]
BrassPin88 has quit [Quit: Client closed]
takkaryx[m] has joined #rust-embedded
<takkaryx[m]> I don't know if I'm just doing something horribly wrong, but I feel like I've been fighting this for too long.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/nCSXashMJBaulvwGzBlVxCHx>)
<JamesMunns[m]> So, you'd want your driver to be generic over a SpiDevice
<JamesMunns[m]> You can use https://docs.rs/embassy-embedded-hal/latest/embassy_embedded_hal/shared_bus/asynch/spi/index.html to turn a GPIO + SpiBus into a SpiDevice
<JamesMunns[m]> That take a SpiBus (inside a Mutex), and a CS (chip select) pin
diondokter[m] has joined #rust-embedded
<diondokter[m]> Same thing really, but I tend to use the embedded-hal-bus crate for that: https://github.com/rust-embedded/embedded-hal/tree/master/embedded-hal-bus
<diondokter[m]> Not sure actually why embassy has its own...
<JamesMunns[m]> If you aren't familiar with generics, https://doc.rust-lang.org/beta/book/ch10-00-generics.html talks about some vundamentals
AlexandrosLiarok has joined #rust-embedded
<JamesMunns[m]> diondokter[m]: > <@diondokter:matrix.org> Same thing really, but I tend to use the embedded-hal-bus crate for that: https://github.com/rust-embedded/embedded-hal/tree/master/embedded-hal-bus... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/JyMMtAmHlhqCuHUEWmBeaSIG>)
<Maebli[m]> <JamesMunns[m]> "flip link: https://github.com/..."; <- A big thanks for your quick help James! 🚀🚀
<diondokter[m]> Ah, makes sense
<JamesMunns[m]> JamesMunns[m]: the e-h-bus one doesn't support async, I think? Or it is weird in some way I can't remember?
<diondokter[m]> It does
<diondokter[m]> Behind a feature flag
<takkaryx[m]> I think that's my problem, I think I've been trying to use both hals somehow, and the API's are confusing me
<takkaryx[m]> gah
<takkaryx[m]> Thanks all, I'll read through some more docs
<diondokter[m]> JamesMunns[m]: Ah hmmm, true shared devices aren't async no. It's only async for the exclusive device
oneDragon[m] has joined #rust-embedded
<oneDragon[m]> I'm a freshman, I was wondering if a bare-metal applications run on common embedded board could be use as a kind of driver board of elink ?
<oneDragon[m]> which this jobs seems has been down by previous via [FPGA](https://www.bilibili.com/video/BV1Wr421u7mM/?spm_id_from=333.999.0.0&vd_source=a32c6b6a885f40c3040fcb76e3e5aefe)
<oneDragon[m]> I actually kind of want to reproduce this effect, but unfortunately I don't think I can afford the price of FPGA.
<oneDragon[m]> * <del>I actually kind of want to reproduce this effect, but unfortunately I don't think I can afford the price of FPGA.</del>
<oneDragon[m]> s/elink/e-ink/
BrassPin88 has joined #rust-embedded
embassy-learner[ has quit [Quit: Idle timeout reached: 172800s]
IlPalazzo-ojiisa has joined #rust-embedded
IlPalazzo-ojiisa has quit [Ping timeout: 240 seconds]
IlPalazzo-ojiisa has joined #rust-embedded
pronvis has quit [Ping timeout: 240 seconds]
IlPalazzo-ojiisa has quit [Remote host closed the connection]
pbsds3 has quit [Quit: Ping timeout (120 seconds)]
pbsds3 has joined #rust-embedded