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

Ch32v208 fixes #473

Merged
merged 2 commits into from
Dec 11, 2024
Merged

Ch32v208 fixes #473

merged 2 commits into from
Dec 11, 2024

Conversation

VynDragon
Copy link
Contributor

Hello, following the discussion in the zephyr PR, I identified the actual issue i had, namely that USART2 (the only accessible on linkW) is on AHB1 and not AHB2, which for some reason has a /2 divider. Comparatively the zephyr clock issue was simply the wrong PLL multiplier being set, and x18 is the expected one (and keeping PB1 and PB2 as the default of 1).

This also includes assigned ram/rom fix for ch32v208 which was getting the wrong one.

Please validate or invalidate those changes based on wether or not it is the preferred way to fix those issues.

@cnlohr
Copy link
Owner

cnlohr commented Dec 10, 2024

Other than that one change, I really like this! Amazing that you were able to get it working with such little extra work.

I am VERY CURIOUS if you have the extra header stuff for making the bluetooth work.

@VynDragon
Copy link
Contributor Author

There was more changes involved for using USART2 instead of USART1 mind you, but this is the generic changes for all CH32V208 and not just linkW.

I have nothing for the BLE, sorry... But I might look into it later once I figure how to properly use the full flash of the mcu like the mounriver BLE samples do.

@cnlohr
Copy link
Owner

cnlohr commented Dec 10, 2024

We can worry about some peripheral details later.

I'm unaware of anyone specifically trying to support the 208, so any support is greatly appreciated.

If you can mod your PR for the DCH32V20x_D8W guard, I'd love to merge it!

@VynDragon
Copy link
Contributor Author

like so?

What happened is in the micropython discord server, agatti and I looked for the best wch device to run micropython, and we ended up chosing ch32v208 as one of the option, as it's available on cheap devboards, is one of the chip featuring the most rom and ram, and has a very nice set of features. They are working on a native port using a mix of ch32v208fun and official WCH SDK, I chose to focus on getting it working in zephyr as a procrastination alternative to the platform im already working on (bouffalolab devices). By this point ch32v003 using your work was already being implemented by kholia and michael hope for zephyr, having had a great experience with your esp8266 stuffs in the past, and already using ch32v003fun for ch32v003 ics, using ch32v003fun was a obvious choice to try and get this more powerful mcu working in it and in zephyr.

@cnlohr
Copy link
Owner

cnlohr commented Dec 11, 2024

Anything they are willing to do to backport everything to 003fun would be greatly appreciated. do you have an invite?

@VynDragon
Copy link
Contributor Author

This is the one from the official website: https://discord.com/invite/RB8HZSAExQ

@cnlohr cnlohr merged commit 8943a99 into cnlohr:master Dec 11, 2024
80 checks passed
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.

2 participants