Author Topic: uTasker + Windows 7 64-bit + VC 2010  (Read 8676 times)

Offline paulk

  • Newbie
  • *
  • Posts: 45
    • View Profile
uTasker + Windows 7 64-bit + VC 2010
« on: January 28, 2011, 03:51:19 AM »
After a long hiatus, I'm trying to get back into the uTasker world.  I recently updated computers to Windows 7 64-bit, and had to make the switch to VC 2010.

After some turmoil, I got my project (previously working--modification of the example) to compile, but I can`t ping it, or access any web pages.  It appears to be grabbing the correct IP address, and it talks to the outside world (ie: grabs the TIME as per the example), but that`s it.

I saw this thread post (http://www.utasker.com/forum/index.php?topic=180.0), but I see that the code is already updated in ip.c

It appears that something is getting through to uTasker, since putting a breakpoint in fnHandleIP triggers when a PING is initiated from another PC.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3068
    • View Profile
    • uTasker
Re: uTasker + Windows 7 64-bit + VC 2010
« Reply #1 on: January 28, 2011, 09:05:14 AM »
Hi Paul

I suspect that it is a check sum offloading difficultly. After I moved to Windows 7 I gave up trying to disable it and made the following chang in fnHandleIP() in ip.c

#if !defined IP_RX_CHECKSUM_OFFLOAD || defined _WINDOWS                  // {5}   
    if (IP_GOOD_CS != fnCalcIP_CS(0, frame->ptEth->ucData, (unsigned short)(IP_MIN_HLEN + olen))) {
    #ifndef _WINDOWS                                                     // Win7 offloading is difficult to disable so ignore
        return 0;                                                        // check sum error - quit   
    #endif
    }
#endif


That means that the check sum of incoming IP frames is not verified. In a LAN there will be no IP checksum errors due to the fact that the MAC CRC checking will already have rejected any corrupt frames.

Regards

Mark

Offline paulk

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: uTasker + Windows 7 64-bit + VC 2010
« Reply #2 on: January 28, 2011, 04:03:18 PM »
Hi Mark,

Forgive my ignorance.  In trying to debug the issue, I'm seeing that the case IP_ICMP (even under ping attempts) in "Ethernet.c" is never getting executed  (in fnTaskEthernet).  However, when I launch a ping from the local PC, the fnHandleIP (ip.c) routine does get entered.  I don't understand how your modification addresses the issue though.  That is, doesn't the modification set the return value of fnHandleIP to "zero", and therefore, the switch statement in Ethernet.c won't get evaluated (because of the if statement)?
Code: [Select]
if ((usIPLength = fnHandleIP(&rx_frame, &usTotalLength)) != 0)
I'm not even sure I'm chasing the right ghost.  I'm having the exact same problem on my work PC (which I could have sworn worked some time ago), and my home PC.  The common thread with those two is that it uses a Broadcom ethernet driver, which I had to upgrade some months ago because it couldn't keep a stable connection to my switch..... I'm not sure if the NIC has anything to do with it or not.[/s]

Also, perhaps it may be good for me to get the latest revision of uTasker, so that all the updates are implemented.  At least that way I can ensure that a known good version (yours!) is working.....

« Last Edit: January 28, 2011, 09:44:43 PM by paulk »

Offline paulk

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: uTasker + Windows 7 64-bit + VC 2010
« Reply #3 on: January 28, 2011, 04:31:32 PM »
HI Mark,

You were absolutely right.  I apologize, I interpreted the code snipped you wrote backwards.  With the code addition you provided, I can ping and get at the web page now.  I had some issues adding it originally because visual C refused to recompile the change.  Regardless, it seems to be working fine now.

I'm 99% convinced that it is a networking card issue (driver related), because I'm sure I had it working on this particular PC in the past, but do remember upgrading the driver a few months ago.

Offline paulk

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: uTasker + Windows 7 64-bit + VC 2010
« Reply #4 on: February 03, 2011, 03:36:42 AM »
Hi Mark,

As an update, I had to add the same "#ifndef _WINDOWS" for the "if (fnCalcIP_CS..." block in the fnHandleUDP function (udp.c), because of the same issue.

Did you make all of these adjustments in the most recent version of uTasker? 

Regards,
Paul

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3068
    • View Profile
    • uTasker
Re: uTasker + Windows 7 64-bit + VC 2010
« Reply #5 on: February 03, 2011, 01:38:41 PM »
Hi Paul

Yes, I also made a change there:

            if (fnCalcIP_CS(usCheckSum, (icp_data - 8 ), received_udp.usLength) != 0xffff) {
    #ifndef _WINDOWS                                                     // avoid potential UDP checksum offload problem when simulating
                return;                                                  // ignore bad check sums
    #endif

            }


Regards

Mark

Offline alager

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: uTasker + Windows 7 64-bit + VC 2010
« Reply #6 on: February 22, 2011, 10:23:46 PM »
Mark,

I've made the changes noted in this thread and I even tried turning off tx and rx offloading in the NIC  card, but I am not seeing any DHCP requests being sent, even though I'm hitting the
else {                                                               // or broadcast
        fnSendUDP(DHCPSocketNr, (unsigned char *)cucBroadcast, DHCP_SERVER_PORT, (unsigned char *)&tUDP_Message.tUDP_Header, DHCP_BUFFER, OWN_TASK);
    }

in dhcp.c

I made the changes to ip.c, tcp.c udp.c icmp.c, but I still am not able to run the simulator....
Any ideas?

EDIT: I just noticed this thread is about 64bit win7, I'm running 32bit win7.  Just in case that makes a difference.

Thanks,
Aaron

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3068
    • View Profile
    • uTasker
Re: uTasker + Windows 7 64-bit + VC 2010
« Reply #7 on: February 22, 2011, 11:22:42 PM »
Hi Aaron

I never had problems with sending together with offloading (the workaround modifications are all on the rx side - for 32 bit and 64 bit versions).

Check that the NIC has been set up correctly since it sounds more like this is not operating.

Regards

Mark

Offline alager

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: uTasker + Windows 7 64-bit + VC 2010
« Reply #8 on: February 22, 2011, 11:30:02 PM »
I'm such an idiot.  That was the problem...

thanks.