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.

sporadic crash of TI rtos

Other Parts Discussed in Thread: SYSBIOS

Hi all,

I am pretty new to ti rtos and rtos systems and working out my first projects on a TM4C1294XL board, using TI rtos 2.10.1.38.

I currently have a setup based on the tcp echo example, using queues and events to communicate between my tasks. Since the tcp worker task is created and closed for each new connection, and at the end of a connection it took me some time to have a stable system.

Now i synchronize the other tasks, using events, together with the queues and sems, so they only put a message when the task is alive and their last message has been removed from the queue, meaning i remove all these events before I close the task.


This is pretty reliable, but when I open the connection and send a message immediately, the system crashes sometimes. I get the error message in ROV then:

Caught exception in view init code: "C:/ti/xdctools_3_30_04_52_core/packages/xdc/rov/StructureDecoder.xs", line 547: java.lang.Exception: Target memory read failed at address: 0x40037000, length: 80

I would like to now how I could trace down the error more exactly, using ROV.


Thanks for your help!

  • Simon,

       You can open up ROV, select the Task module and under CallStacks you can see all your running tasks and what code they last executed. Here's a screenshot below:

    You can put breakpoints at the suspected PC locations and then run the program again to verify where the problem is.

    Let me know if this helps

    Moses

  • Thank you Moses,

    i have this final steps in the task which seems to include the bug:

    0x20016530, Label: HYDRAULICS_T, Task Mode: Preempted,
    0 loader_exit() at exit.c:52,PC = 0x0001648C FP = 0x20005070
    1 abort() at exit.c:117,PC = 0x00016496 FP = 0x20005070
    2 exit(int) at exit.c:108,PC = 0x000164C0 FP = 0x20005078
    3 xdc_runtime_System_exit__E(int) at System.c:133,PC = 0x000191BE FP = 0x20005088
    4 ti_sysbios_BIOS_exitFunc__I(int) at tcpEcho_pem4f.c:2853,PC = 0x00019274 FP = 0x20005090
    5 ti_sysbios_family_arm_m3_Hwi_excHandlerMax__I(unsigned int *, unsigned int) at Hwi.c:920,PC = 0x00008BC0 FP = 0x20005098
    6 ti_sysbios_family_arm_m3_Hwi_excHandler__I(unsigned int *, unsigned int) at Hwi.c:812,PC = 0x000189DC FP = 0x20005140
    7 <symbol is not available>,PC = 0xFFFFFFFC FP = 0x20005148

    Seems to be a problem with a HWI then. I will try to figure it out during the next days.

    Best regards, Simon

  • Simon,

       That still doesn't reveal the problem. When an exception happens it triggers the exception handler which runs as a Hwi. That explains the ti_sysbios_family_arm_m3_Hwi_excHandler calls in the trace but it doesn't still tell us what caused the exception. Looking back at your original post, I see the exception looks like something related to ROV. Can re-run your program and when the exception happens again, open up ROV and send me a screenshot of the "Scan for Errors" tab under the BIOS module like the one below:

    Regards,

    Moses

  • Thank you Moses,

    this is the Error I receive:

    ,ti.sysbios.knl.Queue,Basic,ti.sysbios.knl.Queue@20016f44:JSON_0_Queue,elems,Queue contains loop. Element 536964940 points to element 536885968

    Best regards, Simon

  • Simon,
    The error statement points to the Queue. How are you using it in your application?

    Regards,
    Moses
  • Hello Moses,

    I am basically using queues to send out different process- and ADC- data via TCP, and receive some data, using a single thread. I am using Queue_put and Queue_get to be threadsafe.

    The TCP-handler allows only one connection at a time, I have to set listen to 0, I don't know whether this is the finest solution.

    Most of my queue Structs look like this:

    typedef struct JSON_OUT_Obj {
    Queue_Elem elem;
    String string;
    Int stringlen;
    Int status;
    ti_sysbios_knl_Event_Handle event_handle;
    Uint32 event_Id;
    } JSON_OUT_Obj, *JSON_OUT_Ptr;

    I use the Event Handles to trigger back the task, after the message was removed from the task, since I use pointers to the struct. Otherwise i had problems with the Semaphore, since only one struct is used at the sending task.

    I potentially have more problems, the harder I test the TCP safety. Fast disconnecting and reconnecting with instantly sending messages tends to kill the system.

    Best regards, Simon

  • Hi Moses,

    since the error occurs very sporadic only, and I think this error is non-critical, I decided to use the watchdog to just reset the system then. I implemented it yesterday and it works fine.

    I have some hints that the error occurs within the ADC task, but I am not really sure where this leads to the error within the queue.

    Best regards, Simon

  • I still really don't understand how you're using the Queue from the statement: "queues to send out different process- and ADC- data via TCP, and receive some data, using a single thread". When are you writing and reading from the queue? Are you putting objects into the queue from your TCP task? Also where are you reading data from the queue? Looks like you have a workaround for this but it might help, at least for the future if we understand what's actually wrong

    Regards,
    Moses
  • Hello Moses,

    I use several tasks within my system.

    I have one queue as input to the TCP worker task (this queue is used from several tasks to regularly send process data to my client) and I use one queue from the TCP worker task to a JSON parser task. I disallow more than one TCP worker at a time.

    Since I pass pointers to my queue structs I also use and event_handle and an Id within these structs. I want to make sure that an earlier message has been removed from the queue, before i post a new one. I also post the events to start the communication after a client is connected. When the client is closed, I wait for some seconds to ensure that all tasks have send a message again. Then I remove all the messages from the queue, but without posting the events back to the sender, so no more messages will be send until I have a new client connected. This works well.

    the TCP worker puts messages in a queue for my JSON parser task. There is only one sender for this task.

    I hope this helps to understand how I use the queues.

    Best regards, Simon

  • Simon,
    I think we need to debug further to fully characterize this. You'll need to narrow down the fail case to at least a particular task (HYDRAULICS_T?) and then maybe the specific statement that causes the error. We can review the code in that task for possible error conditions.

    Regards,
    Moses