Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep a structure similar to Arduino_Core_STM32 #118

Closed
bmourit opened this issue Jan 20, 2024 · 3 comments
Closed

Keep a structure similar to Arduino_Core_STM32 #118

bmourit opened this issue Jan 20, 2024 · 3 comments

Comments

@bmourit
Copy link
Contributor

bmourit commented Jan 20, 2024

If possible, imo it would be best to keep this repo as similar as possible to the STM32 version. There are a few reasons for this that I believe make it important.

  1. No need to reinvent the wheel. Since many of these MCUs are compatible with a version of some STM32 MCU, we should reuse as much code as possible from them. This is the entire purpose of Open Source, and the STM32 repo has been tried and tested.

  2. Most GD32 users are using the STM32 repo and our goal should be making it simple for them to switch. The less involved the process, the better. While exact replication isn't always going to be possible, we should at least keep the general structure relatively similar.

  3. Common API
    While GD32 may or may not do this on their own, it would be neat to get a common API for these platforms. Eventually this will cause some diversion from STM32, but we can use macros and defines in a similar way they do to insure legacy MCUs still work.

I'm thinking particularly of the GPIO and pin code with Arduino. The documentation for both STM32 and GD32 is not very clear in the manuals. But we know a lot of chips are using the STM32 version. So let's take advantage of what is already done.

I've started some of this already. I've already separated out digitalpins and analogpins, and respective name files. For some reason the GD32 version was using a different bit packing structure and different functions to find and sort the pins and names. I say we dump that and adopt the exact functions Arduino_STM32 is using. They work, and we wont have to spend hours trying to figure out what is going on.

@obra
Copy link
Contributor

obra commented Jan 20, 2024 via email

@obra
Copy link
Contributor

obra commented Jan 20, 2024 via email

@bmourit
Copy link
Contributor Author

bmourit commented Jan 20, 2024

In the USB libraries yes. I'm not referring to those. There is nothing in the STM32duino code (not done by STM) that would prevent what I am referring to. It was literally done by the Open Source community. One of the tenants of that community being code reuse.

A more "pure" Arduino core would still be feasible if so desired, and my suggestion wouldn't prevent that from happening.
But having a pure core that no one is using benefits no one.

Also, there is nothing predatory about STM's USB license, whatsoever. STM is very good to the open source world in general, so I feel those comments are misplaced.

Please also note, this project has seen almost no activity in nearly a year. So I am not sure why anyone would be against something that could make it usable to many projects, ie. Marlin Firmware. But if this is something unwanted, I will just do my own fork.

@bmourit bmourit closed this as completed Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants