-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fix embassy hangs #72
base: main
Are you sure you want to change the base?
Conversation
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.
@andelf I can confirm this fixes the blinky examples that use embassy. At least for three devices I tested successfully: ch32v302, ch32x035, and ch32l103.
However, I think this means the entire comment above the function is wrong and needs to be corrected.
I added debug outputs in the two relevant init routines and tried all four variants for configuring WFITOWFE
and SEVONPEND
. And embassy based blinking only ever worked with both enabled (following from a ch32l103, but other chips showed same results):
no good, no LED blinking:
2024-11-30 23:27:01.044: post qingke_setup_interrupts state: (00000000)
2024-11-30 23:27:01.050: after ch32-hal embassy init: (00000010)
2024-11-30 23:27:39.990: post qingke_setup_interrupts state: (00000000)
2024-11-30 23:27:39.996: after ch32-hal embassy init: (00000000)
2024-11-30 23:28:04.196: post qingke_setup_interrupts state: (00000008)
2024-11-30 23:28:04.202: after ch32-hal embassy init: (00000008)
All good on ch32l103, LED blinking:
2024-11-30 23:28:19.617: post qingke_setup_interrupts state: (00000008)
2024-11-30 23:28:19.623: after ch32-hal embassy init: (00000018)
ch32v203 is also working. |
Embassy uses
At that time, based on the current situation, it seems that the 3 does not work, and the 1 also seems to be different from the description. Whether the corresponding interrupt is enabled in the PFIC does not seem to affect the effects of the SEVONPEND bit. Perhaps the manual is incorrect? |
Sorry, typo in my comment above: I meant to write v203, there is no v302 (AFAIK anyway). |
I plan to merge this after addressing the comment fixes. This update will resolve issues with the blinky example and other lower-speed peripherals. And it does not block the spin-executor. @Dummyc0m |
Needs more investigation.
At least x035 works now.
Fix #71