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.

CC2640R2L: CC2640r2l调用rom_crypto.c文件的AES加密库跑飞

Part Number: CC2640R2L
Other Parts Discussed in Thread: CC2640, AES-128

调用函数 aes_ecb_encrypt_t aes_ecb_encrypt = (aes_ecb_encrypt_t)(0x10018a99);

在CC2640f128平台没有任何问题,换到CC2640r2l后执行到目标函数死机了,应该是0x10018a99此地址的问题,求解。

  • CC2640R2和CC2640架构是不一样,增加了ROM,将driver ti-rtos 和部分协议栈放在ROM中

  • 地址偏移量不一样吗  还是说R2系列的不支持这个库文件

  • TI员工技术支持一下,感谢

  • 地址偏移量不一样吗 

    这是有可能的

    CC2640r2没有AES的例程,你是在哪里使用的,调用了哪些函数

    PS:论坛支持不是实时的,所以没有办法做到立刻回复,还有其他用户的问题需要处理

  • 感谢回答!

    1、我是拷贝的 C:\ti\tirtos_cc13xx_cc26xx_2_21_01_08\products\cc26xxware_2_24_03_17272\driverlib 这个目录下的rom_crypto.c 和 rom_crypto.h 文件到工程目录直接使用的。

    2、使用的函数是 AES_ECB_EncryptData 和  AES_ECB_DecryptData (代码具体如下)。使用直接将加密数据和秘钥带入函数中。 

    ///////////////////////////////////* AES-128 *//////////////////////////////////

    /* AES - ECB */
    typedef void(*aes_ecb_encrypt_t)(uint8_t *, uint16_t, uint8_t *);
    aes_ecb_encrypt_t aes_ecb_encrypt = (aes_ecb_encrypt_t)(0x10018a99);

    typedef void(*aes_ecb_decrypt_t)(uint8_t *, uint16_t, uint8_t *);
    aes_ecb_decrypt_t aes_ecb_decrypt= (aes_ecb_decrypt_t)(0x10018ac5);

    //*****************************************************************************
    // AES_ECB_EncryptData
    //*****************************************************************************
    void
    AES_ECB_EncryptData(uint8_t *text, uint16_t textLen, uint8_t *aesKey)
    {
    aes_ecb_encrypt(text, textLen, aesKey);
    }

    //*****************************************************************************
    // AES_ECB_DecryptData
    //*****************************************************************************
    void
    AES_ECB_DecryptData(uint8_t *text, uint16_t textLen, uint8_t *aesKey)
    {
    aes_ecb_decrypt(text, textLen, aesKey);
    }

  • AES 和 SHA ROM 库在 CC2640R2中已弃用,建议使用 Crypto Driver程序,

    可在SDK安装路径找到:C:\ti\simplelink_cc2640r2_sdk_5_30_00_03\source\ti\drivers

    说明文档:https://dev.ti.com/tirex/content/simplelink_cc2640r2_sdk_5_30_00_03/docs/tidrivers/doxygen/html/index.html

x 出现错误。请重试或与管理员联系。