well, since
ifconfig() didn't seem to be working, I instead modified the defaults (ip, gateway) in the firmware's modnwwiznet5k.c, and re-flashed the firmware. Now CREGs looks OK and I could ping the wiznet module .... more tests coming.
Code: Select all
Wiz CREG:
0000: 00 c0 a8 01 01 ff ff ff 00 00 08 dc ab cd ef c0
0010: a8 01 10 00 00 00 00 07 d0 08 00 00 00 00 00 03
0020: 00 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00
0030: 00 00 00 00 00 17 00 00 00 00 00 00 00 00 00 00
0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Wiz SREG[0]:
0000: 00 00 00 00 00 00 ff ff ff ff ff ff 00 00 00 00
0010: 00 00 00 00 00 00 80 00 00 00 00 00 00 00 02 02
0020: 08 00 00 00 00 00 00 00 00 00 00 00 ff 40 00 00
read/write speeds to wiznet RAM (1024 bytes) is 15.8 mbs @ 21mhz (default SPI CLK), 25.4 mbs @ 42mhz
UDP tests were OK, 8-byte RTT latency 562us (@21mhz) and 548us (@42mhz),
UDP 1000-byte send rate 7.98 mbs (21 or 42 mhz),
UDP receive lossless receive rate of 20 1000-byte packets, 5.4 mbs (21 or 42 mhz). nonblocking socket IO would have been handy for this, but the firmware lists it as a TODO ....
TCP tests were problematic:
pyboard TCP send of 100 1000-byte packets didn't "finish" at the linux receiver, because the socket.close() on the pyboard apparently shutdown the TCP flow before the last packets got out of the wiznet ?? tcpdump shows pyboard/wiznet emitting TCP RESET flag instead of FIN flag. TCP close() probably should invoke wiznet5k_socket_disconnect()
having the linux host send 100 1000-byte packets to the pyboard, resulted in OSError: 5 after receiving a packet or so. looking at packet trace (tcpdump), can see that wiznet has received some packets (ACK's), but then wiznet advertised window goes to 0 (presumably because OSError has stopped python from receiving), so linux sender is stalled waiting for window to open ....
-----------------------
EDIT:
1. to try and fix ifconfig() I noted that firmware modnwwiznet5k.c does a HAL_Delay(250) after the initial ifconfig. the python call to ifconfig() has no such delay in the firmware, so in my python code, I added a pyb.delay(300) after the ifconfig(). that seemed to work. CREGs looked good.
2. sample UDP progam that uses NTP to set RTC date/time, see
https://github.com/manitou48/pyboard/bl ... /wizntp.py
3. 7/10/15, with latest micropython, plus I added disconnect before close in modnwwiznet5k.c
TCP transmit from pyboard still has problems, but linux receiver is not aborted, but only shows 34000 bytes recvd (should be 100,000 bytes) @ 11.6mbs, though pyboard says it sent data at 35mbs ?? (send()'s getting dropped ?) Checked return value from send(), every other one is 0 -- so added retry in send-loop. OK that worked, pyboard transmitting at 10.8mbs
TCP receive on pyboard, seems ok at 5.7mbs