CommunityGD32Cores / gd32-pio-spl-package

Improved repackaging of GD32 SPL code for PlatformIO
9 stars 13 forks source link

Update SPL packages #9

Open maxgerhardt opened 2 years ago

maxgerhardt commented 2 years ago

As noticed in https://github.com/CommunityGD32Cores/gd32-pio-spl-package/pull/8#issuecomment-920670493, we are one minotr version behind with the GD32F30x firmware library.

We should look for updates at, pull them into https://github.com/CommunityGD32Cores/gigadevice-firmware-and-docs for documentation and then pull them in here for an update.

We might have to do bugfixes again like cplusplus --> __cplusplus, re-definition of bool and I also remember one case in a CMSIS device header where the a macro should have been lower instead of uppercase.

All these fixes / patches should be documented too and maybe create a .patch file from them so that we can update packages more easily.

hisaha commented 2 years ago

I have tried update f10x to v2.2.2 with below steps,

It seems to work. Is this process correct ?

Thanks

hisaha commented 2 years ago

Thanks for your merging. I am surprised the progress is fast !

maxgerhardt commented 2 years ago

Ah yes sorry I wanted to notify for after merge, I merged your stuff since it looked all good.

I'm always keeping an eye on the modifications because we ourselfs did some mods for things that needed to be fixed but Dialog hasn't yet fixed. For example, they define their own boolean type with FALSE and TRUE, we exchanged that for #include <stdbool.h>. They continously misspell #ifdef cplusplus when it should be #ifdef __cplusplus, which breaks using C++ with SPL. But your merge did not modify any of this, so our fixes stayed (good).

At some point I have to think about refactoring those into .patch files or pinging GigaDevice devs again to fix the bugs upstream.

But, to answer your original question: Yes, that update process is perfectly valid. Basically we pull out the SPL files from the original download and put them in the folder structure we have here.

I will also have a look at updating / integrating the USB library at a later time. We already have PlatformIO builder scripts for other USB stacks and they're all similiar (2 basic types I think).