DHCP and uC / OS-ii

Hello Friends,

Has anybody used DHCP assigned IP with rabbit based controller and uC / OS-ii together in the same code?

Normally I use uC / OS-ii in my projects with static IP. I never had any problems. Also I use DHCP assigned IP

To send email messages from rabbit based controller.

Now I need DHCP assigned IP and uC / OS-ii in one program. When I run this program, all the tasks are executed

Only once, then the program terminates.

T P Rathan

Hi there,

You need to make sure your tasks loop around forever otherwise they will run once and exit, unless they are designed to only run once.

Here is what I do in each task.

while(1)
{
// Your code for the task goes here

OSTimeDly(1);  // Let the task yield to other tasks

}

The time int eh delay can be higher values if you don’t need the task running quickly.

Using the Dly call will ensure that lower priority tasks get a time slice otherwise they will not be executed. Only higher priority tasks will cause it to yield automatically.

Hi

Thanks for the reply. I have actually used the OSTimeDlyHMSM() function. I still have the problem. I have been using uCos-ii for long time but I used only with static IP assignmet. But Now I need to use uCos with DHCP assigned IP. DHCP assigned IP is crashing the system. It runs only once and terminates.

Have you ever used Dynamic IP and uCos together. If so, Could you please send me a sample if possible?

Thank You

T P Rathan

Sorry to raise an old post up from the grave, but I am having the same issue as the original poster.

I have multiple tasks running on uC/OS-II. They run fine when the ethernet adapter is configured for static IP.

However, when configuring to DHCP, none of the tasks run.

I ran some tests and it seems that I can only get one task running the tcp_tick(). This task must have priority 0 and contain no OSTimeDly().

The rabbit processor I am using is RCM3720. Dynamic C is version 9.62.

Does anyone know if this is a known bug? And if so was it ever addressed in any Dynamic C version? Or does anyone know a workaround?

Thanks.