Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RISC-V] ECLIC Port and GD32VF103 HAL Support #266

Merged
merged 111 commits into from
Apr 6, 2021

Conversation

KarlK90
Copy link
Contributor

@KarlK90 KarlK90 commented Mar 16, 2021

This pull request adds ChibiOS support for the RISC-V ECLIC architecture by Nucleisys as well as a HAL Port for the GD32VF103 MCU family which is based on this architecture.

The GD32VF103 has been developed by GigaDevice and is a largely API compatible STM32F103/F105/F107 "clone" with a RISC-V RV32IMAC core.

(Some) Differences:
Clock tree is mix of STM32F103 and STM32F105/STM32F107
USB OTG instead of USB Device peripheral
I2C supports Fast Mode Plus
SPI supports TI mode and NSS pulse mode
USB Clock prescalers with values 2 and 2.5 that allow a core Sysclock of 96MHz and 120MHz (Out of spec but works fine)
USB-DFU Bootloader!

My approach was to copy the existing Chibios STM32F103 HAL drivers and rename every register to the correct GigaDevice definition. (I talked to Giovanni about this and this was the preferred approach https://forum.chibios.org/viewtopic.php?f=8&t=5758)

So far I have tested:

GPIO
PWM
UART
DMA
USB OTG
I2C

So far untested:

SPI
RTC
ADC
FLASH
GPT
ICU
CAN
WGD
DAC

The I2C peripheral driver has a timing bug and randomly locks-up that I will address in a different pull request, all other tested drivers work flawless (at least for me).

I also added board definitions for the sipeed longan nano board as well as a usb cdc demo ported from STM.

Please let me know If this is good to merge. :-)

@fpoussin fpoussin self-assigned this Mar 18, 2021
@fpoussin
Copy link
Member

Could you rebase your branch?
It's currently on a very old version of this repo.

@KarlK90 KarlK90 force-pushed the gd32vf103-riscv-eclic branch from 96b3cf9 to 58129bc Compare March 25, 2021 22:43
@KarlK90
Copy link
Contributor Author

KarlK90 commented Mar 25, 2021

Rebased and pushed, don't know how this happened in the first place.

@KarlK90 KarlK90 force-pushed the gd32vf103-riscv-eclic branch from 73e96e0 to 47b93f2 Compare April 6, 2021 10:55
@KarlK90 KarlK90 marked this pull request as ready for review April 6, 2021 11:37
@KarlK90 KarlK90 force-pushed the gd32vf103-riscv-eclic branch from 47b93f2 to 35a04fc Compare April 6, 2021 11:38
@KarlK90
Copy link
Contributor Author

KarlK90 commented Apr 6, 2021

Rebased and ready to merge. I updated the first comment as well :-).

@KarlK90 KarlK90 changed the title [WIP] RISC-V ECLIC Port and GD32VF103 HAL Support [RISC-V] ECLIC Port and GD32VF103 HAL Support Apr 6, 2021
@fpoussin fpoussin merged commit 13f99fd into ChibiOS:chibios-20.3.x Apr 6, 2021
@fpoussin
Copy link
Member

fpoussin commented Apr 6, 2021

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants