-
Notifications
You must be signed in to change notification settings - Fork 3k
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
STM32: CAN Reset() #4396
Comments
A comment in support, There may be other configs as well which need cleaning up? Would it be appropriate for can_reset() to resolve to HAL_CAN_Init() ? |
@chrissnow @thomasonw thanks for reporting this. |
@thomasonw @chrissnow settings like CAN mode() and monitor() would probably be lost as well after reset. Would you expect them to be restored as well or would application set them again ? |
@LMESTM I guess it depends what the API is meant to do, If the intention is to clear some sort of error then I would expect the configuration to survive, if it's meant to be like a hardware reset I'd expect everything to be lost. I didn't check what config(if any) was lost, but it worked fine after clearing standby. |
Here it is, /** Reset CAN interface.
*
* To use after error overflow.
*/
void reset(); So calling it should maintain config. |
@chrissnow I've read those lines as well but let's be honest, that doesn't help much ;-) |
I tested the proposed patch set and have sent the pull requet in #4932 |
Description
Bug
Target
STM32 (device not important)
Toolchain:
ARM
A call to reset() triggers the CAN peripheral reset bit, however the peripheral itself seems to set the sleep bit when this happens.
This means that CAN cannot be used after a call to reset without manually clearing the sleep bit in the MCR register (CAN_MCR_SLEEP) which the user has no easy way of doing.
Should can_reset() be changed to clear the sleep bit after the reset?
cc @thomasonw
The text was updated successfully, but these errors were encountered: