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/TMS320F28069: Float variables sets to infinity

Part Number: TMS320F28069


Tool/software: Code Composer Studio

Hello,

I am using Picollo F28069 microcontroller and CCS version 6.1.1. We have the microcontroler based control systems in our application for the field of Power Electronics. We have two modules, one is a rectifier and another is an inverter, both having seperate controllers. Rectifier operates at 9Khz and Inverter at 4.5 Khz frequency. Suddenly we have started facing a problem in which some of the float variables are always set to infinity and we cannot even overwrite them in Debug window. And the variable keeps changing, I mean the variable is not fixed. This error directly affects the control system and eventually the system shuts down. And this problem is encountered only in Inverter module. In rectifier evrything works perfectly fine with. 

Let me tell you that we have little more complex control in Inverter module thereby increasing the code size and variables in the inverter module. So I tried to reduce the number of float variables as much as I can, thinking that there must be some limit to the number of float variables and that limit must have exceeded. But still the problem remains as it is.

I have tried to browse the related threads on the forum but couldn't find any. If at all the same problem have been encountered before then please send me thread links. 

I am looking forward for your suggestions.

Thank you

  • Hi,

    >>Suddenly we have started facing a problem in which some of the float variables are always set to infinity and we cannot even overwrite them in Debug window. And the variable keeps changing, I mean the variable is not fixed.
    From a CCS perspective, this is a typical error where the JTAG debugger is either starting to lose control over the device and reads random values or, if you are using real-time mode, the device itself is overwriting its own memory (due to a rogue pointer, for example) until it kills the running program. The fact the float values are invalid may indicate the memory is being overwritten by ones (0xFFFFFFFF is NaN in IEEE754 representation).

    In any case, these issues are usually related to the system and not to the tool itself. Therefore, to get better insights and a quicker solution I will move this thread to the C2000 forum, where the experts there are much more knowledgeable about troubleshooting the system.

    Regards,
    Rafael
  • Hello,

    Thank you for your reply and forwarding this thread to C2000 forum.

    In CCS, we have been using Real time mode. I will check it once again if there exists any rogue pointer in the program. Since this problem is only seen in the latest version of the code. Previously such problem never existed.

    One more thing, I would like to clarify is that if I use the same controller card from inverter module in rectifier module then the rectifier code works properly. So one thing is for sure that the controller card is not damaged or no hardware faults exists in the system. There exists some bug in the code somewhere which I am not able to figure out.

    Regards,
    Karan
  • Hello,

    In response to my query few months ago, could anyone please give me their suggestions. I am still facing that problem.

    Thank you.

    Regards,

    Karan

  • Can you take a look at what changed from the previous version of the application to see if it provides any hint of where this issue came from?

    Does this problem exist right from the start or does it work correctly for a little bit before failing?

    Whitney
  • Hello,

    I am almost sure that there is an error in software somewhere. Could you suggest me something in which a float variable would set to infinity? Since I am not very experienced in this field of programming, its not striking me what kind of error it could be. But if you could suggest me some options based on your experience then I can focus on specific part of the code. 

    Thank you.

    Regards,

    Karan

  • Is there also a limit to the number of float variables for Piccolo microcontroller?
  • Some of mostly encountered reasons:
    1) The contens of uninitialized flash or eeprom are also 0xFFFF.FFF. So, when assigned to a variable it inevitably occurs.
    2) Math operations (DIV,SQRT...) with very small operands
    3) Uncontrolled pointer operations
    ...
  • Thanks for the suggestions. I will go through it once again and will come back to you if I find anything.
  • Hi Ibrahim,

    My application involves a little complex control structure. So that involves a lot of arithmetic. We have many float variables like the following.

    float32 C10 = 0.000606425;

    float32 dtk2_rec = 0.000003;

    float32 Tavg=0.00000397; 

    Do you think the above float variables defined in such a way could create a problem?

    Will it be better to write float32 C10 = 6.06425e-4 ?

  • I would recommend to add monitoring code for the problematic variables. Just check the value 'continuously' and stop when it runs away.