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.

TMS320F28069F: After encrypting the program lab01b from motorware, the program cannot run in flash.

Genius 3095 points

Part Number: TMS320F28069F

Dear team:

When I debug lab02b, the program can run normally in flash without encrypting the program, but the program can't run after encryption.

I see the following code in the program:

#ifdef CSM_ENABLE
//copy .econst to unsecure RAM
if(*econst_end - *econst_start)
{
memCopy((uint16_t *)&econst_start,(uint16_t *)&econst_end,(uint16_t *)&econst_ram_load);
}

//copy .switch ot unsecure RAM
if(*switch_end - *switch_start)
{
memCopy((uint16_t *)&switch_start,(uint16_t *)&switch_end,(uint16_t *)&switch_ram_load);
}
#endif

When I enable this code, CCS prompts econst_end/econst_start/econst_ram_load is not defined. My question is:

1, Should this code be enabled? How can I set econst if it should be enabled_ end/econst_ start/econst_ ram_ Load related definitions?

2, After encryption, will the system be divided into encrypted area and unencrypted area? Can these two areas call each other directly? If not, what should be done?

Best ragards

  • This macro definition is only for F280027F, you don't need to change anything for F28069F to support code CSM. All labs for F28069F can support CSM if you didn't change the F28069F.cmd file

  • Part Number: TMS320F28069F

    Dear Yanming:

    There is such a definition in the main function:

    #ifdef CSM_ENABLE
    #pragma DATA_SECTION(gUserParams,"rom_accessed_data");
    #endif

    After I use it, if I define the rom_accessed_data in the non safety area, it will be effective. The motor can rotate, but the rotation is not correct.

    In addition, there is no address defined for below variables. Do you know how to use this part in F28027F?

    #ifdef CSM_ENABLE
    //copy .econst to unsecure RAM
    if(*econst_end - *econst_start)
    {
    memCopy((uint16_t *)&econst_start,(uint16_t *)&econst_end,(uint16_t *)&econst_ram_load);
    }
    
    //copy .switch ot unsecure RAM
    if(*switch_end - *switch_start)
    {
    memCopy((uint16_t *)&switch_start,(uint16_t *)&switch_end,(uint16_t *)&switch_ram_load);
    }
    #endif

    Best Regards

  • You need to have the linker define them for you. You can take a look at the cmd file and how we generate run start, run end, load start, etc...symbols for ramfuncs as an example.

    Can you study your .map file and see if you can identify if there is anything in unsecured SRAMs (0xC000 and above, as well as M0/M1) that is trying to access any variables in the secure RAMs/Flash.

    Whitney

  • As mentioned above. The macro and linker definitions are only for F28027.  You might add reference coder below in the linker file if you want to use the F28027F with CSM.

    .econst : LOAD = D_FLASHA,
    RUN = P_RAML0,
    LOAD_START(_econst_start),
    LOAD_END(_econst_end),
    RUN_START(_econst_ram_load),
    PAGE = 0

    .switch : LOAD = D_FLASHA,
    RUN = P_RAML0,
    LOAD_START(_switch_start),
    LOAD_END(_switch_end),
    RUN_START(_switch_ram_load),
    PAGE = 0