You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm seeing what I believe is an incorrect CRC32 calculation on an STM32F429. I can't explain why this would be, except perhaps that they use the reflected version when providing the CRC to the user.
Expected behaviour
I'm working on understanding a binary firmware. It contains this code:
Peripherals::CRC.CR = 1;
Peripherals::CRC.DR = 0xf407a5c2;
uVar1 = Peripherals::CRC.DR;
if (uVar1 != 0xb5e8b5cd) {
do {
/* WARNING: Do nothing block with infinite loop */
} while( true );
}
With the current implementation of STM32F4_CRC, the resulting value is 0x74EA5CA6. If I instead reflect both the inputs and the outputs, I get the matching value of 0xb5e8b5cd:
Has this ever been validated against real hardware? If so, something isn't quite adding up. If not, then it can be fixed in the model.
Do you plan to address this issue and file a PR?
It's an easy enough fix, but if there is hardware and tests that already use the existing behaviour then I'd rather not touch it and keep using my modified model.
The text was updated successfully, but these errors were encountered:
xobs
added a commit
to xobs/renode-infrastructure
that referenced
this issue
Feb 16, 2024
The STM32F4 CRC engine uses the MPEG2 polynomial and configuration. This
is different from most other CRC engines, and is somewhat surprising.
This patch fixesrenode/renode#585
Signed-off-by: Sean Cross <sean@xobs.io>
The STM32F4 CRC engine uses the MPEG2 polynomial and configuration. This
is different from most other CRC engines, and is somewhat surprising.
This patch fixesrenode#585
Description
I'm seeing what I believe is an incorrect CRC32 calculation on an STM32F429. I can't explain why this would be, except perhaps that they use the reflected version when providing the CRC to the user.
Expected behaviour
I'm working on understanding a binary firmware. It contains this code:
With the current implementation of STM32F4_CRC, the resulting value is
0x74EA5CA6
. If I instead reflect both the inputs and the outputs, I get the matching value of0xb5e8b5cd
:Additional information
I can verify that the output of https://github.com/dimmykar/stm32-crc32-calculator matches what I see -- namely that the CRC32 of
0xF407A5C2
should evaluate to0xb5e8b5cd
.Has this ever been validated against real hardware? If so, something isn't quite adding up. If not, then it can be fixed in the model.
Do you plan to address this issue and file a PR?
It's an easy enough fix, but if there is hardware and tests that already use the existing behaviour then I'd rather not touch it and keep using my modified model.
The text was updated successfully, but these errors were encountered: