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.

Problem with SYS/BIOS: tasks enter error state and untrackable stack overflow

Hello all,

I have recently implemented a SYS/BIOS OS in my Piccolo (C28069). The system has two tasks: TaskFxn (a led-blink routine which triggers every 100 ms) and TaskFxnCAN (an OpenCAN routine which triggers every 1ms).

I can see that the tasks get into Blocked: Internal Error state after a certain time since the application started. Sometimes will be any one of the tasks, sometimes both, and the time they take to reach this state (working properly before) goes from a couple seconds to almost a minute.

You can see how the SYS/BIOS debug tool looks like in two of these situations:

 

Rarely (around 5% of the debug sessions) a stack overflow will be also reported:

The information of the debugger looks like following:

Scan for errors in the SYS/BIOS debugging tool:

 

Does anybody have any idea how I can track the problem further? I cannot see when and why the tasks get into this error state and where exactly does the stack overflows.

Thank you very much in advance.

  • I see these types of errors generally when one of three things occur

    1. Blown Task stack (as you noted in ROV)

    2. Blown System stack (ROV->Hwi->Module)

    3. Memory corruption (e.g. writing to a bad pointer, writing past an array, etc.)

    For the first two, you can increase the respective stack sizes and see if the problem goes away.

    If it persists, I'd look at the corrupted Task_object and Semaphore_objects and see what is above it in memory. Is it a block of memory that you are over-writing? I'd also put in lots of break-points and keep checking ROV to help narrow down when the corruption occurs.

    Todd

  • 6472.my_module.map.123Thank you very much for your reply :)

    I tried to solve the issue by extending the task stacks to twice and even four times its actual size. I does not work. I also cannot see that they would peak above their limits at the moment. 

    About the issue with the system stack, I check in ROV->Hwi->Module but I cannot see there that the stack peak causes any problem. It is about 323/512 in comparison to its size. Also making this stack larger did not help.

    The moment in which the tasks get into blockedOn: Internal Error is not so clear to me. I try by setting a breakpoint in the task (right after the semaphore) but I cannot catch when it enters the problematic state. I understand it will be seen somewhere in the scheduler. Is there any more detailed description about this specific report from the debugger?

    The task stacks are contiguous in memory and I can still plenty of 0x00BE default memory positions before its assigned limits.

     

    I attach my .map file, in case that helps you identify a possible problem.

  • changed the versions of the tools I was working with and now it works without issue.

    Faulty configuration:

    SYS/BIOS 6.34.2.18
    XCD Tools 3.24.5.48
    Compiler 6.2.0

    Working configuration:

    SYS/BIOS 6.35.1.29
    XCD Tools 3.25.5.94
    Compiler 6.1.4