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

STM32H7 SPI overruns are not handled, resulting in infinite loop #349

Closed
bcantrill opened this issue Dec 28, 2021 · 1 comment
Closed

STM32H7 SPI overruns are not handled, resulting in infinite loop #349

bcantrill opened this issue Dec 28, 2021 · 1 comment
Assignees
Labels
robustness Fixing this would improve robustness of deployed firmware stm32 Has specific implications for STM32 processors

Comments

@bcantrill
Copy link
Collaborator

Currently, SPI RX overruns are not handled. When those overruns do occur, the SPI code will take interrupts due to EOT being set, but won't actually terminate its loop -- resulting in an infinite loop. The fix is to check for this condition (both overrun and EOT) and break out of the exchange loop, cleaning up the SPI block on the way out.

@bcantrill bcantrill self-assigned this Dec 28, 2021
bcantrill added a commit that referenced this issue Dec 28, 2021
ITM broken on Nucleo H743/H753 boards (#346)
SPI overruns are not handled, resulting in infinite loop (#349)
SPI can suffer from overruns due to TX/RX asymmetry (#350)

In addition to fixing these bugs, this work removes the Gimlet hostflash
task from the H743/H753 boards -- and replaces it with the venerable ping.
@cbiffle
Copy link
Collaborator

cbiffle commented Jan 5, 2022

(I left some thoughts on #350.)

@cbiffle cbiffle added robustness Fixing this would improve robustness of deployed firmware stm32 Has specific implications for STM32 processors labels Jan 5, 2022
@cbiffle cbiffle changed the title SPI overruns are not handled, resulting in infinite loop STM32H7 SPI overruns are not handled, resulting in infinite loop Jan 5, 2022
bcantrill added a commit that referenced this issue Jan 10, 2022
This fixes the following bugs:

- Spi.exchange() hangs if RX bytes exceeds TX bytes (#341)
- ITM broken on Nucleo H743/H753 boards (#346)
- SPI overruns are not handled, resulting in infinite loop (#349)
- SPI can suffer from overruns due to TX/RX asymmetry (#350)
    
In addition to fixing these bugs, this work removes the Gimlet hostflash
task from the H743/H753 boards -- and replaces it with the venerable
"ping" task (which demonstrates a panicking task).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
robustness Fixing this would improve robustness of deployed firmware stm32 Has specific implications for STM32 processors
Projects
None yet
Development

No branches or pull requests

2 participants