<re_irc>
<@dkhayes117:matrix.org> If anyone can, I need a code review of a pull request (in draft) for the rust-embedded/riscv crate. I've fully implemented methods and functions for the pmpcfg0 module. It is a matter of simple copy/paste for pmpcfg1-3, but I want to cut out as much duplication as possible. I don't understand macros enough...
<re_irc>
<@newam:matrix.org> ub|k: I'm the guy working on that, let me know if you have any questions
dcz_ has joined #rust-embedded
dcz has joined #rust-embedded
dcz_ has quit [Ping timeout: 258 seconds]
fabic has quit [Ping timeout: 255 seconds]
mikehcox has quit [Quit: Client closed]
<re_irc>
<@ubik:matrix.org> newam I assume running LoRaWAN is out of the question for now? 😆
GenTooMan has quit [Ping timeout: 255 seconds]
GenTooMan has joined #rust-embedded
neceve has joined #rust-embedded
tokomak has joined #rust-embedded
rjframe has joined #rust-embedded
fabic has joined #rust-embedded
<re_irc>
<@newam:matrix.org> ub|k: LoRa works; but no code for LoRaWAN yet.
rjframe has quit [Remote host closed the connection]
<re_irc>
<@dkhayes117:matrix.org> Is TravisCI still working for projects on github that was setup for auto checks? I have pull request that showing that `Some checks haven't completed yet` I'm wondering if that will actually ever complete or not.
fabic has quit [Remote host closed the connection]
fabic has joined #rust-embedded
<re_irc>
<@dkhayes117:matrix.org> Doesn't look like it's available anymore from the looks of it.
<re_irc>
<@dkhayes117:matrix.org> at least for free
<re_irc>
<@newam:matrix.org> Travis CI got sold to a not so great company and implemented some sort of limit. Github actions is the better option for open source these days
<re_irc>
<@dkhayes117:matrix.org> Thanks for the info
<re_irc>
<@newam:matrix.org> Also I would not recommend paying; the quality of service went downhill after they got acquired; and paying does not change that.
<re_irc>
<@dkhayes117:matrix.org> Bummer
<re_irc>
<@newam:matrix.org> Yeah ☹️
<re_irc>
<@ubik:matrix.org> newam: how complex is LoRaWAN?
<re_irc>
<@newam:matrix.org> ub|k: The protocol itself is not that complex; but I have not ever implemented any radio protocols since my degree, so I could be missing something 😀
<re_irc>
<@ubik:matrix.org> how much is that from 0 to WebDAV?
<re_irc>
<@newam:matrix.org> with LoRaWAN they wanted something simple like MQTT, you can see its roots there, but radios are inherently complex... so it grew from there.
<re_irc>
<@newam:matrix.org> I have only looked at the basics; but it looks like it would be MQTT + radio complexity + open channel complexity (encryption + signing)
<re_irc>
<@newam:matrix.org> That being said, you asked earlier if you could skip C entirely. You can; but it will take effort since I still consider embedded-rust to be in an early adopter phase.
<re_irc>
<@newam:matrix.org> C is the faster option, simply because there is already code provided by ST and samtech.
<re_irc>
<@newam:matrix.org> I could have been done my project already if I used C; I am using rust because I want to grow the ecosystem, and I find I spend more time coding and less time debugging with rust (more enjoyable for me).
<re_irc>
<@newam:matrix.org> I do not want to discourage you from choosing rust, just want to be realistic about the maturity.
fabic has quit [Ping timeout: 255 seconds]
<re_irc>
<@ubik:matrix.org> Sure, and thanks for being honest about it :)
<re_irc>
<@ubik:matrix.org> BTW, I see st-link doesn't detect STM32WLx yet
<re_irc>
<@newam:matrix.org> I have been using the Nucleo's onboard st-link and probe run which has worked out for me (though only up to 64k flash for reasons I have yet to investigate)
<re_irc>
<@ubik:matrix.org> sorry, I meant the linux tool, not the programmer
<re_irc>
<@newam:matrix.org> ahhh, yeah, I have not been using that tool
<re_irc>
<@ubik:matrix.org> using probe-rs? openocd?
<re_irc>
<@ubik:matrix.org> a pity cortex-debug doesn't seem to support RTT yet
<re_irc>
<@newam:matrix.org> I think cargo-embed supports a simultaneous RTT + GDB server; though I have not tried it myself
<re_irc>
<@thalesfragoso:matrix.org> Openocd added support for RTT in the last version too
<re_irc>
<@thalesfragoso:matrix.org> Although cargo embed seems more integrated with rust environments
tokomak has quit [Ping timeout: 240 seconds]
<re_irc>
<@firefrommoonlight:matrix.org> Thanks for the Lora/STM32WL work
<re_irc>
<@firefrommoonlight:matrix.org> It's interesting seeing the contrast how ST handles bluetooth etc vice lora etc: The latter, you implement yourself. The former, you use a core-interaction mailbox system, and the radio code is proprietary and provided for you for the whole RF core. (If I understand correctly)
starblue1 has joined #rust-embedded
neceve has quit [Ping timeout: 240 seconds]
<re_irc>
<@freckly-sunbeam:matrix.org> Hello 👋 I'm having some difficulty getting `cross` to work. I'm trying to build an executable for raspberry pi from aarch64 macOS. Running `cross build --target armv7-unknown-linux-gnueabihf` tries to use an on-host `armv7-unknown-linux-gnueabihf` target instead of using the docker images, and I can't...
<re_irc>
... seem to get the toolchains set up correctly for armv7. Is there a way to force `cross` to use docker for compiling?
neceve has joined #rust-embedded
<re_irc>
<@newam:matrix.org> Never used cross myself, last time I cross compiled for the pi I just had to set the linker in `.cargo/config.toml`, e.g.
<re_irc>
<@newam:matrix.org> if you search up cross-compiling C on a mac for the pi it should have information to install the toolchains, that part is pretty much the same between rust/c
<re_irc>
<@dirbaio:matrix.org> you don't need to install anything on the host
neceve has quit [Ping timeout: 255 seconds]
dcz has quit [Ping timeout: 265 seconds]
<re_irc>
<@newam:matrix.org> Are there any tricks to use the STM32 DMA's for SPI RX without a second DMA to keep filling the TX FIFO?
<re_irc>
<@freckly-sunbeam:matrix.org> dirbaio: I don't think it's true that cross always uses docker, there's no cross docker image on my machine after running it
<re_irc>
<@dirbaio:matrix.org> can you paste logs of what are you trying to do and how does it fail?
<re_irc>
<@freckly-sunbeam:matrix.org> dirbaio: Sure, this is what I'm trying to build (https://github.com/lily-mara/nanoproxy) and here are the logs of a fresh build
<re_irc>
<@dirbaio:matrix.org> hmm, seems to work for me, and it does use docker, I can see it spin up a container of image `rustembedded/cross:armv7-unknown-linux-gnueabihf-0.2.1` in `docker ps`
<re_irc>
<@thalesfragoso:matrix.org> I compiled to raspberrypi before, never used cross...
<re_irc>
<@thalesfragoso:matrix.org> I just had to use musl because I was getting libc incompatibilities
<re_irc>
<@dirbaio:matrix.org> freckly-sunbeam: try with `--verbose`
<re_irc>
<@freckly-sunbeam:matrix.org> thalesfragoso: Maybe I could re-try compiling with rustup without `cross` but using musl. I added the rustup target for armv7 last night and I ran into a lot of issues and was hoping that cross would "just work"
<re_irc>
<@dirbaio:matrix.org> it seems it's delegating to the host cargo indeed
<re_irc>
<@almindor:matrix.org> > That was a older version he reviewed. I made more commits.
<re_irc>
<@almindor:matrix.org> yes but if you fixed the issues "resolve conversation" so it's not spammy, it's kinda hard to keep track if something is still unsolved
<re_irc>
<@dkhayes117:matrix.org> Sorry, I am a total noob
<re_irc>
<@therealprof:matrix.org> GHA is the natural choice, yeah. Not saying the best but certainly the easiest to get going and free of charge for such projects.
<re_irc>
<@almindor:matrix.org> wouldn't we have to move all the repos over?
<re_irc>
<@therealprof:matrix.org> Yes. Travis CI is pretty much dead so there's not much of a choice.
<re_irc>
<@almindor:matrix.org> hmm I'll have to find out how things like our install.sh script should be done on GHA
<re_irc>
<@therealprof:matrix.org> I think we've pretty much eliminated those scripts since GHA has very good support for a lot of common tasks (including Rust compiler setup).
<re_irc>
<@almindor:matrix.org> oh how do you handle targets?
<re_irc>
<@therealprof:matrix.org> I'd recommend having a look at comparable crates in the Cortex-M domain.
<re_irc>
<@almindor:matrix.org> ah not persistent, always re-do
<re_irc>
<@almindor:matrix.org> > Sorry, I am a total noob
<re_irc>
<@almindor:matrix.org> no probs at all. I'll need to figure this merging issue in riscv first anyhow, maybe ping me about this tomorrow+ :)
<re_irc>
<@dkhayes117:matrix.org> Yessir!
<re_irc>
<@almindor:matrix.org> > I'd recommend having a look at comparable crates in the Cortex-M domain.
<re_irc>
<@firefrommoonlight:matrix.org> I have a question regarding atomics. Previously, I received advice that code like this can product undefined behavior due to the order of atomic operations potentially not being as the code implies:
<re_irc>
<@firefrommoonlight:matrix.org> if EPD_SLEEPING.load(Ordering::Acquire) {
<re_irc>
<@firefrommoonlight:matrix.org> Is there a good explanation? My intuition says either the block gets executed and `false` is stored, or it doesn't since it was `true`
<re_irc>
<@firefrommoonlight:matrix.org> And that you should do `swap` instead
<re_irc>
<@dirbaio:matrix.org> imagine 2 threads running that code
<re_irc>
<@dirbaio:matrix.org> thread A writes `true`
<re_irc>
<@dirbaio:matrix.org> thread B does the load, sees `false`
<re_irc>
<@firefrommoonlight:matrix.org> Thank you - that makes sense. In this parcitular cause, I suppose that could happen due to it being used in interrupts
<re_irc>
<@dirbaio:matrix.org> err the other way around
<re_irc>
<@dirbaio:matrix.org> edited
<re_irc>
<@dirbaio:matrix.org> so even though that code "looks like" wakeup should be done once, maybe it ends up being done multiple times
<re_irc>
<@dirbaio:matrix.org> with swap or similar you can enforce that only one thread does the wakeup
<re_irc>
<@dirbaio:matrix.org> making the "check if it's true, set it to false" operation atomic
<re_irc>
<@firefrommoonlight:matrix.org> Is this how you'd do it?
<re_irc>
<@firefrommoonlight:matrix.org> if EPD_SLEEPING.swap(false,Ordering::AcqRel) {