Page 1 of 1

MOD54415 StartHTTP()

Posted: Thu May 15, 2014 12:03 pm
by GeneralUser
Hey guys, I am using the DEV-70 development board and everything is running perfect; utilizing the LED's and 4 UARTS. The LED's blink at various rates defined by the UART traffic commands, however, when I add the function call StartHTTP(), the LED's stop flashing (specifically LED 6,7,8). What could possibly be the connection between the LED's and StartHTTP()? Did I miss something in the documentation?

Thanks in advance!

Just an added note: Actually, UART2 does not work either the minute I uncomment StartHTTP(). My program is very simple so I doubt its a through put thing...

Re: MOD54415 StartHTTP()

Posted: Fri May 16, 2014 8:03 am
by GeneralUser
Problem solved and no surprise, it was on my end :oops: :oops: :oops: . I had setup a task with the same PRIO as the HTTP. Calling StartHTTP() before my other tasked was created caused HTTP to not work. Moving StartHTTP() after of course solved it, and ultimately, I picked a new PRIO for my task and made sure it did not conflict with any other uC tasks...

Re: MOD54415 StartHTTP()

Posted: Fri May 16, 2014 9:18 am
by dciliske
Ah the great 'Doctor it hurts when I shoot myself in the foot'. We've all been there at one time or another... XD

Glad to hear you figured it out, 'cause I was kinda stumped...

-Dan

Re: MOD54415 StartHTTP()

Posted: Mon May 19, 2014 1:32 pm
by tod
I picked a new PRIO for my task and made sure it did not conflict with any other uC tasks
Did you do this by checking that the return value of OSTaskCreate is OS_NO_ERR? I think it's a shame that so much example code just shows the call without checking for the returned error code. Easy enough to add a specific error message when the value that comes back is OS_PRIO_EXIST.

Re: MOD54415 StartHTTP()

Posted: Mon May 19, 2014 2:04 pm
by Chris Ruff
This is how I have been doing it for years

in the .h
#define AUX_PORT_TASK_ID 22

and in the .cpp

int osPrio = AUX_PORT_TASK_ID;
while (OS_PRIO_EXIST == OSTaskCreate(AuxPortTask,NULL,&AuxPortStk[USER_TASK_STK_SIZE] ,AuxPortStk,osPrio--));
if (osPrio != AUX_PORT_TASK_ID) printf("\nAux Port Final Prio:%d",osPrio+1);

Chris

Re: MOD54415 StartHTTP()

Posted: Mon May 19, 2014 7:56 pm
by Ridgeglider
In addition to checking the return values when tasks are created, I find it useful to have a single ProjectTasks.h file that defines all the task prios in one place so it's easy to see (and occasionally reorder) the relative importance of all the tasks together. In the same file, I have a commented section from constants.h that shows me the standard NB system task prios too.

Another reason why checking the return value is not always done is that unfortunately OSSimpleTaskCreate() and OSSimpleTaskCreatewName() are macros w/o return value.

Re: MOD54415 StartHTTP()

Posted: Tue May 20, 2014 3:51 am
by GeneralUser
Honestly, everything that Ridgeglider said is exactly my comments. I used the SimpleTaskCreate() so no return value which is a bummer. Therefore, again as Ridgeglider said, I created a H file that has all the task priority constants including the core priority constants. I comment out all the core constants so its really just a reference where I can see every single task priority whether or not I use them....much better way going forward.....