<M9names[m]>
<slabity[m]> "Is there something I'm missing?" <- please share your project. it's going to be very hard to anyone to diagnose an issue like this without being able to observe the problem firsthand
<M9names[m]>
you're not resetting the spinlock used by the rp2040 critical-section on startup, that's going to be one potential cause of lack of logs (because it will deadlock a lot of the time)
<slabity[m]>
Hmm... I'm not seeing that in the multicore.rs example in the embassy_rp crate.
<M9names[m]>
it's not in any of the examples, but it is still required
<trinhtuan[m]>
Does anyone successfully use sleep() in a bare metal esp32 (no-std) program? I have tried and searched google but no success. A sample working code is really appriciated also. By the way what are the differences behind the scenes between sleep() and delay()? Thank you.
<M9names[m]>
#esp-rs:matrix.org is a good place for that question, everyone who knows how it's implemented will be there
<slabity[m]>
Okay, so that compiled and uploaded. Still same issue though. Program is not executing
<slabity[m]>
And if I disable the CORE1 program and reupload...
<slabity[m]>
Restart the power, then re-enable CORE and upload...
<slabity[m]>
And now it executes
<M9names[m]>
could you share your cargo.toml as well? i can't get the code you posted to compile, not sure if it's crate versions or because the code is broken
<slabity[m]>
Sure, give me one moment and I should be able to upload the entire Git repo
<M9names[m]>
i would recommend doing it this way in the future. having to RE someone else's project config is tedious
<slabity[m]>
Yea, I just haven't actually committed anything because I was just messing around and didn't have a particular goal in mind. Just have a bunch of files to clean up first
<slabity[m]>
Oh, also I made some changes to use assign-resources because I was told it makes things a lot cleaner for passing clear delimination of resources
<slabity[m]>
My suspicion is that core 1 isn't getting paused or reset when flashed, and so it could be just trying to pick up where it left off for some reason?
<M9names[m]>
seems to reliably print logging info on my end, though obviously it is panicking when trying to do i2c reads.
<M9names[m]>
yeah, maybe? you can manually reset core1 on startup to ensure it's in a good state.
<M9names[m]>
spawn_core1 already does this, but maybe it needs to happen earlier
<slabity[m]>
Well the strange thing is it doesn't even get to the "Starting program" state before the core1 process even spawns. It just doesn't print anything unless I remove the core 1 process, upload it, then reset the entire thing and upload the new program again
<slabity[m]>
Yea, that's definitely an issue. I was told a new update will remove some of the generics issues I was having so I just wanted to rollover to master until that was fixed.
<slabity[m]>
Honestly the entire thing has been kind of me just kicking stuff around to see how embedded rust works.
<slabity[m]>
So I have not been following best practices
<M9names[m]>
are you running release builds?
<slabity[m]>
Well I just updated to debugprobe-v2.0.1 and that doesn't seem to have helped. Wasn't sure if maybe there was some bug there causing it to not reset properly
<slabity[m]>
No, I was hoping to keep debug symbols for the debugger to use
<slabity[m]>
Oh wait, there was a solution for that somewhere
<slabity[m]>
So that I could use DWARF symbols or something in release builds?
<slabity[m]>
Well I think I'm just going to not use the second core until I can figure out what's going on with that. I'll just be happy embassy easily lets me move tasks around without needing to rewrite a ton of code
<M9names[m]>
i'm not able to reproduce any issues replacing your adc task with a blinky on my end, so i'm afraid i won't be much more help
<slabity[m]>
Yea, maybe it's literally my RP2040 having an issue.
adamgreig[m] has quit [Quit: Idle timeout reached: 172800s]
<slabity[m]>
I did have a faulty ADC, so maybe some other weird stuff is going on
<slabity[m]>
I have to give credit where it's due though, the issues I've been running into with embassy have been way minor compared to needing to manually set up interrupts and entire state machines to get things working asynchronously in C++.
<JamesMunns[m]>
jannic[m]: I'd imagine the second core might be running with access to resources and memory it shouldn't have, so pre-init ensure it happens before any memory init possibly happen
<JamesMunns[m]>
JamesMunns[m]: agreed pre_init is Not Great, tho, but probably fine for a single volatile op.
<JamesMunns[m]>
Yeah, idk how much it's POSSIBLE to have miscompilations in `pre_init`, but it's definitely breaking the environmental contract with the rust abstract machine (e.g., some invariants hold true before Rust "starts", e.g. statics will be initialized either to zero or their initial value).... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/GYNKvNxzPhRJCkUgxdYtISya>)
<JamesMunns[m]>
Using statics in pre-init would be a big red flag to me (even/especially read access of statics!), and any writes to statics that aren't uninit/in other sections would be another big red flag.
<JamesMunns[m]>
that being said, "ub is ub and all bets are off and you can't reason logically about it over time", but I can't particularly imagine what the compiler would burn us with outside of static access.
<JamesMunns[m]>
that being said that being said, the optimizer doesn't super mess with volatile ops, so this usage doesn't spook me, personally, for what that's worth.
AtleoS has quit [Ping timeout: 255 seconds]
AtleoS has joined #rust-embedded
<jannic[m]>
Yes, I agree it's probably fine. And for a firmware with limited scope and no intention of long-term maintainability, that should be enough. So just to get things running, I'd probably do the same. I'm just a bit wary of any general advice short of "avoid rust code in pre_init".
<dirbaio[m]>
A custom entry macro composes badly. For example embassy-executor or rtic have their own entry macros too, you can't use both at the same time
<dirbaio[m]>
Perhaps the hal can put a pre_init for you. That'll mean the user won't be able to use pre_init themselves tho.
<JamesMunns[m]>
yeah, extern unmangled pre_init global asm, behind a default feature, on the rp-hal or embassy-rp crates would be pretty slick, IMO
<JamesMunns[m]>
(pre_init usage is rare, and having a feature to disable it would cover any complaints, imo)
therealprof[m] has quit [Quit: Idle timeout reached: 172800s]
AdamHott[m] has quit [Quit: Idle timeout reached: 172800s]
Seth[m] has joined #rust-embedded
<Seth[m]>
ppl
<Seth[m]>
I could use some help
<Seth[m]>
yo
<Seth[m]>
I can't get Joshuto to work with Ueberzugpp
xiretza[cis] has joined #rust-embedded
<xiretza[cis]>
<Seth[m]> "I can't get Joshuto to work with..." <- how is that related to using Rust on embedded devices?
<Seth[m]>
...oh that's what this room is about 💀
<Seth[m]>
well
<Seth[m]>
Joshuto is written in Rust
<Seth[m]>
and...
<Seth[m]>
okay fine nvm
starblue has quit [Ping timeout: 268 seconds]
AtleoS has joined #rust-embedded
starblue has joined #rust-embedded
esden[cis] has quit [Quit: Idle timeout reached: 172800s]
starblue has quit [Ping timeout: 268 seconds]
starblue has joined #rust-embedded
<whitequark[cis]>
none of these words are in the bible
sirhcel[m] has joined #rust-embedded
<sirhcel[m]>
Has anyone a good example/best practices for how to diable some tests requiring actual hardware in ci? Feature, environment variable, ... I'm working on cleaning up tests for serialport-rs and encountered that some of them always suceed due to ignoring Results. Fixing this will cause our ci to fail due to not having any serial devices there and i want to disable tests actually using a serial device in ci.
<sirhcel[m]>
* Has anyone a good example/best practices for how to diable some tests requiring actual hardware in ci? Feature, environment variable, ... I'm working on cleaning up tests for serialport-rs and encountered that some of them always suceed due to ignoring Results. 😅 Fixing this will cause our ci to fail due to not having any serial devices there and i want to disable tests actually using a serial device in ci.
cr1901 has quit [Read error: Connection reset by peer]
cr1901_ has joined #rust-embedded
cr1901__ has joined #rust-embedded
cr1901_ has quit [Read error: Connection reset by peer]