Skip to content

Add board from SCDZ with SOC from wch ch32v307 #90872

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

SoftwareArchitekt
Copy link

Add a board from SCDZ named ch32v307evt
this board has a SOC from wch named ch32v307
inside SOC is a Qinke_v4f Core
There are some diffences to the wch-ch32v307 board, which I will add in the next step: Core Speed, LED, Switches

As it is my first PR for this project, forgive me if I had made mistakes

Copy link

Hello @SoftwareArchitekt, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@nzmichaelh
Copy link
Collaborator

Nice! Some starter comments: could you squash these commits so things like 'revert to the original main.c' go away, and use the Zephyr commit message style? I'll have a look at the contents now...

@@ -0,0 +1,91 @@
.. zephyr:board:: ch32v307evt
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you have a link to the board (home page, store link, or similar) and schematic?

Overview
********

The `SCDZ`_ CH32V307EVT hardware provides support for QingKe 32-bit RISC-V4F
Copy link
Collaborator

Choose a reason for hiding this comment

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

How attached are you to the 'evt' part of the name? I ask as WCH make a series that end with evt, but this board is by a different vendor.

Copy link
Author

Choose a reason for hiding this comment

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

@nzmichaelh yes, I have the 307-Board from wch here too. I use these name with endin evt here, because it is writen in this kind on the pcb. The wch-Board is named CH32V307V-R2-1v1 on the pcb. This (wch 307) I will do after this board is finished.

Overview
********

The `SCDZ`_ CH32V307EVT hardware provides support for QingKe 32-bit RISC-V4F
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks like it was adapted from the other WCH READMEs. These were recently updated to fix some of the wording and style - could you pull in the same changes please?

soc {
sram0: memory@20000000 {
compatible = "mmio-sram";
reg = <0x20000000 DT_SIZE_K(32)>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

32 k or 64 k?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a bit complex, as it's possible to configure the amount of RAM you need (you can configure part of your ram to be a copy of the flash).

Screenshot From 2025-06-03 11-37-36

To change this configuration, you need to write some registers in sequence then reset. But, if I recall correctly, minichlink always write these bits so if you flash with minichlink you are kinda stuck in the state with 32 KB.

};

&cpu0 {
clock-frequency = <DT_FREQ_M(127)>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

127 or 120?

SECTION_FUNC(vectors, ivt)
.option norvc
/* Jump to 0x08000008, into the main flash zone where j __start is */
//lui x5, 0x8000
Copy link
Collaborator

Choose a reason for hiding this comment

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

Drop or uncomment the commented block

SECTION_FUNC(vectors, __start)
li a0, 0xf
csrw mtvec, a0
j __initialize
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: add a blank line at the end of file

@nzmichaelh
Copy link
Collaborator

I see there are a few files that were renamed. Please drop those changes.

Copy link
Member

@cfriedt cfriedt left a comment

Choose a reason for hiding this comment

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

@SoftwareArchitekt - like Michael mentioned, git history needs to be cleaned up a bit.

Maybe

  1. rebase this branch onto the latest main
  2. reset back to main (leaving a number of staged changes
  3. revert the changes that are unwanted / unneeded
  4. Create a first commit for the soc changes
  5. Create a second commit for the board changes

I think that should do it.

@@ -0,0 +1,226 @@
/*
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add the packages on the model of the other SoCs


/dts-v1/;

#include <wch/ch32v307/ch32v307.dtsi>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use package there.

Copy link
Author

Choose a reason for hiding this comment

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

Hi @VynDragon , I don't understand what you mean here. Could you please explain more detailed for me.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Look at this PR: #90992, it fixes the same issue

reg = <0x40010800 0x20>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <8>;
Copy link
Contributor

Choose a reason for hiding this comment

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

ngpios should be 16 (for all the nodes)

Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

squash commits

@VynDragon
Copy link
Collaborator

@SoftwareArchitekt https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History, this commit history is not good for merging, you need to reorganize the whole PR.

Copy link

sonarqubecloud bot commented Jun 4, 2025

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.

7 participants