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.

MSPM0G3519: Testing of Customer secure code examples.

Part Number: MSPM0G3519
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

I want to understand how i can test CSC codes example from sdk for 3519 controllers? it will be helpful if you have proper steps to do that. I went through documentation, but it is for ccs ide. I am using Theia ide, and some options are not there.  can i test customer_secure_code_LP_MSPM0G3519_nortos_ticlang and customer_secure_image_with_bootloader_LP_MSPM0G3519_nortos_ticlang together? or do I need bootloader example code? i don't understand how to test all these codes. Documentation is somehow complicated.

  • I am facing issue while testing example code as it is. in my understanding if I write customer_secure_code_LP_MSPM0G3519_nortos_ticlang example code in flash memory. and then trying to flash one of the prebuild sample image then it is not working as mentioned in document.  also if if i flash prebuild image first and then if i try to debug with customer_secure_code_LP_MSPM0G3519_nortos_ticlang in IDE at that time i am getting issue as show below. will you please give me exact steps to test those example atleast so that i can get clear idea of secure boot and secure firmware update.

  • Helic and TI Team,

     Some additional input / clarification from Mehul directly (from offline emails):

    Q: when trying to follow the step-by-step instructions from either the software-dl or Resource Explorer paths, where does it ‘fail’?

    A:     Sometimes I am getting issue while loading two projects . if I load sample image file using uniflash and then try to debug Customer secure code to see who code will jump and do authentication in this situation I am getting following error .

    Q: are you ‘stuck’ because of the differences between CCS and CCS/Theia?  (I agree that the instructions do also deserve a refresher)

    A: I am using Theia ide ,and follows the process mention in doc to run example codes is with old CCS ide some options are not there or maybe I am not able to find those in Theia. I need clear steps and details to run those example code and what supportive environment I need for that.

     Steps I am doing are as follows:

    1. Get 1. customer_secure_code_LP_MSPM0G3519_nortos_ticlang

    2.customer_secure_sample_image_LP_MSPM0G3519_nortos_ticlang from resource explorer.

    1. Created new key and add it into boot_key.c file of  customer_secure_code_LP_MSPM0G3519_nortos_ticlang.
    2. Build new images(.bin) from those example code.
    3. Sign sample image with new key.
    4. Load firmware using uniflash tool.

     

    But on my board, I can see LED is keep blinking as indication that no valid image is present . I kept customer_secure_code_LP_MSPM0G3519_nortos_ticlang at 0x00000000 location and sample signed image at 0x00004800 location().

    Any help or suggestions welcomed !

     TY,

    Chris

  • Hi Chris and Mehul,

    For CSC example, this will erase nonmain region, thus we have to enable this function in properties -> Debug -> MSPM0 Flash Settings, just like below screenshot:

    Because NONMAIN region will control some boot function, thus we will only erase MAIN region default in SDK example.

    Thanks!

    Best Regards

    Johnson

  • Thanks for the reply, John, I have done this setting but still facing the issue. I want to understand how example codes memory mapping is doing. I mean in flash at which location I need to place sample image and CSC code? also, there are some prebuild .bin available in code base so exactly which one should work.? and if I place prebuild sample image at address 0x00004800 and start debugging using CSC code that does image authentication and jump to sample image at that time I am getting error of non-main memory erase failed. so, it will be helpful if you give me exact steps to test those example code. I am using uniflash tool to load sample image and then Theia ide for debugging CSC code to check image authentication process.

  • hi John. any update?

  • At least tell me the exact steps to test and debug example code. because documentation and example codes flash mapping are quite confusing. 

  • Hi Mehul,

    Loop our security expert Pengfei help here.

    Thanks!

    Best Regards

    Johnson

  • Hi Mehul,

    I request a friendship of you and could send you a slides for CSC example test.

    Actually I recommend you to use customer_secure_sample_image example for signed image firstly, and keep the public key in boot_key.c as default. After the CSC test successful, we could then continue to use new key for signing.

    As for the memory mapping, take MSPM0G3519 as example, it should be as below, and could also be found in 2.2 CSC Memory Maps of Flash Dual Bank feature in MSPM0

    - 0x00000: CSC example

    - 0x40000: customer_secure_code_LP_MSPM0G3519_nortos_ticlang-bank1-0x40000.bin. This is the exactly the same example code as CSC example, but it is placed as start address of Bank1 for jumping to application program in bank1.

    - 0x4800, 0x44800: Different signed application image. It could use different "build configuration" of customer_secure_sample_image example to build different image. For example, you could place sample_image_signed_0x4800_v1_0_0_blue.bin in 0x4800, and place sample_image_signed_0x4800_v2_0_0_green.bin in 0x44800. They have different version number, and CSC will check the version and start from the highest version. 

    As for the non-main erase fail error, it always caused by not select correct flash setting. You should use below setting in CCS v20 (CCS-theia). 

    Best Regards,

    Pengfei

  • Alright, i will check this, but what if I want to debug and see the flow of CSC code.  and as you mention need to place CSC in both banks' means ate address 0x00000000 and 0x00040000 location. so, in real application (my project) do i need to place this code in both the bank? 

  • Hi Mehul,

    Yes, the CSC should also be placed in bank1 in your project. It is used for keeping the same flash mapping of two flash bank and to guide the program to application image of bank1.

    Best Regards,

    Pengfei