stuck in _msgq_send_internal when using RTCS send

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

stuck in _msgq_send_internal when using RTCS send

1,380 Views
preetmehta
Contributor III

Hello,

I am using RTCS for one of my application. As a brief about how, following are some key takeaways.

- I have kept RTCS priority at 70

- My watchdog refresh is also in another task at 70

- One of my task is using send API to send data to the socket, the frequency of sending this data is 50mS. It is almost 35 bytes of data.

This are my rtcs settings.

_RTCSPCB_init = 4;
_RTCSPCB_grow = 50; 
_RTCSPCB_max = 1000; 
_RTCS_msgpool_init = 2;
_RTCS_msgpool_grow = 10;//2;
_RTCS_msgpool_max = 1000;//20;
_RTCS_socket_part_init = 4;
_RTCS_socket_part_grow = 2;
_RTCS_socket_part_max = 20;

_RTCSTASK_stacksize = 60720;
/* Change the priority: */
_RTCSTASK_priority = 70;

I am using 100 Mbps.

ENET_RCR &=~ (ENET_RCR_RMII_10T_MASK);

ENET_RCR &=~ (ENET_RCR_DRT_MASK);

I am facing watchdog resets with following stack when pulled out of my sending task. upper being the latest call when watchdog hit the reset.

\debug\psp\libpsp.a(msgq.o)
0x0821e178 _msgq_send_internal


debug\psp\libpsp.a(msgq.o)
0x0821e0fc _msgq_send_blocked_internal

\debug\rtcs\librtcs.a(rtcscmd.o)
0x081e6ff4 RTCS_cmd_issue

\debug\rtcs\librtcs.a(tcp_send.o)
0x081f13a4 TCP_Process_send

\debug\rtcs\librtcs.a(sock_stream.o)

.text.send 0x081e888c 0x90

\debug\rtcs\librtcs.a(sock.o)
0x081e888c send

\debug\rtcs\librtcs.a(sock_stream.o)

\debug\rtcs\librtcs.a(sock.o)
0x081e888c send

\debug\rtcs\librtcs.a(sock.o)
0x081e888c send

I have noticed that when RTCS is bombarded with faster frequency such thing occurs. Can someone please guide me how to deal with this situation? or if I am doing something wrong?

Thanks in Advance.

Preet

Labels (1)
Tags (3)
0 Kudos
10 Replies

1,115 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Preet:

Which MQX version you are using?

The default priority of RTCS task is 6.  I would suggest you not change the default value. It is a system task.

Regards

Daniel

0 Kudos

1,115 Views
preetmehta
Contributor III

Hi Daniel,

Tried priority of 6 for RTCSTASK. In this scenario I face software reset (watchdog) even earlier than the previous scenario.

The call stack is same as the last one as my post.

RTCSTASK is stuck in msgq_send_internal, when I call send of socket.o

Any suggestions?

Kr,

Preet

0 Kudos

1,115 Views
danielchen
NXP TechSupport
NXP TechSupport

HI Preet:

Have you checked the MQX TAD info, check the task summary and RTCS related info?

Regards

Daniel

0 Kudos

1,115 Views
preetmehta
Contributor III

Hello Daniel,

Thank you for your reply.

I am not pretty sure what to look for /or how exactly other than Task summary using Atollic and J-link.

Which looks fine to me, the stack is still in bound when the issue comes.

Here is one more input when I did some more digging deeper into mqx, I found that the rtcs task is stuck in while inside…

uint32_t TCPIP_Event_time

(

uint32_t time

/* time elapsed */

)

Where in the following snippet event->TIME was generated ‘0’ after addition and hence was never coming out of the loop.

if ((*event->EVENT)(event)) {

event->TIME += time; //here

TCPIP_Event_add(event);

}

After patching it up, when I put my setup on endurance, I face no data on the remote terminal after random time, approx. 1:30 Hrs, almost all the time. Remote endpoint terminal is still connected, but data is not coming out.

Which when debugged, I found that the same path that I mentioned in my original question is returned with 5685 0x1635.

When I searched for this, it is showing RTCS_TCP_CONN_ABORTED ; software caused connection abort.

Now here again is my question restructured, what could be the cause of this? I am facing this error in send() as well as recv(), after 1:30 Hrs of I put my setup on endurance test!!!

Moreover (this might be not at all related but still), when I try to reproduce this with a debugger, it runs all ok, for almost 6-7 hours, and the scenario comes again as soon as I leave my desk and go to home!!!(after 1:30 hours to that).

Any idea???

0 Kudos

1,115 Views
danielchen
NXP TechSupport
NXP TechSupport

Did you apply the patch MQX 4.2.0.2 ?, this patch fixed some RTCS issue.

Regards

Daniel

0 Kudos

1,115 Views
preetmehta
Contributor III

Ok.

I am not pretty sure whether it’s patched already in my MQX 4.2.

I am going to redo it.

Let me update and get back to you.

Meanwhile if there is any way we can know if my library is patched or not?

Preet

0 Kudos

1,115 Views
danielchen
NXP TechSupport
NXP TechSupport

You can download the patch and compare RTCS source code.

Regards

Daniel

0 Kudos

1,115 Views
preetmehta
Contributor III

Hi Daniel,

Patched with 4.2.0.2

I did overnight endurance for non-consecutive 2 days, it works good for a night at least, which is improvement.

Thank you very much for your help. If I find some more issues I know where to look for you :smileywink:

Preet

0 Kudos

1,115 Views
danielchen
NXP TechSupport
NXP TechSupport

Great! Thanks for update.

Regards

Daniel

0 Kudos

1,115 Views
preetmehta
Contributor III

Hi Daniel,

Thanks for your quick reply.

I am using MQX 4.2.

Ok, I will try with RTCS Priority of default.

Kr,

Preet

0 Kudos