Skip to content

Make the CRC Platform Abstraction Layer multi-context-safe#90

Open
parmi93 wants to merge 1 commit into
STMicroelectronics:dev/1.2.0from
parmi93:dev/1.2.0
Open

Make the CRC Platform Abstraction Layer multi-context-safe#90
parmi93 wants to merge 1 commit into
STMicroelectronics:dev/1.2.0from
parmi93:dev/1.2.0

Conversation

@parmi93

@parmi93 parmi93 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
  • Introduces stse_crc16_context_t struct context.
  • Introduces stse_platform_Crc16_ContextInit() and stse_platform_Crc16_ContextRelease() PAL APIs.
  • Refactors stse_platform_Crc16_Accumulate() PAL API.
  • Removes stse_platform_Crc16_Calculate() PAL API.

These changes resolve issue #65 by allowing users to adapt the CRC16 PAL implementation to scenarios where communication with multiple STSAFE devices takes place concurrently.

Additionally, they make it possible to implement thread-safe CRC16 PAL APIs when CRC computation is performed by a shared hardware peripheral. This ensures that concurrent access from multiple threads can be managed safely, even when those threads are not necessarily communicating with different STSAFE devices.

@parmi93 parmi93 force-pushed the dev/1.2.0 branch 2 times, most recently from 22074e5 to 13a4548 Compare June 9, 2026 16:10
@parmi93

parmi93 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

I just realized that this PR targets the main branch instead of dev/1.2.0. I can't find an option to change the target branch on my side, so hopefully one of the maintainers has the necessary permissions to update it.

@nils-cercariolo-st nils-cercariolo-st changed the base branch from main to dev/1.2.0 June 11, 2026 01:37
@TofMassilia13320 TofMassilia13320 force-pushed the dev/1.2.0 branch 2 times, most recently from 71273fe to eda5991 Compare June 15, 2026 13:30
@TofMassilia13320 TofMassilia13320 self-requested a review June 16, 2026 09:39
@TofMassilia13320

Copy link
Copy Markdown
Contributor

Tx to solve conflicts.
I see:

  • multiple crc init
  • stse_platform_Crc16_Calculate presence

@parmi93 parmi93 force-pushed the dev/1.2.0 branch 2 times, most recently from 13a4548 to a709937 Compare June 16, 2026 10:18
@parmi93

parmi93 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Fix the conflicts by rebasing my branch (dev/1.2.0) with the upstream/dev/1.2.0 branch, and I push forced to keep the git history clean.

@parmi93 parmi93 force-pushed the dev/1.2.0 branch 2 times, most recently from 71161d0 to a64d510 Compare June 16, 2026 15:07
@TofMassilia13320 TofMassilia13320 removed their request for review June 17, 2026 11:26
@parmi93 parmi93 closed this Jul 3, 2026
@parmi93 parmi93 reopened this Jul 3, 2026
@parmi93

parmi93 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@TofMassilia13320 I noticed you force-pushed these 2 commits a couple of days ago onto the upstream dev/1.2.0 branch:

This rewrote the commit history for the last 3 weeks. Just a suggestion: as a general rule, I only force-push on my own forks where I'm the sole person working, and I avoid it on upstream branches shared by multiple developers, since it rewrites shared history. Anyone who has already pulled or branched off the old commits ends up with diverging history and has to manually reconcile or reset to match the new one.

Force-pushing on an upstream branch usually makes sense when you need to remove something sensitive from history, like leaked credentials, secrets, or accidentally committed files, where rewriting history is actually necessary. For regular fixes or updates, though. Pushing new commits on top, rather than rewriting old ones, would prevent this issue for anyone else working off this branch.

@TofMassilia13320

TofMassilia13320 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

@parmi93,
You're true. History was rewritten because I've rebased and merged the dev/1.2.0 on the main branch.
I didn't catch you were developing using this 1.2.0branch even if if it was not validated... and I wasn't align with the right management of this dev/1.2.0 branch.
We decided yesterday to now cherry pick each interesting commit from main branch instead of rebasing.
Sorry for this inconvenience.

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.

2 participants