-
Notifications
You must be signed in to change notification settings - Fork 175
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
CH59x bringup and blinky #534
Conversation
Thanks for doing this work, @biemster , I've added comments, it looks like you're really close, but it needs a little bit of cleanup. |
yeah I basically just copied in the bare necessities, so the reviewer can see what all needs to go in properly. Cleanup is definitely necessary, and I might add a small bit of extra stuff on the gpio side of things to handle GPIOB and interrupts as well. Where did you add your comments? |
Sorry, I forgot to commit the review. |
@cnlohr I went through all the comments, I was able to accommodate the changes to edit: those last two force-pushes were to add |
5cd65cc
to
877ad7c
Compare
877ad7c
to
17ace98
Compare
@biemster you will need to make at least one example, even if it's just |
Did I forget to commit the edit: |
You can "overload" them to the MHz functions, but also have your own that define 0, 1, 2, 3, for the mA modes. Like you should allow users to say 10MHz PP, and just be like 🤷 I guess I'll just treat it as the 2nd highest current. |
I do see blink.c Sorry I missed it first time around, but still need to think through printf. |
I noticed the printf going through a debug interface on the ch32 chips, but I did not find anything like that on ch59x. Could I just do that over uart? |
Should there be a warning emitted when a pin definition is way off? For example this: typedef enum
{
...
GPIO_CFGLR_IN_PUPD = 8, ch59x has |
Please if at all possible make default to go over debug interface. My comments were just that you may be able to use a two-word debug output. SWIO debugging is soooo much more convenient than UART debugging. |
Do you mind sharing notes with @dwillmore here? See what his opinions are because the 00x drive mechanism is also different than the ch32vxxx line. I agree that GPIO_CFGLR_IN_PUPD is not possible, so please leave that definition out. |
About the debug interface, it looks like it should JustWork. The CH592 uses a QingKeV4, which has both DMDEBUG0 and DMDEBUG1 interfaces. |
really? that's awesome! i have zero experience with such, but if it's there I'll get it to work |
This is going to be a guessing game, as the datasheet does not mention the debug interfaces or a SWIO pin at all! Same for ch32x305 though, which does have a |
@cnlohr how do I test this? My linkE (and linkW) are still on the slow boat, and my ESP32's are all none s2 ones 😭 |
It's undocumented. But should JustWork |
There is no ESP32 programmer other than rvswd that I'm aware of and it's hard-coded to only work with the ch32v003 and not minichlink :( |
so linkE is my only choice to test the |
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.
Getting pretty close. This has me pretty excited!
yes I just quote this here to remind me |
Because I'm still waiting for my linkE to test
please comment if I'm missing something here? |
Now only testing |
Merged per @biemster's request. A new request will be opened to address emergent issues. |
CH592/1 bringup and blinky. This is the start of CH59x support, and will conclude in merging the https://github.com/biemster/ch592_noblob_advertiser functionality in here.
One major issue is that the CH59x SDK is not based on structs like ch32, but just pointer #defines. Also I could not find anything resembling
RCC
in those #defines, so this might need some refactoring on both sides.