fabic has joined #rust-embedded
fabic has quit [Ping timeout: 258 seconds]
dcz has joined #rust-embedded
hifi has quit [Remote host closed the connection]
hifi has joined #rust-embedded
emerent has quit [Ping timeout: 240 seconds]
emerent has joined #rust-embedded
neceve has joined #rust-embedded
<re_irc> <@t​hejpster:m​atrix.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> <@T​imSmall:m​atrix.org> Interesting. What are you thinking the main micro would be? Slots?
Rahix has quit [Quit: ZNC - https://znc.in]
Rahix has joined #rust-embedded
fabic has joined #rust-embedded
fabic has quit [Ping timeout: 245 seconds]
fabic has joined #rust-embedded
neceve has quit [Ping timeout: 268 seconds]
<re_irc> <@y​ruama_lairba:m​atrix.org> hello, i think i need re explanation about somthing
<re_irc> <@y​ruama_lairba:m​atrix.org> why clousre are use to write value in a pac ? is there another syntax accomplishing the same job ?
<re_irc> <@y​ruama_lairba:m​atrix.org> sorry i ask this to know how to design good API
<re_irc> <@y​ruama_lairba:m​atrix.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> <@h​enrik_alser:m​atrix.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> <@h​enrik_alser:m​atrix.org> (even things like auto-complete)
<re_irc> <@y​ruama_lairba:m​atrix.org> auto-complete ?
<re_irc> <@h​enrik_alser:m​atrix.org> In your ide
<re_irc> <@h​enrik_alser:m​atrix.org> With rust analyzer
<re_irc> <@y​ruama_lairba:m​atrix.org> lol, i don't know how tu use this with vim
<re_irc> <@y​ruama_lairba:m​atrix.org> the autocomplete i use is based on word already writted in opened file
<re_irc> <@h​enrik_alser:m​atrix.org> Sorry i’m in vs code 🤷🏻‍♀️
<re_irc> <@y​ruama_lairba:m​atrix.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> <@h​enrik_alser:m​atrix.org> It’s that you can do |w| w.something().enable().another().option1()
<re_irc> <@y​ruama_lairba:m​atrix.org> i didn't undertand what i can do
<re_irc> <@y​ruama_lairba:m​atrix.org> *how i think the was a confusion
<re_irc> <@h​enrik_alser:m​atrix.org> Sorry bad explanation haha
<re_irc> <@y​ruama_lairba:m​atrix.org> in fact for register.write(something) i was meaning write take a new value resulting of methode call
<re_irc> <@h​enrik_alser:m​atrix.org> I mean you can do multiple things on the register and write them all at once
<re_irc> <@y​ruama_lairba:m​atrix.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> <@a​lmindor:m​atrix.org> libc?
<re_irc> <@a​lmindor:m​atrix.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> <@a​lmindor:m​atrix.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> <@a​lmindor:m​atrix.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> <@a​lmindor:m​atrix.org> [this](https://github.com/rust-embedded/riscv/blob/master/asm.S) is used for interrupts and friends [this](https://github.com/rust-embedded/riscv-rt/blob/master/asm.S) is used for entrypoint definition and [this](https://github.com/rust-embedded/riscv-rt/blob/master/link.x) is used for the linker script to put...
<re_irc> ... it all together
<re_irc> <@a​lmindor:m​atrix.org> damn, I hate markdown incompatibility in these clients
mellowmoonling has joined #rust-embedded
<re_irc> <@a​lmindor:m​atrix.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> <@a​lmindor:m​atrix.org> you can see that DATA is defined to reside within the RAM section
<re_irc> <@a​lmindor:m​atrix.org> oh and the actual core memory definition that's called in the include is here: https://github.com/riscv-rust/e310x/blob/master/memory-fe310.x
<re_irc> <@a​lmindor:m​atrix.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> <@y​ruama_lairba:m​atrix.org> hi, i can't remember what is the crate containing embedded hal for spi
<re_irc> <@a​lmindor:m​atrix.org> this is all linker's job to put together, so .data sections end up in 0x80000000 in the end
<re_irc> <@y​ruama_lairba:m​atrix.org> i can't find it on crates.io
<re_irc> <@a​lmindor:m​atrix.org> > i can't find it on crates.io
<re_irc> <@a​lmindor:m​atrix.org> you mean the spi e-h trait (the general one) ?
<re_irc> <@a​lmindor:m​atrix.org> > i can't find it on crates.io
<re_irc> <@a​lmindor:m​atrix.org> here's the blocking one: https://github.com/rust-embedded/embedded-hal/blob/master/src/blocking/spi.rs
<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> <@y​ruama_lairba:m​atrix.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> <@y​ruama_lairba:m​atrix.org> almindor: thanks that what i was searching
<re_irc> <@d​irbaio:m​atrix.org> g
<re_irc> <@a​lmindor:m​atrix.org> > still, there's a _sidata symbol for the flash location of the data section, so it should be referenced somewhere
<re_irc> <@a​lmindor:m​atrix.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> <@a​lmindor:m​atrix.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> <@a​lmindor:m​atrix.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> <@d​irbaio:m​atrix.org> for cortex-m-rt it's here https://github.com/rust-embedded/cortex-m-rt/blob/master/asm.S#L66-L79
<re_irc> <@d​irbaio:m​atrix.org> riscv-rt uses r0, calls it here https://github.com/rust-embedded/riscv-rt/blob/master/src/lib.rs#L382
<re_irc> <@d​irbaio:m​atrix.org> which does the same thing, but in rust https://github.com/rust-embedded/r0/blob/master/src/lib.rs#L128
<re_irc> <@a​lmindor:m​atrix.org> :doh: of course! :D
<re_irc> <@a​lmindor:m​atrix.org> it's been some years
<re_irc> <@d​irbaio:m​atrix.org> cmrt used to use r0 but it was changed to asm due to concerns of it being UB
<re_irc> <@a​lmindor:m​atrix.org> what concerns?
<re_irc> <@a​lmindor:m​atrix.org> ah https://github.com/rust-embedded/cortex-m-rt/issues/300
<re_irc> <@a​lmindor:m​atrix.org> I guess we should make an issue to fix this in riscv-rt then
<re_irc> <@a​lmindor:m​atrix.org> nvm https://github.com/rust-embedded/riscv-rt/issues/69
<re_irc> <@d​irbaio:m​atrix.org> it's very theoretical, afaik the compiler has never been caught red-handed miscompiling it (?)
<re_irc> <@a​lmindor:m​atrix.org> question of time
<re_irc> <@a​lmindor:m​atrix.org> now I know where to look if rustup ends up borking it
<re_irc> <@d​khayes117:m​atrix.org> murphy's law
* dcz_ is happy to see it go, crates of <100 lines should be coalesced into bigger groups
<re_irc> <@t​hejpster:m​atrix.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> <@t​hejpster:m​atrix.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> <@d​khayes117:m​atrix.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> <@e​ldruin:m​atrix.org> dkhayes117: Welcome!
<re_irc> <@a​lmindor:m​atrix.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> <@a​lmindor:m​atrix.org> welcome
<re_irc> <@j​hbruhn:j​hbruhn.de> hdoordt: I hope to get some nice results from my masters thesis, we'll see how that goes
<re_irc> <@j​hbruhn:j​hbruhn.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> <@j​hbruhn:j​hbruhn.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> <@j​hbruhn:j​hbruhn.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> <@j​beaurivage:m​atrix.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> <@j​beaurivage:m​atrix.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
fabic has joined #rust-embedded