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.

CCS/TMS320F28069F: CSM does not execute programs within the OTP

Part Number: TMS320F28069F


Tool/software: Code Composer Studio

Hi,

I used the 28069F chip and used the program in OTP(the InstaSPIN). When I did not use CSM, the program was completely normal. But once I used the CSM function, other parts of the program were normal, except for the program in OTP could not be called normally, which caused the motor could not run.What is the reason?


Thank you in advance!

  • InstaSPIN is in ROM, not the OTP. Even when the device is secured, the application should run fine in standalone mode. Did you unlock the device before attempting to run your InstaSPIN code? Exactly what error are you seeing?

  • Motor rotating successful before disable CSM。

    error: The program failed to execute InstaSPIN and the motor did not work.

    I executed the following procedure:

    #define CSM_ENABLE

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

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

    In the CMD file:

     rom_accessed_data   : > RAMM1       PAGE = 1

    But I couldn't use the following code:

    #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

    Because I don't know how to get the address of &econst_start,&econst_end.......

    I know how to call a function from Flash into RAM for execution, but what about  .econst?

    AND,Can these tips help me successfully use CSM?

    Thank you!!

  • You can generate them with the linker--see in your cmd file how start and end values are generated for ramfuncs. I don't think this should be necessary for F28069F though.

    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