PMunch / ratel

128 stars 4 forks source link

Question: Is Ratel a HAL? My thoughts. #11

Closed adokitkat closed 2 years ago

adokitkat commented 2 years ago

Hi! Is this project similar to embedded-hal?

I am in a search for a way to use Nim on embedded devices which is user-friendly and not a headache. I personally use ESP32s the most and I would really like to use them comfortably with Nim. I tried many ways :

but each has it's own flaws. There are also ways I did not try yet:

I really like the premise of Ratel but I feel like adding embedded targets manually it's just not plausible and should be somehow automated.

One way I did not really tried yet and also did not mention above is a usage of SVD files. I found out about this only recently so maybe I am totally wrong but these in combination with a HAL could be the answer. There also is svd2nim package similar to Rust's svd2rust. This way should be embedded target agnostic.

However all of this requires a great amount of time to be researched and worked on so... And I am not that skilled to pull it off. Those are just my thoughts and speculations.

If I am wrong then please correct me.

PMunch commented 2 years ago

Yes, it is similar to embedded-hal in concept. The goal is to make programming against microcontrollers as clean and fast as possible to do in Nim.

Currently Ratel doesn't have ESP32 support, but it's on the list of boards I want to get implemented first. Unfortunately embedded targets differ enough that doing everything automatically wouldn't really be feasible. SVDs might work for ARM Cortex chips, but wouldn't really help for anything else AFAIK. Luckily the process of writing board support is fairly simple, and I want to make it even easier. I'm currently working on wrapping more boards and writing the documentation on how to do this. And as I go I discover small things that could be done to make things easier. Hopefully once the documentation is done it should be fairly easy to get more boards integrated.

adokitkat commented 2 years ago

Then I think I'll wait for the documentation.

Btw ESP's also have SVD files released: https://github.com/espressif/svd

Thank you for answer.