Skip to main content
Associate II
February 6, 2025
Solved

L99615 demo GUI CRC

  • February 6, 2025
  • 2 replies
  • 1012 views

Hello,

I’m encountering an issue where I’m unable to fully understand the behavior of the GUI in relation to the commands being transmitted via serial USB to the NUCLEO. I’ve figured out that there is a CRC at the end of the raw data being transmitted through USB. However, despite trying several online calculators to generate the same CRC, I haven’t been able to match the CRC present in the raw data. Is there a specific algorithm used to calculate the CRC? I am attaching two pictures that show the result of calculating the CRC and the CRC generated by the DEMO GUI. Perhaps I’m misunderstanding how the GUI operates, but I assumed the GUI was responsible for generating the CRC in this case.

Thanks in advance for your help.

Best regards,
Dominik Limber

 

Best answer by DominikLIMber

I was trying to verify the CRC from the documentation using a calculator, but I couldn't get the same result. However, I found a simple algorithm that works:

Example:
Input (HEX): A4 04 00
Expected CRC: 58

CALCULATION

A4 (HEX) = 164(DEC)

04 (HEX) = 4 (DEC)

00 (HEX) = 0(DEC)

Sum: 0 + 4 + 164 = 168

Modulo operation: 256%168 = 88

88 in HEX = 0x58

Result: CRC = 0x58

It works fine. From what I can tell, the polynomial mentioned in the documentation might not be used for CRC in the communication between the PC and the NUCLEO. Instead, the CRC seems to be calculated using this simple equation—or maybe I just got lucky and overthought it.

2 replies

Associate II
February 13, 2025

Okey i found out solution.

Tesla DeLorean
Guru
February 13, 2025

For the non-dyslexic the L9961

https://www.st.com/resource/en/datasheet/l9961.pdf#page=40

 

Polynomial 8-bit as 0x107 or 0x07, initialized with zero

Patterns (hex)

A4 04 00 58

55 09 00 40 05 11 21 01 2A

A4 95 2A 99 2D

 

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
DominikLIMberAuthorBest answer
Associate II
February 13, 2025

I was trying to verify the CRC from the documentation using a calculator, but I couldn't get the same result. However, I found a simple algorithm that works:

Example:
Input (HEX): A4 04 00
Expected CRC: 58

CALCULATION

A4 (HEX) = 164(DEC)

04 (HEX) = 4 (DEC)

00 (HEX) = 0(DEC)

Sum: 0 + 4 + 164 = 168

Modulo operation: 256%168 = 88

88 in HEX = 0x58

Result: CRC = 0x58

It works fine. From what I can tell, the polynomial mentioned in the documentation might not be used for CRC in the communication between the PC and the NUCLEO. Instead, the CRC seems to be calculated using this simple equation—or maybe I just got lucky and overthought it.