Martin_Head wrote:I think I have got my network driver working in uqlx2017.
I had to make some changes to the routine that reads data packets.
I have done a quick test between two copies of uqlx2017 running on the same PC. And a test between uqlx2017 on a Linux machine, and QPC2 on a Windows XP machine.
If anyone wants to try it in uqlx2018, you would need to patch the very end of the program. Change the *TCP_ and *SCK_ to TCP_ and SCK_, and alter the word lengths from 5 to 4.
Nice work, what was causing the problem?
There was two problems in the routine that reads the data packets by calling the IP device driver I/O routine directly.
In uqlx2017, the A3 register needs to be a pointer to the IP device driver linkage block when IP_RECV is called, where QPC2 does not.
And, when the IP device driver returns from IP_RECV. The value of the buffer pointer (A1) is updated, where in QPC2 it is not. (at least when you are just looking at the data in the IP buffer, rather than actually removing it).
The A3 problem was causing IP_RECV to return with the calling values unchanged, so when D0 was tested to see if it was not equal to zero (for an error), it was, so the routine failed.
And the A1 problem caused the buffer to be read incorrectly, because it did not expect the buffer pointer to have moved.