!WqsLCItsZbJGhRjnxP:matrix.org

stm32-rs

503 Members
Discussion and support for stm32-rs projects. History is publicly viewable. Bridged to ##stm32-rs on Freenode IRC. Code of conduct: https://www.rust-lang.org/conduct.html55 Servers

Load older messages


SenderMessageTime
19 Jul 2020
@adamgreig:matrix.orgadamgreigand a lot of peripherals are almost identical across families18:15:25
@adamgreig:matrix.orgadamgreigand there's so many families - F0/1/2/3/4/7 L0/1/4/5 H7 G0/4 - that maintaining a large HAL for each of them would be so much work18:15:56
@adamgreig:matrix.orgadamgreigbut it does seem like what a "good HAL design" looks like is still very in flux, so I think it makes sense to keep developing them a bit separately while we work that out at least18:16:18
@therealprof:matrix.orgtherealprof
In reply to @adamgreig:matrix.org
I don't think that fundamentally you can't have a more unified HAL, other projects (FreeRTOS, ChibiOS, libopencm3) manage it in various ways
I don't think that counts at all. They way they're achieving that is completely unacceptable in a Rust world.
18:17:01
@adamgreig:matrix.orgadamgreigit's not that different from feature gates and submodules and stuff18:17:56
@adamgreig:matrix.orgadamgreigyou could definitely have a HAL that had like three SPI sub-modules and exported one or the other as "SPI" based on your selected device18:18:24
@adamgreig:matrix.orgadamgreigrather than having to copy-paste that sub-module into the 4 families to which it applies, etc18:18:32
@therealprof:matrix.orgtherealprofHiding everything in unwieldy structures and callbacks every device specific impl has to implement? Then the totally unsafe reacharound into global registers?18:19:00
@therealprof:matrix.orgtherealprofI agree we can do some stuff more globally. But there'll always be a lot model specific setup.18:19:55
@adamgreig:matrix.orgadamgreigI don't want the weird structures and callbacks and so forth, no, but I don't think they're required18:20:17
@adamgreig:matrix.orgadamgreiganyway my point for now is I think more work is useful just to discover what a good HAL contains18:20:31
@therealprof:matrix.orgtherealprofEven if the peripheral is the same, the way the peripheral is embedded into an MCU sometimes very specific.18:20:45
@adamgreig:matrix.orgadamgreigthe PREC thing in H7 for example seems very neat18:21:09
@adamgreig:matrix.orgadamgreig therealprof: sure, but that's true even inside the same family 18:21:30
@therealprof:matrix.orgtherealprofWhat's that?18:21:31
@adamgreig:matrix.orgadamgreigso you have to handle it anyway, such is the nature of embedded devices18:22:00
@therealprof:matrix.orgtherealprof * Even if the peripheral is the same, the way the peripheral is embedded into an MCU is sometimes very specific.18:22:22
@therealprof:matrix.orgtherealprof
In reply to @adamgreig:matrix.org
therealprof: sure, but that's true even inside the same family
Yes, that's exactly what I'm saying. But there it is managable at least.
18:22:26
@therealprof:matrix.orgtherealprofE.g. in order to make this work you'd have to fully abstract over the possible ways to clock a peripheral.18:23:12
@mindtree:matrix.orgmindtree huh, I rewrote the setup function using the svd generated register api thing and now it seems to be working (doesn't hang anymore at least)! I wonder if maybe one of these hand-written register addresses is wrong or something like this 18:23:46
@therealprof:matrix.orgtherealprofIt is possible to forget about these things with e.g. USB and ETH where you can forget about the details because the clocks are fixed prerequisites.18:24:01
@therealprof:matrix.orgtherealprofThat's makes an abstraction vastly easier.18:24:20
@mindtree:matrix.orgmindtree * huh, I rewrote the setup function using the svd generated register api thing and now it seems to be working (doesn't hang anymore at least)! I wonder if maybe one of these hand-written register addresses in the setup::setup() function is wrong or something along these lines 18:27:42
@thalesfragoso:matrix.orgthalesfragoso
In reply to @mindtree:matrix.org
huh, I rewrote the setup function using the svd generated register api thing and now it seems to be working (doesn't hang anymore at least)! I wonder if maybe one of these hand-written register addresses is wrong or something like this
Hmm, you mean the bb stuff ? I tried on a F407 though .-.
18:33:02
@thalesfragoso:matrix.orgthalesfragosoAnd I also looked at all manuals to see if they were the same18:33:27
@mindtree:matrix.orgmindtreeYeah, if I can confirm the ethernet works I'll do up a PR and get your thoughts on it18:34:00
@thalesfragoso:matrix.orgthalesfragosoHmm, but it would be a bumper if we would need to get rid of the bb18:34:34
@mindtree:matrix.orgmindtreeoh really? why's that?18:35:02
@mindtree:matrix.orgmindtree I was imagining these generated write and read methods might compile down to that under the hood, but I haven't looked closesly at that at all 18:35:38
@thalesfragoso:matrix.orgthalesfragosoBit banding guarantees atomic acesses18:36:21

There are no newer messages yet.


Back to Room ListRoom Version: 5