-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
34: Use volatile reads and writes for rx and tx buffers r=richardeoin a=Abestanis Hi, I'm using this library to drive FDCAN on an Stm32H7 microprocessor and I was able to send CAN messages with the correct header and id, but all data bytes were transmitted as zero bytes. Looking into it, it appears that the ready to transmit bit (`txbar`) is set before the bytes are actually written to the transmit buffer. There was already a todo at the transmit buffer hinting at this problem, and indeed using volatile writes fixes the problem for me. I decided to also wrap the rx buffer in a volatile container, just to be safe, even though that receiving seems to also work without it. I used the `volatile-register` crate, because it is also used by the `cortex-m` crate. Co-authored-by: Sebastian Scholz <[email protected]>
- Loading branch information
Showing
3 changed files
with
37 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters