Good afternoon, I connected wiznet 5300 with stm32 via FSMC, porting a webserver example with HTTPServer_LPC11E36_LPCXpresso It worked, but when you refresh the page, several times per second, it freezes in:
while(getSn_TX_FSR(s) != (getSn_TXBUF_SIZE(s)*1024))
{
VargetSn_TX_FSR[0]=getSn_TX_FSR(s);
//if((get_httpServer_timecount() - gettime) > 3)
//{
//break;
//}
}
I did not connect a timeout, because me are very importan time(I accept an UDP stream on another socket) and I can not wait about a second until http hangs.
It hangs due to the fact that the buffer is not freed, it is not clear for what reason, usually at the moment of freezing, its size is 2(VargetSn_TX_FSR[0]) bytes instead of 8192, but there are also 7000(VargetSn_TX_FSR[0]) bytes, and also it is not freed , I tried to send SEND commands at the moment of freezing so that it would free, without change.
I added checks to the function wiz_send_data
getTX_FSR=getSn_TX_FSR(sn);
if(getTX_FSR<1000){
while(1){}
}
if(getTX_FSR<len){
while(1){}
}
to make sure that I am writing no more buffer to tx than I have, but everything goes well.
Thought FSMC might not read getSn_TX_FSR correctly
inside it set read ip addresses to be read correctly.
Tell me what else can be the case and how can this be solved?
My init w5300:
WIZCHIP_WRITE (MR, MR_RST);
setSHAR(Network.mac);
setGAR(Network.gw);
setSUBR(Network.sn);
setSIPR(Network.ip);