-
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. |
a9f9ebe
to
0c6ca7c
Compare
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.
hi, flagged few more pending comments and added few more, let's keep this moving :-)
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <offsets.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.
@nzmichaelh @kholia is this someting you are going to look into further?
RCC_TypeDef *regs = config->regs; | ||
uint8_t id = (uintptr_t)sys; | ||
|
||
*(®s->AHBPCENR + WCH_RCC_CLOCK_ID_OFFSET(id)) |= 1 << WCH_RCC_CLOCK_ID_BIT(id); |
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.
still pending
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
"""CH32V00x specific runner.""" |
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.
found references of minichlink
and other parts, I say just rename it to be generic
b89d78c
to
70dc45a
Compare
This is used for WCH chips including the CH32V003. Signed-off-by: Dhiru Kholia <[email protected]>
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 <[email protected]> Signed-off-by: Dhiru Kholia <[email protected]>
70dc45a
to
0a0f7d4
Compare
This commit adds the soc support for WCH CH32V003. Signed-off-by: Michael Hope <[email protected]> Signed-off-by: Dhiru Kholia <[email protected]>
This commit adds the pinctrl driver for WCH CH32V003. Signed-off-by: Michael Hope <[email protected]> Signed-off-by: Dhiru Kholia <[email protected]>
This commit adds the clock driver for WCH CH32V003. Signed-off-by: Michael Hope <[email protected]> Signed-off-by: Dhiru Kholia <[email protected]>
This commit adds the systick driver for WCH CH32V003. Signed-off-by: Michael Hope <[email protected]> Signed-off-by: Dhiru Kholia <[email protected]>
This commit adds the usart driver for WCH CH32V003. Signed-off-by: Michael Hope <[email protected]> Signed-off-by: Dhiru Kholia <[email protected]>
This commit adds the pfic interrupt controller driver for WCH CH32V003. Signed-off-by: Michael Hope <[email protected]> Signed-off-by: Dhiru Kholia <[email protected]>
This commit adds the gpio driver for WCH CH32V003. Signed-off-by: Michael Hope <[email protected]> Signed-off-by: Dhiru Kholia <[email protected]>
This commit adds support for the CH32V003EVT board which features a 32-bit general-purpose RISC-V MCU. Signed-off-by: Michael Hope <[email protected]> Signed-off-by: Dhiru Kholia <[email protected]>
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 <[email protected]> Signed-off-by: Dhiru Kholia <[email protected]>
0a0f7d4
to
358113b
Compare
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?
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.