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.

TMS320F280025C: Copy Secure Functions from Flash To Ram in TMS320F280025C

Part Number: TMS320F280025C
Other Parts Discussed in Thread: C2000WARE

Hi 

I am checking the DCSM tool and I want to copy functions(also interrupt) from the secure flash sector to the ram. I tried to copy

in the regular way through the .cmd file  but the program leads me to illegal operations. I looked in the data sheet and I saw this:

There are functions that handle the secure data copy from falsh to ram:

Uint16 SafeCopyCodeZ1(Uint32 size, Uint16 *dst, Uint16 *src);

Uint16 SafeCopyCodeZ2(Uint32 size, Uint16 *dst, Uint16 *src);

the problem that I cant find them.

can you please lead me to the location of those functions or what I need to do to include them. or maybe you have another way to copy secure data from flash to ram.

Thanks

Yoav

  • Hi,

    You need to include the device specifc SafeZone code libraries into your project in order to use the Secure ROM function APIs. The Secure ROM function API libraries for a particular device are a part of C2000Ware.
    Please navigate to <C2000Ware_install_Directory>\libraries\boot_rom\f28002x\rev0\rom_symbol_libs\SafeZoneCode to access the libraries.

    Hope this helps. Please close this ticket and marked it "resolved" if this response has answered your query.

    Thanks & Regards
    Pramod

  • Hi Yoav,

    These functions are part of ROM provided by TI. You just need to link them during compile time using ROM library (available at <C200Ware>\libraries\boot_rom\f28002x\rev0\rom_symbol_libs\SafeZoneCode). Please note that these functions are provided to copy code from EXEONLY secure flash sectors. For non EXEONLY secure flash sector you need to just place memcpy function in secure flash sector and use that to copy from flash to RAM. You can refer this application report which has detail on this.

    Regards,

    Vivek Singh

  • Hi

    Thanks for the replies. I managed to import the the function. I needed to do extern with the functions prototype. for example:

    extern uint16_t SafeCopyCodeZ2(uint32_t size, uint16_t *dst, uint16_t *src);

    unfortunately, the function doesn't copy the data. I looked at the return value and it is zero.

    I will explain what I am trying to do:

    I have the Secure zone 2 -  RAMLS5 and FLASH_BANK0_SEC6 belong to this zone.

    all I want to do is to run secure functions from the secure ram and not from the flash.

    everything working fine when the functions is in FLASH_BANK0_SEC6.

    in the image below this change will cause illegal interrupt as soon as the program try to enter the function that is located there:

    You can refer this application report which has detail on this.

    I also tried this:

     I already have .TI.ramfunc section in my .cmd file:

    so I defined other one But I get this warning as you can see in the image:

    I included the library FlashAPI_F28002x_FPU32.lib by dragging it to the project as the file suggested.

    What am I missing here?

    Thanks

    Yoav 

  • Hi,

    The SafeCopy Functions are to be used only if the copy is to be done from EXEONLY FLash sector to EXEONLY RAM. Can you please confirm if your RAMLS5 and FLASH_BANK0_SEC6 belong to the same zone and are configured as EXEONLY regions? 

    Check this out and then see if the return value from the SafeCopy function is non-zero.  

    Also, I suggest you to please create a different thread for this query since the original query has already been resolved. WE can continue the discussion in the new thread.

    Thanks & Regards

    Pramod