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.

TMDSICE3359: Socket error 10054: occurs after about 1 hour(Again)

Genius 5350 points
Part Number: TMDSICE3359
Other Parts Discussed in Thread: AM3359, TMDXICE110

Hi experts,

This is a continuation of the original thread.

My customer has run the following two example projects on TMDSICE3359.

NIMU_FtpExample_icev2AM335x_armExampleproject
NIMU_ICSS_FtpExample_icev2AM335x_wSoCLib_armExampleproject

In both projects, a socket error 10054 occurs after about 3855 communications in fixed format communication. Can you please tell me how to avoid this problem?

The test method and details are listed below.

In "ftpsever.c", add IP address and send/receive process to test the communication between PC and evaluation board. (Other than that, change the stack size of the client to 32768)

[Modbus/TCP]
Client command: 00 00 00 00 00 06 01 03 00 01 00 04
Server response :00 00 00 00 00 0B 01 03 08 01 02 03 04 05 06 07 08
(Fixed format response)

In this case, if they send and receive repeatedly in a 1 second cycle after connecting the line, Socket Error 10054: will occur after about 1 hour. Even if the cycle is changed, the same error will occur after about the 3856th communication. If they reset the client (disconnect to connect) after the error occurs, communication resumes again, but the error occurs again after the same number of communications.

To test this, disconnect from the PC at (for example) 3850 times before reaching 3855 times, and reconnect, and this error will not occur. The above suggests that the error is occurring because AM3359 disconnects when the communication frequency exceeds a certain limit.

It would be great if you could give me some related information, including whether this is a NDK specification or not.

