Is it the netX error code? The error code 7 indicates NX_PTR_ERROR which is due to Invalid IP or socket pointer. Is the WLAN interface in STA or AP mode? I presume the WLAN device had been associated first and then you called the wiced_tcp_create_socket()? The failure could be because of DHCP bring up failure. Did you observe any IP address on the console logs after the association was successful?