Cyclic Redundancy Check Subsystem (CRC Subsys)

Browse source code on GitHub

Overview

This sample demonstrates how to use the Cyclic Redundancy Check Subsystem

Configuration Options

This sample uses the following Kconfig options:

  • CONFIG_CRC: Enable CRC functionality.

  • CONFIG_CRC*: Use software-based CRC if a chosen node is present; otherwise, hardware acceleration is used.

These options can be modified in the project’s prj.conf file or passed via CMake arguments.

Building and Running

Building and Running for Renesas RA8M1

The sample can be built and executed for the RA8M1 Evaluation Kit as follows:

west build -b ek_ra8m1 samples/subsys/crc
west flash

To build for another board, change “ek_ra8m1” above to that board’s name.

Sample Output

subsys_crc_example: Result of CRC32 IEEE: 0xCEA4A6C2
subsys_crc_example: Result of CRC8 CCITT: 0x96
subsys_crc_example: CRC computation completed successfully

Note

If the board does not support a hardware CRC driver, the computation will fall back to a software-based implementation.

Expected Behavior

When the sample runs, it should:

  1. Compute the CRC32 and CRC8 values of predefined data.

  2. Print the computed CRC values.