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.

LP-AM263P: doubts in running aes encryption code

Part Number: LP-AM263P

Tool/software:

Hi Nikhil,

I tried dumping the AES-CBC-128 bit encryption code(from mcu_sdk) onto my LaunchPad. In the console, it only shows the message "AES example started", and it's not printing any of the statements placed after the DTHE_AES_open(aes_handle) function. So, I suspect the code is getting stuck or looping within the DTHE_AES_open API.

Could you provide a video recording of this code running? I might be missing something.

My card is in HS-FS .




  • Please refer the below recording to load AES.

    /cfs-file/__key/communityserver-discussions-components-files/908/AES-demo-run.mp4

    This example wouldn't work if it is directly loaded to CCS, as there is no HSMRT loaded by SBL (as there is no SBL, there is only gel), the firewall does not allow R5 to access the AES registers causing an abort when trying to access any AES register in  DTHE_AES_open API.

    So we need to load an SBL and HSMRT for this application as shown in the attached video.

    Thanks and Regards,

    Nikhil Dasan

  • Hi Nikhil,

       As per the instructions in the video, I started writing the command under the js section. However, it's throwing an error saying that some file in the am263p-cc folder is missing, even though the files are actually present. I'm stuck at this point.

  • The path shown in the script in C:/ti/mcu_plus_sdk

    Have you installed the SDK under this name? If not, can you update the path in the .js file?

    Thanks and Regards,

    Nikhil

  • Hi Nikhil,

       I have mentioned correct paths under products section as shown below. Can you update me where to change path in .js file?

  • In the .js file,  

     Modify "sdkPath" (search for EDIT THIS) to point to the absolute path of the SDK.

    - On windows make sure to use '/' or '\\' as path separator

    Thanks and Regards,

    Nikhil 

  • Hi Nikhil , 

      It would be more clear if you could attach snips to the above information.

  • Please update the sdkpath as shown below in the load_sbl.js file

    And please build the sbl_null example in the SDK using below command, before running the .js file

    cd ${MCU_PLUS_SDK_PATH}
    gmake -s -C examples\drivers\boot\sbl_null\am263px-cc\r5fss0-0_nortos\ti-arm-clang all
    
    or u can use CCS as well to build this SBL

    Thanks and Regards,

    Nikhil Dasan

  • Hi Nikhil , 

      I first built the sbl_null example using the command prompt. After that, I tried running the load_sbl.js file in the scripting console, but I encountered an error.

  • Hi,

    Are you on AM263-CC or LP board? 

    I see that the path pointed in the .js file is AM263Px-CC. Have you build this sbl_null at your end?

  • Hi Nikhil,

      I tried executing the code as you showed in the video, but I'm still facing the same issue. It's getting stuck in a loop somewhere in the code. I'm attaching the video below -check it once.

  • Hi Sravya,

    May I know why is your example named AES_encryption_testing.out

    Is there any modification on the same from the Standard SDK release?

    Could you please try the example from the SDK that is built for the LP board first to confirm it is working?

    Thanks and Regards,

    Nikhil Dasan

  • Hi Nikhil,

    Even with example code present in mcu_plus_sdk I'm facing same issue. 

     Starting command "aes cbc-128 example started" printing in the console . There's no "Dthe aes cbc 128 example completed printing in the console".

  • Hi,

    I tried the binary on the AM263Px LP board at my end as well and it worked. Below is the binary I tried at my end on the AM263Px-LP board

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/crypto_5F00_dthe_5F00_aes_5F00_cbc_5F00_128.release.out

    Could you please try with the above example binary?

    i.e. 

    Step 1: Power ON the board in DEV boot mode

    Step 2: Launch the target configuration and run the load_sbl.js file

    Step 3: Load the above image to the R5_0 core and execute. You should see the below logs.

    [CRYPTO] DTHE AES CBC-128 example started ...
    [CRYPTO] DTHE AES CBC-128 example completed!!
    All tests have passed!!

    Thanks and Regards,

    Nikhil Dasan

  • Hi Nikhil, 
     
        It's working fine now . I have one more query , Why there is need of running sbl_null and load_sbl.js file before running aes encryption code . What's the link between them .

  • It is because of the below reason

    AM263x MCU+ SDK: Security

    So, sbl_null will load the HSM, only then you would be able to access AES registers from R5 core

    Thanks and Regards,

    Nikhil Dasan