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

Serialize access to the CRC peripheral (STM32F2xx) #1465

Merged
merged 2 commits into from Jan 22, 2018
Merged

Conversation

sergeuz
Copy link
Member

@sergeuz sergeuz commented Jan 17, 2018

Problem

The CRC peripheral is not thread-safe and thus concurrent hardware-accelerated CRC calculations should be serialized.

While there's no evidence that the system and application threads perform CRC calculations concurrently, a synthetic test shows that such a situation can cause invalidation of the DCT.

Solution

Guard the platform's Compute_CRC32() function with a global lock.

Steps to Test

  • wiring/no_fixture: CONCURRENT_02*

References

  • [CH10651]

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@sergeuz sergeuz added this to the 0.8.0 milestone Jan 17, 2018
Copy link
Contributor

@m-mcgowan m-mcgowan left a comment

Choose a reason for hiding this comment

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

Would be good with some tests too to demonstrate the thread safety.

@sergeuz
Copy link
Member Author

sergeuz commented Jan 17, 2018

Would be good with some tests too to demonstrate the thread safety

I'll strip that DCT stress test application which I used to reproduce the issue and turn it into a test app 👍

@m-mcgowan m-mcgowan modified the milestones: 0.8.0, 0.8.0-rc.2 Jan 18, 2018
@m-mcgowan m-mcgowan merged commit 798966b into develop Jan 22, 2018
@m-mcgowan m-mcgowan deleted the feature/crc_lock branch January 22, 2018 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants