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

Arduino Framework disables Dead Battery Support #20

Open
klaus-liebler opened this issue Nov 21, 2024 · 2 comments
Open

Arduino Framework disables Dead Battery Support #20

klaus-liebler opened this issue Nov 21, 2024 · 2 comments

Comments

@klaus-liebler
Copy link

Grüezi in die Schweiz,

thank you, Manuel, for this wonderful library! I am using it in my project https://github.com/klaus-liebler/labathome. The usage scenario requires Dead Battery Support.

I did not get this feature working and after investigating it, I discovered this: stm32duino/Arduino_Core_STM32@1f5cb30

So, the Arduino Framework disables the Dead Battery PullDowns in a very early initialisation phase, when your stack has not yet initialized the UCPD peripherial. So, the USB-C PSU shuts down, the STM32 resets and presents the PullDowns again...which awakes the PSU and the CPU boots again --> endless reboots. Unfortunately, the only way to overcome this Arduino-paternalism is to comment out the particular line of code.
Of cource, this is not a direct issue of your library, but just in case others stumble on it.

Regards,

Klaus

@manuelbl
Copy link
Owner

Thank you for the feedback. This is good to know. So far I didn't pay much attention to the Arduino code in that area...

@VIPQualityPost
Copy link
Contributor

Thanks for this issue! I had an issue with only specific PD sources causing some issues, I wonder if the timing of this was causing an issue with that. I'll have to check again now that STM32duino has patched it.

In order to avoid chasing github issues, the way to disable this behavior in stm32duino core >2.9.0 is build flag SKIP_DISABLING_UCPD_DEAD_BATTERY.

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

No branches or pull requests

3 participants