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.

CC1310: ECC_generateKey causing exception

Part Number: CC1310


I am attempting to port the aesKeyAgreement_CC1310_LAUNCHXL_tirtos_ccs example to an existing RF project. Something is causing ECC_generateKey to cause an exception and never return.

The ported code includes

#pragma LOCATION(romCryptoOutputBuffer, ROM_CRYPTO_BUFFER_ADDR);
uint8_t romCryptoOutputBuffer[ROM_CRYPTO_BUFFER_SIZE];
/* This memset informs the compiler that we intend to make use of the
 * buffer so it does not get optimised out. */
memset(romCryptoOutputBuffer, 0, ROM_CRYPTO_BUFFER_SIZE);

/* Allocate workzone memory for ecc, recommended workzone size is 275 bytes */
uint32_t *workzone = (uint32_t *) malloc(ECC_WORKZONE_SIZE * ECC_WINDOW_SIZE);
if (workzone == NULL) {
    while(1);
}

/* Initialize ECC with a pointer to the allocated workzone */
ECC_initialize(workzone);

It still appears something is not correct. I am able to execute the example project successfully, but not when the code is used in a different project.

Are there other project settings required?

Software versions:

CCS v10.0.0.00010 

SimpleLink CC13x0 SDK v3.20.00.23

  • I found the issue. Looks like the call to ECC_initialize() was happening before initializing the memory and Crypto module. 

    Calling in the below order seems to have fixed the issue

        TRNG_init();
        CryptoCC26XX_init();
        memset(romCryptoOutputBuffer, 0, ROM_CRYPTO_BUFFER_SIZE);
        /* Allocate workzone memory for ecc - recommended workzone size is 275 bytes */
        uint32_t *workzone = (uint32_t *)malloc(ECC_WORKZONE_SIZE * ECC_WINDOW_SIZE);
        if (workzone == NULL) {
            while(1);
        }
        ECC_initialize(workzone);

  • Hi Dillon,

    Thank you for posting the solution!