Skip to content

macraw infinite loop ws5500 #168

@rFronteddu

Description

@rFronteddu

I was testing some code with a pico2 and the ws5500, I noticed that in MACRAW mode, if I send a lot of packets the board can get stuck in socket.c. It seems that tmp is always 0. I was able to avoid the problem by calling return when tmp is 0. I also added a print to see how often that would happen and it is not very often. I know that the ws is not bricked because I am able to query other flags from SPI such as getSn_TX_FSR(sn) and the WS also replies to ping.

Are you aware of anything that I could be doing wrong?

while(1)
{
	tmp = getSn_IR(sn);
        if(tmp & Sn_IR_SENDOK)
        {
            setSn_IR(sn, Sn_IR_SENDOK);
            printf("z9a %d\n", len);
            break;
        }
        //M:20131104
        //else if(tmp & Sn_IR_TIMEOUT) return SOCKERR_TIMEOUT;
        else if(tmp & Sn_IR_TIMEOUT)
        {
            setSn_IR(sn, Sn_IR_TIMEOUT);
            //M20150409 : Fixed the lost of sign bits by type casting.
            //len = (uint16_t)SOCKERR_TIMEOUT;
            //break;
            printf("z9b %d\n", len);
            #if _WIZCHIP_ < 5500    //M20150401 : for WIZCHIP Errata #4, #5 (ARP errata)
               if(taddr) setSUBR((uint8_t*)&taddr);
            #endif
            return SOCKERR_TIMEOUT;
        }
        print("Error"); // I added this
        return (int32_t)len;
}
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions