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.

Load problem or Initialization problem?

I have debugged a programm. It seems to go wrong after I remove some blank rows or some comments, which I think is really weired.

Not all the things went wrong, just some state of the system did. pecificly speaking, I am observing the error rate of  4fsk demodulation process written in the dsp. And it seems alright before I remove some blanks or comments in the demodulation function. After I remove some, the error rate uprises which I think is abnormal.

And this abmormal phenomenon seem to appear when I first turn the power on. If the abnormal phenomenon appears, I reload the programm into ram for a few times, it seems to restore to the right state, in which the error rate is back to normal.

what is wrong with my prgramm? Is there someting wrong with initializtion? I mean there is some variable I haven't initialized.  Or other problem?

  • Hi,

    It is difficult to pinpoint an exact cause for the issue you describe, but are you saying the behaviour of the code is different if you remove comments and blank lines from your source code?

    If so, that should never happen. However, since it is very difficult to pinpoint an exact root cause without actually looking at the code, I would suggest the obvious tip of making sure you are not removing anything significant (parenthesis or other seemingly innocuous constructs - I have done that in the past). Also, I would remove the lines and comments in smaller groups just to be sure you can narrow the range of the source code changes that can potentially cause a problem.

    Moving to the load/initialization phase, I would first make sure that, every time you start the code you start at the very same scenario. One of the major issues is when, during code development, lots of changes and reloading are performed - this can cause the code to start executing at different initial conditions every time, with obvious differences in the runtime behaviour. In general disconnecting from the cores and performing a hardware reset/reconnect helps start fresh every time. You don't need to terminate the debug session, just disconnecting is enough.

    A few threads that may be relevant to the load/initialization issue are below:
    e2e.ti.com/.../1390001
    e2e.ti.com/.../1452701
    e2e.ti.com/.../408396

    Hope this helps,
    Rafael
  • Thanks for answering. I just want to make some complementation.

    I did'nt remove any useful code, just some blank lines or comments. 

    And the programm is given to me by a Japanese while I am a Chinese. But the comments are all English and  there is no Japanese or Chinese charactor in the programm, at least I can't see any with my  eye.The operation system is not same. Is it possible that there is something wrong with different systems? probably encoding problem?

    And there is already some code in the ROM outside the dsp, which runs after powering up or reset and I can't prevent this happening. Is there any problem with this?

  • Is it possible that the programm isn't loaded completely? Because when I run the programm and things go wrong I reload for several times , the programm seems right again?