crabbedhaloablut has quit [Remote host closed the connection]
rardiol has quit [Ping timeout: 256 seconds]
crabbedhaloablut has joined #rust-embedded
rardiol has joined #rust-embedded
rardiol has quit [Ping timeout: 260 seconds]
starblue has quit [Ping timeout: 240 seconds]
starblue has joined #rust-embedded
<re_irc> <> I've made a bunch of updates to the this-year-in-embedded-rust post:
<re_irc> <> 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> <> also it says we'll be looking forward but maybe it's enough to finish looking back 😅
<re_irc> <> not quite ready to resort to serde/deserde to/from flash memory in smaller chunks..
<re_irc> <> I'm back to trying to resolve my blown stack segfault (via big deserde)
<re_irc> <> 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> <> Any issue with running my stack from sram?
<re_irc> <> seems to be working okay..
<re_irc> <> 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> <> I assume I have to use MaybeUnit but I kinda flailed on my first attempt
<re_irc> <> > Any issue with running my stack from sram
<re_irc> <> might get some bandwidth contention from other peripherals accessing it, but otherwise fine
<re_irc> <> not unless you have a bootloader that initialises and zeroes it before your program runs
<re_irc> <> > I guess I can't assume its zeroed out
<re_irc> <> 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> <> 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> <> 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> <> (so the same as bss really)
PyroPeter has quit [Ping timeout: 252 seconds]
<re_irc> <> 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> <> 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> <> oh, maybe i just make the var `static mut` and then all access is unsafe?
<re_irc> <> adamgreig: Any examples of this I can reference?
<re_irc> <> Hm, not that I've seen in the wild
<re_irc> <> Right, this is what I usually do for simple buffers
<re_irc> <> Like, arrays of u8 or u16 etc
<re_irc> <> 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> <> You could probably wrap the Mutex around the maybeuninit in that case but a static mut maybeuninit works too
<re_irc> <> But.. how will you know what to initialise it to?
<re_irc> <> I guess so long as you just write some new structure to each maybeuninit it should be ok
<re_irc> <> 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> <> Trickier to set up though
<re_irc> <> And maybe not useful if the contents aren't known at compile time anyway...
<re_irc> <> they are, they're all actually Default impls
<re_irc> <> 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> <> yeah, on that thread, why not `static mut Mutex<Option<MyThing>> = Default::default();` and then alloc with the allocator in init?
<re_irc> <> does it need mut?
<re_irc> <> The default for Option is None so it's not hard to set it up at runtime at least
<re_irc> <> 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> <> 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> <> Is anyone using `lazy_static`? Does it work for you in nightly?
rardiol has quit [Quit: - Chat comfortably. Anywhere.]
<re_irc> <> I'm using `lazy_static` but not in nightly..