Skip to content

[RFC] GigaDevice Vendor Support #38657

Open
Open
@nandojve

Description

@nandojve

Introduction

There is community interest to add support to GigaDevice SoC Vendor in Zephyr. Community members have intentions to support both ARM and RISC-V SoC's. This RFC was opened to serve as an umbrella to help community and Zephyr members know the initiatives.

Problem description

Currently there are some attempts to introduce support in Zephyr:
#36832
#36833
#34970
#34971

The main discussion was conducted at #34971, which is TSC tagged.

Proposed change

Give an overview about all pieces required to add GigaDevice SoC Vendor in Zephyr.

Detailed RFC

In this section of the document the target audience is the dev team. Upon reading this section each engineer should have a rather clear picture of what needs to be done in order to implement the described feature.

There are two content groups that need to be addressed: hal and drivers.

Vendors HAL

There are two vendors dependencies that should be addressed: hal_gigadevice and NMSIS module.

The HAL GigaDevice

This HAL is necessary to keep tracking with manufacturer firmware versions. The vendor provide an API that abstracts registers access and it is well tested. The documentation and firmware versions can be found at gd32mcu.com web site.

Some SoC series may have aditional features. This is the reason for some series have different drivers versions. For instance, F403 series not share same drivers versions with other SoC from the same series.
To address those details a directory structure is proposed. It is composed by default Zephyr module structure plus each SoC series directory. The below example uses gd32f403 ARM series and gd32vf103 RISC-V series:

├── gd32f403
│   ├── cmsis
│   │   └── gd
│   │       └── gd32f403
│   │           ├── include
│   │           │   ├── gd32f403.h
│   │           │   └── system_gd32f403.h
│   │           └── source
│   │               └── system_gd32f403.c
│   ├── README.h
│   └── standard_peripheral
│       ├── include
│       │   ├── gd32f403_adc.h
│       │   ├── ...
│       │   └── gd32f403_wwdgt.h
│       └── source
│           ├── gd32f403_adc.c
│           ├── ...
│           └── gd32f403_wwdgt.c
├── gd32bf103
│   ├── README.h
│   ├── riscv
│   │   ├── include
│   │   │   ├── gd32vf103.h
│   │   │   └── system_gd32vf103.h
│   │   └── source
│   │       └── system_gd32vf103.c
│   └── standard_peripheral
│       ├── include
│       │   ├── gd32vf103_adc.h
│       │   ├── ...
│       │   └── gd32vf103_wwdgt.h
│       └── source
│           ├── gd32vf103_adc.c
│           ├── ...
│           └── gd32vf103_wwdgt.c
└── zephyr
    └── module.yml

The content of CMSIS and NMSIS should be replaced by proper Zephyr structure over time. In the ARM case, it is straightforward to bring up any board. The NMSIS will follow the decision of NMSIS module.

The remaining content of firmware package from vendor should not be added. The reason that is for Zephyr use case only the peripheral definitions are the essential component.

NMSIS module from Nuclei Systems

Nuclei System Technology is a RISC-V processor IP and solution provider. Nuclei Systems collaborated with GigaDevice for the first RISC-V based general-purpose MCU in the world — GD32VF103. The NMSIS is a similar core with a structure similar to ARM CMSIS. More information at www.nucleisys.com and Nuclei-Software.

It is not 100% clear yet how integrate this structure into Zephyr. The main discussion was initially made at #34971. The Nuclei Systems suggested initially that gd32vf103 drivers should be at same place of NMSIS. However, this can be a problem to share drivers and support more Nuclei Systems newer IPs. Besides GD32VF103 directory contains the RISCV directory the intention is not use that content and can be keep it for historical reasons.

Peripheral Drivers

The GD32 platform shares in many cases the same peripheral IPs. This means that community members should check for compatibility between some SoC series. The suggested list is:

  • gd32e103
  • gd32f403
  • gd32vf103

Dependencies

The current dependencies are add module NMSIS from Nuclei Systems and HAL gigadevices. Those are the fundamental base to create the future port and Zephyr drivers.

Task List

The below task list is a suggestion plan to coordinate work to enable minimal support on Zephyr:

Essential List

Boards/SoC

Driver Extended List

The extended list is not limited and community is encouraged to edit and add/remove entries. It is recommended complete the essential list before start with any item from the extended list to avoid unnecessary future rework.

Other drivers

Enhancements

Note to Community

The GigaDevice and Nuclei System community are encouraged to edit this RFC proposal.

CC: @feilongfl @soburi @fanghuaqi
Zephyr: @galak @carlescufi @olofj @cfriedt @kgugala @MaureenHelm @katsuster

Metadata

Metadata

Assignees

Labels

MetaA collection of features, enhancements or bugsRFCRequest For Comments: want input from the communityplatform: GD32GigaDevice

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions