onkoe[m] has quit [Quit: Idle timeout reached: 172800s]
starblue has quit [Ping timeout: 245 seconds]
starblue has joined #rust-embedded
ChristianHeussy[ has joined #rust-embedded
<ChristianHeussy[>
I'm playing around with the `DEP_NAME_KEY=value` feature in the context of multiple `-sys` crates. Here's a [demo workspace](https://github.com/christianheussy/sys_crate_metadata). I'm getting an undefined reference error and I think I'm not entirely understanding how this works. I thought that `bar`'s dependency on `foo` and `... (full message at
<ChristianHeussy[>
<ChristianHeussy[> "I'm playing around with the `DEP..." <- It seems that setting `println!("cargo:rustc-link-lib=foo");` in bar's build script makes this work. I'm not entirely sure that's the right approach.
<ChristianHeussy[>
* It seems that setting `println!("cargo:rustc-link-lib=foo");` in bar's build script makes this work, however that doesn't seem correct.
<ChristianHeussy[>
> Cargo requires that there is at most one package per links value. In other words, it is forbidden to have two packages link to the same native library.
Foxyloxy_ has joined #rust-embedded
Foxyloxy has quit [Ping timeout: 256 seconds]
crabbedhaloablut has joined #rust-embedded
notgull has quit [Ping timeout: 264 seconds]
notgull has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
<JamesMunns[m]>
Link lib and links are different directives
notgull has quit [Ping timeout: 245 seconds]
<JamesMunns[m]>
I'm afk, but I can look it up a bit later. You need to tell the linker to grab your static/dynamic library, the links key in cargo-toml says "dibs on X, I'm the only provider", but doesn't say anything to the linker
<M9names[m]>
i assume it's just enough to get the static lib symbols from the compiled C lib into the rlib
StephenD[m] has joined #rust-embedded
<StephenD[m]>
This isn't strictly rust-specific, but how does one go about designing a protocol for communication that can gracefully handle missing or extra bytes? I'm thinking for something like uart or even SPI (though SPI is hard because you could end up with a single bit of offset)
<JamesMunns[m]>
Usually you are looking for a concept called "framing", which is how you define where one message ends and the next starts
<JamesMunns[m]>
COBS is one example of how to do this, using an encoding to do it in-band.
<JamesMunns[m]>
An example for "out of band" would be something like a Line Break on UART, where you hold the wire low for "too long", which isn't expressible with inline data, and the line being idle should be high.
<JamesMunns[m]>
For SPI as well, you often get implicit "framing" by when the chip select goes active/inactive, this is enough example of "out of bound" signalling/framing.
Guest7282 has left #rust-embedded [Error from remote client]
<StephenD[m]>
Good point on SPI
<StephenD[m]>
And thanks, COBS looks perfect
notgull has joined #rust-embedded
<JamesMunns[m]>
That is what I usually use with postcard over serial :)
notgull has quit [Ping timeout: 245 seconds]
sample-user-just has joined #rust-embedded
<sample-user-just>
Hello everyone!
<sample-user-just>
I was testing the `riscv` crate...but I noticed that the `medeleg` object does not have a `write` function associated with it (like other registers such as `satp` do). Would it be possible to implement it?
<sample-user-just>
Thanks in advance!
notgull has joined #rust-embedded
Guest7282 has joined #rust-embedded
barnabyw[m] has quit [Quit: Idle timeout reached: 172800s]
Noah[m]1 has quit [Quit: Idle timeout reached: 172800s]
<dirbaio[m]>
the interrupt has to be the SAADC interrupt, you have to bind it so the HAL can handle it for you
<dirbaio[m]>
once you launch the SAADC sampler, you get the callback called periodically with chunks of samples, where you can process it further
bartmassey[m] has joined #rust-embedded
<bartmassey[m]>
Yeah my thing is from a long time ago and very preliminary and intended to work with the HAL directly. dirbaio has the right example for you here.
Guest7282 has joined #rust-embedded
<TristramGrbener[>
thank you a lot for all those examples :) I’ll toy with that tomorrow
kpcyrd[m] has quit [Quit: Idle timeout reached: 172800s]