Nuclei-Software / nuclei-sdk

Nuclei RISC-V Software Development Kit
https://doc.nucleisys.com/nuclei_sdk
Apache License 2.0
117 stars 50 forks source link

board: Add support for TTGO T-Display-GD32 #23

Closed tuupola closed 3 years ago

tuupola commented 3 years ago

This PR adds support for the LILYGO® TTGO T-Display-GD32 board. PR is still work in progress, documentation etc is missing.

$ make SOC=gd32vf103 BOARD=gd32vf103c_t_display all

Few questions.

  1. Is the board naming ok (gd32vf103c_t_display) or should it be something else?
  2. Should the linker file be named gcc_gd32vf103_flashxip.ld like now or should it be gcc_gd32vf103xb_flashxip.ld like with Longan Nano? The latter version require also extra conditional sentence in Makefile.soc.gd32vf103.
fanghuaqi commented 3 years ago

Hi, @tuupola,

  1. The board name looks good to me, the chip is a gd32vf103c on it?
  2. I think it will easiler to name gcc_gd32vf103_flashxip.ld to not change too much in Makefile.soc.gd32vf103.
tuupola commented 3 years ago

Yes, it has a GD32VF103CBT6.

tuupola commented 3 years ago

Just a quick note. I have not forgotten this, just busy with other things atm.

tuupola commented 3 years ago

After some testing this should be ready.

One question though. Currently there is some inconsistencies with naming of things. There is LEDG_PIN and KEY_A_PIN. There is both LED1 and LED_1 but only KEY_A. I think it would be good idea to choose one naming scheme and stick to it.

Which one should I use?

It is still ok to break BC when bumping SDK from 0.3.x to 0.4.0. I also don't think there is too much software which will break because of this, and if they do the fix is really easy.

tuupola commented 3 years ago

Also the board image in documentation is taken from manufacture website. If this is a problem I can take a photo of the board myself.

fanghuaqi commented 3 years ago

Hi @tuupola , I prefer to user must define the following enums:

typedef enum
{
    LED_1 = 0,
    LED_2 = 1,
    LED_3 = 2,
} led_typedef_enum;

typedef enum
{
    KEY_A = 0,
    KEY_B = 1,
    KEY_C = 2,
} key_typedef_enum;

typedef enum
{
    KEY_MODE_GPIO = 0,
    KEY_MODE_EXTI = 1
} keymode_typedef_enum;

If you have more than 3 leds, and keys, the above should be defined.

Thanks Huaqi

tuupola commented 3 years ago

I test compiled and uploaded everything in application folder. There are some unrelated compiler warnings with demo_dsp and freertos/demo . Everything works fine with my TTGO T-Display-GD32 board though. I think this should be ready for merging.

fanghuaqi commented 3 years ago

Done