Closed H-Grobben closed 3 years ago
Thanks for this. Will be happy to add it because we do want STM32G4 support in MicroPython.
I actually have a script (which I can eventually put in this repo) which automatically imports a Cube HAL library from ST's github repo. That makes it pretty easy to import new HALs and upgrade them over time. I'm not sure how you added the code here, but it may be simpler to just use this import script to do it? That way everything is converted in a canonical way (eg tabs converted to spaces).
I've checked out the code from the ST repo on git and applied the sh command/script mentioned in the readme file.
I've just updated to 1.3.0 today, and just removed all files in this g4 lib for micropython and copied them over from the STM repo after applying the code formatting / cleanup script.
It could be better to have a script that pulls all libs from the STM repo, I saw the local edits that fix bugs that are also fixed in the STM repo.
I checked this PR against what my script does and there are some minor discrepancies (trailing white space, and iar linker scripts which are not needed).
I appreciate your efforts to open this PR, but it might be easier if I just push my local additions made by the import script? I'll also push the import script itself to make it easier next time for contributors (ST only recently made the Cube HAL code available on GitHub, so this automated import is relatively new).
Please do, I will check with my hardware if it compiles. And it will be easier to add new families later. It's not like there is a lot of effort going into this PR. The other PR in MicroPython self was more effort.
G4 support was added to the vendor branch in 32d53d5b47de454a5fc5197c95a697001705fc68
I've integrated the STM32G4 lib (v1.2.0) with the vendor branch, seems you like to put them on a different branch, so I don't know if you need to change the branch. But I've tested it with my own micropython with changes for the G4 series. The pull request for that is following this one.