Closed hathach closed 2 months ago
thanks @hathach !
Hello @hathach, for my CH32V003 project I needed to enable the Watchdog and also wanted to use sleep. When looking for some Arduino standard I found that the Adafruit_SleepyDog library provided the broadest universal support. A moment ago I published a fork of Adafruit_SleepyDog that supports the CH32V003.
Other than perhaps some cleanup I think this version could already be useful for testing by other people. Unfortunately I don't have any other CH32 chips, so I couldn't add support for those. I did see in the core code that other chips use different EXTI_Line registers for implementing sleep(), but have no hardware to test that. Did you already have a look at supporting sleep for the CH32V203?
we have no plans to add more library supports at this time so PRs are welcome! please submit a PR and you can tag @hathach to get a review for that library
Hello @ladyada - thanks for the swift reply. When I have time I will do some cleanup and submit that PR. And before I forget: a big THANKS to Adafruit for making all those libraries to support a large community of makers, including myself.
@TianpeiLee sorry to bother your, would you please review this since we already launch the product for a few weeks. We could contribute to maintain support for our boards should there is any issue with it.
Hello, sorry for not processing it in time
@hathach
What does 224KB mean?
@hathach https://www.adafruit.com/product/5996 I already got it from here ,thank you !
@TianpeiLee thank you for merging the PR.
What does 224KB mean?
For your question, all v203 always has 224KB of flash, however, only 32K/64K is zero-wait state i.e fast flash. The rest is considered as slow flash, which requires to enable Flash Enhanced Read mode for stability, which we implemented in pre_init() for qtpy variant (check diff comment above). In our testing, it can run with application exeeding normal 32KB without any issues. I guess it will slow down a bit but not really notable with most arduino user.
Note: openocd only flash 32Kb due to its algorithm, to flash the whole elf up to full 224KB we need to either use wchisp (bootrom) and/or wchlink
from datasheet
from manual
Ref: article https://cpldcpu.wordpress.com/2024/05/01/decapsulating-the-ch32v203-reveals-a-separate-flash-die/
PS: Let me know if these make sense to you, or if you need any more clarification
thank you for your explanation
Add support for Adafruit qtpy ch32v203g, which is the main reason for my effort (on behalf of Adafruit) for porting tinyusb to ch32v core as well as recent PRs. Boards is tested with neoixel, i2c, spi, uart2 all working well, for more info. Hopefully @ladyada would make more of ch32v hardware if that gain popular enough (and she could manage the time).
Note:
What menu looks like after merged.