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

Fix embassy hangs #72

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

Fix embassy hangs #72

wants to merge 1 commit into from

Conversation

andelf
Copy link
Contributor

@andelf andelf commented Nov 20, 2024

Needs more investigation.

At least x035 works now.

Fix #71

Copy link

@mwanner mwanner left a 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)

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.

Embassy driver for CH32X035 is broken
3 participants