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

changing standard mode of the CH32x035 to machine mode #480

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yves5141
Copy link

According to the reference manual, ch32x035 has a PMP and is by default in user mode which prevents from reading some registers, mstatus for example.
This change set the default mode to machine mode.

@TommyMurphyTM1234
Copy link
Contributor

Presumably relates to this issue?

@TommyMurphyTM1234
Copy link
Contributor

Please see my comment here as to why I'm not convinced by this change.

@cnlohr
Copy link
Owner

cnlohr commented Dec 26, 2024

We set mstatus here.

https://github.com/cnlohr/ch32v003fun/blob/master/ch32v003fun/ch32v003fun.c#L1012-L1020

Why would you set it as well later?

@cnlohr
Copy link
Owner

cnlohr commented Dec 26, 2024

Also are you sure you want to be setting MPP and XS? I don't think you do. That sounds like a holdover from some completely unrelated processor.

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

Successfully merging this pull request may close these issues.

3 participants