This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432E401Y: Matching Hardware CRC16 CCITT generated on MSP432E401Y to MSP430FR5739 16-bit Hardware CRC-CCITT-BR

Part Number: MSP432E401Y
Other Parts Discussed in Thread: MSP430FR5739,

Hi TI Experts, 

I am working on a communication protocol between the MSP432E401Y and the MSP430FR5739, which requires 16-bit hardware CRC generation. I am using the driver libraries on both the MSP432 and the MSP430 to interface with each CRC driver to generate a 16-bit CRC. Data input to the drivers is 1 byte at a time (unsigned char or uint8_t type).

The MSP432 has several CRC standards to choose from, but the closest to the MSP430 is the CCITT option. The MSP430 has the 16-bit CRC-CCITT-BR (BR=byte reversed?) standard (cannot be changed), so it is not exactly the same as the MSP432.

Below is the example for the MSP432E401Y I am following, modified to show my CRC configuration and parameters entered. The data I am creating the checksum for is also the same. The CRC16 result  = unsigned short 1111111101110100b (Binary) 

 *  ======== crc.c ========
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>

/* Driver Header files */
#include <ti/drivers/CRC.h>

/* Driver configuration */
#include "ti_drivers_config.h"

/* Expected CRC for CRC_32_IEEE with full endianness reversal */
static const uint32_t expectedCrc = 0x4C4B4461;

/* Example test vector */
static const size_t srcSize = 3;
static const uint8_t src [] = {

/* ======== mainThread ======== */
void *mainThread(void *arg0)
    int_fast16_t status;
    uint16_t result;

    CRC_Handle handle;
    CRC_Params params;

    /* Initialize the drivers */

    /* Set data processing options, including endianness control */
    params.byteSwapInput = CRC_BYTESWAP_UNCHANGED;
    params.returnBehavior = CRC_RETURN_BEHAVIOR_BLOCKING;
    params.polynomial = CRC_POLYNOMIAL_CRC_16_CCITT;
    params.dataSize = CRC_DATA_SIZE_8BIT;
    params.seed = 0xFFFF;

    /* Open the driver using the settings above */
    handle = CRC_open(CONFIG_CRC_0, &params);
    if (handle == NULL)
        /* If the handle is already open, execution will stop here */

    /* Calculate the CRC of all 32 bytes in the source array */
    status = CRC_calculateFull(handle, src, srcSize, &result);
    if (status != CRC_STATUS_SUCCESS)
        /* If the CRC engine is busy or if an error occurs execution will stop here */

    /* Close the driver to allow other users to access this driver instance */

    return NULL;

Below is the example code for the MSP430FR5739 I am following, modified to show my configuration, parameters and data entered. The resulting CRC16 crcResult  = unsigned int 1011011111011001b (Binary) 

#include "driverlib.h"

uint16_t crcResult;

void main (void)
    uint16_t crcSeed = 0xFFFF;
    uint8_t data[] = {0x02,

    uint8_t i;

    //Stop WDT

    //Set P1.0 as an output

    //Set the CRC seed

    for (i = 0; i < 5; i++)
        //Add all of the values into the CRC signature

    //Save the current CRC signature checksum to be compared for later
    crcResult = CRC_getResult(CRC_BASE);

    //Enter LPM4, interrupts enabled

I have attempted to enter the reversed byte on the MSP430, hoping to get back the CCITT standard without reversed bytes, so I can match it to the CCITT CRC16 standard on the MSP432. However, I may be implementing this wrong. Can someone please show me how I can modify this example code on the MSP430 or the MSP432, so I can match the calculated CRC using the two slightly different CRC standards on the two devices.

Hope this is possible using the hardware CRC generators on these two devices. Looking forward to a solution.