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

Fix CRC32 peripheral #283

Merged
merged 6 commits into from
Mar 26, 2021
Merged

Fix CRC32 peripheral #283

merged 6 commits into from
Mar 26, 2021

Conversation

theunkn0wn1
Copy link
Contributor

The current implementation of the CRC32 perhipheral does not enable the CRC32 clock.
On the STM32F446, this causes all calculations against this peripheral to emit an incorrect null instead of the checksum.

This PR enables the CRC clock when the HAL's peripheral is acquired, and disables it when released.

Fixes #281

src/crc32.rs Outdated Show resolved Hide resolved
 - use DSB after tinkering with clocks as per errata.
Copy link
Member

@thalesfragoso thalesfragoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting the problem and providing a solution! I left a few suggestions.

src/crc32.rs Outdated Show resolved Hide resolved
src/crc32.rs Outdated Show resolved Hide resolved
src/crc32.rs Outdated Show resolved Hide resolved
src/crc32.rs Outdated Show resolved Hide resolved
src/crc32.rs Outdated Show resolved Hide resolved
Copy link
Member

@thalesfragoso thalesfragoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again!

bors r+

@bors bors bot merged commit 6a56889 into stm32-rs:master Mar 26, 2021
@theunkn0wn1 theunkn0wn1 deleted the fix/crc branch March 26, 2021 01:08
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

Successfully merging this pull request may close these issues.

CRC32 always emits zero when fed bytes
3 participants