Author Topic: Possible problem compiling uTasker in VS2005?  (Read 10746 times)

MarcV

  • Guest
Possible problem compiling uTasker in VS2005?
« on: May 03, 2008, 08:13:14 AM »
Hello,
I'm currently trying to build an uTasker project in simulation on MS Visual Studio 2005 (professional edition).
I want my application to use DHCP, so I uncommented USE_DHCP in config.h
The thing is that the simulator does not get a IP address from the DHCP server. After examining this I noticed that in taskconfig.h, the lines

Code: [Select]
#ifdef USE_DHCP
  { "DHCP",      fnDHCP,         SMALL_QUEUE, (DELAY_LIMIT)(NO_DELAY_RESERVE_MONO), 0, UTASKER_STOP}, // delay only for timer queue space
#endif

are STILL grayed out, while in other files that refer to USE_DHCP, those lines are colored.

So I guess the DHCP task will never be called...

In fact, everything behind #ifdef OPSYS_CONFIG is grayed out in taskconfig.h while OPSYS_CONFIG is defined in config.h and taskconfig.h is included in config.h after the defines of USE_DHCP and OPSYS_CONFIG.
So maybe there's some bug in VS2005? Or maybe I'm just missing something here?

I'm using uTasker for Coldfire by the way, with SP5 installed.

EDIT:
OPSYS_CONFIG is defined in winsym.c, after which config.h is included. So config.h and taskconfig.h are supposed to "know" OPSYS_CONFIG but apparently they don't...
« Last Edit: May 03, 2008, 08:26:21 AM by MarcV »

MarcV

  • Guest
Re: Possible problem compiling uTasker in VS2005?
« Reply #1 on: May 03, 2008, 09:50:40 AM »
I tried to compile and run the simulator on another PC using Visual Studio 6 and got the same results.
I really must be missing something here... ???

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Possible problem compiling uTasker in VS2005?
« Reply #2 on: May 03, 2008, 10:41:08 AM »
Hi Marc

My first idea is that VS2005 is getting confused and not showing this line to be active - I have seen this several times before.

There are two simple checks that you can do.

1. Make an error at the line of code (I always do my 'a' test).
a  { "DHCP",      fnDHCP,         SMALL_QUEUE, (DELAY_LIMIT)(NO_DELAY_RESERVE_MONO), 0, UTASKER_STOP}, // delay only for timer queue space
[Inserting an 'a' is simply the easiest error to insert since it seems always to be under my left finger when I am typing]

If it compiles without error the line is not being used, but a compiler error signals that it is certainly being used.

2. When the simulator runs, it shows the assigned IP address. If this is immediately visible it is using a fixed IP address. Don't forget that activating DHCP as an option means that the support is included in the project - whether the device actually uses a fixed IP or obtains one using DHCP depends on the parameter settings (the user can then decide which is to be used).

See cParameters[] in application.c
(/*ACTIVE_DHCP +*/ ACTIVE_LOGIN + ACTIVE_FTP_SERVER /*+ ACTIVE_FTP_LOGIN*/ + ACTIVE_WEB_SERVER + ACTIVE_TELNET_SERVER + SMTP_LOGIN),

To default to DHCP when no parameters have been set comment in ACTIVE_DHCP.

When the simulated device is obtaining an address using DHCP the simulator will display the present status (you will see it searching (Resolving) and then the obtained IP address will be displayed).

Regards

Mark


MarcV

  • Guest
Re: Possible problem compiling uTasker in VS2005?
« Reply #3 on: May 03, 2008, 11:52:07 AM »
See cParameters[] in application.c
(/*ACTIVE_DHCP +*/ ACTIVE_LOGIN + ACTIVE_FTP_SERVER /*+ ACTIVE_FTP_LOGIN*/ + ACTIVE_WEB_SERVER + ACTIVE_TELNET_SERVER + SMTP_LOGIN),

Yep, this is what was missing! I forgot to uncomment ACTIVE_DHCP! :-[ It's working now!

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Possible problem compiling uTasker in VS2005?
« Reply #4 on: May 03, 2008, 12:52:18 PM »
Hi Marc

Good news!

I understand that you are working on a web client - you may like to use this as a reference - there is also a TCP client example towards the bottom: http://www.utasker.com/forum/index.php?topic=25.0

For web client development, record a standard connection and data transfer using a Web broswer and Ethereal/WireShark. Then develop your project to do the same - you can do this gradually by first checking that the connection works, then that the GET is sent correctly and finally that the returned data is interpreted correctly. This can be done 'on-line' or you can make recordings of attempts and play them back through the simulator (see the tutorial for more details of doing this).

Good luck

Regards

Mark

MarcV

  • Guest
Re: Possible problem compiling uTasker in VS2005?
« Reply #5 on: May 03, 2008, 12:59:29 PM »
Hi Marc

Good news!

I understand that you are working on a web client - you may like to use this as a reference - there is also a TCP client example towards the bottom: http://www.utasker.com/forum/index.php?topic=25.0

For web client development, record a standard connection and data transfer using a Web broswer and Ethereal/WireShark. Then develop your project to do the same - you can do this gradually by first checking that the connection works, then that the GET is sent correctly and finally that the returned data is interpreted correctly. This can be done 'on-line' or you can make recordings of attempts and play them back through the simulator (see the tutorial for more details of doing this).

Good luck

Regards

Mark


OK, thanks Mark, I will look into this later today!

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Possible problem compiling uTasker in VS2005?
« Reply #6 on: May 03, 2008, 01:14:37 PM »
Marc

One last remark about the DHCP stuff. It is not absolutely necessary to modify also the default parameter. You could also leave it with a fixed address as default and then configure the DHCP mode via the LAN web page or via TELNET/serial menu.

Looking at it the other way, also when set to default to DHCP a fixed IP address can also be set using the same method.

Regards

Mark
« Last Edit: May 03, 2008, 09:07:36 PM by mark »