7 Replies Latest reply on Jan 14, 2015 7:19 AM by userc_7973

    TCP Connection Issue on WICED SDK 3.1.2

      Hi,

       

      We use the Inventek module  ISM43362_M3G_L44 which uses the STM32F205 processor.Our application is that the Host(STM32F205)  will continuously receive streaming audio data(PCM format) from another HD radio DSP chip through I2S interface. Then the host will pack the PCM streaming data to TCP packets and send these packets to the Android tablet through Soft AP. The host also receives the commands from the tablet through TCP socket for HD radio tuning functions. Our application including the I2S DMA API/driver are running well in WICED SDK 2.4.1/3.1.1.

       

       

      In order to take the advantages of the WICED SDK 3.1.2, I have ported our application to the WICED SDK 3.1.2. I can compile and download the image. But the tablet app can't connect to the device through the TCP socket. There is no issues on SDK 2.4.1 and 3.1.1. Can you investigate this?

       

       

       

       

      Thanks in advance

        • 1. Re: TCP Connection Issue on WICED SDK 3.1.2

          Hi,

           

          First TCP command socket connection is ok, But the second TCP audio socket connection failed. below is the error message from android logcat

           

          12-30 13:27:43.984: E/AudioTcpStream(15874): SocketException: java.net.ConnectException: failed to connect to /192.168.10.1 (port 50007): connect failed: ETIMEDOUT (Connection timed out)

           

          My make target command is "demo.hdradio_streaming-ISM43362_M3G_L44 download run".  It seems that SDK 3.1.2 doesn't support the second socket connection.

           

          Can you investigate this?


          Thanks in advance


          Tiger

          • 2. Re: TCP Connection Issue on WICED SDK 3.1.2

            Hi,

             

            When I change mu make target command to "demo.hdradio_streaming-ISM43362_M3G_L44-FreeRTOS-LwIP download run", i got errors below

             

            **** Build of configuration Default for project Wiced-SDK ****

             

             

            C:\Users\feng\WICED-SDK-3.1.2\Wiced-SDK\make.exe demo.hdradio_streaming-ISM43362_M3G_L44-FreeRTOS-LwIP download run

            Making .gdbinit

            Building Bootloader

            Finished Building Bootloader

             

             

            Compiling WICED_LwIP_Interface

            Compiling Lib_HTTP_Server

            WICED/network/LwIP/WICED/wiced_network.c:81:1: error: unknown type name 'NX_IP'

            NX_IP* wiced_ip_handle[ 3 ] =

            ^

            WICED/network/LwIP/WICED/wiced_network.c:81:8: error: conflicting types for 'wiced_ip_handle'

            NX_IP* wiced_ip_handle[ 3 ] =

                    ^

            In file included from ./include/wiced_tcpip.h:19:0,

                             from ./include/wiced.h:21,

                             from WICED/network/LwIP/WICED/wiced_network.c:15:

            ././WICED/network/LwIP/WICED/./wiced_network.h:154:24: note: previous declaration of 'wiced_ip_handle' was here

            extern struct netif*   wiced_ip_handle[3];

                                    ^

            WICED/network/LwIP/WICED/wiced_network.c:83:5: error: initialization from incompatible pointer type [-Werror]

                 [WICED_STA_INTERFACE] = STA_IP_HANDLE,

                 ^

            WICED/network/LwIP/WICED/wiced_network.c:83:5: error: (near initialization for 'wiced_ip_handle[0]') [-Werror]

            WICED/network/LwIP/WICED/wiced_network.c:84:5: error: initialization from incompatible pointer type [-Werror]

                 [WICED_AP_INTERFACE]  = AP_IP_HANDLE,

                 ^

            WICED/network/LwIP/WICED/wiced_network.c:84:5: error: (near initialization for 'wiced_ip_handle[1]') [-Werror]

            WICED/network/LwIP/WICED/wiced_network.c:89:21: error: conflicting types for 'wiced_ip_handle'

            struct netif        wiced_ip_handle[3];

                                 ^

            In file included from ./include/wiced_tcpip.h:19:0,

                             from ./include/wiced.h:21,

                             from WICED/network/LwIP/WICED/wiced_network.c:15:

            ././WICED/network/LwIP/WICED/./wiced_network.h:154:24: note: previous declaration of 'wiced_ip_handle' was here

            extern struct netif*   wiced_ip_handle[3];

                                    ^

            In file included from ./include/wiced_tcpip.h:19:0,

                             from ./include/wiced.h:21,

                             from WICED/network/LwIP/WICED/wiced_network.c:15:

            WICED/network/LwIP/WICED/wiced_network.c: In function 'wiced_ip_up':

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:310:30: note: in expansion of macro 'IP_HANDLE'

                 if ( NULL == netif_add( &IP_HANDLE(interface), &ipaddr, &netmask, &gw, (void*) WICED_TO_WWD_INTERFACE( interface ), ethernetif_init, ethernet_input ) )

                                          ^

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:323:24: note: in expansion of macro 'IP_HANDLE'

                     netif_set_up( &IP_HANDLE(interface) );

                                    ^

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:324:29: note: in expansion of macro 'IP_HANDLE'

                     netif_set_default( &IP_HANDLE(interface) );

                                         ^

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:327:27: note: in expansion of macro 'IP_HANDLE'

                     dhcp_set_struct( &IP_HANDLE(interface), &wiced_dhcp_handle );

                                       ^

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:328:22: note: in expansion of macro 'IP_HANDLE'

                     dhcp_start( &IP_HANDLE(interface) );

                                  ^

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:343:25: note: in expansion of macro 'IP_HANDLE'

                         dhcp_stop( &IP_HANDLE(interface) );

                                     ^

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:344:28: note: in expansion of macro 'IP_HANDLE'

                         netif_remove( &IP_HANDLE(interface) );

                                        ^

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:387:24: note: in expansion of macro 'IP_HANDLE'

                     netif_set_up( &IP_HANDLE(interface) );

                                    ^

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:389:21: note: in expansion of macro 'IP_HANDLE'

                     igmp_start(&IP_HANDLE(interface));

                                 ^

            In file included from ././WICED/WWD/include/wwd_assert.h:17:0,

                             from ././WICED/RTOS/FreeRTOS/WWD/./ARM_CM3/FreeRTOSConfig.h:16,

                             from ./WICED/RTOS/FreeRTOS/ver7.5.2/Source/include/FreeRTOS.h:78,

                             from ././WICED/RTOS/FreeRTOS/WWD/./wwd_rtos.h:21,

                             from ././WICED/WWD/include/RTOS/wwd_rtos_interface.h:22,

                             from ./WICED/platform/MCU/STM32F2xx/peripherals/./platform_mcu_peripheral.h:31,

                             from ././WICED/platform/MCU/STM32F2xx/../../include/platform_peripheral.h:17,

                             from ./include/wiced_platform.h:21,

                             from ./include/wiced.h:19,

                             from WICED/network/LwIP/WICED/wiced_network.c:15:

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            ././WICED/WWD/include/wwd_debug.h:35:39: note: in definition of macro 'WPRINT_MACRO'

            #define WPRINT_MACRO(args) do {printf args;} while(0==1)

                                                   ^

            WICED/network/LwIP/WICED/wiced_network.c:400:5: note: in expansion of macro 'WPRINT_NETWORK_INFO'

                 WPRINT_NETWORK_INFO( ( "Network ready IP: %u.%u.%u.%u\n", (unsigned char) ( ( htonl( IP_HANDLE(interface).ip_addr.addr ) >> 24 ) & 0xff ),

                 ^

            WICED/network/LwIP/WICED/wiced_network.c:400:83: note: in expansion of macro 'htonl'

                 WPRINT_NETWORK_INFO( ( "Network ready IP: %u.%u.%u.%u\n", (unsigned char) ( ( htonl( IP_HANDLE(interface).ip_addr.addr ) >> 24 ) & 0xff ),

                                                                                               ^

            WICED/network/LwIP/WICED/wiced_network.c:400:90: note: in expansion of macro 'IP_HANDLE'

                 WPRINT_NETWORK_INFO( ( "Network ready IP: %u.%u.%u.%u\n", (unsigned char) ( ( htonl( IP_HANDLE(interface).ip_addr.addr ) >> 24 ) & 0xff ),

                                                                                                      ^

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            ././WICED/WWD/include/wwd_debug.h:35:39: note: in definition of macro 'WPRINT_MACRO'

            #define WPRINT_MACRO(args) do {printf args;} while(0==1)

                                                   ^

            WICED/network/LwIP/WICED/wiced_network.c:400:5: note: in expansion of macro 'WPRINT_NETWORK_INFO'

                 WPRINT_NETWORK_INFO( ( "Network ready IP: %u.%u.%u.%u\n", (unsigned char) ( ( htonl( IP_HANDLE(interface).ip_addr.addr ) >> 24 ) & 0xff ),

                 ^

            WICED/network/LwIP/WICED/wiced_network.c:401:29: note: in expansion of macro 'htonl'

                     (unsigned char) ( ( htonl( IP_HANDLE(interface).ip_addr.addr ) >> 16 ) & 0xff ),

                                         ^

            WICED/network/LwIP/WICED/wiced_network.c:401:36: note: in expansion of macro 'IP_HANDLE'

                     (unsigned char) ( ( htonl( IP_HANDLE(interface).ip_addr.addr ) >> 16 ) & 0xff ),

                                                ^

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            ././WICED/WWD/include/wwd_debug.h:35:39: note: in definition of macro 'WPRINT_MACRO'

            #define WPRINT_MACRO(args) do {printf args;} while(0==1)

                                                   ^

            WICED/network/LwIP/WICED/wiced_network.c:400:5: note: in expansion of macro 'WPRINT_NETWORK_INFO'

                 WPRINT_NETWORK_INFO( ( "Network ready IP: %u.%u.%u.%u\n", (unsigned char) ( ( htonl( IP_HANDLE(interface).ip_addr.addr ) >> 24 ) & 0xff ),

                 ^

            WICED/network/LwIP/WICED/wiced_network.c:402:29: note: in expansion of macro 'htonl'

                     (unsigned char) ( ( htonl( IP_HANDLE(interface).ip_addr.addr ) >>  8 ) & 0xff ),

                                         ^

            Compiling Lib_DNS_Redirect_Daemon

            WICED/network/LwIP/WICED/wiced_network.c:402:36: note: in expansion of macro 'IP_HANDLE'

                     (unsigned char) ( ( htonl( IP_HANDLE(interface).ip_addr.addr ) >>  8 ) & 0xff ),

                                                ^

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            ././WICED/WWD/include/wwd_debug.h:35:39: note: in definition of macro 'WPRINT_MACRO'

            #define WPRINT_MACRO(args) do {printf args;} while(0==1)

                                                   ^

            WICED/network/LwIP/WICED/wiced_network.c:400:5: note: in expansion of macro 'WPRINT_NETWORK_INFO'

                 WPRINT_NETWORK_INFO( ( "Network ready IP: %u.%u.%u.%u\n", (unsigned char) ( ( htonl( IP_HANDLE(interface).ip_addr.addr ) >> 24 ) & 0xff ),

                 ^

            WICED/network/LwIP/WICED/wiced_network.c:403:29: note: in expansion of macro 'htonl'

                     (unsigned char) ( ( htonl( IP_HANDLE(interface).ip_addr.addr ) >>  0 ) & 0xff ) ) );

                                         ^

            WICED/network/LwIP/WICED/wiced_network.c:403:36: note: in expansion of macro 'IP_HANDLE'

                     (unsigned char) ( ( htonl( IP_HANDLE(interface).ip_addr.addr ) >>  0 ) & 0xff ) ) );

                                                ^

            In file included from ./include/wiced_tcpip.h:19:0,

                             from ./include/wiced.h:21,

                             from WICED/network/LwIP/WICED/wiced_network.c:15:

            WICED/network/LwIP/WICED/wiced_network.c: In function 'wiced_network_down':

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:434:29: note: in expansion of macro 'IP_HANDLE'

                             dhcp_stop( &IP_HANDLE(interface) );

                                         ^

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:441:24: note: in expansion of macro 'IP_HANDLE'

                     netif_remove( &IP_HANDLE(interface) );

                                    ^

            WICED/network/LwIP/WICED/wiced_network.c: In function 'wiced_network_notify_link_up':

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:476:20: note: in expansion of macro 'IP_HANDLE'

                 netif_set_up( &IP_HANDLE(WICED_STA_INTERFACE) );

                                ^

            WICED/network/LwIP/WICED/wiced_network.c: In function 'wiced_network_notify_link_down':

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:482:22: note: in expansion of macro 'IP_HANDLE'

                 netif_set_down( &IP_HANDLE(WICED_STA_INTERFACE) );

                                  ^

            WICED/network/LwIP/WICED/wiced_network.c: In function 'wiced_network_link_down_handler':

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:494:21: note: in expansion of macro 'IP_HANDLE'

                     dhcp_stop( &IP_HANDLE(WICED_STA_INTERFACE) );

                                 ^

            WICED/network/LwIP/WICED/wiced_network.c: In function 'wiced_network_link_up_handler':

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:549:28: note: in expansion of macro 'IP_HANDLE'

                     netif_set_ipaddr( &IP_HANDLE(WICED_STA_INTERFACE), &ip_addr);

                                        ^

            Compiling Lib_DNS

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:552:27: note: in expansion of macro 'IP_HANDLE'

                     if ( dhcp_start( &IP_HANDLE(WICED_STA_INTERFACE)) != ERR_OK )

                                       ^

            WICED/network/LwIP/WICED/wiced_network.c: In function 'wiced_network_link_renew_handler':

            ././WICED/network/LwIP/WICED/./wiced_network.h:49:33: error: invalid type argument of unary '*' (have 'struct netif')

            #define IP_HANDLE(interface)   (*wiced_ip_handle[(interface)&3])

                                             ^

            WICED/network/LwIP/WICED/wiced_network.c:589:33: note: in expansion of macro 'IP_HANDLE'

                     netifapi_netif_common( &IP_HANDLE(WICED_STA_INTERFACE), (netifapi_void_fn)dhcp_renew, NULL);

            tools/makefiles/wiced_elf.mk:170: recipe for target 'build/demo_hdradio_streaming-ISM43362_M3G_L44-FreeRTOS-LwIP/Modules/./WICED/network/LwIP/WICED/wiced_network.o' failed

                                             ^

            cc1.exe: all warnings being treated as errors

            make.exe[1]: *** [build/demo_hdradio_streaming-ISM43362_M3G_L44-FreeRTOS-LwIP/Modules/./WICED/network/LwIP/WICED/wiced_network.o] Error 1

            make.exe[1]: *** Waiting for unfinished jobs....

            Makefile:185: recipe for target 'main_app' failed

            make: *** [main_app] Error 2

            • 4. Re: TCP Connection Issue on WICED SDK 3.1.2

              This patch fixed the build issue for "demo.hdradio_streaming-ISM43362_M3G_L44-FreeRTOS-LwIP download run". But please see my email above and the TCP socket connection problem still exists for any network stack like build commands "demo.hdradio_streaming-ISM43362_M3G_L44 download run" or "demo.hdradio_streaming-ISM43362_M3G_L44-ThreadX-NetX download run" or "demo.hdradio_streaming-ISM43362_M3G_L44-FreeRTOS-LwIP download run".

               

              Thanks

              • 5. Re: TCP Connection Issue on WICED SDK 3.1.2

                I have fixed this issue that is related to dynamic heap overflow when creating the second TCP thread.

                • 6. Re: TCP Connection Issue on WICED SDK 3.1.2

                  Hi userc_7973

                   

                  I'm also facing similar issue related to dynamic heap overflow while using TCP ,

                  How did you managed to solve the this "issue that is related to dynamic heap overflow" ?

                   

                  • 7. Re: TCP Connection Issue on WICED SDK 3.1.2

                    Hi

                     

                    I reduce the stack size in function wiced_rtos_create_thread().