<re_irc>
<@adamgreig:matrix.org> especially if anyone from the various platform support orgs and other projects mentioned (probe-rs, rtic, embassy, smoltcp, knurling, embedded-graphics) would like to add any news or updates from the year, please do
<re_irc>
<@adamgreig:matrix.org> also it says we'll be looking forward but maybe it's enough to finish looking back 😅
<re_irc>
<@xnorman:matrix.org> not quite ready to resort to serde/deserde to/from flash memory in smaller chunks..
<re_irc>
<@xnorman:matrix.org> I'm back to trying to resolve my blown stack segfault (via big deserde)
<re_irc>
<@xnorman:matrix.org> I just tried moving my stack to sram, which is is 512k where the dtcmram is 128k.. i assume the stack does to dtcmram by default? maybe I'm wrong?
<re_irc>
<@xnorman:matrix.org> Any issue with running my stack from sram?
<re_irc>
<@xnorman:matrix.org> seems to be working okay..
<re_irc>
<@xnorman:matrix.org> as a followup.. i have a big sdram peripheral, I guess I can't assume its zeroed out, are there any guides on how to use link_section with something like that?
<re_irc>
<@xnorman:matrix.org> I assume I have to use MaybeUnit but I kinda flailed on my first attempt
<re_irc>
<@9names:matrix.org> > Any issue with running my stack from sram
<re_irc>
<@9names:matrix.org> might get some bandwidth contention from other peripherals accessing it, but otherwise fine
<re_irc>
<@9names:matrix.org> not unless you have a bootloader that initialises and zeroes it before your program runs
<re_irc>
<@9names:matrix.org> > I guess I can't assume its zeroed out
<re_irc>
<@adamgreig:matrix.org> you have a few options, like maybe when you set up the fmc to access the sdram, you could write all 0s to the whole sdram
<re_irc>
<@adamgreig:matrix.org> or use MaybeUninit, or often I'll just leave it uninitialised if I know it's going to be written before it's read and it only stores plain data so can't have an invalid type...
<re_irc>
<@adamgreig:matrix.org> if you need non-zero-initialised data (like .data) where it's initialised from values in flash you'll have to do that yourself at the moment, you can use the same linker script stuff (>FLASH AT >RAM) but cortex-m-rt won't copy the data for you, you'll have to do that copying after setting up the peripheral
<re_irc>
<@adamgreig:matrix.org> (so the same as bss really)
PyroPeter has quit [Ping timeout: 252 seconds]
<re_irc>
<@xnorman:matrix.org> right now I have a lot of `lazy_static` data, I was wondering about moving some of that into sdram.. I was thinking I'd have `static X: MaybeUninit<SomeMutex<Foo>> = ..` but how do I get it so I can write to X (I realize its unsafe)
<re_irc>
<@xnorman:matrix.org> as is.. It seems like I'm doing pretty well just moving my stack into sram, so maybe I don't need to use the sdram, I'm more just curious
PyroPeter has joined #rust-embedded
<re_irc>
<@xnorman:matrix.org> oh, maybe i just make the var `static mut` and then all access is unsafe?
<re_irc>
<@xnorman:matrix.org> adamgreig: Any examples of this I can reference?
<re_irc>
<@adamgreig:matrix.org> Hm, not that I've seen in the wild
<re_irc>
<@adamgreig:matrix.org> xnorman:matrix.org: Right, this is what I usually do for simple buffers
<re_irc>
<@adamgreig:matrix.org> Like, arrays of u8 or u16 etc
<re_irc>
<@xnorman:matrix.org> yeah, the data in question is nested structs with options in some places.. so I figure I'd just use `static mut MaybeUninit...`
<re_irc>
<@adamgreig:matrix.org> You could probably wrap the Mutex around the maybeuninit in that case but a static mut maybeuninit works too
<re_irc>
<@adamgreig:matrix.org> But.. how will you know what to initialise it to?
<re_irc>
<@adamgreig:matrix.org> I guess so long as you just write some new structure to each maybeuninit it should be ok
<re_irc>
<@adamgreig:matrix.org> In principle if your values are known at compile time you could have them saved in flash and your code can just bulk copy flash to sdram to set everything up
<re_irc>
<@adamgreig:matrix.org> Trickier to set up though
<re_irc>
<@adamgreig:matrix.org> And maybe not useful if the contents aren't known at compile time anyway...
<re_irc>
<@xnorman:matrix.org> they are, they're all actually Default impls
<re_irc>
<@9names:matrix.org> hmm. would it work if you set up an allocator that took in all of sdram as it's backing storage, then created a Vec of these structs?
<re_irc>
<@xnorman:matrix.org> yeah, on that thread, why not `static mut Mutex<Option<MyThing>> = Default::default();` and then alloc with the allocator in init?
<re_irc>
<@xnorman:matrix.org> does it need mut?
<re_irc>
<@adamgreig:matrix.org> The default for Option is None so it's not hard to set it up at runtime at least
<re_irc>
<@adamgreig:matrix.org> static mutex option is a pretty common pattern for this sort of thing yea, and you can just set it to none or some useful Some after configuring the sdram
<re_irc>
<@xnorman:matrix.org> great! .. well, I like it even better that I think that I don't have to do it at all.. but good to know in case
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
<chrisb>
wow, cask has a lot of dependencies
fooker has quit [Ping timeout: 252 seconds]
fooker has joined #rust-embedded
fooker has quit [Ping timeout: 240 seconds]
fooker has joined #rust-embedded
rardiol has joined #rust-embedded
Socke has joined #rust-embedded
rardiol has quit [Ping timeout: 256 seconds]
rardiol has joined #rust-embedded
dne has quit [Remote host closed the connection]
dne has joined #rust-embedded
<re_irc>
<@ubik:matrix.org> Is anyone using `lazy_static`? Does it work for you in nightly?