zephyrproject-rtos / gsoc-2022-arduino-core

Arduino Core Zephyr Module (GSoC 2022 Project)
Apache License 2.0
44 stars 11 forks source link

Autogenerate board support #11

Open beriberikix opened 2 years ago

beriberikix commented 2 years ago

Note: this is currently out of scope for the GSoC season due to the time required to implement but I'm leaving this here for future contributions.

Arduino cores call each board a "variant" and place board-specific files in the variants folder. These files, plus specifying them in the boards.txt (see #10,) is what let's the Arduino tools know how to build, flash and generally interact with a board.

In the Zephyr world, a lot of that information is encapsulated in files like a board's device tree. It is theoretically possible to use this information to partially (or fully?) autogenerate Arduino variants and boards.txt. There are many libraries out there, but for example lopper is a common Python library to manipulate DTS files.

DhruvaG2000 commented 10 months ago

This is a good idea @beriberikix , and since it involves devicetree I think a potential topic to bring up in coming Linux Plumbers Conf 2023. Do update if you have had any more insights on this topic from since when you've raised this issue.

beriberikix commented 10 months ago

Okay! I still think creating a custom output for lopper might be the most straightforward. I know the MicroPython folks are asking a similar question.

The idea was inspired by this talk: https://youtu.be/m8wh0pT_P-c?si=KPeCzlqY5_yIaPZ8