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

Unable to manage overrun for USART #72

Open
Maldus512 opened this issue Oct 30, 2019 · 0 comments
Open

Unable to manage overrun for USART #72

Maldus512 opened this issue Oct 30, 2019 · 0 comments

Comments

@Maldus512
Copy link
Contributor

Maldus512 commented Oct 30, 2019

I'm trying to use the USART2 peripheral on my stm32f030RC. I'm not using interrupts, so from time to time an overrun interrupt is to be expected (and is acceptable); however I am unable to manage the error with the tools provided by the API.
When an overrun occurs the serial.read method returns an error accordingly, but:

  • the Peripheral.USART2 reference has been passed to the Serial object, so I cannot access its ICF register to clear the ORE bit.
  • I cannot set the OVRDIS bit and ignore every overrun because the Serial constructor resets the CR3 register (https://docs.rs/stm32f0xx-hal/0.14.1/src/stm32f0xx_hal/serial.rs.html#350); I cannot change it afterwards because the USART2 reference is gone and that bit cannot be changed while the peripheral is on.

How do I manage overrun errors? Either clearing the flag or disabling it altogether would be fine for me.

Edit: this problem would be resolved by PR #63

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

1 participant