This module guide will enable you to effectively use a module in your own design. Upon completion of this
guide, you will be able to add this module to your own design, configure it correctly for the target application
and write code, using the included application project code as a reference and an efficient starting point.
References to more detailed API descriptions and suggestions of other application projects that illustrate
more advanced uses of the module are included in the document and should be valuable resources for
creating more complex designs.
The CRC HAL module is a high-level API used to calculate 8, 16 and 32-bit CRC values on a block of data in
memory or a stream of data over a Serial Communication Interface (SCI) channel using various types of
industry-standard polynomials. The CRC HAL module is implemented on r_crc and uses the CRC peripheral
on the Synergy MCU.
Contents
1. CRC HAL Module Features ..................................................................................................... 2
The CRC HAL module defines APIs for opening, closing, enabling and calculating. A complete list of the
available APIs, an exam ple API call and a short description of each can be found in the following table. A
table of status return values follows the API summary table.
Retrieve the API version with the version point er .
Name
Description
SSP_SUCCESS
Configuration was successful.
SSP_ERR_ASSERTION
Assertion error.
SSP_ERR_INVALID_ARGUMENT
Invalid argument error.
SSP_ERR_NOT_OPEN
The driver is not opened.
SSP_ERR_IN_USE
If driver is already open.
num_bytes, crc_seed, &crc_result);
Perform a CRC calculation on a block of data.
Note: For details on operation and definitions for the function data structures, typedefs, defines, API data,
API structures, and function variables, review the SSP User’s Manual API References for the
associated module.
Table 2. Status Return Values
Note: Lower-level drivers may return common error codes. Refer to the SSP User’s Manual API References
for the associated module for a definition of all relevant status return values.
3. CRC HAL Module Operational Overview
When the CRC HAL module is used to calculate the CRC value for a block of data in memory, the
crc_api_t::calculate API ca n be us ed which t ak es the input buf fer poi nter, length and the CR C se ed valu e as
input and outputs the calculated CRC value.
When the CRC HAL module is used to calculate CRC on a stream of data being transmitted or received over
a serial communication Interface (SCI) channel (snoop mode), the module should be configured to be in
snoop mode by calling the crc_api_t::snoopCfg followed by the crc_api_t::snoopEnable APIs. After the
requested number of data is transmitted or received on the SCI channel, the calculated CRC value can be
polled from the module using the crc_api_t::crcResultGet API.
3.1 CRC HAL Module Important Operational Notes and Limitations
3.1.1 CRC HAL Module Operational Notes
• The CRC block does not use any interrupts.
• There is no clock configuration for the CRC module.
•
There are no callbacks for the CRC module.
•When using 32-bit CRC polynomials for c alculating CRC values of data bloc k in memory, the data
block is interpreted using little-endian byte order.
3.2 CRC HAL Module Limitations
Refer to the most recent SSP Release Notes for any additional operational limitations for this module.
4. Including the CRC HAL Module in an Application
This section describes how to include the CRC HAL module in an application using the SSP configurator.
Note: This section assumes you are familiar with creating a project, adding threads, adding a stack to a
thread and configuring a block within the stack. If you are unfamiliar with any of these items, refer to
the first few chapters of the SSP User’s Manual to learn how to manage each of these important
To add the CRC Driver to an application, simply add it to a thread using the stacks selection sequence
provided in the following table. (The default name for the CRC Driver is g_crc0. This name can be changed
in the associated Properties window.)
R11AN0092EU0102 Rev.1.02 Page 3 of 10
Feb.01.19
steps in creating SSP-based applications.
Renesas Synergy™ Platform CRC HAL Module Guide
Resource
ISDE Tab
Stacks Selection Sequence
r_crc0 CRC Driver on r_crc
Threads
New Stack> Driver> Monitoring> CRC Driver on
r_crc
ISDE Property
Value
Description
Parameter Checking
BSP, Enabled, Disabled
Enable or disable the
Name
g_crc0
Module name.
CRC Polynomial
CRC-8, CRC-16, CRC-CCITT, CRC-32, CRC-32C
Specify the polynomial to
Bit Order
LSB, MSB
Specify the bit order of
Table 3. CRC Driver Selection Sequence
When the CRC Driver on r_crc is added to the thread stack as shown in the following figure, the
configurator automatically adds any needed lower-level modules. Any drivers that need additional
configuration inform ation will be box text hig hl ight ed in Red. Mod ul es with a Gray band are individual
modules that stand alone.
Figure 2. CRC HAL Module Stack
5. Configuring the CRC H AL Module
The CRC HAL module must be configured by the user for the desired operation. The SSP configuration
window will automatically identify (by highlighting the block in red) any required configuration selections, such
as interrupts or operating modes, which must be configured for lower-level modules for successful operation.
Furthermore, only those properties that can be changed without causing conflicts are available for
modification. Other properties are locked and are not available for changes and are identified with a lock icon
for the locked property in the Properties window in the ISDE. This approach simplifies the configuration
process and makes it much less error prone than previous manual approaches to configuration. The
available configuration settings and defaults for all the user-accessible properties are given in the Properties
tab within the SSP configurator and are shown in the following tables for easy reference.
One of the properties most often identified as requiring a change is the interrupt priority; this configuration
setting is available within the Properties window of the associated module. Simply select the indicated
module and then view the Properties window; the interrupt settings are often toward the bottom of the
properties list, so scroll down until they become available. Note that the interrupt priorities listed in the
Properties window in the ISDE will include an indication as to the validity of the setting based on the targeted
MCU (CM4 or CM0+). This level of detail is not included in the following configuration properties tables but is
easily visible with the ISDE when configur i ng inter r upt-priority leve ls .
Note: You may want to open your ISDE, create the module and explore the Propert y sett ings in para lle l with
looking over the following configuration table settings. This will help orient you and can be a useful
Table 4. Configuration Settings for the CRC HAL Module on r_crc
hands-on approach to learning the ins and outs of deve lop ing wit h SSP.
Default: BSP
Default: CRC-32C
Default: MSB
Note: The example values and defaults are for a project using the S7G2 Synergy MSU Group. Other MCUs
may have different default values and available configuration settings.
R11AN0092EU0102 Rev.1.02 Page 4 of 10
Feb.01.19
parameter error checking.
use for calculation.
the calculation.
Loading...
+ 7 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.