Im trying to send 1K chunks of firmware and software to a SC20100 over TCP.
At random moments, the socket.receive or socket.send methods will cause the entire system to hang up. I’ve narrowed it down to this line in the libraries:
var sent = this.ni.Send(this.m_Handle, buffer, offset + totalSend, size - totalSend, socketFlags);
Some times, when this method gets called, the entire system locks up. Visual studio loses debug connection and the module needs a complete power reset to function again.
I can not see what the code of the function does, but my suspicion is that it probably causes some kind of while loop hangup or similar.
I am trying to get a sample project so you can reproduce it, in the meanwhile: can you look at the code and see if there is a possibility of a loop hang or similar? Could this have something to do with the non blocking changes to sockets?
I am using a SC20100 with embedded emac and the DP83848KSQ network PHY. This is on the latest firmware. It happens on both a switched network and a direct connection to my laptop.
By downloading TcpTest and flashing that into a SC20100S with a DP83848 PHY connected to it, it will initialize ethernet on set IP and open a tcp socket on the set port.
You can then start OTAUpdateTester (which is a windows forms application) and enter the ip/port combo you used in TCPTester. After this use the top 2 buttons to select a firmware and a .tca file and then hit the update button.
If the updater makes connection, you will start to see messages in the debug window from the SC20 and the updater debug window.
What is happening for me every time I do this, is that the tincylr operating system crashes after x amount of chunks.
I do hope I made it easy enough for someone at GHI to reproduce this issue because it is stopping me from further developing my over the air updating of my SC20100s.
Spent most of this week researching this and I think it was a broken switch port…
Almost impossible to reproduce, but apparantly the network can crash under super specific broken switch port circumstances