-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Add Zephyr RTOS support for WCH CH32V003 #73761
base: main
Are you sure you want to change the base?
Conversation
Hello @kholia, and thank you very much for your first pull request to the Zephyr project! |
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
All references to [dhiru@zippy zephyr]$ rg ch32v003fun
modules/hal_wch/ch32_rcc.h
11:#include <ch32v003fun.h>
modules/hal_wch/ch32_gpio.h
11:#include <ch32v003fun.h>
modules/hal_wch/CMakeLists.txt
2: zephyr_include_directories(${ZEPHYR_HAL_WCH_MODULE_DIR}/ch32v003fun .)
modules/hal_wch/ch32_uart.h
11:#include <ch32v003fun.h>
modules/hal_wch/ch32_soc.h
11:#include <ch32v003fun.h>
modules/hal_wch/ch32_pinctrl.h
11:#include <ch32v003fun.h>
modules/hal_wch/ch32_systick.h
11:#include <ch32v003fun.h>
modules/hal_wch/ch32_pfic.h
11:#include <ch32v003fun.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good starting point, would be cool to redo the clock configuration in devicetree rather than kconfig options but that can be a followup. To the other folks in the review list, can you do another pass?
The clock tree on the 003 really only has 4 reasonable configurations, XTAL/internal and PLL/no PLL. There are extra main clock divisors you can use, but their practicality is very low. Is it expected to have richer configurations in things like this? |
My vote is no, but if someone wants to add it in a follow up and it (ideally) doesn't increase the flash usage, then that's all good. I think it's reasonable for Zephyr to support the common configurations. For example, it shouldn't cover just the CH32V003JM46 but all part numbers; and it shouldn't be HSE only but both HSI and HSE. |
All the 003 part numbers have identical cores, flash RAM and clock trees, thankfully. |
It's getting very close, @fabiobaltieri ! |
39630a6
to
2ca52da
Compare
@kholia do you have a summary for what you changed? Or who's if any's quests have been changed? |
@cnlohr I just added The current build failure does NOT seem related to this work. I will rebase and re-push the commits. |
2ca52da
to
f87099a
Compare
This is used for WCH chips including the CH32V003. Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
This commit adds the dtsi and bindings for the WCH CH32V003 which is a 32-bit general-purpose RISC-V MCU. Signed-off-by: Michael Hope <michaelh@juju.nz> Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
This commit adds the soc support for WCH CH32V003. Signed-off-by: Michael Hope <michaelh@juju.nz> Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
This commit adds the pinctrl driver for WCH CH32V003. Signed-off-by: Michael Hope <michaelh@juju.nz> Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
This commit adds the clock driver for WCH CH32V003. Signed-off-by: Michael Hope <michaelh@juju.nz> Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
This commit adds the systick driver for WCH CH32V003. Signed-off-by: Michael Hope <michaelh@juju.nz> Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
This commit adds the usart driver for WCH CH32V003. Signed-off-by: Michael Hope <michaelh@juju.nz> Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
This commit adds the pfic interrupt controller driver for WCH CH32V003. Signed-off-by: Michael Hope <michaelh@juju.nz> Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
This commit adds the gpio driver for WCH CH32V003. Signed-off-by: Michael Hope <michaelh@juju.nz> Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
This commit adds support for the CH32V003EVT board which features a 32-bit general-purpose RISC-V MCU. Signed-off-by: Michael Hope <michaelh@juju.nz> Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
This commit adds a runner wrapper for the 'minichlink' program which offers a free, open mechanism to use the CH-LinkE programming dongle for the CH32V003. https://github.com/cnlohr/ch32v003fun/tree/master/minichlink Signed-off-by: Michael Hope <michaelh@juju.nz> Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
f87099a
to
aa19307
Compare
I have rebased and re-pushed the same commits in the hope of passing the CI checks! |
Details
This PR adds Zephyr RTOS support for WCH CH32V003 RISC-V MCU.
https://www.wch-ic.com/products/CH32V003.html
Usage
Tested On
Bare CH32V003J4M6 SOP-8 chip
WCH CH32V003EVT board (CH32V003 Evaluation Kit)
Blinky Build
It is fun to see Zephyr RTOS running on a "10 cent" MCU.