HAL Design Philosophy #31
Replies: 2 comments 1 reply
-
Going to do a bit of a brain-dump just to get this out in the open, will likely add on to it later. Feel free to discuss these and/or add your own points.
|
Beta Was this translation helpful? Give feedback.
-
I agree on all of the above - especially the thing about as much compile-time-safety as possible. For the "not depend on ESP-IDF bootloader" we could try MCU-boot until we have some minimal (direct-boot like) bootloader written in pure Rust to verify that - I guess we will need some specific init code for every bootloader we will support? e.g. NuttX does some different things when ESP-IDF bootloader or MCU boot is used. But I really like the idea of a pure Rust minimal-bootloader One thing I really don't have a strong opinion on: Concurrency. I looked at different HAL implementations and seems like some don't care at all and some do care. In most situations exclusive ownership of the peripheral should do the trick for us but some peripherals are used in multiple places (for enabling peripherals and interrupt configuration / reset at least) - in those places we just use raw-pointers from the PAC which will cause problems when modified concurrently. One solution could be to move that functionality elsewhere and enforce ownership. That however will be much less convenient - if not problematic in some situations - at the call site. Not even sure if we can do that really for everything |
Beta Was this translation helpful? Give feedback.
-
In a PR @bjoernQ had mentioned:
This discussion has been created with the intent of trying to solve some of these problems.
Beta Was this translation helpful? Give feedback.
All reactions