Hi,
I am having some random TCP connection off issues with MQX RTCS connected to a Windows host.
I have enabled keepalive to be sent every 1 minute, and so when idle it will automatically send a keepalive out and receive an Ack normally, but randomly I won't receive the Ack, and thus my blocking call recv() would fail with error code 0x00001649, which means RTCSERR_TCP_TIMED_OUT based on below definition:
// #define RTCS_ERROR_BASE (0x00001000ul)
// #define RTCSERR_TCP_TIMED_OUT (RTCS_ERROR_BASE|0x649) /* Connection timed out */
Wireshark capture is showing the connection was idle for more than a few minutes before this error was reported.
To troubleshoot, I planned to call RTCSLOG_enable() to enable the RTCS logging to see what's going on, but the problem is: where is the generated logs, and how to access the logs?
I could not find clues from MQX_RTOS_5.2_reference_manual.pdf document.
Many thanks!
Hello @Chin_Z ,
Thanks for your post. According to the MQX_RTCS_User_Guide 5.2 - Jan 2022, "RTCS log entries are written into the kernel log. Therefore, the kernel log must have been created prior to enabling RTCS logging. In addition, the socket API log entries belong to the kernel log functions group in the kernel. To log socket API calls, this group must be enabled using the MQX function
_klog_control()."
Then according to the Freescale MQX RTOS User's Guide,
You can go to this directory: mqx\examples\klog to find the kernel log file.
Hope it can help you. If my answer still not solve your problem, you can try to directly contact mqxsales@nxp.com for help.
BRs,
Celeste
----------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!
----------------------------------------------------------------------------------------------------------------
Hi @Celeste_Liu ,
Thanks for the reply, this helps a lot.
I followed the steps and made some progress.
Now I can see some loggings for interrupts, but nothing from RTCS, even though I have turned on all logging for RTCS.
I have made sure that in user_config.h file:
#define RTCSCFG_LOGGING 1
#ifndef NDEBUG
#define MQX_KERNEL_LOGGING 1
#endif
I built the library in DEBUG configuration.
Here is my code:
void Task_Log_Display(uint32_t initial_data)
{
_mqx_uint result;
_mqx_uint i;
/* Create the kernel log */
result = _klog_create(2 * 1024, 0);
if (result != MQX_OK) {
printf("Main task: _klog_create failed %08x", result);
_task_block();
}
/* Clear all the control bits and then set particular ones: */
_klog_control(0xFFFFFFFF, FALSE);
/* Enable kernel logging */
_klog_control(KLOG_ENABLED | KLOG_FUNCTIONS_ENABLED | RTCSLOG_FNBASE | KLOG_INTERRUPTS_ENABLED, TRUE);
/* Tell RTCS to start logging */
RTCSLOG_enable(RTCS_LOGCTRL_ALL);
/* Write data into kernel log */
for (i = 0; i < 10; i++) {
_time_delay_ticks(5 * i);
}
/* Read data from the kernel log */
printf("\nKernel log contains:\n");
while (_klog_display()) {
_time_delay(100);
printf("k");
}
_task_block();
}
Any more clues?
Thanks,
Chin
Hello @Chin_Z ,
Sorry, I don't have any new clues at my end.
I would suggest you contact our MQX partner, Embedded Access for fast support.
Embedded Access - MQX Design, Products, & Services
or contact with mqxsales@nxp.com.
Thanks for your understanding in advance.
BRs,
Celeste