Best regards,
O.H

  • Hi O.H,

    Let me first try to reproduce this problem on my setup and then investigate. Please expect some delay. 

    Thanks for your patience.

    Regards,

    Jianzhong

  • Hello O.H,

    Could you please provide details how your customer did the testing? I'd like to do exactly what they did in order to reproduce the problem. The more details you provide, the better.

    Thank you very much.

    Jianzhong

  • Hi Jianzhong,

    Thank you for your reply.

    I am attaching the source code and config file that my customer is using.(.cfg file is the file used in TMDXICE110).

    ftpserver.c
    /**
     * ftpserver.c
     *
     *   This file contains:                                 ���̃t�@�C���ɂ͎��̂�̂��܂܂�Ă��܂��B
     *   - FTP Server and client implementation               -FTP�T�[�o�[�ƃN���C�A���g�̎���
     *   .
     *   which are relevant for the ftpserver module.         �����ftpserver���W���[���Ɋ֘A���Ă��܂��B
     *
     *   Used Registry entries:
     *        "NETWORK/FTPSERVER/CONFIG/PORT"
     *        "NETWORK/FTPSERVER/CONFIG/LISTEN_TIMEOUT"
     *        "NETWORK/FTPSERVER/USERNAME"
     *        "NETWORK/FTPSERVER/PASSWORD"
     *
     *     Registry write callback:
     *
     */
    
     /**
      * Include files
      */
    #include "ti/transport/ndk/nimu/example/ftpApp/modules.h"
    
    #ifdef FTP_SERVER_MODULE_INCLUDED
    
    #include <ti/csl/csl_error.h>
    #include <ti/fs/fatfs/ff.h>
    #include <ti/transport/ndk/nimu/example/ftpApp/ftpserver/ftpserver.h>
    
    /*
     * Defines
     */
    #define LISTEN_TIMEOUT                        (10000)
    #define FTPSERVER_PORT                        (21)
    
    /* Ftpserver task definitions */                                   // Ftpserver�^�X�N��`
    #define TASK_FTP_SERVER_STACK_SIZE            (4096)
    //#define TASK_FTP_SERVER_STACK_SIZE            (16384)               // �e�X�g �ς�炸
    #define TASK_FTP_SERVER_PRIO                (5)
    #define TASK_FTP_SERVER_NAME                "FTP Task"
    
    /* Ftpserver client connection task definitions */                 // FTP�T�[�o�[�N���C�A���g�ڑ��^�X�N�̒�`
    //#define TASK_FTP_SERVER_CLIENT_STACK_SIZE    (16384)
    #define TASK_FTP_SERVER_CLIENT_STACK_SIZE    (32768)                  // �e�X�g
    #define TASK_FTP_SERVER_CLIENT_PRIO            (5)
    #define TASK_FTP_SERVER_CLIENT_NAME            "FTP-Client Task"
    
    /*
     * Local functions
     */
    static void ftpserver_thread_entry(UArg a0, UArg a1);
    static void ftpserver_client_thread_entry (UArg a0, UArg a1);
    static int32_t ftpserver_parser (io_handler_t *ioh);
    static uint16_t port;
    static uint32_t listen_timeout;
    
    extern ftp_cmd_handler_t cmd_handler[];
    
    char ftpUser[NAME_AND_PASSWD_LEN];
    char ftpPassword[NAME_AND_PASSWD_LEN];
    
    /*
     * ftpserver_init
     */
    int32_t ftpserver_init(void)
    {
        Task_Handle task;
        Task_Params params;
        Error_Block eb;
    
        Task_Params_init(&params);
        Error_init(&eb);
    
        params.priority = TASK_FTP_SERVER_PRIO;
        params.stackSize = TASK_FTP_SERVER_STACK_SIZE;
        params.arg0 = 0;
        params.arg1 = 0;
        
        /* Read data from config (or default values) */             // �\���i�܂��̓f�t�H���g�l�j����f�[�^��ǂݎ��܂�
        port = FTPSERVER_PORT;
        listen_timeout = LISTEN_TIMEOUT;
    
        task = Task_create(ftpserver_thread_entry, &params, &eb);
        if (task == NULL)
        {
    //      UART_printf("Task '%s', creation failed for ftpserver_thread!, Error %s\n", Error_getMsg(&eb));
            return ERROR_TASK_CREATE;
        }
    
        return ERROR_SUCCESS;
    }
    
    /**
     * ftpserver_thread_entry
     *
     * @brief     FTP server main thread. Listen on new connections and spawnes of client connection tasks.
     *            FTP�T�[�o�[�̃��C���X���b�h�B �V�����ڑ��ƃN���C�A���g�ڑ��^�X�N�̐�������b�X�����܂��B
     * @param a0    Not used
     * @param a1    Not used
     *
     * @return        -
     */
    void ftpserver_thread_entry(UArg a0, UArg a1)
    {
    
        Task_Params params;
        Error_Block eb;
    
        struct sockaddr_in server_addr, client_addr;
        SOCKET listen_sock, client_sock;
        int len = sizeof(struct sockaddr_in);
        struct timeval timeout = {10, 0};
    
    
    
        memset(&server_addr, 0, sizeof(struct sockaddr_in));
        server_addr.sin_family = AF_INET;                                                                        //TYPE (AF_INET:IP4,AF_INET6)
        server_addr.sin_addr.s_addr = NDK_htonl(0xC0A80249);   // NDK_htonl(INADDR_ANY);                         //IP�A�h���X 192.168.2.73
    //  server_addr.sin_addr.s_addr = NDK_htonl(0xC0A8024A);   // NDK_htonl(INADDR_ANY);                         //IP�A�h���X 192.168.2.74
        server_addr.sin_port = NDK_htons(port);                                                                  //�|�[�g 
    
        fdOpenSession (TaskSelf ());
    
        if ((listen_sock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET)                        // SOCKET = socket(int domain, int type, int protocol)
        {                                                                                                        // �C�[�T�l�b�g�\�P�b�g��쐬
            return;
        }
    
        memset(&server_addr, 0, sizeof(struct sockaddr_in));
        server_addr.sin_family = AF_INET;
        server_addr.sin_addr.s_addr = inet_addr("192.168.2.73");  // 0xC0A80249; //inet_addr("192.168.2.73");
    //  server_addr.sin_addr.s_addr = inet_addr("192.168.2.74");  // 0xC0A8024A; //inet_addr("192.168.2.74");
        server_addr.sin_port = NDK_htons(port);
    
        if (bind(listen_sock, (struct sockaddr*)&server_addr, sizeof(struct sockaddr_in)) == SOCKET_ERROR)       // bind(SOCKET s, struct sockaddr *pName, int len)
        {                                                                                                        // ���O��\�P�b�g�Ƀo�C���h����
            fdClose(listen_sock);
            return;
        }
    
        if (listen(listen_sock, 5) == SOCKET_ERROR)                                                              // listen(SOCKET s, int maxcon) s:�\�P�b�g maxcon:�L���[�ւ̐ڑ��ő吔
        {                                                                                                        // �\�P�b�g�̐ڑ��v����ҋ@���܂�
            fdClose(listen_sock);
            return;
        }
    
        /* Set listen timeout to make watchdog work */                                                           // �E�H�b�`�h�b�O��@�\�����邽�߂Ƀ��b�X���^�C���A�E�g��ݒ肷��
        timeout.tv_sec = listen_timeout;
        if (setsockopt(listen_sock, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)) == SOCKET_ERROR)         // setsockopt(SOCKET s, int level, int op, void *pbuf, int bufsize)
        {                                                                                                        // 
            fdClose(listen_sock);
            return;
        }
        UART_printStatus("\n All tests have passed.\n");                                                         // �e�X�g����̍쐬�ɍ��i
    
        for (;;)
        {
            Task_Handle task;
    
            if( (client_sock = accept(listen_sock, (struct sockaddr*)&client_addr, &len)) == INVALID_SOCKET)     // SOCKET accept(SOCKET s, struct sockaddr *pName, int *plen)
            {                                                                                                    // �\�P�b�g�Őڑ���󂯓���� 
                                                                                                                 // ������ (struct sockaddr*)&client_addr, �Ƀ}�X�^��IP�Ԓn�|�[�g�ԍ���������?
                /* Timeout, Wait a short time and try again */                                                   // �^�C���A�E�g�A���΂炭�҂��Ă���Ď��s���Ă�������
                fdClose (listen_sock);
                Task_sleep (100);
                break;
            }
    
    
            Task_Params_init(&params);
            Error_init(&eb);
        
            params.priority = TASK_FTP_SERVER_CLIENT_PRIO;
            params.stackSize = TASK_FTP_SERVER_CLIENT_STACK_SIZE;
            params.arg0 = (UArg)client_sock;
            params.arg1 = 0;
    
    
            task = Task_create(ftpserver_client_thread_entry, &params, &eb);                                     // �ڑ������� �^�X�N�쐬 ftpserver_client_thread_entry
            if (task == NULL)
            {
                fdClose(client_sock);
                Task_sleep (100);
                continue;
            }
        }
    
        // Close the file session
        fdCloseSession(TaskSelf());
    }
    
    /**
     * ftpserver_client_thread_entry
     *
     * @brief     FTP server client connection task. Spawned of from the ftp server task                // FTP�T�[�o�[�N���C�A���g�ڑ��^�X�N�B
     *          when a new connection is established                                                    // �V�����ڑ����m�����ꂽ�Ƃ���ftp�T�[�o�[�^�X�N���琶������܂�
     *
     * @param a0    client socket
     * @param a1    Not used
     *
     * @return        -
     */
    static void ftpserver_client_thread_entry (UArg a0, UArg a1)
    {
        io_handler_t ftpserver;
        SOCKET socket = (SOCKET)a0;
        int32_t opt = 1;
    
        strcpy (ftpUser, "user");
        strcpy (ftpPassword, "password");
    
        // Close the file session                                                                       // �t�@�C���Z�b�V������‚���
        fdOpenSession(TaskSelf());
    
        memset (&ftpserver, 0, sizeof (ftpserver));
    
        /* Disables the Nagle algorithm for TCP sockets */                                              // TCP�\�P�b�g��Nagle�A���S���Y���𖳌��ɂ��܂�
        if (setsockopt(socket, IPPROTO_TCP, NDK_TCP_NODELAY, &opt, sizeof(opt)) != SOCKET_ERROR)
        {
            ftpserver.authenticated = 0;
            ftpserver.socket = (void *)socket;
            ftpserver.send_buffer = malloc(BUFFER_SIZES);                                               // BUFFER_SIZES = 1024
            ftpserver.receive_buffer = malloc(BUFFER_SIZES);                                            
            ftpserver.current_working_dir_path = malloc(DATA_BUFFER_SIZE);                              // DATA_BUFFER_SIZE=512
            ftpserver.DataBuf = malloc (DATA_BUFFER_SIZE);                                              
            ftpserver.temp = malloc(DATA_BUFFER_SIZE);                                                  
    
            sprintf (ftpserver.current_working_dir_path, "0:");
    
            if (ftpserver.send_buffer &&
                ftpserver.receive_buffer &&
                ftpserver.current_working_dir_path &&
                ftpserver.DataBuf &&
                ftpserver.temp)
            {
                ftpserver_parser (&ftpserver);
    
    // �ڑ����(�������̉��)
                if (ftpserver.send_buffer) free (ftpserver.send_buffer);
                if (ftpserver.receive_buffer) free (ftpserver.receive_buffer);
                if (ftpserver.current_working_dir_path) free (ftpserver.current_working_dir_path);
                if (ftpserver.temp) free (ftpserver.temp);
                if (ftpserver.DataBuf) free (ftpserver.DataBuf);
            }
        }
        
        /* Close the client socket */               // �N���C�A���g�\�P�b�g��‚��܂�
        fdClose(socket);
        
        /* Close the file session */                // �t�@�C���Z�b�V������‚���
        fdCloseSession(TaskSelf());
    }
    
    /**
     * ftpserver_parser()
     *
     * @brief FTP Server comand parser              // FTP�T�[�o�[�R�}���h �p�[�T�[
     *
     * @params ioh    Pointer to io-structure that contains buffers, socket etc, see          �\�P�b�g�Ȃǂ�܂�io-structure�ւ̃|�C���^�o�b�t�@�B
     *              io_handler_t structure definition.                                        io_handler_t�\���̂̒�`��Q�Ƃ��Ă��������B
     *
     * @return ERROR_SUCCESS
     */
    uint8_t EtxBuf[DATA_BUFFER_SIZE] ;
    uint8_t ErxBuf[DATA_BUFFER_SIZE];
    
    
    static int32_t ftpserver_parser (io_handler_t *ioh)
    {
        int32_t n, bytes,rlen;
        int     i, EtxBytes;
    
    //    ftp_cmd_handler_t *p;
    
        /* Respond with welcome message */                                                   // �E�F���J�����b�Z�[�W�ŕԐM���� (�K�v�Ȃ���Εs�v)
        sprintf(ioh->send_buffer,"220 Welcome to TCP-TEST FTP server \r\n");                 // ���M�o�b�t�@�ɕ�����Z�b�g
        bytes = send(ioh->socket, ioh->send_buffer, strlen(ioh->send_buffer), 0);            // �ڑ����ꂽ�\�P�b�g�Ƀf�[�^�𑗐M���� send(SOCKET s, void *pbuf, int size, int flags)
                                                                                             // s:�\�P�b�g pbuf:���M�f�[�^�̂���f�[�^�o�b�t�@ size:�f�[�^�̃T�C�Y �t���O:
                                                                                             // �߂�l:���펞�͑��M������,�G���[���͕��l
        ioh->running = TRUE;
        while (ioh->running)
        {
            n = 0;
            while (1)
            {
                if (n > (BUFFER_SIZES - 2)) break;                                           // ��M�������̐���
                
                bytes = recv(ioh->socket, &ioh->receive_buffer[n], 1, 0);                    // receive byte by byte... (�o�C�g���ƂɎ�M...) recv(SOCKET s, void *pbuf, int size, int flags)
                                                                                             // s:�\�P�b�g pbuf:��M�f�[�^��ۑ�����o�b�t�@ size:�f�[�^�̃T�C�Y �t���O:
                if ( bytes <= 0 ) break;                                                     // // �߂�l:���펞�͎�M������,�G���[���͕��l,����0
    //          if (ioh->receive_buffer[n] == '\n')
    //          {
    //              ioh->receive_buffer[n] = '\0';
    //              break;
    //          }
    //          if (ioh->receive_buffer[n] != '\r') n++; /*ignore CRs*/
    
                if (++n >=6){
                    rlen = (ioh->receive_buffer[4]<<8) + (ioh->receive_buffer[5]);           // Modbus TCP�̓f�[�^���̍ő�256�ȉ� 
                    if(n >= (rlen+6)){                                                       // ��M����
                    /* Process requested command */                                          // �v�����ꂽ�R�}���h���������
                        for (i = 0; i < rlen; i++){
                            ErxBuf[i] = ioh->receive_buffer[i+6];                            // ��M������R�s�[
                        }
    //                  EtxBytes = comm_rtu(&ErxBuf,&EtxBuf,rlen,PORT_ETH);                  // ��M�R�}���h��� & �����̍쐬 (PORT_ETH:CRC�`�F�b�N�����ɂ���)
    // Debug ��
    // ��������͂��ꂽ�Ƃ��ĉ���������
                        EtxBytes = 11;
                        EtxBuf[0] = 0x01; 
                        EtxBuf[1] = 0x03; 
                        EtxBuf[2] = 0x08; 
                        EtxBuf[3] = 0x01; 
                        EtxBuf[4] = 0x02; 
                        EtxBuf[5] = 0x03; 
                        EtxBuf[6] = 0x04; 
                        EtxBuf[7] = 0x05; 
                        EtxBuf[8] = 0x06; 
                        EtxBuf[9] = 0x07; 
                        EtxBuf[10] = 0x08; 
    // Debug ��
    
                        if(EtxBytes > 0){
                            for (i = 0; i < 4; i++){
                                ioh->send_buffer[i] = ioh->receive_buffer[i];                // MBAP�w�b�_���R�s�[(�G�R�[�o�b�N)
                            }
                            ioh->send_buffer[4] = (EtxBytes>>8) & 0xFF;                      // �f�[�^���T�C�Y(���)
                            ioh->send_buffer[5] = (EtxBytes) & 0xFF;                         // �f�[�^���T�C�Y(����)
                            for (i = 0; i < EtxBytes; i++){
                                ioh->send_buffer[i+6] = EtxBuf[i];                           // �����f�[�^���R�s�[
                            }
                            
                            bytes = send(ioh->socket, ioh->send_buffer, (EtxBytes+6), 0);    // �ڑ����ꂽ�\�P�b�g�Ƀf�[�^�𑗐M���� 
                        }
                        break; 
                    }                                              
                }
            }
            if ( bytes <= 0 ) break;
    
            /* Process requested command */                                                  // �v�����ꂽ�R�}���h���������
    //      for (p = &cmd_handler[0]; p->func != NULL; p++)
    //      {
    //          if (strncmp(ioh->receive_buffer, p->cmd, p->len) == 0)
    //          {
    //              if (p->func) p->func(ioh);
    //              break;
    //          }
    //      }
    
            /* Command NOT found! */
    //      if (p->func == NULL)
    //      {
    //          sprintf(ioh->send_buffer,"202 Command not implemented (%s), superfluous at this site. \r\n", ioh->receive_buffer);
    //          bytes = send(ioh->socket, ioh->send_buffer, strlen(ioh->send_buffer), 0);
    //      }
    
        }
    
        return ERROR_SUCCESS;
    }
    
    #endif
    
    am335x_app_icev2_wSoCLib.cfg

    If there is any missing information, please let me know.

    Best regards,
    O.H

  • Hi O.H,

    Sorry, but it is not clear to me how your customer did their testing. I have built NIMU_FtpExample_icev2AM335x_armExampleproject and it is running. What did your customer do from the client side? Did they have some automated script test? Can they share with me? I need to replicate what they do in order to reproduce the problem. Information about the exact test setup and tools/commands are needed.

    Thank you for your patience.

    Regards,

    Jianzhong

  • Hi Jianzhong,

    Attached is the actual project we are using. There is a sample code with the same name, but the changes are as follows.
    PDK17_NIMU_FtpExample_icev2AM335x_armExampleproject.zip

    • main_a8.c >> lines 86, 88 Change the IP address
      char *ipAddr = "192.168.2.73";
      char *ipMask = "255.255.255.0";
      char *ipGateway = "192.168.2.1";
    • am335x_app_icev2_wSoCLib.cfg >> line 164 Change IP address Change the IP address
    • ftpserver.c >> for fixed response processing (same as before)

    The procedure is as follows.

    [Test tool operation]

    1. Set IP address(192.168.2.73), port number(21), slave address(1), function code(3), data item(0), data code(4)
    2. Transmission data (00 00 00 00 00 06 01 03 00 01 00 04)
    3. Set the number of communication times (3850~3856 times, continuous communication times)
    4. Transmission time (Communication interval: 200ms, 4000 times in about 15 minutes)
    5. Start (Disconnect and reconnect the port for each set number of transmissions, and repeat)

    [Flow after start]

    (1) Connect
    (2) Establish connection (Listen)
    (3) Establish communication
    (4) Host data transmission
    (5) Receive host data (server response: TMDSICE3359)
    (6) Repeat communication times (4) to (5)
    (7) Disconnect
    (8) Repeat from (1) again.

    Currently, error 10054 occurs when the number of repetitions of (4) to (5) exceeds 3855. e.g. 3850 times will not be reproduced.

    As for the tool, there is free software for Modbus/TCP on the web. If you use a tool that performs the communication (connection and disconnection) separately as shown in the procedure, it should reproduce the problem.

    However, I have not found a free tool on the web that has the capability to reproduce the problem. I will check if the tools created by our customers can be shared, but if you have information on a tool that works, it would be helpful if you could check with it.

    Best regards,
    O.H

  • Hi O.H,

    Same tool used by your customer is preferred. Please also make sure this problem is not caused by the tool.

    In addition, can your customer try the same test using NIMU_ICSS_FtpExample_icev2AM335x_wSoCLib_armExampleproject? The FTP application can be built on either one of two networking interfaces: EMAC or PRU-ICSS. The NIMU_Ftp_xxx is built on top of EMAC and the NIMU_ICSS_xxx is built on top of PRU-ICSS. I'd like to see if the problem also happens with PRU-ICSS.

    Regards,

    Jianzhong

  • Hi Jianzhong,

    A customer shared some information about tools with me. We have confirmed that the following two tools and two sample projects generate the same error ("Socket error #10054 : connection reset by peer" on the 3856th communication).

    [Tool]

    • Modbus_Tool_v12:www.hdl.co.jp/.../download.cgi
      • This is a Japanese tool. If you want to use it, please refer to the following configuration screen.. You do not need to operate anything other than the translated part enclosed in a red frame.

    • Tool created by the customer
      • If you need to share the tool because it is in Japanese and contains customer information, we will send it to you via private chat.

    [Software]
    The sample project uses pdk_am335x_1_0_17 and changes "ftpserver.c" and "am335x_app_icev2_wSoCLib.cfg".

    • NIMU_FtpExample_icev2AM335x_armExampleproject
    • NIMU_ICSS_FtpExample_icev2AM335x_wSoCLib_armExampleproject

    Can the above information help you determine if this problem is dependent on the NDK or the files used in the sample project?

    Best regards,
    O.H

  • Hello O.H,

    Thank you very much for providing the tools and for doing the additional testing. This does look like an issue inside NDK. Can your customer do a Wireshark capture to get more insight?

    Regards,

    Jianzhong

  • Hello Jianzhong,

    Thanks for the confirmation.

    What kind of capture content do you want in Wireshark?

    For example, the first 100 times and the 38500-3856 times when a communication error occurs. Or, the entire communication contents when no communication error occurs. It would be helpful if you could point out the specific contents of the capture screen.

    Best regards,
    O.H

  • Hi O.H,

    A capture of the last 10 communications up to and including the failure would be helpful.

    Regards,

    Jianzhong

  • Hello Jianzhong,

    We have obtained a screen capture of the error in Wireshark from a customer. For your reference, I have also attached the log from the start of communication until the error occurred.

    Windows 7 (1:1 with LAN cable)
    "TMDSICE3359_3.png" is the confirmation by the customer's own tool.
    "TMDSICE3359_4.png" is the confirmation by the communication evaluation tool (Modbus_Tool_v12).

    The extension of the log file is changed for the convenience of uploading, so please contact us if you cannot check it. You can probably check it by deleting the ".txt" file.
    TMDSICE3359_FtpExample_xds_off_log3.pcapng.txt

    Best regards,
    O.H

  • Hi O.H,

    Thanks for sending the Wireshark capture. It seems to me that host "192.168.2.28" sent a reset message to "192.168.2.73" (AM3359 ICE) at the end. Was that responding to Socket Error 10054?

    I was trying to use Modbus tool but it always gave me "Time Out" error. Do you know what I missed?

    I used NIMU_ICSS_FtpExample without any modification. Below is what I saw on UART console. Did your customer see the same?

    To help determine whether this issue is caused by NDK or the testing code, I would recommend your customer to add some debug messages to the testing code and see what happened when this socket error occurred.

    Regards,

    Jianzhong

  • Hello Jianzhong,

    Thanks for the confirmation.

    Thanks for sending the Wireshark capture. It seems to me that host "192.168.2.28" sent a reset message to "192.168.2.73" (AM3359 ICE) at the end. Was that responding to Socket Error 10054?

    The Modbus tool is designed to send "00 00 00 00 00 00 06 01 03 00 01 00 01" without any limit to the number of times it can be sent. So we don't understand why it sends the reset message.

    I was trying to use Modbus tool but it always gave me "Time Out" error. Do you know what I missed?

    Like you, I also get "Time out" when I use "NIMU_ICSS_FtpExample" without modifying it. I don't know the behavior of the sample code, but I think it is because there is no action to respond to data. I am looking for a way to get the same problem to occur in the sample project.

    If you use the customer's project "PDK17_NIMU_FtpExample_icev2AM335x_armExampleproject.zip", you should be able to see the "Socket Error 10054" can be confirmed.
    PDK17_NIMU_FtpExample_icev2AM335x_armExampleproject.zip

    I used NIMU_ICSS_FtpExample without any modification. Below is what I saw on UART console. Did your customer see the same?

    Attached are the results of the UART console screen for the two different projects. The left one is the sample project and the right one is the customer's project.

    I will ask the customer to add a debug message. In order to isolate this problem, I think the quickest way is to run the same 3856 communication on the sample project and see if an error occurs.

    Best regards,
    O.H

  • Hi O.H,

    Thanks for sharing your customer's project. I was able to build and run it with Modbus Tool. Once I reproduce the problem, I'll do some debugging.

    Regards,

    Jianzhong

  • Hello Jianzhong,

    Could you tell me what is the status of the investigation now?

    The customer is looking for progress, so it would be helpful if you could tell us the current status of the investigation. If you are not able to reproduce the problem, please point out any additional information you need.

    Sorry to rush you.

    Best Regards,
    O.H

  • Hello O.H,

    Sorry for not being able to make much progress this past week. I will be out this Friday and next week. 

    I suspect this may be a limit of the example code instead of NDK. I would again recommend your customer to add debug traces to the example code and find out what's happening when the error occurs.

    Thanks for the patience.

    Best regards,

    Jianzhong

  • Hello Jianzhong,

    Thank you for sharing the situation with us.

    Could you please tell me what exactly we should check?

    we've added debug messages to the sample code, but we are not making much progress. Also, the CPU itself did not behave in such a way that once the program was executed, the reset would be executed even if an error occurred.

    It would be helpful if you could specifically point out what we should check using debug messages in order to isolate whether it is a problem with the NDK or the sample/test code. (For example, is it the contents of the CPU registers or the PRU registers?)

    Best Regards,
    O.H

  • Hello O.H,

    Sorry for my delayed response. I was able to run the test according to your instruction, but haven't seen any problem for more than 4 hours. 

    Does your customer have any updates on their end?

    Thanks and regards,

    Jianzhong

  • Hello Jianzhong,

    Thank you for your confirmation.

    We have just received an update from a customer, and it turns out that the problem is dependent on the PORT number. By changing the PORT number from 21, the problem is no longer reproduced and the development is proceeding without any problems.

    We apologize for the inconvenience. Thank you for your kind support.

    Best regards,
    O.H

  • Hello O.H,

    Thank you for the update. Glad that your customer resolved this issue.

    Regards,

    Jianzhong