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/TMS570LS0332: Optimizations in CCS Vs Controller ESM interrupt/Abort related to Flash memory

Part Number: TMS570LS0332

Tool/software: Code Composer Studio

Hi,

I am using TMS570LS0332 in my design and using CCS for software development. If I enable the optimizations settings of the microcontroller as shown in the attached figure, i see that nERROR pin of the safety controller is activated. The reason for this is related to flash ECC.  Is there any dependency between the flash ECC and CCS optimization settings. 

  • Hello,

    My test shows that the combination of opt_level=1 and opt_for_speed=3 will cause this issue. All other settings don't cause the ESM error. The error happens in TI_auto_init().

    TI_auto_init() is used to perform C autoinitialization of global/static variables, and process the binit copy table.

    I don't know why this combination causes esm error. Will check with compiler team. Thanks

  • Dear QJ,

    thanks for the answer. I am a co-worker of Srikanth, adding some info which might help:
    - we are using compiler TI ARM 5.2.9
    - we are presently setting optmization flags for certain individual C files only, not for the whole project

    Do you think this could be related to the usage of float variables? We have floating point mode set to "strict" and we use float variables in the optimized files.

    Best,
    Stefan
  • Hello Stefan,

    TMS570LS0332 doesn't support floating point. If floating operation is performed, it will generate undef abort.
  • Hi QJ,

    "If floating operation is performed, it will generate undef abort."

    My observation is the following: Regardless of optimization, I use type float32 in my program on the TMS570LS0332. It compiles, works and tests fine, so your statement is not correct. I know that the controller does not have a floating point support, so it must be implemented in SW / a Ti library. In CCS, you can specify "vfplib" for float support.

    We use the setting shown below in additionwith runtime support library "rtsv7R4_T_be_eabi.lib".

    Also see this forum entry for this topic:

    e2e.ti.com/.../2423247

    Can you comment?

    1. Please confirm that float can be used with TMS570LS0332 as described above

    2. Going back to the original question about optimization: Provided that float is generally ok to be used, can you comment on what effect different optimization settings have on the Flash memory abort (see original problem)?

    Further, I can tell you that we have changed optimization settings to "0 Register Optimization" Speed vs size 3. We have not encountered the issue with that setting.

    What I do not understand is what "Floating Point mode" means in the optimization dialog, as shown below. Can you comment?

    Thanks,

    Stefan

  • Stefan,

    Let me answer questions related to the floating-point operations use. These statements are also found in the ARM Code Generation Tools Users Guide, SPNU151: www.ti.com/.../spnu151

    You are right in that the RTS library does support floating-point arithmetic functions. However, for MCUs that do not include a floating-point coprocessor, the "--float_support" needs to be configured as "none" in the CCS project's processor options.

    The "--fp_mode" setting enables or disables a relaxed floating-point mode. Choosing a "relaxed" mode causes double-precision floating-point operations and storage to be converted to single-precision floating-point or integers where possible. This is non-conformant behavior, but results in faster code, with some loss in accuracy.

    Regards,
    Sunil