Tool/software:
I have executed the following sample program from the SDK, but it stops at Exception_handlerSpin at ExceptionArmV8M.c
Specifically, it seems that an error is occurring in vListInsert()
within list.c
.
Could you please provide any solutions or workarounds for this issue?
This code is a combination of the sample code from CryptoKeyKeyStore_PSA and empty.c
SDK version is 8.40.02.01
#include <unistd.h> #include <stdint.h> #include <stddef.h> /* Driver Header files */ #include <ti/drivers/GPIO.h> // #include <ti/drivers/I2C.h> // #include <ti/drivers/SPI.h> // #include <ti/drivers/Watchdog.h> #include <ti/drivers/cryptoutils/cryptokey/CryptoKeyKeyStore_PSA.h> #include <ti/drivers/cryptoutils/cryptokey/CryptoKeyKeyStore_PSA_helpers.h> /* Driver configuration */ #include "ti_drivers_config.h" /* * ======== mainThread ======== */ void *mainThread(void *arg0) { uint8_t keyingMaterial[16] = {0x1f, 0x8e, 0x49, 0x73, 0x95, 0x3f, 0x3f, 0xb0, 0xbd, 0x6b, 0x16, 0x66, 0x2e, 0x9a, 0x3c, 0x17}; CryptoKey cryptoKey; KeyStore_PSA_KeyFileId keyID; int_fast16_t status; KeyStore_PSA_KeyAttributes attributes = KEYSTORE_PSA_KEY_ATTRIBUTES_INIT; // Assign key attributes KeyStore_PSA_setKeyUsageFlags(&attributes, (KEYSTORE_PSA_KEY_USAGE_DECRYPT | KEYSTORE_PSA_KEY_USAGE_ENCRYPT)); KeyStore_PSA_setKeyAlgorithm(&attributes, KEYSTORE_PSA_ALG_CCM); KeyStore_PSA_setKeyType(&attributes, KEYSTORE_PSA_KEY_TYPE_AES); KeyStore_PSA_setKeyLifetime(&attributes, KEYSTORE_PSA_KEY_LIFETIME_PERSISTENT); // Set key ID GET_KEY_ID(keyID, KEYSTORE_PSA_KEY_ID_USER_MIN); KeyStore_PSA_setKeyId(&attributes, keyID); // Import the keyingMaterial status = KeyStore_PSA_importKey(&attributes, keyingMaterial, sizeof(keyingMaterial), &keyID); if (status != KEYSTORE_PSA_STATUS_SUCCESS) { // Handle error } // Initialize cryptoKey for crypto operations KeyStore_PSA_initKey(&cryptoKey, keyID, sizeof(keyingMaterial), NULL); // Use the cryptoKey for AESCCM operations // Destroy key after use status = KeyStore_PSA_destroyKey(keyID); if (status != KEYSTORE_PSA_STATUS_SUCCESS) { // Handle error } while (1) { } }
Best regards,