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.

RM57L843: Complex Debugging Issue - Function call seemingly skipped over.

Part Number: RM57L843

Hi,

I'm using a RM57L843, CCS 12.5.0.00007 with TI V20.2.7.LTS ARM Compiler, LE.

I had to debug an application because we determined a seemingly trivial function was not being called during some system level validation tests..

A image of my function call is shown below. I'm passing in a U32, U8, U32 and a pointer.

I also note the disassembly listing just just before the CPU should branch to my function

When I step in the C code window, the function does not get called and my cursor ends up at the end of the calling function:

Interesting to note that the function in question seems to be the first function linked at FLASH address 0x60:

I know from our testing, that the structure within the target function call is not being updated, so even during run time (i.e. without the debugger attached) we can see on a system level that the function is not getitng called.

The calling function is entered after some lengthy stack calls, and I'm not sure if that is contributing to the issue, however other functions with the same calling method and call depth work just fine. (I don't think the call depth is too excessive)

When I step in the dissasembly window, using instruction stepping mode, the CPU will enter our function

But the actual code at that function is from another module (the code shown above is actually part of a ethernet driver), and as soon as I get into that target function it looks like the stack is gone or the CPU is lost.

The linker stack size is 0x3000 and the current stack pointer is at 0x080023D0, so I don't think we are seeing a stack overflow (and there is no reason either, we are not passing lots of memory between function calls). I am not in interrupt context, this is a mature code base, and the issue is repeatable.

So looking for some help from TI as to what on earth could be causing this issue, espeically in a safety CPU.

Thanks!.

  • Hi TI,

    Our regular projects consist of an application project and a library project, the libary remains rather static as it contains our common code.

    During the course of investigating the bug above, I rebuilt both the library and the application several times.

    However, to correct the above error, I deleted the Debug output folders for both the library project, rebuilt and now our system works as expected.

    I can only assume a stale object file in one of those directories was causing an issue?

    However, as we have approx 200 library projects and just short of 2000 firmware projects, with a lot of them in critical applications, how do we ensure this type of issue never occurs again?

    Looking for some help from TI as to understand why code could be successfully compiled, but produce possibly wrong executable code, presumably due to something stale in a Debug folder.

    Thanks.

  • Hi Stomp,

    Apologies for the delay in my late response. I was stuck with other issues in this mean time.

    However, to correct the above error, I deleted the Debug output folders for both the library project, rebuilt and now our system works as expected.

    Good to hear that after deleted the debug output folder and rebuilt the project works as expected.

    I can only assume a stale object file in one of those directories was causing an issue?

    Yes, you are right i am also suspecting the same.

    However, as we have approx 200 library projects and just short of 2000 firmware projects, with a lot of them in critical applications, how do we ensure this type of issue never occurs again?

    It is difficult to judge this type of issues by just looking the project.

    I can just give you a shortcut to delete output folders in all the projects and rebuilt all the projects with one click.

    first step is you just need to import all the required projects in CCS.

    Second step is select the "clean" build option in CCS.

    Now click the check box of the "clean all projects".

    and click the "Clean" button now.

    What this option will do is, it will delete the debug output folders in the all the projects and projects will get rebuilt from the scratch.

    --
    Thanks & regards,
    Jagadish.