Skip to content

Draft Catch and raise deadlock in adc config. #16808

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

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

Conversation

andrewleech
Copy link
Contributor

Summary

Seen on a project using the stm32wb55 occasionally the device was locking up, pausing on the attached debugger showed the code was stuck in this while loop waiting for the ADC to report ready which never occurred.

The ADC read in progress was of a pin that's regularly read in a looping async task, normally operates fine.

The lockup was a number of times in the same place, in all cases it seemed to occur shortly after a cpu speed change.

Testing

I've not been able to reliably reproduce the original failure so I'm not yet certain if this exception raise works as expected.
After the issue occurs I'm not sure if re-trying the ADC read is enough to get it working or whether some broader reset of the ADC is required.

Trade-offs and Alternatives

If the issue is caused by the cpu speed change then some kind of ADC block / clock reset might be possible at a lower level as part of the speed change logic.

Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@andrewleech andrewleech changed the title Catch and raise deadlock in adc config. Draft Catch and raise deadlock in adc config. Feb 25, 2025
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants