Closed howitzer74 closed 3 years ago
The gd32_includes.h
looks very good, thanks!
The example will probably build fine but with recent enhancements in the platform / builder code and SPL package, it can be simplified a lot:
-D <board name>
macros in the platformio.ini
because _bare.py
(which is included by all builder scripts, such as spl.py
and arduino.py
adds the name of the board automatically as macro here. (e.g. gd32350g_start.json
board def -> GD32350G_START
macro)gd32f307c_eval.h
will in the feature be done in the SPL package as a PlatformIO library. Basically SPL looks in the gd32/libraries/<spl series>
for library folders, which can e.g. be folders where this board BSP is. The build support for that is already there in spl.py
(see here), but the libraries have only been added for the GD32F3x0 series at this point, not your F30X series. (A minor caveat of that is that in order for PIO's library dependency finder to identify the library dependency in that nested #if defined(...)
statement, lib_ldf_mode
has to be set to chain+
) I'll merge this now and this ToDo note will serve me as reminder for later refactor.
Hm, the example has failed to build, not finding #include <gd32f30x.h>
, I'll investigate.
@howitzer74 The example code has a lot of eval boards in the platformio.ini
of different series, like gd32103b_eval
from the GD32F10X series, but the file gd32f30x_it.h
unconditionally includes gd32f30x.h
, which is not there since its of a different series. Also since gd32f307c_eval.c
is compiled in unconditionally and not guarded by say #if defined(GD32307C_EVAL)
, it will also trigger gd32f30x.h
inclusion.
The example needs a lot more work if needs to work for every known eval board, also e.g. regarding the used LED (not all have LED2) and the GPIO API (different between series). Should we reduce the platformio.ini
to only the gd32307c_eval
environment or how do you want to proceed?
I've added all libraries for all currently supported series in https://github.com/CommunityGD32Cores/gd32-pio-spl-package/tree/main/gd32/spl/libraries, the approach with adding support for all series should be much easier now if using these automatically found libraries.
I'll merge for now and then expand for all eval boards, should be quicker.
Adding gd32-spl-blinky-eval demo to show how the GD- provided EVAL and DEMO board support files can be used to simplify the blinky demo.