Hi! I am new using W5500, and I’m using it with microprocessor of renesas, specifically the one, and I am using the e2 studio to program it. I want to do a webservice but I don’t know much about networks.
I’m follow next link because STM IDE it’s to similar to e2studio
I’m using iolibrary for W5500 and my problem is when I set the information.
I’m using logic analyser and I debug the program step by step in function wizchip_setnetinfo, specifically in setSHAR, setGAR, setSUBR and setSUBR
void wizchip_setnetinfo(wiz_NetInfo* pnetinfo)
{
setSHAR(pnetinfo->mac);
setGAR(pnetinfo->gw);
setSUBR(pnetinfo->sn);
setSIPR(pnetinfo->ip);
DNS[0] = pnetinfo->dns[0];
DNS[1] = pnetinfo->dns[1];
DNS[2] = pnetinfo->dns[2];
DNS[3] = pnetinfo->dns[3];
DHCP = pnetinfo->dhcp;
}
I could see in MOSI channel that it is sending 0x00
In function wizhip_getnetinfo, I obtain all parameters as 0 (ip, gateway, mac…)
I’m using this code:
{
uint8_t retVal, sockStatus;
int16_t rcvLen;
uint8_t rcvBuf[20], bufSize = {2, 2, 2, 2};
uint8_t codigo[1];
reg_wizchip_cs_cbfunc(cs_sel, cs_desel);
reg_wizchip_spi_cbfunc(spi_rb, spi_wb);
wizchip_init(bufSize, bufSize);
wiz_NetInfo netInfo = { .mac = {0x6c, 0xfd, 0xb9, 0x52, 0xf9, 0x38}, // Mac address
.ip = {192, 168, 1, 195}, // IP address
.sn = {255, 255, 255, 0}, // Subnet mask
.gw = {192, 168, 2, 1}}; // Gateway address
wizchip_setnetinfo(&netInfo);
wizchip_getnetinfo(&netInfo);
// Open socket 0 as TCP_SOCKET with port 5000
if(((retVal = socket(0, Sn_MR_TCP, 5000, 0))) == 0)
…
}
I’m including libraries and I’m starting SPI before this code run. Also, I use cs_sel, cs_desel, spi_rb and spi_wb according to the tutorial of Adding ethernet connectivity to a STM32-Nucleo and my configuration
To configure netinfo, I use cmd-> ipconfig/all to see information but I’m not sure if this information is correct.
My questions are:
- How I can know netinfo is correct?
- Why it didn’t send the correct information across logic analyser?
- Why I’m receiving net inforamtion as 0?
I’m student and I’m trying to learn about this kind of networks, and I’m searching in forum about this problem, but I can’t know why it is falling.
I would appreciate any possible help.