Hi every body, I am in a bit trouble of finding out the processing time taken by main_tcpnet() function. As it is written in documents that this function must be called periodically but does not specify at how much rate i.e milliseconds. Secondaly since i have other work to do also during interrupt (timer) i wonder how to fix main_tcpnet() function in the same interrupt as doing this causes my hardware to reset. Plz help me Thanx in advance
Are you sure it is a good idea to call an unknown function from an ISR? How will you make sure that all other uses of the TCP functionality isn't affected by reentrancy problems?
If you do not know how long the worst-case call to the function takes, how will you then be able to figure out the effect on your interrupt handler, or on the rest of the interrupt system?
I agree with Per. I don't think this should be called from an ISR. There are definite re-entrance problems here. Plus, you might be overflowing your ISR stack.
Surely it would be better to call the function from a task; just like the example(s) given by Keil.
I don't see the need to consider calling it from an ISR.
Thakyou all for reply,
First of all i would say that i m not using RTX kernel, and since calling it from main while(1) making a non periodic call, i am calling it from ISR. And don't worry i am using a timer interrupt of 10msec and even after not doing any thing in ISR except calling main_tcpnet(), my board is getting reset sometime, Thus obviously my que is can any body tell me what is the function of main_tcpnet(), How much time will it take to execute, and on factors does it depends,
Also plz tell me can i do tcpip without using main_tcpnet
aren't there better ways to achieve what you are trying to do? for example, polling a free running hardware timer in your main() 'while' loop and calling 'main_tcpnet()' regularly? or having the hardware timer interrupt the core, set a flag in the timer ISR and polling that one in 'main'? What you are doing is wrong, and probably the cause for your misery.
Quite a number of embedded stacks are intended to be used either in a RTOS thread, or as one of many actions to perform in a while (1) loop.
Hi Michal
What u r saying is the same thing i m doing. Please try to understand following scenario
1) you have set a timer interrupt of say x milli sec 2) after x milli sec you have set a flag in ISR 3) in while(1) u are doing other stuff and say after y milli seconds you poll the flag and called main_tcpnet().
in the above situation first of all ur call to main_tcpnet is not periodic and if y > x main_tcpnet will not work or becomes vey slow.
View all questions in Keil forum