wiznet 5500 connect() SOCK_BUSY problem . Why ??
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: wiznet 5500 connect() SOCK_BUSY problem . Why ??
by becky ·
Please check the return value of socket().
This error does not occur if the socket is opened normally.
RE: RE: wiznet 5500 connect() SOCK_BUSY problem . Why ??
by alperen erdogan ·
Thank you for answer
i checked socket . İts returned socket num . its working normally . now connect’s return value is -3 in decimal form . its mean is SOCKERR_SOCKINIT . its mean is " Socket is not initialized or SIPR is Zero IP address when Sn_MR_TCP . " what does is mean ? im usign stm32f303-re . İm tring tcp client with w5500 . İ cant find enough resources . I’ll be happy if you can help me .
im using this code :
void cs_sel() {
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_10, GPIO_PIN_RESET); //CS LOW
}
void cs_desel() {
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_10, GPIO_PIN_SET); //CS HIGH
}
uint8_t spi_rb(void) {
uint8_t rbuf;
HAL_SPI_Receive(&hspi3, &rbuf, 1, 0xFFFFFFFF);
return rbuf;
}
void spi_wb(uint8_t b) {
HAL_SPI_Transmit(&hspi3, &b, 1, 0xFFFFFFFF);
}
/* ----------------------------------------------*/
uint8_t bufSize = {2, 2, 2, 2};
/* ----------------------------------------------*/
reg_wizchip_cs_cbfunc(cs_sel, cs_desel);
reg_wizchip_spi_cbfunc(spi_rb, spi_wb);
/* ----------------------------------------------*/
wizchip_init(bufSize, bufSize);
wiz_NetInfo netInfo = { .mac = {0x00, 0x08, 0xdc, 0xab, 0xcd, 0xef}, // Mac address
.ip = {192, 168, 2, 2}, // IP address
.sn = {255, 255, 255, 0}, // Subnet mask
.gw = {192, 168, 2, 1}}; // Gateway address
wizchip_setnetinfo(&netInfo);
uint8_t s ;
s = 1 ;
uint8_t server_ip[4] = {192,168,2,1} ;
uint8_t Baglan ;
int32_t ret=2 ; // check socket value
/* ----------------------------------------------*/
ret = socket(s,Sn_MR_TCP,5656,SF_TCP_NODELAY);
}
RE: wiznet 5500 connect() SOCK_BUSY problem . Why ??
by becky ·
The w5500 has 8 sockets.
Change this to uint8_t bufSize={2,2,2,2,2,2,2,2};
RE: wiznet 5500 connect() SOCK_BUSY problem . Why ??
by alperen erdogan ·
Thank you for answer but i tried but not working again . ithink problem is not in socket . Because i updated code and work correctly. this section .
if (Sn_SR(0) != SOCK_INIT) // The socket initialization query completes.
{
ret = socket(s,Sn_MR_TCP,5656,SF_TCP_NODELAY);
}
im using stm32cubeide . İ found problem in connect() fuction .
uint8_t s ;
s = 0 ;
uint8_t server_ip[4] = {192,168,1,5} ; // This should be in my pc .
uint8_t Baglan ;
do
{
Baglan = connect(s,server_ip,5656);
code stays inside the while loop and Baglan cant SOCK_OK . I couldn’t find the reason for this .
and after i tried differntly connection like this :
and i tried connect to hercule’s tcp server . but its not worked .
At another point, I started to think I was making a mistake.
im using hercules and wireshark . this is the screenshots I see when I run the code .
İ used first time this apps . I think the connect function works according to the application. But I can not understand why I could not establish a connection with the server in the other application.
RE: wiznet 5500 connect() SOCK_BUSY problem . Why ??
by Ali Osman AYDIN ·
Add “HAL_Delay(1000)” after “wizchip_setnetinfo(&netInfo)”