Skip to content

Conversation

@feilongfl
Copy link
Contributor

@feilongfl feilongfl commented Jul 9, 2021

This PR adds support for GigaDevice GD32E103VBT6 SoC and GD32E103V-EVAL board that is use the SoC.

Currently, the west module dependency points to https://github.com/feilongfl/hal_gd32 (most of these code was download from gigadevice's website, -> Documents & Software -> Firmware Library)
I'm not sure where can I put these code,I found another issues #34971 have gigadevice RISKV device,but I think it's not good to put code there.

At this time, Only samples/basic/blinky is work.And lots of code is copy from stm32, So some code is not necessary.
I'll remove them later.

@github-actions
Copy link

github-actions bot commented Jul 9, 2021

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
hal_gigadevice zephyrproject-rtos/hal_gigadevice@242a7f4 zephyrproject-rtos/hal_gigadevice@cc85acb (main) zephyrproject-rtos/[email protected]

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@feilongfl feilongfl changed the title Add GD32E103(arm cotex-m4) device support boards: Add GD32E103(arm cotex-m4) device support Jul 9, 2021
@feilongfl feilongfl force-pushed the dev-GD32E103_EVAL branch 4 times, most recently from e018417 to 7995b36 Compare July 10, 2021 21:42
@carlescufi
Copy link
Member

carlescufi commented Jul 26, 2021

@feilongfl thank you for this PR. Regarding the .dtsi files in the https://github.com/feilongfl/hal_gd32 repo, are those present in the upstream repository that this was taken from? If they are not, then you should put them in the main zephyr tree instead.

In general the policy is: if it's written exclusively for Zephyr it should be in the main zephyr tree. If it's part of a cross-RTOS HAL or library that is published separately then it belongs in the external module repo.

@carlescufi
Copy link
Member

Currently, the west module dependency points to https://github.com/feilongfl/hal_gd32.

Could you please describe in the main body of this PR where this code comes from?

@feilongfl
Copy link
Contributor Author

@feilongfl thank you for this PR. Regarding the .dtsi files in the https://github.com/feilongfl/hal_gd32 repo, are those present in the upstream repository that this was taken from? If they are not, then you should put them in the main zephyr tree instead.

In general the policy is: if it's written exclusively for Zephyr it should be in the main zephyr tree. If it's part of a cross-RTOS HAL or library that is published separately then it belongs in the external module repo.

I got it, i will move these dtsi code to zephyr prj.

Could you please describe in the main body of this PR where this code comes from?

most of these code was download from gigadevice's website, -> Documents & Software -> Firmware Library

@nandojve
Copy link
Member

Hi @carlescufi ,

Do you think Zephyr project can add at least hal_gigadevice ? I have an gd32f403 minimal working too. It was just a test but I can clean up e fix docs and that can be very useful. GigaDevices ARM firmwares are pretty easy to be used with Zephyr.

GigaDevices provides a firmware library and tools for all ARM and RISC-V at GigaDevices Download Site .

@feilongfl
Copy link
Contributor Author

I've move *.dtsi from module to zephyr repo and migrate to latest version.

@feilongfl
Copy link
Contributor Author

I've migrated this pr to latest main branch. If somewhere need modify, just let me know.

@carlescufi

@nandojve nandojve mentioned this pull request Sep 19, 2021
55 tasks
Copy link
Member

@nandojve nandojve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @feilongfl !
Two comments only.

@nandojve nandojve requested a review from gmarull February 27, 2022 20:03
@nandojve nandojve added this to the v3.1.0 milestone Feb 28, 2022
Update the hal_gigadevice revirsion which support gd32e10x HAL.

Signed-off-by: YuLong Yao <[email protected]>
add soc.h include in pinctrl_gd32_afio.c

Signed-off-by: YuLong Yao <[email protected]>
Add support for GigaDevice gd32e10x series.

Signed-off-by: YuLong Yao <[email protected]>
Add support for the E10x series.

Signed-off-by: YuLong Yao <[email protected]>
Add gigadevice gd32e103v_eval board initial version.

Signed-off-by: YuLong Yao <[email protected]>
@feilongfl feilongfl force-pushed the dev-GD32E103_EVAL branch from b7b539a to 4271540 Compare March 1, 2022 10:50
Copy link
Member

@gmarull gmarull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a couple of minor comments before approval

Comment on lines 22 to 31
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be:

group1 {
    pinmux = <I2C0_SCL_PB6_NORMP>, <I2C0_SDA_PB7_NORMP>;
    drive-open-drain;
};

Copy link
Contributor Author

@feilongfl feilongfl Mar 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the eval board SCL have pull-up resistors, but I'm not sure as IIC master, does SCL needs to be open-drain?
😕

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still need it, e.g. for https://www.i2c-bus.org/clock-stretching/

feilongfl added 10 commits March 1, 2022 20:34
set HAXTL_VALUE to GD32_HXTAL_8MHZ for gd32_e103.

Signed-off-by: YuLong Yao <[email protected]>
add exti for gd32e103

Signed-off-by: YuLong Yao <[email protected]>
add `gpio-controller` property to gpio node.

Signed-off-by: YuLong Yao <[email protected]>
add 4x leds and 3x button for eval board.

Signed-off-by: YuLong Yao <[email protected]>
add timer and pwm into dts.

Signed-off-by: YuLong Yao <[email protected]>
add 1x pwmled.

Signed-off-by: YuLong Yao <[email protected]>
add i2c node in dts.

Signed-off-by: YuLong Yao <[email protected]>
add support for at24 eeprom.

Signed-off-by: YuLong Yao <[email protected]>
enable dac.


Signed-off-by: YuLong Yao <[email protected]>
add dac support.

Signed-off-by: YuLong Yao <[email protected]>
@feilongfl feilongfl force-pushed the dev-GD32E103_EVAL branch from 4271540 to c077ab3 Compare March 1, 2022 12:39
@gmarull gmarull requested a review from nandojve March 1, 2022 14:01
Copy link
Member

@nandojve nandojve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @feilongfl,
Thank you so much.

@henrikbrixandersen henrikbrixandersen removed their request for review March 1, 2022 15:50
@carlescufi carlescufi merged commit 86f460c into zephyrproject-rtos:main Mar 1, 2022
@str4t0m str4t0m added the platform: GD32 GigaDevice label Aug 26, 2022
Copy link

@tianrking tianrking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants