<re_irc>
<@thejpster:matrix.org> Would anyone like a micro ATX sized Cortex-M board with VGA, Stereo Audio in and out, an SD slot, and a bunch of expansion slots? Lots of ATX sized Rust fun - for the main micro and the little STM32 that does button debouncing and controls system reset.
fabic has joined #rust-embedded
dcz_ has joined #rust-embedded
dcz has quit [Ping timeout: 258 seconds]
fabic has quit [Ping timeout: 258 seconds]
<re_irc>
<@TimSmall:matrix.org> Interesting. What are you thinking the main micro would be? Slots?
<re_irc>
<@yruama_lairba:matrix.org> hello, i think i need re explanation about somthing
<re_irc>
<@yruama_lairba:matrix.org> why clousre are use to write value in a pac ? is there another syntax accomplishing the same job ?
<re_irc>
<@yruama_lairba:matrix.org> sorry i ask this to know how to design good API
<re_irc>
<@yruama_lairba:matrix.org> i also saw this pattern in a crate without understanding the reason they do that (and honestly in think they just immitated what does a package access crate)
<re_irc>
<@henrik_alser:matrix.org> One advantage is you can manipulate multiple bits in one write operation, and it provides a safe api to what values are allowed etc
<re_irc>
<@henrik_alser:matrix.org> (even things like auto-complete)
<re_irc>
<@henrik_alser:matrix.org> With rust analyzer
<re_irc>
<@yruama_lairba:matrix.org> lol, i don't know how tu use this with vim
<re_irc>
<@yruama_lairba:matrix.org> the autocomplete i use is based on word already writted in opened file
<re_irc>
<@henrik_alser:matrix.org> Sorry i’m in vs code 🤷🏻♀️
<re_irc>
<@yruama_lairba:matrix.org> i also wandered something,is it so different to write to do register.write( something) thant register.write(|w| {something}) where something is method call to build the value to write ?
neceve has joined #rust-embedded
creich_ has quit [Read error: Connection reset by peer]
<re_irc>
<@henrik_alser:matrix.org> It’s that you can do |w| w.something().enable().another().option1()
<re_irc>
<@yruama_lairba:matrix.org> i didn't undertand what i can do
<re_irc>
<@yruama_lairba:matrix.org> *how i think the was a confusion
<re_irc>
<@henrik_alser:matrix.org> Sorry bad explanation haha
<re_irc>
<@yruama_lairba:matrix.org> in fact for register.write(something) i was meaning write take a new value resulting of methode call
<re_irc>
<@henrik_alser:matrix.org> I mean you can do multiple things on the register and write them all at once
<re_irc>
<@yruama_lairba:matrix.org> but what is there big difference between register.write(<builder_result>) and register.write(|w| {<builder_call>})
rektide has quit [Remote host closed the connection]
<dcz_>
does the libc on a microcontroller copy the .data section to RAM manually? its flash address doesn't match the elf address
<dcz_>
(or riscv-rt in this case)
<re_irc>
<@almindor:matrix.org> libc?
<re_irc>
<@almindor:matrix.org> > does the libc on a microcontroller copy the .data section to RAM manually? its flash address doesn't match the elf address
<re_irc>
<@almindor:matrix.org> you're using C/libc setup on a risc-v board?
<dcz_>
just wondering where the startup code is - in the boot loader or in the CPU support package or something
<dcz_>
I'm just using the default Rust setup
<dcz_>
maybe I should be saying "runtime" instead
<re_irc>
<@almindor:matrix.org> there's no libc of course, it's all Rust and some assembly with a linker script
<dcz_>
yeah, I just can't fing the copying procedure
<re_irc>
<@almindor:matrix.org> damn, I hate markdown incompatibility in these clients
mellowmoonling has joined #rust-embedded
<re_irc>
<@almindor:matrix.org> the link.x script expects a memory.x script (for each core model specifically) for things like "how big is the flash, where's the start"
<re_irc>
<@almindor:matrix.org> so the memory-hifive1-revb.x board "memory definition" includes the memory-fe310.x core "ram definition" and then all that is included into the link.x master script
<re_irc>
<@yruama_lairba:matrix.org> hi, i can't remember what is the crate containing embedded hal for spi
<re_irc>
<@almindor:matrix.org> this is all linker's job to put together, so .data sections end up in 0x80000000 in the end
<re_irc>
<@yruama_lairba:matrix.org> i can't find it on crates.io
<re_irc>
<@almindor:matrix.org> > i can't find it on crates.io
<re_irc>
<@almindor:matrix.org> you mean the spi e-h trait (the general one) ?
<re_irc>
<@almindor:matrix.org> > i can't find it on crates.io
<dcz_>
I traced the linker files and I think I get them, but I still can't see the asm loop that would load .data from flash in the linked files...
<dcz_>
maybe I'm not used to reading asm any more
<re_irc>
<@yruama_lairba:matrix.org> in fact i'm searching the project trying to abstract many embedded thing, for example SPI and I2C
<dcz_>
still, there's a _sidata symbol for the flash location of the data section, so it should be referenced somewhere
<re_irc>
<@yruama_lairba:matrix.org> almindor: thanks that what i was searching
<re_irc>
<@dirbaio:matrix.org> g
<re_irc>
<@almindor:matrix.org> > still, there's a _sidata symbol for the flash location of the data section, so it should be referenced somewhere
<re_irc>
<@almindor:matrix.org> tbh. I never thought about that much. I'm guessing the locations correspond to the hw sections (e.g. ram vs flash) by address and are simply taken to the right place by the actual loader (e.g. jlink)
<re_irc>
<@almindor:matrix.org> so e.g. for this board if I have a section that points to 0x2000000 it's flash but 0x8000000 would go in ram
<re_irc>
<@almindor:matrix.org> hmm no it should have a basic data init I guess, good question!
<dcz_>
I vaguely recall having seen such an init procedure years ago. Unexercised skills atrophy :S
<re_irc>
<@dirbaio:matrix.org> it's very theoretical, afaik the compiler has never been caught red-handed miscompiling it (?)
<re_irc>
<@almindor:matrix.org> question of time
<re_irc>
<@almindor:matrix.org> now I know where to look if rustup ends up borking it
<re_irc>
<@dkhayes117:matrix.org> murphy's law
* dcz_
is happy to see it go, crates of <100 lines should be coalesced into bigger groups
<re_irc>
<@thejpster:matrix.org> TimSmall: Currently I'm using an RP2040 on a Pi Pico. The slots are a nice TE edge connector carrying SPI and I2C.
<re_irc>
<@thejpster:matrix.org> I bought five boards - broke one, sold one. Happy to give one away to an enthusiast who can commit to spending some time on it.
fabic has quit [Ping timeout: 265 seconds]
<re_irc>
<@dkhayes117:matrix.org> Cool, I'm an offical WG member of the risc-v team! Thank you fellowWG members, hopefully I can contribute to making more embedded rust awesome!
<re_irc>
<@almindor:matrix.org> > Cool, I'm an offical WG member of the risc-v team! Thank you fellowWG members, hopefully I can contribute to making more embedded rust awesome!
<re_irc>
<@almindor:matrix.org> welcome
<re_irc>
<@jhbruhn:jhbruhn.de> hdoordt: I hope to get some nice results from my masters thesis, we'll see how that goes
<re_irc>
<@jhbruhn:jhbruhn.de> Meaning: A bootloader and reference implementation for OTA, but the latter usually is too application specific (transport used, MCU used, ...) to make a totally generic All in One crate
<re_irc>
<@jhbruhn:jhbruhn.de> Speaking of totally-generic AiO: Are the other trait-collection traits for device drivers like https://github.com/NeoBirth/accelerometer.rs or the others listed in awesome-rust-embedded that i am missing? For example temperature/humidity sensors?
<re_irc>
<@jhbruhn:jhbruhn.de> And if not, would there be interest for more trait-crates like these to establish a standard interface one could use to write their application against, abstracted away from the actual hardware implementation (and thus allowing to test the application logic on host with mocks)?
neceve has quit [Ping timeout: 245 seconds]
creich has joined #rust-embedded
<re_irc>
<@jbeaurivage:matrix.org> That's a great idea, I think it could be even more useful as an all-inclusive `embedded-sensors` crate or some such
<re_irc>
<@jbeaurivage:matrix.org> I'd be willing to help out with some traits. Specifically, I already have some very basic traits for a temperature/pressure sensor which I use as an altimeter