<firefrommoonligh>
<PhilMarkgraf[m]> "What approach do folks use for..." <- > <@shakencodes:matrix.org> What approach do folks use for having multiple drivers share a resource like an I2C or SPI bus? For example, I am using eldruin's excellent eeprom24x driver and need to write a driver for an ADC on the same I2C bus. The... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/ecUxLccMHIYBEZtbLMtmdtDB>)
<firefrommoonligh>
And make sure you're sequencing them appropriately
<firefrommoonligh>
For example starting one transfer in the transfer-complete ISR of the prev one or w/e
starblue has quit [Ping timeout: 240 seconds]
starblue has joined #rust-embedded
Guest7221 has left #rust-embedded [#rust-embedded]
crabbedhaloablut has joined #rust-embedded
crabbedhaloablut has quit [Read error: Connection reset by peer]
<JamesMunns[m]>
The downside to 1 is that you will probably place your stack guard at a fixed location, which means you don't get the "most" area available
<JamesMunns[m]>
I'd probably add your own stack guard object in `> RAM` at the bottom of the page, then keep stack start at the end of RAM, then assert (stack start - end of guard) >= 59K
<MathiasKoch[m]>
I think 1 is essentially what i have above, right? With the stack guard placed at a fixed location
<JamesMunns[m]>
yeah, I think above is approximately 1, with a section instead of a placed object
<MathiasKoch[m]>
Cool! That should work! Can i do an assert in memory.x, or does it need to go at the bottom of link.x? does the order of operations matter in a linkerfile?
<JamesMunns[m]>
Someone better at linker scripts might have a more elegant suggestion, but I think you get what I'm going for :)
<JamesMunns[m]>
Ah it's also #[used] not #[keep]
ryan-summers[m] has joined #rust-embedded
<ryan-summers[m]>
Does anyone know why cargo isn't setting CARGO_CFG_TARGET_FAMILY during the build? The docs indicate it should always be present
<ryan-summers[m]>
It's not being set, which is causing built to fail to run on my build because of it being missing
<ryan-summers[m]>
Not sure if this is a cargo bug, as I don't know what I'd expect that to be
<MathiasKoch[m]>
James Munns: Thank you very much for the pointers! That should get me started on something that will work 👍️
loki_val has quit []
crabbedhaloablut has joined #rust-embedded
crabbedhaloablut has quit [Client Quit]
crabbedhaloablut has joined #rust-embedded
starblue has quit [Ping timeout: 244 seconds]
starblue has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
brazuca has joined #rust-embedded
mabez[m] has quit [Quit: Idle timeout reached: 172800s]
Guest7221 has left #rust-embedded [Error from remote client]
olsen__[m] has joined #rust-embedded
<olsen__[m]>
Hi all, i currently try to migrate a c project using freertos (wrapped with cmsis) partly to rust. As the architecture ist more or less different in terms of memory and shared data i have questions. :) I have multiple tasks (preemptive) that should have access to a spi driver. Have you any hints for sharing data, and more general rules of thumb for migrating that relatively large project?
<thejpster[m]>
Mara just opened a stream for a “binary size working group”
mabez[m] has joined #rust-embedded
<mabez[m]>
thejpster[m]: Oh hell yes
<thejpster[m]>
<olsen__[m]> "Hi all, i currently try to..." <- How do you share the SPI driver in the FreeRTOS version?
fuse117[m] has joined #rust-embedded
<fuse117[m]>
is defmt more robust (or better) than rtt-target?
<olsen__[m]>
<thejpster[m]> "How do you share the SPI..." <- Using a native c api (cmsis) and created a kind of wrapper in rust to share the entity among the threads within rust space.
<Lumpio->
Does CMSIS handle locking for you?
<Lumpio->
Or how does it prevent multiple tasks from accessing it at the same time
<Lumpio->
Oh is it that CMSIS-RTOS thing?
<olsen__[m]>
Nope, that must be part of the wrapper
<AngelLofey[m]>
Copy and paste link on any browser create an account , put your age 45+ confirm your email and give me screenshot
<Charles[m]>
might want to consider setting up the ruma automod bot in this room
jessebraham[m] has joined #rust-embedded
<jessebraham[m]>
@dirbaio @James Munns @adamgreig
AngelLofey[m] has left #rust-embedded [#rust-embedded]
<Charles[m]>
that account was added to the ruma automod bot's banlist 20 minutes ago
<olsen__[m]>
Lumpio-: Yes, but still native c
<Charles[m]>
* minutes ago (i.e. before the account joined this room)
Guest7221 has joined #rust-embedded
sauce has quit [Ping timeout: 264 seconds]
<thejpster[m]>
So you’ve got two options. Using CMSIS-RTOS functions to lock access to the shared objects. Or have the SPI owned by just one task add have other tasks post it messages containing commands that it will complete on their behalf using the SPI bus. I don’t know what you’re building but I’ve built several systems of the latter design.
sauce has joined #rust-embedded
Guest7221 has left #rust-embedded [Error from remote client]
<JamesMunns[m]>
<Charles[m]> "might want to consider setting..." <- Do you work with that? If so would you mind being at the meeting tomorrow at 8pm cest? Might be good to discuss then
<JamesMunns[m]>
(cc adamgreig for agenda reasons)
<Charles[m]>
Yeah, we use it in Rust (lang) and Conduit Matrix Server and probably others too. I can be at the meeting but I think all it takes is inviting it and giving it a high enough power level
<Charles[m]>
There's a control room I'd invite you to so you can, well, control it
brazuca has quit [Quit: Client closed]
<JamesMunns[m]>
Cool! Any docs we could/should read first?
<M9names[m]>
The folks that would know best what is broken in avr are in avr-rust/Lobby, but I see you've already posted this there as well 😕
duderonomy has quit [Ping timeout: 240 seconds]
<M9names[m]>
Llvm support for avr is not finished. The "definitive solution" is to fix it yourself, work around issues like this when they come up or switch to an arch that isn't so broken.
brazuca has joined #rust-embedded
Guest7221 has left #rust-embedded [Error from remote client]
<ilpalazzo-ojiis4>
You've probably noticed, their channel is not exactly what one would call “active”.
<PhilMarkgraf[m]>
Following the [removal of traits with unconstrained Time associated types](https://github.com/rust-embedded/embedded-hal/pull/324/), has anyone "landed" these in a new location outside of embedded-hal? (This is mentioned in the discussion.)
<PhilMarkgraf[m]>
If not, what are people doing at the moment? Are we copying the trait into a file local to its usage?
<dngrsspookyvisio>
no completion, sadface... but I think I can implement that myself
<cr1901>
I'd be curious to see completion w/ only static buffers
<dngrsspookyvisio>
I never said no_alloc 😬
<cr1901>
Ahhh :(
<cr1901>
Anyways, I've not used this crate yet. But it's under my starred crates on crates.io, so I'm watching w/ interest
<dngrsspookyvisio>
I mean, it'd be cool, but I'm looking for quick wins first
<dngrsspookyvisio>
and since the project is a VM, I'll pretty much need alloc anyway. I tried writing one with `no_alloc` but it's so enormously tedious to guess all the heapless struct sizes
<dngrsspookyvisio>
(I did make it work but then quickly abandoned the branch)
IlPalazzo-ojiisa has quit [Remote host closed the connection]
<cr1901>
I commend your effort to make it work out of spite