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.

Compiler/CODECOMPOSER: Same Expression makes Fault ISR

Part Number: CODECOMPOSER

Tool/software: TI C/C++ Compiler

Hi,

I'm developing a project with TM4c129 MCU and CCS 6.1.3, Compiler TI 15.12.1.LTS,

In this project, I2C, Ethernet are used, the system is working without any error ,

Now I have used a below statement which is already used in other module makes Fault ISR,

httpd.c (module 1)

data=fault.value[0];

user_i2c.c (module 2)

data=fault.value[0];

the variable "data" is a external variable (type:int)

the variable fault.value[0] is  a structure variable, external (type: int)

Trials

I have tried with optimization settings, even off the optimization, but can't able to solve it,

I have changed both variable with "volatile", keyword, result no effect

if command that line (data=fault.value[0];) at any one of the module , the system is working fine without any fault ISR,

Opinions

i. is the same expressions at different module would be single by compiler optimization?

ii. is compiler optimization disturb the same expression?

Iet me know the problem, help to solve it.

Thanks in advance!.........

  • Are you saying that changing a line from ...

    dineshkumar mani said:
    data=fault.value[0];

    to ...

    dineshkumar mani said:
    (data=fault.value[0];)

    ... makes a difference?  You only added the parentheses.  This will not make a difference in the code generated by the compiler.  

    You probably have some intermittent problem that only seems like it is related to the parentheses.  Please check again.

    Thanks and regards,

    -George

  • Dear george,

    I'm not add the any parenthesis,

    Just i command that line in one module , then it s work.

    //data=fault.value[0];

    How to know intermittent pbm& how to solve it?

  • So, when you remove the comments from this line ...

    dineshkumar mani said:
    //data=fault.value[0];

    ... your system changes from working to failing.  Is that correct?

    That is a very simple statement.  The TI ARM compiler has been generating correct code for statements like that from the beginning.  It is very unlikely that the compiler is directly contributing to the problem.  I suspect the problem is present all the time, but changing this code is what causes it to finally appear.

    You need a much better understanding of why the code goes wrong.  For that, you need help with debugging techniques on your system and software.  Since you are on a TM4C system,  I recommend you start a new thread in the TM4C Microcontrollers Forum.  Or, if you prefer, I can move this thread to that forum.

    Thanks and regards,

    -George